diff --git a/test/fixtures/transformation/es6-destructuring/array-unpack-optimisation/actual.js b/test/fixtures/transformation/es6-destructuring/array-unpack-optimisation/actual.js index 89bfb76776..51454e64c4 100644 --- a/test/fixtures/transformation/es6-destructuring/array-unpack-optimisation/actual.js +++ b/test/fixtures/transformation/es6-destructuring/array-unpack-optimisation/actual.js @@ -7,3 +7,4 @@ var [[a, b, ...c]] = [[1, 2, 3, 4]]; // deopt var [a, b] = [1, 2, 3]; var [[a, b]] = [[1, 2, 3]]; +var [a, b] = [a, b]; diff --git a/test/fixtures/transformation/es6-destructuring/array-unpack-optimisation/expected.js b/test/fixtures/transformation/es6-destructuring/array-unpack-optimisation/expected.js index d1aaf9d67a..1ba95f1de6 100644 --- a/test/fixtures/transformation/es6-destructuring/array-unpack-optimisation/expected.js +++ b/test/fixtures/transformation/es6-destructuring/array-unpack-optimisation/expected.js @@ -19,3 +19,6 @@ var b = _ref[1]; var _ref2 = [1, 2, 3]; var a = _ref2[0]; var b = _ref2[1]; +var _ref3 = [a, b]; +var a = _ref3[0]; +var b = _ref3[1]; diff --git a/test/fixtures/transformation/es6-destructuring/array/actual.js b/test/fixtures/transformation/es6-destructuring/array/actual.js index 4163832fd0..807dbdb574 100644 --- a/test/fixtures/transformation/es6-destructuring/array/actual.js +++ b/test/fixtures/transformation/es6-destructuring/array/actual.js @@ -1 +1,3 @@ var [a, [b], [c]] = ["hello", [", ", "junk"], ["world"]]; +[a, [b], [c]] = ["hello", [", ", "junk"], ["world"]]; +; diff --git a/test/fixtures/transformation/es6-destructuring/array/expected.js b/test/fixtures/transformation/es6-destructuring/array/expected.js index a84ffda3d5..e250f872c7 100644 --- a/test/fixtures/transformation/es6-destructuring/array/expected.js +++ b/test/fixtures/transformation/es6-destructuring/array/expected.js @@ -4,3 +4,9 @@ var a = "hello"; var _ref = [", ", "junk"]; var b = _ref[0]; var c = "world"; +a = "hello"; +var _ref2 = [", ", "junk"]; +b = _ref2[0]; +c = "world"; + +; diff --git a/test/fixtures/transformation/es6-destructuring/assignment-statement/expected.js b/test/fixtures/transformation/es6-destructuring/assignment-statement/expected.js index 8a076f9f6e..be5074dd30 100644 --- a/test/fixtures/transformation/es6-destructuring/assignment-statement/expected.js +++ b/test/fixtures/transformation/es6-destructuring/assignment-statement/expected.js @@ -1,10 +1,10 @@ "use strict"; -var _ref = f(); +var _f = f(); -var _ref2 = babelHelpers.slicedToArray(_ref, 2); +var _f2 = babelHelpers.slicedToArray(_f, 2); -a = _ref2[0]; -b = _ref2[1]; +a = _f2[0]; +b = _f2[1]; ; diff --git a/test/fixtures/transformation/es6-destructuring/member-expression/expected.js b/test/fixtures/transformation/es6-destructuring/member-expression/expected.js index 57c5ef8472..bb06a8b3a2 100644 --- a/test/fixtures/transformation/es6-destructuring/member-expression/expected.js +++ b/test/fixtures/transformation/es6-destructuring/member-expression/expected.js @@ -1,10 +1,4 @@ "use strict"; -var _ref = [1, 2]; - -var _ref2 = babelHelpers.slicedToArray(_ref, 2); - -foo.foo = _ref2[0]; -foo.bar = _ref2[1]; - -; +foo.foo = 1; +foo.bar = 2; diff --git a/test/fixtures/transformation/es6-destructuring/mixed/actual.js b/test/fixtures/transformation/es6-destructuring/mixed/actual.js index 79ac2cb22f..750152e4d8 100644 --- a/test/fixtures/transformation/es6-destructuring/mixed/actual.js +++ b/test/fixtures/transformation/es6-destructuring/mixed/actual.js @@ -1 +1,2 @@ +var rect = {}; var {topLeft: [x1, y1], bottomRight: [x2, y2] } = rect; diff --git a/test/fixtures/transformation/es6-destructuring/mixed/expected.js b/test/fixtures/transformation/es6-destructuring/mixed/expected.js index 8a7d6a658b..2265a6d4c3 100644 --- a/test/fixtures/transformation/es6-destructuring/mixed/expected.js +++ b/test/fixtures/transformation/es6-destructuring/mixed/expected.js @@ -1,5 +1,7 @@ "use strict"; +var rect = {}; + var _rect$topLeft = babelHelpers.slicedToArray(rect.topLeft, 2); var x1 = _rect$topLeft[0]; diff --git a/test/fixtures/transformation/es6-destructuring/multiple/actual.js b/test/fixtures/transformation/es6-destructuring/multiple/actual.js index 09249c483c..76d2562560 100644 --- a/test/fixtures/transformation/es6-destructuring/multiple/actual.js +++ b/test/fixtures/transformation/es6-destructuring/multiple/actual.js @@ -1,2 +1,3 @@ +var coords = [1, 2]; var { x, y } = coords, foo = "bar"; diff --git a/test/fixtures/transformation/es6-destructuring/multiple/expected.js b/test/fixtures/transformation/es6-destructuring/multiple/expected.js index c782335937..e7babadf88 100644 --- a/test/fixtures/transformation/es6-destructuring/multiple/expected.js +++ b/test/fixtures/transformation/es6-destructuring/multiple/expected.js @@ -1,5 +1,6 @@ "use strict"; +var coords = [1, 2]; var x = coords.x; var y = coords.y; var foo = "bar"; diff --git a/test/fixtures/transformation/es6-destructuring/object-advanced/actual.js b/test/fixtures/transformation/es6-destructuring/object-advanced/actual.js index c4b85492cf..27a221c473 100644 --- a/test/fixtures/transformation/es6-destructuring/object-advanced/actual.js +++ b/test/fixtures/transformation/es6-destructuring/object-advanced/actual.js @@ -1 +1,2 @@ +var rect = {}; var {topLeft: {x: x1, y: y1}, bottomRight: {x: x2, y: y2}} = rect; diff --git a/test/fixtures/transformation/es6-destructuring/object-advanced/expected.js b/test/fixtures/transformation/es6-destructuring/object-advanced/expected.js index 1048f7d0d4..9d8636356f 100644 --- a/test/fixtures/transformation/es6-destructuring/object-advanced/expected.js +++ b/test/fixtures/transformation/es6-destructuring/object-advanced/expected.js @@ -1,8 +1,9 @@ "use strict"; +var rect = {}; var _rect$topLeft = rect.topLeft; var x1 = _rect$topLeft.x; var y1 = _rect$topLeft.y; var _rect$bottomRight = rect.bottomRight; var x2 = _rect$bottomRight.x; -var y2 = _rect$bottomRight.y; \ No newline at end of file +var y2 = _rect$bottomRight.y; diff --git a/test/fixtures/transformation/es6-destructuring/object-basic/actual.js b/test/fixtures/transformation/es6-destructuring/object-basic/actual.js index dae014575e..df6ae4086f 100644 --- a/test/fixtures/transformation/es6-destructuring/object-basic/actual.js +++ b/test/fixtures/transformation/es6-destructuring/object-basic/actual.js @@ -1 +1,2 @@ +var coords = [1, 2]; var { x, y } = coords; diff --git a/test/fixtures/transformation/es6-destructuring/object-basic/expected.js b/test/fixtures/transformation/es6-destructuring/object-basic/expected.js index 97601e8b4e..9f119eee59 100644 --- a/test/fixtures/transformation/es6-destructuring/object-basic/expected.js +++ b/test/fixtures/transformation/es6-destructuring/object-basic/expected.js @@ -1,4 +1,5 @@ "use strict"; +var coords = [1, 2]; var x = coords.x; var y = coords.y; diff --git a/test/fixtures/transformation/es6-properties.computed-loose/argument/expected.js b/test/fixtures/transformation/es6-properties.computed-loose/argument/expected.js index 3731ff5791..04b57e5996 100644 --- a/test/fixtures/transformation/es6-properties.computed-loose/argument/expected.js +++ b/test/fixtures/transformation/es6-properties.computed-loose/argument/expected.js @@ -1,7 +1,5 @@ "use strict"; -foo((function () { - var _foo = {}; - _foo[bar] = "foobar"; - return _foo; -})()); +var _foo; + +foo((_foo = {}, _foo[bar] = "foobar", _foo)); diff --git a/test/fixtures/transformation/es6-properties.computed-loose/assignment/expected.js b/test/fixtures/transformation/es6-properties.computed-loose/assignment/expected.js index 190325c4da..9d9df1af31 100644 --- a/test/fixtures/transformation/es6-properties.computed-loose/assignment/expected.js +++ b/test/fixtures/transformation/es6-properties.computed-loose/assignment/expected.js @@ -1,7 +1,5 @@ "use strict"; -foo = (function () { - var _foo = {}; - _foo[bar] = "foobar"; - return _foo; -})(); +var _foo; + +foo = (_foo = {}, _foo[bar] = "foobar", _foo); diff --git a/test/fixtures/transformation/es6-properties.computed-loose/ignore-symbol/expected.js b/test/fixtures/transformation/es6-properties.computed-loose/ignore-symbol/expected.js index 96612ae7ad..b6290c7e20 100644 --- a/test/fixtures/transformation/es6-properties.computed-loose/ignore-symbol/expected.js +++ b/test/fixtures/transformation/es6-properties.computed-loose/ignore-symbol/expected.js @@ -1,7 +1,5 @@ "use strict"; -var foo = (function () { - var _foo = {}; - _foo[Symbol.iterator] = "foobar"; - return _foo; -})(); +var _foo; + +var foo = (_foo = {}, _foo[Symbol.iterator] = "foobar", _foo); diff --git a/test/fixtures/transformation/es6-properties.computed-loose/mixed/expected.js b/test/fixtures/transformation/es6-properties.computed-loose/mixed/expected.js index a31474e280..3d6db24771 100644 --- a/test/fixtures/transformation/es6-properties.computed-loose/mixed/expected.js +++ b/test/fixtures/transformation/es6-properties.computed-loose/mixed/expected.js @@ -1,10 +1,5 @@ "use strict"; -var obj = (function () { - var _obj = {}; - _obj["x" + foo] = "heh"; - _obj["y" + bar] = "noo"; - _obj.foo = "foo"; - _obj.bar = "bar"; - return _obj; -})(); +var _obj; + +var obj = (_obj = {}, _obj["x" + foo] = "heh", _obj["y" + bar] = "noo", _obj.foo = "foo", _obj.bar = "bar", _obj); diff --git a/test/fixtures/transformation/es6-properties.computed-loose/multiple/expected.js b/test/fixtures/transformation/es6-properties.computed-loose/multiple/expected.js index d1d1e8b1d1..6a23087ca8 100644 --- a/test/fixtures/transformation/es6-properties.computed-loose/multiple/expected.js +++ b/test/fixtures/transformation/es6-properties.computed-loose/multiple/expected.js @@ -1,8 +1,5 @@ "use strict"; -var obj = (function () { - var _obj = {}; - _obj["x" + foo] = "heh"; - _obj["y" + bar] = "noo"; - return _obj; -})(); +var _obj; + +var obj = (_obj = {}, _obj["x" + foo] = "heh", _obj["y" + bar] = "noo", _obj); diff --git a/test/fixtures/transformation/es6-properties.computed-loose/single/expected.js b/test/fixtures/transformation/es6-properties.computed-loose/single/expected.js index 774b07f4d4..5edaf8d9e8 100644 --- a/test/fixtures/transformation/es6-properties.computed-loose/single/expected.js +++ b/test/fixtures/transformation/es6-properties.computed-loose/single/expected.js @@ -1,7 +1,5 @@ "use strict"; -var obj = (function () { - var _obj = {}; - _obj["x" + foo] = "heh"; - return _obj; -})(); +var _obj; + +var obj = (_obj = {}, _obj["x" + foo] = "heh", _obj); diff --git a/test/fixtures/transformation/es6-properties.computed-loose/this/expected.js b/test/fixtures/transformation/es6-properties.computed-loose/this/expected.js index fc7d1bd4c7..e5db7b747f 100644 --- a/test/fixtures/transformation/es6-properties.computed-loose/this/expected.js +++ b/test/fixtures/transformation/es6-properties.computed-loose/this/expected.js @@ -1,7 +1,5 @@ "use strict"; -var obj = (function () { - var _obj = {}; - _obj["x" + foo.bar] = "heh"; - return _obj; -})(); +var _obj; + +var obj = (_obj = {}, _obj["x" + foo.bar] = "heh", _obj); diff --git a/test/fixtures/transformation/es6-properties.computed-loose/two/expected.js b/test/fixtures/transformation/es6-properties.computed-loose/two/expected.js index 523a93dcb7..349f1e881e 100644 --- a/test/fixtures/transformation/es6-properties.computed-loose/two/expected.js +++ b/test/fixtures/transformation/es6-properties.computed-loose/two/expected.js @@ -1,8 +1,5 @@ "use strict"; -var obj = (function () { - var _obj = {}; - _obj.first = "first"; - _obj.second = "second"; - return _obj; -})(); +var _obj; + +var obj = (_obj = {}, _obj.first = "first", _obj.second = "second", _obj); diff --git a/test/fixtures/transformation/es6-properties.computed-loose/variable/expected.js b/test/fixtures/transformation/es6-properties.computed-loose/variable/expected.js index 656ac58d4c..33f0163d3a 100644 --- a/test/fixtures/transformation/es6-properties.computed-loose/variable/expected.js +++ b/test/fixtures/transformation/es6-properties.computed-loose/variable/expected.js @@ -1,7 +1,5 @@ "use strict"; -var foo = (function () { - var _foo = {}; - _foo[bar] = "foobar"; - return _foo; -})(); +var _foo; + +var foo = (_foo = {}, _foo[bar] = "foobar", _foo); diff --git a/test/fixtures/transformation/es6-properties.computed/ignore-symbol/expected.js b/test/fixtures/transformation/es6-properties.computed/ignore-symbol/expected.js index 96612ae7ad..b6290c7e20 100644 --- a/test/fixtures/transformation/es6-properties.computed/ignore-symbol/expected.js +++ b/test/fixtures/transformation/es6-properties.computed/ignore-symbol/expected.js @@ -1,7 +1,5 @@ "use strict"; -var foo = (function () { - var _foo = {}; - _foo[Symbol.iterator] = "foobar"; - return _foo; -})(); +var _foo; + +var foo = (_foo = {}, _foo[Symbol.iterator] = "foobar", _foo); diff --git a/test/fixtures/transformation/es6-properties.computed/mixed/expected.js b/test/fixtures/transformation/es6-properties.computed/mixed/expected.js index f8f870ed3e..225abc7834 100644 --- a/test/fixtures/transformation/es6-properties.computed/mixed/expected.js +++ b/test/fixtures/transformation/es6-properties.computed/mixed/expected.js @@ -1,10 +1,5 @@ "use strict"; -var obj = (function () { - var _obj = {}; - babelHelpers.defineProperty(_obj, "x" + foo, "heh"); - babelHelpers.defineProperty(_obj, "y" + bar, "noo"); - babelHelpers.defineProperty(_obj, "foo", "foo"); - babelHelpers.defineProperty(_obj, "bar", "bar"); - return _obj; -})(); +var _obj; + +var obj = (_obj = {}, babelHelpers.defineProperty(_obj, "x" + foo, "heh"), babelHelpers.defineProperty(_obj, "y" + bar, "noo"), babelHelpers.defineProperty(_obj, "foo", "foo"), babelHelpers.defineProperty(_obj, "bar", "bar"), _obj); diff --git a/test/fixtures/transformation/es6-properties.computed/multiple/expected.js b/test/fixtures/transformation/es6-properties.computed/multiple/expected.js index 2dda4c9afc..9da44049fe 100644 --- a/test/fixtures/transformation/es6-properties.computed/multiple/expected.js +++ b/test/fixtures/transformation/es6-properties.computed/multiple/expected.js @@ -1,8 +1,5 @@ "use strict"; -var obj = (function () { - var _obj = {}; - babelHelpers.defineProperty(_obj, "x" + foo, "heh"); - babelHelpers.defineProperty(_obj, "y" + bar, "noo"); - return _obj; -})(); +var _obj; + +var obj = (_obj = {}, babelHelpers.defineProperty(_obj, "x" + foo, "heh"), babelHelpers.defineProperty(_obj, "y" + bar, "noo"), _obj);