Fix destructuring evaluation with call expressions (#4552)
* Fix destructuring evaluation with call expressions Do not optimize destructions with callExpressions, as the call might change the value of a variable that we are assigning to. Fixes #4054 * Also deopt on member expressions members expressions might be getters who have side effects
This commit is contained in:
committed by
Henry Zhu
parent
a83262026f
commit
c2d2702cf9
@@ -8,3 +8,6 @@ var [[a, b]] = [[1, 2, 3]];
|
||||
var [a, b] = [a, b];
|
||||
[a[0], a[1]] = [a[1], a[0]];
|
||||
var [a, b] = [...foo, bar];
|
||||
var [a, b] = [foo(), bar];
|
||||
var [a, b] = [clazz.foo(), bar];
|
||||
var [a, b] = [clazz.foo, bar];
|
||||
|
||||
@@ -25,3 +25,12 @@ var _ref5 = [].concat(babelHelpers.toConsumableArray(foo), [bar]);
|
||||
|
||||
var a = _ref5[0];
|
||||
var b = _ref5[1];
|
||||
var _ref6 = [foo(), bar];
|
||||
var a = _ref6[0];
|
||||
var b = _ref6[1];
|
||||
var _ref7 = [clazz.foo(), bar];
|
||||
var a = _ref7[0];
|
||||
var b = _ref7[1];
|
||||
var _ref8 = [clazz.foo, bar];
|
||||
var a = _ref8[0];
|
||||
var b = _ref8[1];
|
||||
|
||||
Reference in New Issue
Block a user