Fix evaluation order with object spread (#11412)

* Fix object spread runtime semantics

* limit this deoptimization

* optimize empty objects

* declare variables
This commit is contained in:
Zen
2020-04-24 05:59:35 +08:00
committed by GitHub
parent 5f299bab18
commit af669297ef
12 changed files with 144 additions and 1 deletions

View File

@@ -1,3 +1,7 @@
var x;
var y;
var z;
z = { x, ...y };
z = { x, w: { ...y } };

View File

@@ -4,6 +4,9 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var x;
var y;
var z;
z = _objectSpread({
x
}, y);