diff --git a/lib/6to5/transformation/transformers/es6-destructuring.js b/lib/6to5/transformation/transformers/es6-destructuring.js index 33929faadd..8b1f5ae882 100644 --- a/lib/6to5/transformation/transformers/es6-destructuring.js +++ b/lib/6to5/transformation/transformers/es6-destructuring.js @@ -7,7 +7,7 @@ var buildVariableAssign = function (opts, id, init) { if (t.isMemberExpression(id)) op = "="; if (op) { - return t.expressionStatement(t.assignmentExpression(op, id, init)); + return t.expressionStatement(t.assignmentExpression("=", id, init)); } else { return t.variableDeclaration(opts.kind, [ t.variableDeclarator(id, init) @@ -95,12 +95,7 @@ var pushArrayPattern = function (opts, nodes, pattern, parentId) { } } - var isLoose = opts.file.isLoose("destructuring"); - var toArray = parentId; - - if (!isLoose) { - toArray = opts.file.toArray(parentId, !hasSpreadElement && pattern.elements.length); - } + var toArray = opts.file.toArray(parentId, !hasSpreadElement && pattern.elements.length); var _parentId = opts.scope.generateUidBasedOnNode(parentId, opts.file); nodes.push(t.variableDeclaration("var", [ @@ -112,14 +107,12 @@ var pushArrayPattern = function (opts, nodes, pattern, parentId) { var elem = pattern.elements[i]; if (!elem) continue; + i = +i; + var newPatternId; if (t.isSpreadElement(elem)) { - newPatternId = parentId; - - if (!isLoose) { - newPatternId = opts.file.toArray(parentId); - } + newPatternId = opts.file.toArray(parentId); if (i > 0) { newPatternId = t.callExpression(t.memberExpression(newPatternId, t.identifier("slice")), [t.literal(i)]); diff --git a/lib/6to5/transformation/transformers/es6-spread.js b/lib/6to5/transformation/transformers/es6-spread.js index 2b9865fce5..4fa64b5e2b 100644 --- a/lib/6to5/transformation/transformers/es6-spread.js +++ b/lib/6to5/transformation/transformers/es6-spread.js @@ -2,11 +2,7 @@ var t = require("../../types"); var _ = require("lodash"); var getSpreadLiteral = function (spread, file) { - if (file.isLoose("spread")) { - return spread.argument; - } else { - return file.toArray(spread.argument); - } + return file.toArray(spread.argument); }; var hasSpread = function (nodes) { @@ -68,7 +64,7 @@ exports.CallExpression = function (node, parent, scope, context, file) { node.arguments = []; var nodes; - if (args.length === 1 && args[0].argument.name === "arguments") { + if (args.length === 1 && args[0].argument.name === 'arguments') { nodes = [args[0].argument]; } else { nodes = build(args, file); diff --git a/test/fixtures/transformation/es6-destructuring-loose/array/actual.js b/test/fixtures/transformation/es6-destructuring-loose/array/actual.js deleted file mode 100644 index 10aa8799ed..0000000000 --- a/test/fixtures/transformation/es6-destructuring-loose/array/actual.js +++ /dev/null @@ -1 +0,0 @@ -var [a, [b], [c], d] = ["hello", [", ", "junk"], ["world"]]; diff --git a/test/fixtures/transformation/es6-destructuring-loose/array/expected.js b/test/fixtures/transformation/es6-destructuring-loose/array/expected.js deleted file mode 100644 index 2b7403faed..0000000000 --- a/test/fixtures/transformation/es6-destructuring-loose/array/expected.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; - -var _ref = ["hello", [", ", "junk"], ["world"]]; - -var a = _ref[0]; -var _ref$1 = _ref[1]; -var b = _ref$1[0]; -var _ref$2 = _ref[2]; -var c = _ref$2[0]; -var d = _ref[3]; \ No newline at end of file diff --git a/test/fixtures/transformation/es6-destructuring-loose/assignment-expression/actual.js b/test/fixtures/transformation/es6-destructuring-loose/assignment-expression/actual.js deleted file mode 100644 index 2ebf93ff16..0000000000 --- a/test/fixtures/transformation/es6-destructuring-loose/assignment-expression/actual.js +++ /dev/null @@ -1 +0,0 @@ -console.log([x] = [123]); diff --git a/test/fixtures/transformation/es6-destructuring-loose/assignment-expression/expected.js b/test/fixtures/transformation/es6-destructuring-loose/assignment-expression/expected.js deleted file mode 100644 index b7721a94bf..0000000000 --- a/test/fixtures/transformation/es6-destructuring-loose/assignment-expression/expected.js +++ /dev/null @@ -1,4 +0,0 @@ -"use strict"; - -var _temp, _temp2; -console.log((_temp = [123], _temp2 = _temp, x = _temp2[0], _temp)); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-destructuring-loose/assignment-statement/actual.js b/test/fixtures/transformation/es6-destructuring-loose/assignment-statement/actual.js deleted file mode 100644 index d14ce7e47d..0000000000 --- a/test/fixtures/transformation/es6-destructuring-loose/assignment-statement/actual.js +++ /dev/null @@ -1 +0,0 @@ -[a, b] = f(); diff --git a/test/fixtures/transformation/es6-destructuring-loose/assignment-statement/expected.js b/test/fixtures/transformation/es6-destructuring-loose/assignment-statement/expected.js deleted file mode 100644 index e1feb2d7fe..0000000000 --- a/test/fixtures/transformation/es6-destructuring-loose/assignment-statement/expected.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; - -var _ref = f(); - -var _ref2 = _ref; -a = _ref2[0]; -b = _ref2[1]; \ No newline at end of file diff --git a/test/fixtures/transformation/es6-destructuring-loose/empty/actual.js b/test/fixtures/transformation/es6-destructuring-loose/empty/actual.js deleted file mode 100644 index a70e49fdd6..0000000000 --- a/test/fixtures/transformation/es6-destructuring-loose/empty/actual.js +++ /dev/null @@ -1 +0,0 @@ -var [, a, [b], [c], d] = ["foo", "hello", [", ", "junk"], ["world"]]; diff --git a/test/fixtures/transformation/es6-destructuring-loose/empty/expected.js b/test/fixtures/transformation/es6-destructuring-loose/empty/expected.js deleted file mode 100644 index 1bdbe4fc65..0000000000 --- a/test/fixtures/transformation/es6-destructuring-loose/empty/expected.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; - -var _ref = ["foo", "hello", [", ", "junk"], ["world"]]; - -var a = _ref[1]; -var _ref$2 = _ref[2]; -var b = _ref$2[0]; -var _ref$3 = _ref[3]; -var c = _ref$3[0]; -var d = _ref[4]; \ No newline at end of file diff --git a/test/fixtures/transformation/es6-destructuring-loose/es7-object-rest/actual.js b/test/fixtures/transformation/es6-destructuring-loose/es7-object-rest/actual.js deleted file mode 100644 index b4877d6e45..0000000000 --- a/test/fixtures/transformation/es6-destructuring-loose/es7-object-rest/actual.js +++ /dev/null @@ -1,3 +0,0 @@ -var { ...x } = z; -var { x, ...y } = z; -(function({ x, ...y }) { }) diff --git a/test/fixtures/transformation/es6-destructuring-loose/es7-object-rest/expected.js b/test/fixtures/transformation/es6-destructuring-loose/es7-object-rest/expected.js deleted file mode 100644 index dbb29cb23d..0000000000 --- a/test/fixtures/transformation/es6-destructuring-loose/es7-object-rest/expected.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; - -var _objectWithoutProperties = function (obj, keys) { - var target = {}; - - for (var i in obj) { - if (keys.indexOf(i) >= 0) continue; - if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; - target[i] = obj[i]; - } - - return target; -}; - -var x = _objectWithoutProperties(z, []); - -var x = z.x; -var y = _objectWithoutProperties(z, ["x"]); - -(function (_ref) { - var x = _ref.x; - var y = _objectWithoutProperties(_ref, ["x"]); -}); diff --git a/test/fixtures/transformation/es6-destructuring-loose/es7-object-rest/options.json b/test/fixtures/transformation/es6-destructuring-loose/es7-object-rest/options.json deleted file mode 100644 index 252f473a73..0000000000 --- a/test/fixtures/transformation/es6-destructuring-loose/es7-object-rest/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "experimental": true -} diff --git a/test/fixtures/transformation/es6-destructuring-loose/for-in/actual.js b/test/fixtures/transformation/es6-destructuring-loose/for-in/actual.js deleted file mode 100644 index 87fe7e7dde..0000000000 --- a/test/fixtures/transformation/es6-destructuring-loose/for-in/actual.js +++ /dev/null @@ -1,3 +0,0 @@ -for (var [name, value] in obj) { - print("Name: " + name + ", Value: " + value); -} diff --git a/test/fixtures/transformation/es6-destructuring-loose/for-in/expected.js b/test/fixtures/transformation/es6-destructuring-loose/for-in/expected.js deleted file mode 100644 index 787fa1df42..0000000000 --- a/test/fixtures/transformation/es6-destructuring-loose/for-in/expected.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; - -for (var _ref in obj) { - var _ref2 = _ref; - var name = _ref2[0]; - var value = _ref2[1]; - print("Name: " + name + ", Value: " + value); -} \ No newline at end of file diff --git a/test/fixtures/transformation/es6-destructuring-loose/for-of/actual.js b/test/fixtures/transformation/es6-destructuring-loose/for-of/actual.js deleted file mode 100644 index 5873553d65..0000000000 --- a/test/fixtures/transformation/es6-destructuring-loose/for-of/actual.js +++ /dev/null @@ -1,3 +0,0 @@ -for (var [ name, before, after ] of this.test.expectation.registers) { - -} diff --git a/test/fixtures/transformation/es6-destructuring-loose/for-of/expected.js b/test/fixtures/transformation/es6-destructuring-loose/for-of/expected.js deleted file mode 100644 index 314c03654c..0000000000 --- a/test/fixtures/transformation/es6-destructuring-loose/for-of/expected.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; - -for (var _iterator = this.test.expectation.registers[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { - var _ref = _step.value; - var _ref2 = _ref; - var name = _ref2[0]; - var before = _ref2[1]; - var after = _ref2[2]; -} \ No newline at end of file diff --git a/test/fixtures/transformation/es6-destructuring-loose/member-expression/actual.js b/test/fixtures/transformation/es6-destructuring-loose/member-expression/actual.js deleted file mode 100644 index bd5e42d7d1..0000000000 --- a/test/fixtures/transformation/es6-destructuring-loose/member-expression/actual.js +++ /dev/null @@ -1 +0,0 @@ -[this.foo, this.bar] = [1, 2]; diff --git a/test/fixtures/transformation/es6-destructuring-loose/member-expression/expected.js b/test/fixtures/transformation/es6-destructuring-loose/member-expression/expected.js deleted file mode 100644 index 7e7353b88f..0000000000 --- a/test/fixtures/transformation/es6-destructuring-loose/member-expression/expected.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; - -var _ref = [1, 2]; - -var _ref2 = _ref; -this.foo = _ref2[0]; -this.bar = _ref2[1]; \ No newline at end of file diff --git a/test/fixtures/transformation/es6-destructuring-loose/mixed/actual.js b/test/fixtures/transformation/es6-destructuring-loose/mixed/actual.js deleted file mode 100644 index 79ac2cb22f..0000000000 --- a/test/fixtures/transformation/es6-destructuring-loose/mixed/actual.js +++ /dev/null @@ -1 +0,0 @@ -var {topLeft: [x1, y1], bottomRight: [x2, y2] } = rect; diff --git a/test/fixtures/transformation/es6-destructuring-loose/mixed/expected.js b/test/fixtures/transformation/es6-destructuring-loose/mixed/expected.js deleted file mode 100644 index 7f44ca9a37..0000000000 --- a/test/fixtures/transformation/es6-destructuring-loose/mixed/expected.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; - -var _rect$topLeft = rect.topLeft; -var x1 = _rect$topLeft[0]; -var y1 = _rect$topLeft[1]; -var _rect$bottomRight = rect.bottomRight; -var x2 = _rect$bottomRight[0]; -var y2 = _rect$bottomRight[1]; \ No newline at end of file diff --git a/test/fixtures/transformation/es6-destructuring-loose/multiple/actual.js b/test/fixtures/transformation/es6-destructuring-loose/multiple/actual.js deleted file mode 100644 index 09249c483c..0000000000 --- a/test/fixtures/transformation/es6-destructuring-loose/multiple/actual.js +++ /dev/null @@ -1,2 +0,0 @@ -var { x, y } = coords, - foo = "bar"; diff --git a/test/fixtures/transformation/es6-destructuring-loose/multiple/expected.js b/test/fixtures/transformation/es6-destructuring-loose/multiple/expected.js deleted file mode 100644 index c782335937..0000000000 --- a/test/fixtures/transformation/es6-destructuring-loose/multiple/expected.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; - -var x = coords.x; -var y = coords.y; -var foo = "bar"; diff --git a/test/fixtures/transformation/es6-destructuring-loose/object-advanced/actual.js b/test/fixtures/transformation/es6-destructuring-loose/object-advanced/actual.js deleted file mode 100644 index c4b85492cf..0000000000 --- a/test/fixtures/transformation/es6-destructuring-loose/object-advanced/actual.js +++ /dev/null @@ -1 +0,0 @@ -var {topLeft: {x: x1, y: y1}, bottomRight: {x: x2, y: y2}} = rect; diff --git a/test/fixtures/transformation/es6-destructuring-loose/object-advanced/expected.js b/test/fixtures/transformation/es6-destructuring-loose/object-advanced/expected.js deleted file mode 100644 index d3ee04ea05..0000000000 --- a/test/fixtures/transformation/es6-destructuring-loose/object-advanced/expected.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict"; - -var x1 = rect.topLeft.x; -var y1 = rect.topLeft.y; -var x2 = rect.bottomRight.x; -var y2 = rect.bottomRight.y; diff --git a/test/fixtures/transformation/es6-destructuring-loose/object-basic/actual.js b/test/fixtures/transformation/es6-destructuring-loose/object-basic/actual.js deleted file mode 100644 index dae014575e..0000000000 --- a/test/fixtures/transformation/es6-destructuring-loose/object-basic/actual.js +++ /dev/null @@ -1 +0,0 @@ -var { x, y } = coords; diff --git a/test/fixtures/transformation/es6-destructuring-loose/object-basic/expected.js b/test/fixtures/transformation/es6-destructuring-loose/object-basic/expected.js deleted file mode 100644 index 97601e8b4e..0000000000 --- a/test/fixtures/transformation/es6-destructuring-loose/object-basic/expected.js +++ /dev/null @@ -1,4 +0,0 @@ -"use strict"; - -var x = coords.x; -var y = coords.y; diff --git a/test/fixtures/transformation/es6-destructuring-loose/options.json b/test/fixtures/transformation/es6-destructuring-loose/options.json deleted file mode 100644 index 77a73984e1..0000000000 --- a/test/fixtures/transformation/es6-destructuring-loose/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "loose": ["destructuring"] -} diff --git a/test/fixtures/transformation/es6-destructuring-loose/parameters/actual.js b/test/fixtures/transformation/es6-destructuring-loose/parameters/actual.js deleted file mode 100644 index 896a7ce416..0000000000 --- a/test/fixtures/transformation/es6-destructuring-loose/parameters/actual.js +++ /dev/null @@ -1,15 +0,0 @@ -function somethingAdvanced({topLeft: {x: x1, y: y1}, bottomRight: {x: x2, y: y2}}){ - -} - -function unpackObject({title: title, author: author}) { - return title + ' ' + author; -} - -console.log(unpackObject({title: 'title', author: 'author'})); - -var unpackArray = function ([a, b, c], [x, y, z]) { - return a+b+c; -}; - -console.log(unpackArray(['hello', ', ', 'world'], [1, 2, 3])); diff --git a/test/fixtures/transformation/es6-destructuring-loose/parameters/expected.js b/test/fixtures/transformation/es6-destructuring-loose/parameters/expected.js deleted file mode 100644 index 3fd491d5b0..0000000000 --- a/test/fixtures/transformation/es6-destructuring-loose/parameters/expected.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; - -function somethingAdvanced(_ref) { - var x1 = _ref.topLeft.x; - var y1 = _ref.topLeft.y; - var x2 = _ref.bottomRight.x; - var y2 = _ref.bottomRight.y; -} - -function unpackObject(_ref2) { - var title = _ref2.title; - var author = _ref2.author; - return title + " " + author; -} - -console.log(unpackObject({ title: "title", author: "author" })); - -var unpackArray = function (_ref3, _ref4) { - var _ref32 = _ref3; - var a = _ref32[0]; - var b = _ref32[1]; - var c = _ref32[2]; - var _ref42 = _ref4; - var x = _ref42[0]; - var y = _ref42[1]; - var z = _ref42[2]; - return a + b + c; -}; - -console.log(unpackArray(["hello", ", ", "world"], [1, 2, 3])); diff --git a/test/fixtures/transformation/es6-destructuring-loose/spread/actual.js b/test/fixtures/transformation/es6-destructuring-loose/spread/actual.js deleted file mode 100644 index 0ef8f028ed..0000000000 --- a/test/fixtures/transformation/es6-destructuring-loose/spread/actual.js +++ /dev/null @@ -1,5 +0,0 @@ -var isSorted = ([x, y, ...wow]) => { - if (!zs.length) return true - if (y > x) return isSorted(zs) - return false -}; diff --git a/test/fixtures/transformation/es6-destructuring-loose/spread/expected.js b/test/fixtures/transformation/es6-destructuring-loose/spread/expected.js deleted file mode 100644 index 03400c9581..0000000000 --- a/test/fixtures/transformation/es6-destructuring-loose/spread/expected.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; - -var isSorted = function (_ref) { - var _ref2 = _ref; - var x = _ref2[0]; - var y = _ref2[1]; - var wow = _ref2.slice(2); - - if (!zs.length) return true; - if (y > x) return isSorted(zs); - return false; -}; diff --git a/test/fixtures/transformation/es6-destructuring/parameters/expected.js b/test/fixtures/transformation/es6-destructuring/parameters/expected.js index 830eb15edc..a6a1d3dfe6 100644 --- a/test/fixtures/transformation/es6-destructuring/parameters/expected.js +++ b/test/fixtures/transformation/es6-destructuring/parameters/expected.js @@ -32,16 +32,16 @@ function unpackObject(_ref2) { console.log(unpackObject({ title: "title", author: "author" })); var unpackArray = function (_ref3, _ref4) { - var _ref32 = _slicedToArray(_ref3, 3); + var _ref3 = _slicedToArray(_ref3, 3); - var a = _ref32[0]; - var b = _ref32[1]; - var c = _ref32[2]; - var _ref42 = _slicedToArray(_ref4, 3); + var a = _ref3[0]; + var b = _ref3[1]; + var c = _ref3[2]; + var _ref4 = _slicedToArray(_ref4, 3); - var x = _ref42[0]; - var y = _ref42[1]; - var z = _ref42[2]; + var x = _ref4[0]; + var y = _ref4[1]; + var z = _ref4[2]; return a + b + c; }; diff --git a/test/fixtures/transformation/es6-let-scoping/exec-block-scoped-2/exec.js b/test/fixtures/transformation/es6-let-scoping/exec-block-scoped-2/exec.js deleted file mode 100644 index e98bf47f5e..0000000000 --- a/test/fixtures/transformation/es6-let-scoping/exec-block-scoped-2/exec.js +++ /dev/null @@ -1,12 +0,0 @@ -assert.equal(() => { - let sum = 0; - let a = 0; - { - let a = 10; - for (let i = 0; i < a; i++) { - let a = 1; - sum += (() => a)(); - } - } - return sum; -}(), 10); diff --git a/test/fixtures/transformation/es6-spread-loose/arguments-array/actual.js b/test/fixtures/transformation/es6-spread-loose/arguments-array/actual.js deleted file mode 100644 index e18c362b1b..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/arguments-array/actual.js +++ /dev/null @@ -1,9 +0,0 @@ -function foo() { - return bar([...arguments]); -} - -function bar(one, two, three) { - return [one, two, three]; -} - -foo("foo", "bar"); diff --git a/test/fixtures/transformation/es6-spread-loose/arguments-array/expected.js b/test/fixtures/transformation/es6-spread-loose/arguments-array/expected.js deleted file mode 100644 index 92e9e6ff46..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/arguments-array/expected.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; - -function foo() { - return bar([].concat(arguments)); -} - -function bar(one, two, three) { - return [one, two, three]; -} - -foo("foo", "bar"); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-spread-loose/arguments-concat/actual.js b/test/fixtures/transformation/es6-spread-loose/arguments-concat/actual.js deleted file mode 100644 index a6fdb21bef..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/arguments-concat/actual.js +++ /dev/null @@ -1,9 +0,0 @@ -function foo() { - return bar("test", ...arguments); -} - -function bar(one, two, three) { - return [one, two, three]; -} - -foo("foo", "bar"); diff --git a/test/fixtures/transformation/es6-spread-loose/arguments-concat/expected.js b/test/fixtures/transformation/es6-spread-loose/arguments-concat/expected.js deleted file mode 100644 index b0bbaef08f..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/arguments-concat/expected.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; - -function foo() { - return bar.apply(undefined, ["test"].concat(arguments)); -} - -function bar(one, two, three) { - return [one, two, three]; -} - -foo("foo", "bar"); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-spread-loose/arguments/actual.js b/test/fixtures/transformation/es6-spread-loose/arguments/actual.js deleted file mode 100644 index 476da431e8..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/arguments/actual.js +++ /dev/null @@ -1,9 +0,0 @@ -function foo() { - return bar(...arguments); -} - -function bar(one, two, three) { - return [one, two, three]; -} - -foo("foo", "bar"); diff --git a/test/fixtures/transformation/es6-spread-loose/arguments/expected.js b/test/fixtures/transformation/es6-spread-loose/arguments/expected.js deleted file mode 100644 index 52a18f07e7..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/arguments/expected.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; - -function foo() { - return bar.apply(undefined, arguments); -} - -function bar(one, two, three) { - return [one, two, three]; -} - -foo("foo", "bar"); diff --git a/test/fixtures/transformation/es6-spread-loose/array-literal-first/actual.js b/test/fixtures/transformation/es6-spread-loose/array-literal-first/actual.js deleted file mode 100644 index 3857ab97d4..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/array-literal-first/actual.js +++ /dev/null @@ -1 +0,0 @@ -var lyrics = [...parts, "head", "and", "toes"]; diff --git a/test/fixtures/transformation/es6-spread-loose/array-literal-first/expected.js b/test/fixtures/transformation/es6-spread-loose/array-literal-first/expected.js deleted file mode 100644 index 3d1401d537..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/array-literal-first/expected.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; - -var lyrics = [].concat(parts, ["head", "and", "toes"]); diff --git a/test/fixtures/transformation/es6-spread-loose/array-literal-middle/actual.js b/test/fixtures/transformation/es6-spread-loose/array-literal-middle/actual.js deleted file mode 100644 index 9b354ad7cf..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/array-literal-middle/actual.js +++ /dev/null @@ -1 +0,0 @@ -var a = [b, ...c, d]; diff --git a/test/fixtures/transformation/es6-spread-loose/array-literal-middle/expected.js b/test/fixtures/transformation/es6-spread-loose/array-literal-middle/expected.js deleted file mode 100644 index cc40455aeb..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/array-literal-middle/expected.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; - -var a = [b].concat(c, [d]); diff --git a/test/fixtures/transformation/es6-spread-loose/array-literal-multiple/actual.js b/test/fixtures/transformation/es6-spread-loose/array-literal-multiple/actual.js deleted file mode 100644 index e65edc597a..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/array-literal-multiple/actual.js +++ /dev/null @@ -1 +0,0 @@ -var a = [b, ...c, d, e, ...f]; diff --git a/test/fixtures/transformation/es6-spread-loose/array-literal-multiple/expected.js b/test/fixtures/transformation/es6-spread-loose/array-literal-multiple/expected.js deleted file mode 100644 index 5b55e67414..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/array-literal-multiple/expected.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; - -var a = [b].concat(c, [d, e], f); diff --git a/test/fixtures/transformation/es6-spread-loose/array-literals/actual.js b/test/fixtures/transformation/es6-spread-loose/array-literals/actual.js deleted file mode 100644 index 5ebb80da66..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/array-literals/actual.js +++ /dev/null @@ -1 +0,0 @@ -var lyrics = ["head", "and", "toes", ...parts]; diff --git a/test/fixtures/transformation/es6-spread-loose/array-literals/expected.js b/test/fixtures/transformation/es6-spread-loose/array-literals/expected.js deleted file mode 100644 index 4b402a9818..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/array-literals/expected.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; - -var lyrics = ["head", "and", "toes"].concat(parts); diff --git a/test/fixtures/transformation/es6-spread-loose/contexted-computed-method-call-multiple-args/actual.js b/test/fixtures/transformation/es6-spread-loose/contexted-computed-method-call-multiple-args/actual.js deleted file mode 100644 index 305586e2a6..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/contexted-computed-method-call-multiple-args/actual.js +++ /dev/null @@ -1 +0,0 @@ -obj[method](foo, bar, ...args); diff --git a/test/fixtures/transformation/es6-spread-loose/contexted-computed-method-call-multiple-args/expected.js b/test/fixtures/transformation/es6-spread-loose/contexted-computed-method-call-multiple-args/expected.js deleted file mode 100644 index 6303149d3c..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/contexted-computed-method-call-multiple-args/expected.js +++ /dev/null @@ -1,4 +0,0 @@ -"use strict"; - -var _obj; -(_obj = obj)[method].apply(_obj, [foo, bar].concat(args)); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-spread-loose/contexted-computed-method-call-single-arg/actual.js b/test/fixtures/transformation/es6-spread-loose/contexted-computed-method-call-single-arg/actual.js deleted file mode 100644 index 65a21cba1e..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/contexted-computed-method-call-single-arg/actual.js +++ /dev/null @@ -1 +0,0 @@ -obj[method](...args); diff --git a/test/fixtures/transformation/es6-spread-loose/contexted-computed-method-call-single-arg/expected.js b/test/fixtures/transformation/es6-spread-loose/contexted-computed-method-call-single-arg/expected.js deleted file mode 100644 index 786a1efbd7..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/contexted-computed-method-call-single-arg/expected.js +++ /dev/null @@ -1,4 +0,0 @@ -"use strict"; - -var _obj; -(_obj = obj)[method].apply(_obj, args); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-spread-loose/contexted-method-call-multiple-args/actual.js b/test/fixtures/transformation/es6-spread-loose/contexted-method-call-multiple-args/actual.js deleted file mode 100644 index 7dc7d142a1..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/contexted-method-call-multiple-args/actual.js +++ /dev/null @@ -1,2 +0,0 @@ -foob.add(foo, bar, ...numbers); -foob.test.add(foo, bar, ...numbers); diff --git a/test/fixtures/transformation/es6-spread-loose/contexted-method-call-multiple-args/expected.js b/test/fixtures/transformation/es6-spread-loose/contexted-method-call-multiple-args/expected.js deleted file mode 100644 index 5c9d6466ef..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/contexted-method-call-multiple-args/expected.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; - -var _foob, _foob$test; -(_foob = foob).add.apply(_foob, [foo, bar].concat(numbers)); -(_foob$test = foob.test).add.apply(_foob$test, [foo, bar].concat(numbers)); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-spread-loose/contexted-method-call-single-arg/actual.js b/test/fixtures/transformation/es6-spread-loose/contexted-method-call-single-arg/actual.js deleted file mode 100644 index ef061e17a8..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/contexted-method-call-single-arg/actual.js +++ /dev/null @@ -1,2 +0,0 @@ -foob.add(...numbers); -foob.test.add(...numbers); diff --git a/test/fixtures/transformation/es6-spread-loose/contexted-method-call-single-arg/expected.js b/test/fixtures/transformation/es6-spread-loose/contexted-method-call-single-arg/expected.js deleted file mode 100644 index f03c36ac76..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/contexted-method-call-single-arg/expected.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; - -var _foob, _foob$test; -(_foob = foob).add.apply(_foob, numbers); -(_foob$test = foob.test).add.apply(_foob$test, numbers); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-spread-loose/method-call-array-literal/actual.js b/test/fixtures/transformation/es6-spread-loose/method-call-array-literal/actual.js deleted file mode 100644 index 2d1a0bb716..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/method-call-array-literal/actual.js +++ /dev/null @@ -1 +0,0 @@ -f(...[1, 2, 3]); diff --git a/test/fixtures/transformation/es6-spread-loose/method-call-array-literal/expected.js b/test/fixtures/transformation/es6-spread-loose/method-call-array-literal/expected.js deleted file mode 100644 index a370047756..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/method-call-array-literal/expected.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; - -f.apply(undefined, [1, 2, 3]); diff --git a/test/fixtures/transformation/es6-spread-loose/method-call-first/actual.js b/test/fixtures/transformation/es6-spread-loose/method-call-first/actual.js deleted file mode 100644 index 0d63c0ea63..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/method-call-first/actual.js +++ /dev/null @@ -1 +0,0 @@ -add(...numbers, foo, bar); diff --git a/test/fixtures/transformation/es6-spread-loose/method-call-first/expected.js b/test/fixtures/transformation/es6-spread-loose/method-call-first/expected.js deleted file mode 100644 index 4700d54131..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/method-call-first/expected.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; - -add.apply(undefined, numbers.concat([foo, bar])); diff --git a/test/fixtures/transformation/es6-spread-loose/method-call-middle/actual.js b/test/fixtures/transformation/es6-spread-loose/method-call-middle/actual.js deleted file mode 100644 index b04a3f0223..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/method-call-middle/actual.js +++ /dev/null @@ -1 +0,0 @@ -add(foo, ...numbers, bar); diff --git a/test/fixtures/transformation/es6-spread-loose/method-call-middle/expected.js b/test/fixtures/transformation/es6-spread-loose/method-call-middle/expected.js deleted file mode 100644 index 74f6a108ac..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/method-call-middle/expected.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; - -add.apply(undefined, [foo].concat(numbers, [bar])); diff --git a/test/fixtures/transformation/es6-spread-loose/method-call-multiple-args/actual.js b/test/fixtures/transformation/es6-spread-loose/method-call-multiple-args/actual.js deleted file mode 100644 index 0a2421b7b4..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/method-call-multiple-args/actual.js +++ /dev/null @@ -1 +0,0 @@ -add(foo, bar, ...numbers); diff --git a/test/fixtures/transformation/es6-spread-loose/method-call-multiple-args/expected.js b/test/fixtures/transformation/es6-spread-loose/method-call-multiple-args/expected.js deleted file mode 100644 index e543eca3db..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/method-call-multiple-args/expected.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; - -add.apply(undefined, [foo, bar].concat(numbers)); diff --git a/test/fixtures/transformation/es6-spread-loose/method-call-multiple/actual.js b/test/fixtures/transformation/es6-spread-loose/method-call-multiple/actual.js deleted file mode 100644 index c06ed01cfb..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/method-call-multiple/actual.js +++ /dev/null @@ -1 +0,0 @@ -add(foo, ...numbers, bar, what, ...test); diff --git a/test/fixtures/transformation/es6-spread-loose/method-call-multiple/expected.js b/test/fixtures/transformation/es6-spread-loose/method-call-multiple/expected.js deleted file mode 100644 index 046ac08426..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/method-call-multiple/expected.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; - -add.apply(undefined, [foo].concat(numbers, [bar, what], test)); diff --git a/test/fixtures/transformation/es6-spread-loose/method-call-single-arg/actual.js b/test/fixtures/transformation/es6-spread-loose/method-call-single-arg/actual.js deleted file mode 100644 index a24aa1b09c..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/method-call-single-arg/actual.js +++ /dev/null @@ -1 +0,0 @@ -add(...numbers); diff --git a/test/fixtures/transformation/es6-spread-loose/method-call-single-arg/expected.js b/test/fixtures/transformation/es6-spread-loose/method-call-single-arg/expected.js deleted file mode 100644 index ef2f902647..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/method-call-single-arg/expected.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; - -add.apply(undefined, numbers); diff --git a/test/fixtures/transformation/es6-spread-loose/new-expression/actual.js b/test/fixtures/transformation/es6-spread-loose/new-expression/actual.js deleted file mode 100644 index 72800dd42b..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/new-expression/actual.js +++ /dev/null @@ -1,2 +0,0 @@ -new Numbers(...nums); -new Numbers(1, ...nums); diff --git a/test/fixtures/transformation/es6-spread-loose/new-expression/expected.js b/test/fixtures/transformation/es6-spread-loose/new-expression/expected.js deleted file mode 100644 index 5677c95bec..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/new-expression/expected.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; - -var _applyConstructor = function (Constructor, args) { - var instance = Object.create(Constructor.prototype); - - var result = Constructor.apply(instance, args); - - return result != null && (typeof result == "object" || typeof result == "function") ? result : instance; -}; - -_applyConstructor(Numbers, nums); -_applyConstructor(Numbers, [1].concat(nums)); diff --git a/test/fixtures/transformation/es6-spread-loose/options.json b/test/fixtures/transformation/es6-spread-loose/options.json deleted file mode 100644 index 536a7d71d2..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "loose": "spread" -} diff --git a/test/fixtures/transformation/es6-spread-loose/single/actual.js b/test/fixtures/transformation/es6-spread-loose/single/actual.js deleted file mode 100644 index 6541257708..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/single/actual.js +++ /dev/null @@ -1 +0,0 @@ -[...foo]; diff --git a/test/fixtures/transformation/es6-spread-loose/single/expected.js b/test/fixtures/transformation/es6-spread-loose/single/expected.js deleted file mode 100644 index 0d7e55ac18..0000000000 --- a/test/fixtures/transformation/es6-spread-loose/single/expected.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; - -[].concat(foo); diff --git a/test/fixtures/transformation/es7-array-comprehension-loose/arguments/actual.js b/test/fixtures/transformation/es7-array-comprehension-loose/arguments/actual.js deleted file mode 100644 index 95f9a4df57..0000000000 --- a/test/fixtures/transformation/es7-array-comprehension-loose/arguments/actual.js +++ /dev/null @@ -1,5 +0,0 @@ -function add() { - return [for (i of [1, 2, 3]) i * arguments[0]]; -} - -add(5); diff --git a/test/fixtures/transformation/es7-array-comprehension-loose/arguments/expected.js b/test/fixtures/transformation/es7-array-comprehension-loose/arguments/expected.js deleted file mode 100644 index 39115d87d3..0000000000 --- a/test/fixtures/transformation/es7-array-comprehension-loose/arguments/expected.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; - -function add() { - var _arguments = arguments; - return (function () { - var _ref = []; - - for (var _iterator = [1, 2, 3][Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { - var i = _step.value; - _ref.push(i * _arguments[0]); - } - - return _ref; - })(); -} - -add(5); diff --git a/test/fixtures/transformation/es7-array-comprehension-loose/array-expression-single-if/actual.js b/test/fixtures/transformation/es7-array-comprehension-loose/array-expression-single-if/actual.js deleted file mode 100644 index 4882336b9f..0000000000 --- a/test/fixtures/transformation/es7-array-comprehension-loose/array-expression-single-if/actual.js +++ /dev/null @@ -1 +0,0 @@ -var arr = [for (i of [1, 2, 3]) if (i > 1) i * i]; diff --git a/test/fixtures/transformation/es7-array-comprehension-loose/array-expression-single-if/expected.js b/test/fixtures/transformation/es7-array-comprehension-loose/array-expression-single-if/expected.js deleted file mode 100644 index 0f3f625138..0000000000 --- a/test/fixtures/transformation/es7-array-comprehension-loose/array-expression-single-if/expected.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; - -var arr = (function () { - var _arr = []; - - for (var _iterator = [1, 2, 3][Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { - var i = _step.value; - if (i > 1) { - _arr.push(i * i); - } - } - - return _arr; -})(); diff --git a/test/fixtures/transformation/es7-array-comprehension-loose/array-expression-single/actual.js b/test/fixtures/transformation/es7-array-comprehension-loose/array-expression-single/actual.js deleted file mode 100644 index 2087ae351b..0000000000 --- a/test/fixtures/transformation/es7-array-comprehension-loose/array-expression-single/actual.js +++ /dev/null @@ -1 +0,0 @@ -var arr = [for (i of [1, 2, 3]) i * i]; diff --git a/test/fixtures/transformation/es7-array-comprehension-loose/array-expression-single/expected.js b/test/fixtures/transformation/es7-array-comprehension-loose/array-expression-single/expected.js deleted file mode 100644 index c3ae8d9432..0000000000 --- a/test/fixtures/transformation/es7-array-comprehension-loose/array-expression-single/expected.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; - -var arr = (function () { - var _arr = []; - - for (var _iterator = [1, 2, 3][Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { - var i = _step.value; - _arr.push(i * i); - } - - return _arr; -})(); diff --git a/test/fixtures/transformation/es7-array-comprehension-loose/multiple-if/actual.js b/test/fixtures/transformation/es7-array-comprehension-loose/multiple-if/actual.js deleted file mode 100644 index 754bb7e894..0000000000 --- a/test/fixtures/transformation/es7-array-comprehension-loose/multiple-if/actual.js +++ /dev/null @@ -1 +0,0 @@ -var seattlers = [for (customers of countries) for (c of customers) if (c.city == "Seattle") { name: c.name, age: c.age }]; diff --git a/test/fixtures/transformation/es7-array-comprehension-loose/multiple-if/expected.js b/test/fixtures/transformation/es7-array-comprehension-loose/multiple-if/expected.js deleted file mode 100644 index 6b486b45f5..0000000000 --- a/test/fixtures/transformation/es7-array-comprehension-loose/multiple-if/expected.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; - -var seattlers = (function () { - var _seattlers = []; - - for (var _iterator = countries[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { - var customers = _step.value; - for (var _iterator2 = customers[Symbol.iterator](), _step2; !(_step2 = _iterator2.next()).done;) { - var c = _step2.value; - if (c.city == "Seattle") { - _seattlers.push({ name: c.name, age: c.age }); - } - } - } - - return _seattlers; -})(); diff --git a/test/fixtures/transformation/es7-array-comprehension-loose/multiple/actual.js b/test/fixtures/transformation/es7-array-comprehension-loose/multiple/actual.js deleted file mode 100644 index f0aaa63c27..0000000000 --- a/test/fixtures/transformation/es7-array-comprehension-loose/multiple/actual.js +++ /dev/null @@ -1 +0,0 @@ -var arr = [for (x of "abcdefgh".split("")) for (y of "12345678".split("")) x + y]; diff --git a/test/fixtures/transformation/es7-array-comprehension-loose/multiple/expected.js b/test/fixtures/transformation/es7-array-comprehension-loose/multiple/expected.js deleted file mode 100644 index 05f2c6e76d..0000000000 --- a/test/fixtures/transformation/es7-array-comprehension-loose/multiple/expected.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; - -var arr = (function () { - var _arr = []; - - for (var _iterator = "abcdefgh".split("")[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { - var x = _step.value; - for (var _iterator2 = "12345678".split("")[Symbol.iterator](), _step2; !(_step2 = _iterator2.next()).done;) { - var y = _step2.value; - _arr.push(x + y); - } - } - - return _arr; -})(); diff --git a/test/fixtures/transformation/es7-array-comprehension-loose/options.json b/test/fixtures/transformation/es7-array-comprehension-loose/options.json deleted file mode 100644 index 6e5e1c6b65..0000000000 --- a/test/fixtures/transformation/es7-array-comprehension-loose/options.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "experimental": true, - "loose": "arrayComprehension" -} diff --git a/test/fixtures/transformation/es7-array-comprehension-loose/single-if/actual.js b/test/fixtures/transformation/es7-array-comprehension-loose/single-if/actual.js deleted file mode 100644 index e2cf129386..0000000000 --- a/test/fixtures/transformation/es7-array-comprehension-loose/single-if/actual.js +++ /dev/null @@ -1 +0,0 @@ -var arr = [for (i of nums) if (i > 1) i * i]; diff --git a/test/fixtures/transformation/es7-array-comprehension-loose/single-if/expected.js b/test/fixtures/transformation/es7-array-comprehension-loose/single-if/expected.js deleted file mode 100644 index 6e95f9cadc..0000000000 --- a/test/fixtures/transformation/es7-array-comprehension-loose/single-if/expected.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; - -var arr = (function () { - var _arr = []; - - for (var _iterator = nums[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { - var i = _step.value; - if (i > 1) { - _arr.push(i * i); - } - } - - return _arr; -})(); diff --git a/test/fixtures/transformation/es7-array-comprehension-loose/single/actual.js b/test/fixtures/transformation/es7-array-comprehension-loose/single/actual.js deleted file mode 100644 index 9dda19048b..0000000000 --- a/test/fixtures/transformation/es7-array-comprehension-loose/single/actual.js +++ /dev/null @@ -1 +0,0 @@ -var arr = [for (i of nums) i * i]; diff --git a/test/fixtures/transformation/es7-array-comprehension-loose/single/expected.js b/test/fixtures/transformation/es7-array-comprehension-loose/single/expected.js deleted file mode 100644 index 88e01e350a..0000000000 --- a/test/fixtures/transformation/es7-array-comprehension-loose/single/expected.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; - -var arr = (function () { - var _arr = []; - - for (var _iterator = nums[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { - var i = _step.value; - _arr.push(i * i); - } - - return _arr; -})(); diff --git a/test/fixtures/transformation/es7-array-comprehension-loose/this/actual.js b/test/fixtures/transformation/es7-array-comprehension-loose/this/actual.js deleted file mode 100644 index 355ed48188..0000000000 --- a/test/fixtures/transformation/es7-array-comprehension-loose/this/actual.js +++ /dev/null @@ -1,5 +0,0 @@ -function add() { - return [for (i of [1, 2, 3]) i * this.multiplier]; -} - -add.call({ multiplier: 5 }); diff --git a/test/fixtures/transformation/es7-array-comprehension-loose/this/expected.js b/test/fixtures/transformation/es7-array-comprehension-loose/this/expected.js deleted file mode 100644 index 5645b53dcc..0000000000 --- a/test/fixtures/transformation/es7-array-comprehension-loose/this/expected.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; - -function add() { - var _this = this; - return (function () { - var _ref = []; - - for (var _iterator = [1, 2, 3][Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { - var i = _step.value; - _ref.push(i * _this.multiplier); - } - - return _ref; - })(); -} - -add.call({ multiplier: 5 }); diff --git a/test/fixtures/transformation/es7-generator-comprehension-loose/options.json b/test/fixtures/transformation/es7-generator-comprehension-loose/options.json deleted file mode 100644 index 4fdef2f3ff..0000000000 --- a/test/fixtures/transformation/es7-generator-comprehension-loose/options.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "experimental": true, - "loose": "generatorComprehension" -} diff --git a/test/fixtures/transformation/es7-generator-comprehension-loose/simple/exec.js b/test/fixtures/transformation/es7-generator-comprehension-loose/simple/exec.js deleted file mode 100644 index dd7ef4da0a..0000000000 --- a/test/fixtures/transformation/es7-generator-comprehension-loose/simple/exec.js +++ /dev/null @@ -1,6 +0,0 @@ -var nums = [1, 2, 3, 4, 5, 6]; -var multiples = (for (i of nums) if (i % 2) i * i); -assert.equal(multiples.next().value, 1); -assert.equal(multiples.next().value, 9); -assert.equal(multiples.next().value, 25); -assert.ok(multiples.next().done);