From 513d93f6bfcadf86d6ec3faa2f8b46f5b469fbfc Mon Sep 17 00:00:00 2001 From: Teddy Katz Date: Wed, 28 Mar 2018 22:53:47 -0400 Subject: [PATCH] Breaking: remove experimentalObjectRestSpread option Users who want to use object rest/spread should enable `ecmaVersion: 2018` instead. As discussed in https://github.com/eslint/eslint/issues/9990, ESLint 5 will translate the `experimentalObjectRestSpread` option to `ecmaVersion: 2018` and emit a deprecation warning. --- espree.js | 113 -- lib/ast-node-types.js | 2 - lib/features.js | 5 +- lib/visitor-keys.js | 6 +- .../arg-spread.result.js | 406 -------- .../arg-spread.src.js | 1 - .../destructuring-assign-mirror.result.js | 549 ---------- .../destructuring-assign-mirror.src.js | 1 - .../invalid-rest-trailing-comma.result.js | 6 - .../invalid-rest-trailing-comma.src.js | 1 - .../invalid-rest.result.js | 6 - .../invalid-rest.src.js | 1 - .../object-rest.result.js | 982 ------------------ .../object-rest.src.js | 1 - .../property-spread.result.js | 859 --------------- .../property-spread.src.js | 9 - .../shorthand-method-args.result.js | 626 ----------- .../shorthand-method-args.src.js | 5 - .../shorthand-methods.result.js | 685 ------------ .../shorthand-methods.src.js | 5 - .../shorthand-properties.result.js | 715 ------------- .../shorthand-properties.src.js | 9 - .../single-spread.result.js | 787 -------------- .../single-spread.src.js | 9 - .../spread-trailing-comma.result.js | 449 -------- .../spread-trailing-comma.src.js | 1 - .../two-spread.result.js | 747 ------------- .../two-spread.src.js | 9 - tests/lib/ecma-features.js | 12 - 29 files changed, 2 insertions(+), 7005 deletions(-) delete mode 100644 tests/fixtures/ecma-features/experimentalObjectRestSpread/arg-spread.result.js delete mode 100644 tests/fixtures/ecma-features/experimentalObjectRestSpread/arg-spread.src.js delete mode 100644 tests/fixtures/ecma-features/experimentalObjectRestSpread/destructuring-assign-mirror.result.js delete mode 100644 tests/fixtures/ecma-features/experimentalObjectRestSpread/destructuring-assign-mirror.src.js delete mode 100644 tests/fixtures/ecma-features/experimentalObjectRestSpread/invalid-rest-trailing-comma.result.js delete mode 100644 tests/fixtures/ecma-features/experimentalObjectRestSpread/invalid-rest-trailing-comma.src.js delete mode 100644 tests/fixtures/ecma-features/experimentalObjectRestSpread/invalid-rest.result.js delete mode 100644 tests/fixtures/ecma-features/experimentalObjectRestSpread/invalid-rest.src.js delete mode 100644 tests/fixtures/ecma-features/experimentalObjectRestSpread/object-rest.result.js delete mode 100644 tests/fixtures/ecma-features/experimentalObjectRestSpread/object-rest.src.js delete mode 100644 tests/fixtures/ecma-features/experimentalObjectRestSpread/property-spread.result.js delete mode 100644 tests/fixtures/ecma-features/experimentalObjectRestSpread/property-spread.src.js delete mode 100644 tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-method-args.result.js delete mode 100644 tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-method-args.src.js delete mode 100644 tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-methods.result.js delete mode 100644 tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-methods.src.js delete mode 100644 tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-properties.result.js delete mode 100644 tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-properties.src.js delete mode 100644 tests/fixtures/ecma-features/experimentalObjectRestSpread/single-spread.result.js delete mode 100644 tests/fixtures/ecma-features/experimentalObjectRestSpread/single-spread.src.js delete mode 100644 tests/fixtures/ecma-features/experimentalObjectRestSpread/spread-trailing-comma.result.js delete mode 100644 tests/fixtures/ecma-features/experimentalObjectRestSpread/spread-trailing-comma.src.js delete mode 100644 tests/fixtures/ecma-features/experimentalObjectRestSpread/two-spread.result.js delete mode 100644 tests/fixtures/ecma-features/experimentalObjectRestSpread/two-spread.src.js diff --git a/espree.js b/espree.js index 23d434e5..e0f55d97 100644 --- a/espree.js +++ b/espree.js @@ -159,13 +159,7 @@ function normalizeEcmaVersion(ecmaVersion) { * @private */ function isValidNode(node) { - var ecma = extra.ecmaFeatures; - switch (node.type) { - case "ExperimentalSpreadProperty": - case "ExperimentalRestProperty": - return ecma.experimentalObjectRestSpread; - case "ImportDeclaration": case "ExportNamedDeclaration": case "ExportDefaultDeclaration": @@ -289,24 +283,6 @@ acorn.plugins.espree = function(instance) { }; }); - // needed for experimental object rest/spread - instance.extend("checkLVal", function(checkLVal) { - - return /** @this acorn.Parser */ function(expr, isBinding, checkClashes) { - - if (extra.ecmaFeatures.experimentalObjectRestSpread && expr.type === "ObjectPattern") { - for (var i = 0; i < expr.properties.length; i++) { - if (expr.properties[i].type.indexOf("Experimental") === -1) { - this.checkLVal(expr.properties[i].value, isBinding, checkClashes); - } - } - return undefined; - } - - return checkLVal.call(this, expr, isBinding, checkClashes); - }; - }); - instance.extend("parseTopLevel", function(parseTopLevel) { return /** @this acorn.Parser */ function(node) { if (extra.ecmaFeatures.impliedStrict && this.options.ecmaVersion >= 5) { @@ -316,95 +292,6 @@ acorn.plugins.espree = function(instance) { }; }); - instance.extend("toAssignable", function(toAssignable) { - - return /** @this acorn.Parser */ function(node, isBinding, refDestructuringErrors) { - - if (extra.ecmaFeatures.experimentalObjectRestSpread && - node.type === "ObjectExpression" - ) { - node.type = "ObjectPattern"; - - for (var i = 0; i < node.properties.length; i++) { - var prop = node.properties[i]; - - if (prop.type === "ExperimentalSpreadProperty") { - prop.type = "ExperimentalRestProperty"; - } else if (prop.kind !== "init") { - this.raise(prop.key.start, "Object pattern can't contain getter or setter"); - } else { - this.toAssignable(prop.value, isBinding); - } - } - - return node; - } else { - return toAssignable.call(this, node, isBinding, refDestructuringErrors); - } - }; - - }); - - /** - * Method to parse an object rest or object spread. - * @returns {ASTNode} The node representing object rest or object spread. - * @this acorn.Parser - */ - instance.parseObjectRest = function() { - var node = this.startNode(); - this.next(); - node.argument = this.parseIdent(); - - if (this.type === tt.comma) { - this.raise(this.start, "Unexpected trailing comma after rest property"); - } - - return this.finishNode(node, "ExperimentalRestProperty"); - }; - - instance.extend("parseProperty", function(parseProperty) { - /** - * Override `parseProperty` method to parse rest/spread properties. - * @param {boolean} isPattern True if the object is a destructuring pattern. - * @param {Object} refDestructuringErrors ? - * @returns {ASTNode} The node representing a rest/spread property. - * @this acorn.Parser - */ - return function(isPattern, refDestructuringErrors) { - if (extra.ecmaFeatures.experimentalObjectRestSpread && this.type === tt.ellipsis) { - var prop; - - if (isPattern) { - prop = this.parseObjectRest(); - } else { - prop = this.parseSpread(); - prop.type = "ExperimentalSpreadProperty"; - } - - return prop; - } - - return parseProperty.call(this, isPattern, refDestructuringErrors); - }; - }); - - instance.extend("checkPropClash", function(checkPropClash) { - /** - * Override `checkPropClash` method to avoid clash on rest/spread properties. - * @param {ASTNode} prop A property node to check. - * @param {Object} propHash Names map. - * @param {Object} refDestructuringErrors Destructuring error information. - * @returns {void} - * @this acorn.Parser - */ - return function(prop, propHash, refDestructuringErrors) { - if (prop.type === "ExperimentalRestProperty" || prop.type === "ExperimentalSpreadProperty") { - return; - } - checkPropClash.call(this, prop, propHash, refDestructuringErrors); - }; - }); - /** * Overwrites the default raise method to throw Esprima-style errors. * @param {int} pos The position of the error. diff --git a/lib/ast-node-types.js b/lib/ast-node-types.js index 35bcaed0..2844024d 100644 --- a/lib/ast-node-types.js +++ b/lib/ast-node-types.js @@ -35,8 +35,6 @@ module.exports = { DoWhileStatement: "DoWhileStatement", DebuggerStatement: "DebuggerStatement", EmptyStatement: "EmptyStatement", - ExperimentalRestProperty: "ExperimentalRestProperty", - ExperimentalSpreadProperty: "ExperimentalSpreadProperty", ExpressionStatement: "ExpressionStatement", ForStatement: "ForStatement", ForInStatement: "ForInStatement", diff --git a/lib/features.js b/lib/features.js index 774f8e5e..d1ad5f85 100644 --- a/lib/features.js +++ b/lib/features.js @@ -25,8 +25,5 @@ module.exports = { globalReturn: false, // allow implied strict mode - impliedStrict: false, - - // allow experimental object rest/spread - experimentalObjectRestSpread: false + impliedStrict: false }; diff --git a/lib/visitor-keys.js b/lib/visitor-keys.js index d1efeb7a..efc6c616 100644 --- a/lib/visitor-keys.js +++ b/lib/visitor-keys.js @@ -119,9 +119,5 @@ module.exports = { JSXOpeningElement: ["name", "attributes"], JSXAttribute: ["name", "value"], JSXText: null, - JSXSpreadAttribute: ["argument"], - - // Experimental features - ExperimentalRestProperty: ["argument"], - ExperimentalSpreadProperty: ["argument"] + JSXSpreadAttribute: ["argument"] }; diff --git a/tests/fixtures/ecma-features/experimentalObjectRestSpread/arg-spread.result.js b/tests/fixtures/ecma-features/experimentalObjectRestSpread/arg-spread.result.js deleted file mode 100644 index 26080298..00000000 --- a/tests/fixtures/ecma-features/experimentalObjectRestSpread/arg-spread.result.js +++ /dev/null @@ -1,406 +0,0 @@ -module.exports = { - "type": "Program", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, - "range": [ - 0, - 24 - ], - "body": [ - { - "type": "FunctionDeclaration", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, - "range": [ - 0, - 24 - ], - "id": { - "type": "Identifier", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "range": [ - 9, - 10 - ], - "name": "c" - }, - "generator": false, - "expression": false, - "params": [ - { - "type": "ObjectPattern", - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "range": [ - 11, - 20 - ], - "properties": [ - { - "type": "Property", - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "range": [ - 12, - 13 - ], - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "range": [ - 12, - 13 - ], - "name": "a" - }, - "kind": "init", - "value": { - "type": "Identifier", - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "range": [ - 12, - 13 - ], - "name": "a" - } - }, - { - "type": "ExperimentalRestProperty", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "range": [ - 15, - 19 - ], - "argument": { - "type": "Identifier", - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "range": [ - 18, - 19 - ], - "name": "b" - } - } - ] - } - ], - "body": { - "type": "BlockStatement", - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 24 - } - }, - "range": [ - 22, - 24 - ], - "body": [] - } - } - ], - "sourceType": "script", - "tokens": [ - { - "type": "Keyword", - "value": "function", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - }, - "range": [ - 0, - 8 - ] - }, - { - "type": "Identifier", - "value": "c", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "range": [ - 9, - 10 - ] - }, - { - "type": "Punctuator", - "value": "(", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - }, - "range": [ - 10, - 11 - ] - }, - { - "type": "Punctuator", - "value": "{", - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, - "range": [ - 11, - 12 - ] - }, - { - "type": "Identifier", - "value": "a", - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "range": [ - 12, - 13 - ] - }, - { - "type": "Punctuator", - "value": ",", - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - }, - "range": [ - 13, - 14 - ] - }, - { - "type": "Punctuator", - "value": "...", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "range": [ - 15, - 18 - ] - }, - { - "type": "Identifier", - "value": "b", - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "range": [ - 18, - 19 - ] - }, - { - "type": "Punctuator", - "value": "}", - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "range": [ - 19, - 20 - ] - }, - { - "type": "Punctuator", - "value": ")", - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - }, - "range": [ - 20, - 21 - ] - }, - { - "type": "Punctuator", - "value": "{", - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "range": [ - 22, - 23 - ] - }, - { - "type": "Punctuator", - "value": "}", - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - }, - "range": [ - 23, - 24 - ] - } - ] -}; \ No newline at end of file diff --git a/tests/fixtures/ecma-features/experimentalObjectRestSpread/arg-spread.src.js b/tests/fixtures/ecma-features/experimentalObjectRestSpread/arg-spread.src.js deleted file mode 100644 index 99da0c53..00000000 --- a/tests/fixtures/ecma-features/experimentalObjectRestSpread/arg-spread.src.js +++ /dev/null @@ -1 +0,0 @@ -function c({a, ...b}) {} diff --git a/tests/fixtures/ecma-features/experimentalObjectRestSpread/destructuring-assign-mirror.result.js b/tests/fixtures/ecma-features/experimentalObjectRestSpread/destructuring-assign-mirror.result.js deleted file mode 100644 index 49acb2b8..00000000 --- a/tests/fixtures/ecma-features/experimentalObjectRestSpread/destructuring-assign-mirror.result.js +++ /dev/null @@ -1,549 +0,0 @@ -module.exports = { - "type": "Program", - "body": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "a", - "range": [ - 2, - 3 - ], - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - "value": { - "type": "Identifier", - "name": "a", - "range": [ - 2, - 3 - ], - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "range": [ - 2, - 3 - ], - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - { - "type": "ExperimentalRestProperty", - "argument": { - "type": "Identifier", - "name": "b", - "range": [ - 8, - 9 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - "range": [ - 5, - 9 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 9 - } - } - } - ], - "range": [ - 1, - 10 - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "key": { - "type": "Identifier", - "name": "a", - "range": [ - 14, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "value": { - "type": "Identifier", - "name": "a", - "range": [ - 14, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - "kind": "init", - "method": false, - "shorthand": true, - "computed": false, - "range": [ - 14, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - { - "type": "ExperimentalSpreadProperty", - "argument": { - "type": "Identifier", - "name": "b", - "range": [ - 20, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - "range": [ - 17, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 21 - } - } - } - ], - "range": [ - 13, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "range": [ - 1, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "range": [ - 0, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - } - } - ], - "sourceType": "script", - "range": [ - 0, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "tokens": [ - { - "type": "Punctuator", - "value": "(", - "range": [ - 0, - 1 - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - { - "type": "Punctuator", - "value": "{", - "range": [ - 1, - 2 - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - } - }, - { - "type": "Identifier", - "value": "a", - "range": [ - 2, - 3 - ], - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - } - }, - { - "type": "Punctuator", - "value": ",", - "range": [ - 3, - 4 - ], - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - { - "type": "Punctuator", - "value": "...", - "range": [ - 5, - 8 - ], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - { - "type": "Identifier", - "value": "b", - "range": [ - 8, - 9 - ], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - { - "type": "Punctuator", - "value": "}", - "range": [ - 9, - 10 - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - { - "type": "Punctuator", - "value": "=", - "range": [ - 11, - 12 - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - { - "type": "Punctuator", - "value": "{", - "range": [ - 13, - 14 - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - { - "type": "Identifier", - "value": "a", - "range": [ - 14, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - } - } - }, - { - "type": "Punctuator", - "value": ",", - "range": [ - 15, - 16 - ], - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - { - "type": "Punctuator", - "value": "...", - "range": [ - 17, - 20 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - } - } - }, - { - "type": "Identifier", - "value": "b", - "range": [ - 20, - 21 - ], - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - { - "type": "Punctuator", - "value": "}", - "range": [ - 21, - 22 - ], - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - { - "type": "Punctuator", - "value": ")", - "range": [ - 22, - 23 - ], - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - } - } - ] -}; diff --git a/tests/fixtures/ecma-features/experimentalObjectRestSpread/destructuring-assign-mirror.src.js b/tests/fixtures/ecma-features/experimentalObjectRestSpread/destructuring-assign-mirror.src.js deleted file mode 100644 index 0caa3fab..00000000 --- a/tests/fixtures/ecma-features/experimentalObjectRestSpread/destructuring-assign-mirror.src.js +++ /dev/null @@ -1 +0,0 @@ -({a, ...b} = {a, ...b}) diff --git a/tests/fixtures/ecma-features/experimentalObjectRestSpread/invalid-rest-trailing-comma.result.js b/tests/fixtures/ecma-features/experimentalObjectRestSpread/invalid-rest-trailing-comma.result.js deleted file mode 100644 index 741ae54b..00000000 --- a/tests/fixtures/ecma-features/experimentalObjectRestSpread/invalid-rest-trailing-comma.result.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - index: 16, - lineNumber: 1, - column: 17, - message: "Unexpected trailing comma after rest property" -}; diff --git a/tests/fixtures/ecma-features/experimentalObjectRestSpread/invalid-rest-trailing-comma.src.js b/tests/fixtures/ecma-features/experimentalObjectRestSpread/invalid-rest-trailing-comma.src.js deleted file mode 100644 index 39ef542f..00000000 --- a/tests/fixtures/ecma-features/experimentalObjectRestSpread/invalid-rest-trailing-comma.src.js +++ /dev/null @@ -1 +0,0 @@ -var { x, y, ...z, } = foo; diff --git a/tests/fixtures/ecma-features/experimentalObjectRestSpread/invalid-rest.result.js b/tests/fixtures/ecma-features/experimentalObjectRestSpread/invalid-rest.result.js deleted file mode 100644 index c18a2de4..00000000 --- a/tests/fixtures/ecma-features/experimentalObjectRestSpread/invalid-rest.result.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - "index": 18, - "lineNumber": 1, - "column": 19, - "message": "Unexpected token ." -}; \ No newline at end of file diff --git a/tests/fixtures/ecma-features/experimentalObjectRestSpread/invalid-rest.src.js b/tests/fixtures/ecma-features/experimentalObjectRestSpread/invalid-rest.src.js deleted file mode 100644 index a38d92cf..00000000 --- a/tests/fixtures/ecma-features/experimentalObjectRestSpread/invalid-rest.src.js +++ /dev/null @@ -1 +0,0 @@ -var { x, y, ...foo.bar } = { x: 1, y: 2, a: 3, b: 4 }; diff --git a/tests/fixtures/ecma-features/experimentalObjectRestSpread/object-rest.result.js b/tests/fixtures/ecma-features/experimentalObjectRestSpread/object-rest.result.js deleted file mode 100644 index af6c6694..00000000 --- a/tests/fixtures/ecma-features/experimentalObjectRestSpread/object-rest.result.js +++ /dev/null @@ -1,982 +0,0 @@ -module.exports = { - "type": "Program", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, - "range": [ - 0, - 48 - ], - "body": [ - { - "type": "VariableDeclaration", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, - "range": [ - 0, - 48 - ], - "declarations": [ - { - "type": "VariableDeclarator", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 47 - } - }, - "range": [ - 4, - 47 - ], - "id": { - "type": "ObjectPattern", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "range": [ - 4, - 18 - ], - "properties": [ - { - "type": "Property", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, - "range": [ - 6, - 7 - ], - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, - "range": [ - 6, - 7 - ], - "name": "x" - }, - "kind": "init", - "value": { - "type": "Identifier", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, - "range": [ - 6, - 7 - ], - "name": "x" - } - }, - { - "type": "Property", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "range": [ - 9, - 10 - ], - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "range": [ - 9, - 10 - ], - "name": "y" - }, - "kind": "init", - "value": { - "type": "Identifier", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "range": [ - 9, - 10 - ], - "name": "y" - } - }, - { - "type": "ExperimentalRestProperty", - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 16 - } - }, - "range": [ - 12, - 16 - ], - "argument": { - "type": "Identifier", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, - "range": [ - 15, - 16 - ], - "name": "z" - } - } - ] - }, - "init": { - "type": "ObjectExpression", - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 47 - } - }, - "range": [ - 21, - 47 - ], - "properties": [ - { - "type": "Property", - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "range": [ - 23, - 27 - ], - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - }, - "range": [ - 23, - 24 - ], - "name": "x" - }, - "value": { - "type": "Literal", - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "range": [ - 26, - 27 - ], - "value": 1, - "raw": "1" - }, - "kind": "init" - }, - { - "type": "Property", - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 33 - } - }, - "range": [ - 29, - 33 - ], - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - } - }, - "range": [ - 29, - 30 - ], - "name": "y" - }, - "value": { - "type": "Literal", - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 33 - } - }, - "range": [ - 32, - 33 - ], - "value": 2, - "raw": "2" - }, - "kind": "init" - }, - { - "type": "Property", - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 39 - } - }, - "range": [ - 35, - 39 - ], - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 36 - } - }, - "range": [ - 35, - 36 - ], - "name": "a" - }, - "value": { - "type": "Literal", - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 39 - } - }, - "range": [ - 38, - 39 - ], - "value": 3, - "raw": "3" - }, - "kind": "init" - }, - { - "type": "Property", - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 45 - } - }, - "range": [ - 41, - 45 - ], - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 42 - } - }, - "range": [ - 41, - 42 - ], - "name": "b" - }, - "value": { - "type": "Literal", - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 45 - } - }, - "range": [ - 44, - 45 - ], - "value": 4, - "raw": "4" - }, - "kind": "init" - } - ] - } - } - ], - "kind": "var" - } - ], - "sourceType": "script", - "tokens": [ - { - "type": "Keyword", - "value": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - }, - "range": [ - 0, - 3 - ] - }, - { - "type": "Punctuator", - "value": "{", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - }, - "range": [ - 4, - 5 - ] - }, - { - "type": "Identifier", - "value": "x", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, - "range": [ - 6, - 7 - ] - }, - { - "type": "Punctuator", - "value": ",", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - }, - "range": [ - 7, - 8 - ] - }, - { - "type": "Identifier", - "value": "y", - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "range": [ - 9, - 10 - ] - }, - { - "type": "Punctuator", - "value": ",", - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - }, - "range": [ - 10, - 11 - ] - }, - { - "type": "Punctuator", - "value": "...", - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "range": [ - 12, - 15 - ] - }, - { - "type": "Identifier", - "value": "z", - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, - "range": [ - 15, - 16 - ] - }, - { - "type": "Punctuator", - "value": "}", - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "range": [ - 17, - 18 - ] - }, - { - "type": "Punctuator", - "value": "=", - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "range": [ - 19, - 20 - ] - }, - { - "type": "Punctuator", - "value": "{", - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "range": [ - 21, - 22 - ] - }, - { - "type": "Identifier", - "value": "x", - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - }, - "range": [ - 23, - 24 - ] - }, - { - "type": "Punctuator", - "value": ":", - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "range": [ - 24, - 25 - ] - }, - { - "type": "Numeric", - "value": "1", - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "range": [ - 26, - 27 - ] - }, - { - "type": "Punctuator", - "value": ",", - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - } - }, - "range": [ - 27, - 28 - ] - }, - { - "type": "Identifier", - "value": "y", - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - } - }, - "range": [ - 29, - 30 - ] - }, - { - "type": "Punctuator", - "value": ":", - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 31 - } - }, - "range": [ - 30, - 31 - ] - }, - { - "type": "Numeric", - "value": "2", - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 33 - } - }, - "range": [ - 32, - 33 - ] - }, - { - "type": "Punctuator", - "value": ",", - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 34 - } - }, - "range": [ - 33, - 34 - ] - }, - { - "type": "Identifier", - "value": "a", - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 36 - } - }, - "range": [ - 35, - 36 - ] - }, - { - "type": "Punctuator", - "value": ":", - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 37 - } - }, - "range": [ - 36, - 37 - ] - }, - { - "type": "Numeric", - "value": "3", - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 39 - } - }, - "range": [ - 38, - 39 - ] - }, - { - "type": "Punctuator", - "value": ",", - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 40 - } - }, - "range": [ - 39, - 40 - ] - }, - { - "type": "Identifier", - "value": "b", - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 42 - } - }, - "range": [ - 41, - 42 - ] - }, - { - "type": "Punctuator", - "value": ":", - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 43 - } - }, - "range": [ - 42, - 43 - ] - }, - { - "type": "Numeric", - "value": "4", - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 45 - } - }, - "range": [ - 44, - 45 - ] - }, - { - "type": "Punctuator", - "value": "}", - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 47 - } - }, - "range": [ - 46, - 47 - ] - }, - { - "type": "Punctuator", - "value": ";", - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 48 - } - }, - "range": [ - 47, - 48 - ] - } - ] -}; \ No newline at end of file diff --git a/tests/fixtures/ecma-features/experimentalObjectRestSpread/object-rest.src.js b/tests/fixtures/ecma-features/experimentalObjectRestSpread/object-rest.src.js deleted file mode 100644 index 4d733791..00000000 --- a/tests/fixtures/ecma-features/experimentalObjectRestSpread/object-rest.src.js +++ /dev/null @@ -1 +0,0 @@ -var { x, y, ...z } = { x: 1, y: 2, a: 3, b: 4 }; diff --git a/tests/fixtures/ecma-features/experimentalObjectRestSpread/property-spread.result.js b/tests/fixtures/ecma-features/experimentalObjectRestSpread/property-spread.result.js deleted file mode 100644 index 25637c84..00000000 --- a/tests/fixtures/ecma-features/experimentalObjectRestSpread/property-spread.result.js +++ /dev/null @@ -1,859 +0,0 @@ -module.exports = { - "type": "Program", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 2 - } - }, - "range": [ - 0, - 83 - ], - "body": [ - { - "type": "VariableDeclaration", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 8 - } - }, - "range": [ - 0, - 26 - ], - "declarations": [ - { - "type": "VariableDeclarator", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, - "range": [ - 4, - 7 - ], - "id": { - "type": "Identifier", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, - "range": [ - 4, - 7 - ], - "name": "foo" - }, - "init": null - }, - { - "type": "VariableDeclarator", - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - } - }, - "range": [ - 13, - 16 - ], - "id": { - "type": "Identifier", - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - } - }, - "range": [ - 13, - 16 - ], - "name": "get" - }, - "init": null - }, - { - "type": "VariableDeclarator", - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 7 - } - }, - "range": [ - 22, - 25 - ], - "id": { - "type": "Identifier", - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 7 - } - }, - "range": [ - 22, - 25 - ], - "name": "set" - }, - "init": null - } - ], - "kind": "var" - }, - { - "type": "VariableDeclaration", - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 9, - "column": 2 - } - }, - "range": [ - 28, - 83 - ], - "declarations": [ - { - "type": "VariableDeclarator", - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 9, - "column": 1 - } - }, - "range": [ - 32, - 82 - ], - "id": { - "type": "Identifier", - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 5 - } - }, - "range": [ - 32, - 33 - ], - "name": "x" - }, - "init": { - "type": "ObjectExpression", - "loc": { - "start": { - "line": 5, - "column": 8 - }, - "end": { - "line": 9, - "column": 1 - } - }, - "range": [ - 36, - 82 - ], - "properties": [ - { - "type": "Property", - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 12 - } - }, - "range": [ - 42, - 50 - ], - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 7 - } - }, - "range": [ - 42, - 45 - ], - "name": "foo" - }, - "value": { - "type": "Identifier", - "loc": { - "start": { - "line": 6, - "column": 9 - }, - "end": { - "line": 6, - "column": 12 - } - }, - "range": [ - 47, - 50 - ], - "name": "foo" - }, - "kind": "init" - }, - { - "type": "Property", - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 12 - } - }, - "range": [ - 56, - 64 - ], - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 7 - } - }, - "range": [ - 56, - 59 - ], - "name": "get" - }, - "value": { - "type": "Identifier", - "loc": { - "start": { - "line": 7, - "column": 9 - }, - "end": { - "line": 7, - "column": 12 - } - }, - "range": [ - 61, - 64 - ], - "name": "get" - }, - "kind": "init" - }, - { - "type": "ExperimentalSpreadProperty", - "loc": { - "start": { - "line": 8, - "column": 4 - }, - "end": { - "line": 8, - "column": 14 - } - }, - "range": [ - 70, - 80 - ], - "argument": { - "type": "MemberExpression", - "loc": { - "start": { - "line": 8, - "column": 7 - }, - "end": { - "line": 8, - "column": 14 - } - }, - "range": [ - 73, - 80 - ], - "object": { - "type": "Identifier", - "loc": { - "start": { - "line": 8, - "column": 7 - }, - "end": { - "line": 8, - "column": 10 - } - }, - "range": [ - 73, - 76 - ], - "name": "set" - }, - "property": { - "type": "Identifier", - "loc": { - "start": { - "line": 8, - "column": 11 - }, - "end": { - "line": 8, - "column": 14 - } - }, - "range": [ - 77, - 80 - ], - "name": "foo" - }, - "computed": false - } - } - ] - } - } - ], - "kind": "var" - } - ], - "sourceType": "script", - "tokens": [ - { - "type": "Keyword", - "value": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - }, - "range": [ - 0, - 3 - ] - }, - { - "type": "Identifier", - "value": "foo", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, - "range": [ - 4, - 7 - ] - }, - { - "type": "Punctuator", - "value": ",", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - }, - "range": [ - 7, - 8 - ] - }, - { - "type": "Identifier", - "value": "get", - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - } - }, - "range": [ - 13, - 16 - ] - }, - { - "type": "Punctuator", - "value": ",", - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - } - }, - "range": [ - 16, - 17 - ] - }, - { - "type": "Identifier", - "value": "set", - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 7 - } - }, - "range": [ - 22, - 25 - ] - }, - { - "type": "Punctuator", - "value": ";", - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - } - }, - "range": [ - 25, - 26 - ] - }, - { - "type": "Keyword", - "value": "var", - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 3 - } - }, - "range": [ - 28, - 31 - ] - }, - { - "type": "Identifier", - "value": "x", - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 5 - } - }, - "range": [ - 32, - 33 - ] - }, - { - "type": "Punctuator", - "value": "=", - "loc": { - "start": { - "line": 5, - "column": 6 - }, - "end": { - "line": 5, - "column": 7 - } - }, - "range": [ - 34, - 35 - ] - }, - { - "type": "Punctuator", - "value": "{", - "loc": { - "start": { - "line": 5, - "column": 8 - }, - "end": { - "line": 5, - "column": 9 - } - }, - "range": [ - 36, - 37 - ] - }, - { - "type": "Identifier", - "value": "foo", - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 7 - } - }, - "range": [ - 42, - 45 - ] - }, - { - "type": "Punctuator", - "value": ":", - "loc": { - "start": { - "line": 6, - "column": 7 - }, - "end": { - "line": 6, - "column": 8 - } - }, - "range": [ - 45, - 46 - ] - }, - { - "type": "Identifier", - "value": "foo", - "loc": { - "start": { - "line": 6, - "column": 9 - }, - "end": { - "line": 6, - "column": 12 - } - }, - "range": [ - 47, - 50 - ] - }, - { - "type": "Punctuator", - "value": ",", - "loc": { - "start": { - "line": 6, - "column": 12 - }, - "end": { - "line": 6, - "column": 13 - } - }, - "range": [ - 50, - 51 - ] - }, - { - "type": "Identifier", - "value": "get", - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 7 - } - }, - "range": [ - 56, - 59 - ] - }, - { - "type": "Punctuator", - "value": ":", - "loc": { - "start": { - "line": 7, - "column": 7 - }, - "end": { - "line": 7, - "column": 8 - } - }, - "range": [ - 59, - 60 - ] - }, - { - "type": "Identifier", - "value": "get", - "loc": { - "start": { - "line": 7, - "column": 9 - }, - "end": { - "line": 7, - "column": 12 - } - }, - "range": [ - 61, - 64 - ] - }, - { - "type": "Punctuator", - "value": ",", - "loc": { - "start": { - "line": 7, - "column": 12 - }, - "end": { - "line": 7, - "column": 13 - } - }, - "range": [ - 64, - 65 - ] - }, - { - "type": "Punctuator", - "value": "...", - "loc": { - "start": { - "line": 8, - "column": 4 - }, - "end": { - "line": 8, - "column": 7 - } - }, - "range": [ - 70, - 73 - ] - }, - { - "type": "Identifier", - "value": "set", - "loc": { - "start": { - "line": 8, - "column": 7 - }, - "end": { - "line": 8, - "column": 10 - } - }, - "range": [ - 73, - 76 - ] - }, - { - "type": "Punctuator", - "value": ".", - "loc": { - "start": { - "line": 8, - "column": 10 - }, - "end": { - "line": 8, - "column": 11 - } - }, - "range": [ - 76, - 77 - ] - }, - { - "type": "Identifier", - "value": "foo", - "loc": { - "start": { - "line": 8, - "column": 11 - }, - "end": { - "line": 8, - "column": 14 - } - }, - "range": [ - 77, - 80 - ] - }, - { - "type": "Punctuator", - "value": "}", - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - } - }, - "range": [ - 81, - 82 - ] - }, - { - "type": "Punctuator", - "value": ";", - "loc": { - "start": { - "line": 9, - "column": 1 - }, - "end": { - "line": 9, - "column": 2 - } - }, - "range": [ - 82, - 83 - ] - } - ] -}; \ No newline at end of file diff --git a/tests/fixtures/ecma-features/experimentalObjectRestSpread/property-spread.src.js b/tests/fixtures/ecma-features/experimentalObjectRestSpread/property-spread.src.js deleted file mode 100644 index 1ef4ef44..00000000 --- a/tests/fixtures/ecma-features/experimentalObjectRestSpread/property-spread.src.js +++ /dev/null @@ -1,9 +0,0 @@ -var foo, - get, - set; - -var x = { - foo: foo, - get: get, - ...set.foo -}; diff --git a/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-method-args.result.js b/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-method-args.result.js deleted file mode 100644 index bb091b07..00000000 --- a/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-method-args.result.js +++ /dev/null @@ -1,626 +0,0 @@ -module.exports = { - "type": "Program", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 3 - } - }, - "range": [0, 108], - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 3 - } - }, - "expression": { - "type": "ObjectExpression", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 5, - "column": 1 - } - }, - "properties": [ - { - "type": "Property", - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 4, - "column": 5 - } - }, - "method": true, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 14 - } - }, - "name": "initialize", - "range": [ - 7, - 17 - ], - }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 4, - "column": 5 - } - }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "ObjectPattern", - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 46 - } - }, - "properties": [ - { - "type": "Property", - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 23 - } - }, - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 23 - } - }, - "name": "someVar", - "range": [ - 19, - 26 - ], - }, - "kind": "init", - "value": { - "type": "Identifier", - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 23 - } - }, - "name": "someVar", - "range": [ - 19, - 26 - ], - }, - "range": [ - 19, - 26 - ], - }, - { - "type": "Property", - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 33 - } - }, - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 33 - } - }, - "name": "otherVar", - "range": [ - 28, - 36 - ], - }, - "kind": "init", - "value": { - "type": "Identifier", - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 33 - } - }, - "name": "otherVar", - "range": [ - 28, - 36 - ], - }, - "range": [ - 28, - 36 - ], - }, - { - "type": "ExperimentalRestProperty", - "loc": { - "start": { - "line": 2, - "column": 35 - }, - "end": { - "line": 2, - "column": 45 - } - }, - "argument": { - "type": "Identifier", - "loc": { - "start": { - "line": 2, - "column": 38 - }, - "end": { - "line": 2, - "column": 45 - } - }, - "name": "options", - "range": [ - 41, - 48 - ], - }, - "range": [ - 38, - 48 - ] - } - ], - "range": [ - 18, - 49 - ], - } - ], - "body": { - "type": "BlockStatement", - "loc": { - "start": { - "line": 2, - "column": 48 - }, - "end": { - "line": 4, - "column": 5 - } - }, - "body": [], - "range": [ - 51, - 104 - ], - }, - "range": [ - 17, - 104 - ], - }, - "range": [ - 7, - 104 - ], - } - ], - "range": [ - 1, - 106 - ], - }, - "range": [ - 0, - 108 - ], - } - ], - "tokens": [ - { - "type": "Punctuator", - "value": "(", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - }, - "range": [ - 0, - 1 - ] - }, - { - "type": "Punctuator", - "value": "{", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - }, - "range": [ - 1, - 2 - ] - }, - { - "type": "Identifier", - "value": "initialize", - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 14 - } - }, - "range": [ - 7, - 17 - ] - }, - { - "type": "Punctuator", - "value": "(", - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - } - }, - "range": [ - 17, - 18 - ] - }, - { - "type": "Punctuator", - "value": "{", - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 16 - } - }, - "range": [ - 18, - 19 - ] - }, - { - "type": "Identifier", - "value": "someVar", - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 23 - } - }, - "range": [ - 19, - 26 - ] - }, - { - "type": "Punctuator", - "value": ",", - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 24 - } - }, - "range": [ - 26, - 27 - ] - }, - { - "type": "Identifier", - "value": "otherVar", - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 33 - } - }, - "range": [ - 28, - 36 - ] - }, - { - "type": "Punctuator", - "value": ",", - "loc": { - "start": { - "line": 2, - "column": 33 - }, - "end": { - "line": 2, - "column": 34 - } - }, - "range": [ - 36, - 37 - ] - }, - { - "type": "Punctuator", - "value": "...", - "loc": { - "start": { - "line": 2, - "column": 35 - }, - "end": { - "line": 2, - "column": 38 - } - }, - "range": [ - 38, - 41 - ] - }, - { - "type": "Identifier", - "value": "options", - "loc": { - "start": { - "line": 2, - "column": 38 - }, - "end": { - "line": 2, - "column": 45 - } - }, - "range": [ - 41, - 48 - ] - }, - { - "type": "Punctuator", - "value": "}", - "loc": { - "start": { - "line": 2, - "column": 45 - }, - "end": { - "line": 2, - "column": 46 - } - }, - "range": [ - 48, - 49 - ] - }, - { - "type": "Punctuator", - "value": ")", - "loc": { - "start": { - "line": 2, - "column": 46 - }, - "end": { - "line": 2, - "column": 47 - } - }, - "range": [ - 49, - 50 - ] - }, - { - "type": "Punctuator", - "value": "{", - "loc": { - "start": { - "line": 2, - "column": 48 - }, - "end": { - "line": 2, - "column": 49 - } - }, - "range": [ - 51, - 52 - ] - }, - { - "type": "Punctuator", - "value": "}", - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 5 - } - }, - "range": [ - 103, - 104 - ] - }, - { - "type": "Punctuator", - "value": "}", - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, - "range": [ - 105, - 106 - ] - }, - { - "type": "Punctuator", - "value": ")", - "loc": { - "start": { - "line": 5, - "column": 1 - }, - "end": { - "line": 5, - "column": 2 - } - }, - "range": [ - 106, - 107 - ] - }, - { - "type": "Punctuator", - "value": ";", - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 3 - } - }, - "range": [ - 107, - 108 - ] - } - ] -}; diff --git a/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-method-args.src.js b/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-method-args.src.js deleted file mode 100644 index 4247e4a5..00000000 --- a/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-method-args.src.js +++ /dev/null @@ -1,5 +0,0 @@ -({ - initialize({someVar, otherVar, ...options}) { - // ... do some stuff with options ... - } -}); diff --git a/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-methods.result.js b/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-methods.result.js deleted file mode 100644 index 7590dc13..00000000 --- a/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-methods.result.js +++ /dev/null @@ -1,685 +0,0 @@ -module.exports = { - "type": "Program", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 2 - } - }, - "range": [ - 0, - 114 - ], - "body": [ - { - "type": "VariableDeclaration", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 2 - } - }, - "range": [ - 0, - 114 - ], - "declarations": [ - { - "type": "VariableDeclarator", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 5, - "column": 1 - } - }, - "range": [ - 4, - 113 - ], - "id": { - "type": "Identifier", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - }, - "range": [ - 4, - 5 - ], - "name": "x" - }, - "init": { - "type": "ObjectExpression", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 5, - "column": 1 - } - }, - "range": [ - 8, - 113 - ], - "properties": [ - { - "type": "Property", - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 4, - "column": 5 - } - }, - "range": [ - 14, - 111 - ], - "method": true, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 14 - } - }, - "range": [ - 14, - 24 - ], - "name": "initialize" - }, - "kind": "init", - "value": { - "type": "FunctionExpression", - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 4, - "column": 5 - } - }, - "range": [ - 24, - 111 - ], - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "ObjectPattern", - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 46 - } - }, - "range": [ - 25, - 56 - ], - "properties": [ - { - "type": "Property", - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 23 - } - }, - "range": [ - 26, - 33 - ], - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 23 - } - }, - "range": [ - 26, - 33 - ], - "name": "someVar" - }, - "kind": "init", - "value": { - "type": "Identifier", - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 23 - } - }, - "range": [ - 26, - 33 - ], - "name": "someVar" - } - }, - { - "type": "Property", - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 33 - } - }, - "range": [ - 35, - 43 - ], - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 33 - } - }, - "range": [ - 35, - 43 - ], - "name": "otherVar" - }, - "kind": "init", - "value": { - "type": "Identifier", - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 33 - } - }, - "range": [ - 35, - 43 - ], - "name": "otherVar" - } - }, - { - "type": "ExperimentalRestProperty", - "loc": { - "start": { - "line": 2, - "column": 35 - }, - "end": { - "line": 2, - "column": 45 - } - }, - "range": [ - 45, - 55 - ], - "argument": { - "type": "Identifier", - "loc": { - "start": { - "line": 2, - "column": 38 - }, - "end": { - "line": 2, - "column": 45 - } - }, - "range": [ - 48, - 55 - ], - "name": "options" - } - } - ] - } - ], - "body": { - "type": "BlockStatement", - "loc": { - "start": { - "line": 2, - "column": 48 - }, - "end": { - "line": 4, - "column": 5 - } - }, - "range": [ - 58, - 111 - ], - "body": [] - } - } - } - ] - } - } - ], - "kind": "var" - } - ], - "sourceType": "script", - "tokens": [ - { - "type": "Keyword", - "value": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - }, - "range": [ - 0, - 3 - ] - }, - { - "type": "Identifier", - "value": "x", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - }, - "range": [ - 4, - 5 - ] - }, - { - "type": "Punctuator", - "value": "=", - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, - "range": [ - 6, - 7 - ] - }, - { - "type": "Punctuator", - "value": "{", - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - }, - "range": [ - 8, - 9 - ] - }, - { - "type": "Identifier", - "value": "initialize", - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 14 - } - }, - "range": [ - 14, - 24 - ] - }, - { - "type": "Punctuator", - "value": "(", - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - } - }, - "range": [ - 24, - 25 - ] - }, - { - "type": "Punctuator", - "value": "{", - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 16 - } - }, - "range": [ - 25, - 26 - ] - }, - { - "type": "Identifier", - "value": "someVar", - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 23 - } - }, - "range": [ - 26, - 33 - ] - }, - { - "type": "Punctuator", - "value": ",", - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 24 - } - }, - "range": [ - 33, - 34 - ] - }, - { - "type": "Identifier", - "value": "otherVar", - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 33 - } - }, - "range": [ - 35, - 43 - ] - }, - { - "type": "Punctuator", - "value": ",", - "loc": { - "start": { - "line": 2, - "column": 33 - }, - "end": { - "line": 2, - "column": 34 - } - }, - "range": [ - 43, - 44 - ] - }, - { - "type": "Punctuator", - "value": "...", - "loc": { - "start": { - "line": 2, - "column": 35 - }, - "end": { - "line": 2, - "column": 38 - } - }, - "range": [ - 45, - 48 - ] - }, - { - "type": "Identifier", - "value": "options", - "loc": { - "start": { - "line": 2, - "column": 38 - }, - "end": { - "line": 2, - "column": 45 - } - }, - "range": [ - 48, - 55 - ] - }, - { - "type": "Punctuator", - "value": "}", - "loc": { - "start": { - "line": 2, - "column": 45 - }, - "end": { - "line": 2, - "column": 46 - } - }, - "range": [ - 55, - 56 - ] - }, - { - "type": "Punctuator", - "value": ")", - "loc": { - "start": { - "line": 2, - "column": 46 - }, - "end": { - "line": 2, - "column": 47 - } - }, - "range": [ - 56, - 57 - ] - }, - { - "type": "Punctuator", - "value": "{", - "loc": { - "start": { - "line": 2, - "column": 48 - }, - "end": { - "line": 2, - "column": 49 - } - }, - "range": [ - 58, - 59 - ] - }, - { - "type": "Punctuator", - "value": "}", - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 5 - } - }, - "range": [ - 110, - 111 - ] - }, - { - "type": "Punctuator", - "value": "}", - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, - "range": [ - 112, - 113 - ] - }, - { - "type": "Punctuator", - "value": ";", - "loc": { - "start": { - "line": 5, - "column": 1 - }, - "end": { - "line": 5, - "column": 2 - } - }, - "range": [ - 113, - 114 - ] - } - ] -}; \ No newline at end of file diff --git a/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-methods.src.js b/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-methods.src.js deleted file mode 100644 index 2eb0d18f..00000000 --- a/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-methods.src.js +++ /dev/null @@ -1,5 +0,0 @@ -var x = { - initialize({someVar, otherVar, ...options}) { - // ... do some stuff with options ... - } -}; \ No newline at end of file diff --git a/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-properties.result.js b/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-properties.result.js deleted file mode 100644 index 9b861afb..00000000 --- a/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-properties.result.js +++ /dev/null @@ -1,715 +0,0 @@ -module.exports = { - "type": "Program", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 2 - } - }, - "range": [ - 0, - 69 - ], - "body": [ - { - "type": "VariableDeclaration", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 8 - } - }, - "range": [ - 0, - 26 - ], - "declarations": [ - { - "type": "VariableDeclarator", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, - "range": [ - 4, - 7 - ], - "id": { - "type": "Identifier", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, - "range": [ - 4, - 7 - ], - "name": "foo" - }, - "init": null - }, - { - "type": "VariableDeclarator", - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - } - }, - "range": [ - 13, - 16 - ], - "id": { - "type": "Identifier", - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - } - }, - "range": [ - 13, - 16 - ], - "name": "get" - }, - "init": null - }, - { - "type": "VariableDeclarator", - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 7 - } - }, - "range": [ - 22, - 25 - ], - "id": { - "type": "Identifier", - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 7 - } - }, - "range": [ - 22, - 25 - ], - "name": "set" - }, - "init": null - } - ], - "kind": "var" - }, - { - "type": "VariableDeclaration", - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 9, - "column": 2 - } - }, - "range": [ - 28, - 69 - ], - "declarations": [ - { - "type": "VariableDeclarator", - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 9, - "column": 1 - } - }, - "range": [ - 32, - 68 - ], - "id": { - "type": "Identifier", - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 5 - } - }, - "range": [ - 32, - 33 - ], - "name": "x" - }, - "init": { - "type": "ObjectExpression", - "loc": { - "start": { - "line": 5, - "column": 8 - }, - "end": { - "line": 9, - "column": 1 - } - }, - "range": [ - 36, - 68 - ], - "properties": [ - { - "type": "Property", - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 7 - } - }, - "range": [ - 42, - 45 - ], - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 7 - } - }, - "range": [ - 42, - 45 - ], - "name": "foo" - }, - "kind": "init", - "value": { - "type": "Identifier", - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 7 - } - }, - "range": [ - 42, - 45 - ], - "name": "foo" - } - }, - { - "type": "Property", - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 7 - } - }, - "range": [ - 51, - 54 - ], - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 7 - } - }, - "range": [ - 51, - 54 - ], - "name": "get" - }, - "kind": "init", - "value": { - "type": "Identifier", - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 7 - } - }, - "range": [ - 51, - 54 - ], - "name": "get" - } - }, - { - "type": "ExperimentalSpreadProperty", - "loc": { - "start": { - "line": 8, - "column": 4 - }, - "end": { - "line": 8, - "column": 10 - } - }, - "range": [ - 60, - 66 - ], - "argument": { - "type": "Identifier", - "loc": { - "start": { - "line": 8, - "column": 7 - }, - "end": { - "line": 8, - "column": 10 - } - }, - "range": [ - 63, - 66 - ], - "name": "set" - } - } - ] - } - } - ], - "kind": "var" - } - ], - "sourceType": "script", - "tokens": [ - { - "type": "Keyword", - "value": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - }, - "range": [ - 0, - 3 - ] - }, - { - "type": "Identifier", - "value": "foo", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, - "range": [ - 4, - 7 - ] - }, - { - "type": "Punctuator", - "value": ",", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - }, - "range": [ - 7, - 8 - ] - }, - { - "type": "Identifier", - "value": "get", - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - } - }, - "range": [ - 13, - 16 - ] - }, - { - "type": "Punctuator", - "value": ",", - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - } - }, - "range": [ - 16, - 17 - ] - }, - { - "type": "Identifier", - "value": "set", - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 7 - } - }, - "range": [ - 22, - 25 - ] - }, - { - "type": "Punctuator", - "value": ";", - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - } - }, - "range": [ - 25, - 26 - ] - }, - { - "type": "Keyword", - "value": "var", - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 3 - } - }, - "range": [ - 28, - 31 - ] - }, - { - "type": "Identifier", - "value": "x", - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 5 - } - }, - "range": [ - 32, - 33 - ] - }, - { - "type": "Punctuator", - "value": "=", - "loc": { - "start": { - "line": 5, - "column": 6 - }, - "end": { - "line": 5, - "column": 7 - } - }, - "range": [ - 34, - 35 - ] - }, - { - "type": "Punctuator", - "value": "{", - "loc": { - "start": { - "line": 5, - "column": 8 - }, - "end": { - "line": 5, - "column": 9 - } - }, - "range": [ - 36, - 37 - ] - }, - { - "type": "Identifier", - "value": "foo", - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 7 - } - }, - "range": [ - 42, - 45 - ] - }, - { - "type": "Punctuator", - "value": ",", - "loc": { - "start": { - "line": 6, - "column": 7 - }, - "end": { - "line": 6, - "column": 8 - } - }, - "range": [ - 45, - 46 - ] - }, - { - "type": "Identifier", - "value": "get", - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 7 - } - }, - "range": [ - 51, - 54 - ] - }, - { - "type": "Punctuator", - "value": ",", - "loc": { - "start": { - "line": 7, - "column": 7 - }, - "end": { - "line": 7, - "column": 8 - } - }, - "range": [ - 54, - 55 - ] - }, - { - "type": "Punctuator", - "value": "...", - "loc": { - "start": { - "line": 8, - "column": 4 - }, - "end": { - "line": 8, - "column": 7 - } - }, - "range": [ - 60, - 63 - ] - }, - { - "type": "Identifier", - "value": "set", - "loc": { - "start": { - "line": 8, - "column": 7 - }, - "end": { - "line": 8, - "column": 10 - } - }, - "range": [ - 63, - 66 - ] - }, - { - "type": "Punctuator", - "value": "}", - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - } - }, - "range": [ - 67, - 68 - ] - }, - { - "type": "Punctuator", - "value": ";", - "loc": { - "start": { - "line": 9, - "column": 1 - }, - "end": { - "line": 9, - "column": 2 - } - }, - "range": [ - 68, - 69 - ] - } - ] -}; \ No newline at end of file diff --git a/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-properties.src.js b/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-properties.src.js deleted file mode 100644 index 11d8c39b..00000000 --- a/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-properties.src.js +++ /dev/null @@ -1,9 +0,0 @@ -var foo, - get, - set; - -var x = { - foo, - get, - ...set -}; diff --git a/tests/fixtures/ecma-features/experimentalObjectRestSpread/single-spread.result.js b/tests/fixtures/ecma-features/experimentalObjectRestSpread/single-spread.result.js deleted file mode 100644 index f2afb48d..00000000 --- a/tests/fixtures/ecma-features/experimentalObjectRestSpread/single-spread.result.js +++ /dev/null @@ -1,787 +0,0 @@ -module.exports = { - "type": "Program", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 2 - } - }, - "range": [ - 0, - 79 - ], - "body": [ - { - "type": "VariableDeclaration", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 8 - } - }, - "range": [ - 0, - 26 - ], - "declarations": [ - { - "type": "VariableDeclarator", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, - "range": [ - 4, - 7 - ], - "id": { - "type": "Identifier", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, - "range": [ - 4, - 7 - ], - "name": "foo" - }, - "init": null - }, - { - "type": "VariableDeclarator", - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - } - }, - "range": [ - 13, - 16 - ], - "id": { - "type": "Identifier", - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - } - }, - "range": [ - 13, - 16 - ], - "name": "get" - }, - "init": null - }, - { - "type": "VariableDeclarator", - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 7 - } - }, - "range": [ - 22, - 25 - ], - "id": { - "type": "Identifier", - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 7 - } - }, - "range": [ - 22, - 25 - ], - "name": "set" - }, - "init": null - } - ], - "kind": "var" - }, - { - "type": "VariableDeclaration", - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 9, - "column": 2 - } - }, - "range": [ - 28, - 79 - ], - "declarations": [ - { - "type": "VariableDeclarator", - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 9, - "column": 1 - } - }, - "range": [ - 32, - 78 - ], - "id": { - "type": "Identifier", - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 5 - } - }, - "range": [ - 32, - 33 - ], - "name": "x" - }, - "init": { - "type": "ObjectExpression", - "loc": { - "start": { - "line": 5, - "column": 8 - }, - "end": { - "line": 9, - "column": 1 - } - }, - "range": [ - 36, - 78 - ], - "properties": [ - { - "type": "Property", - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 12 - } - }, - "range": [ - 42, - 50 - ], - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 7 - } - }, - "range": [ - 42, - 45 - ], - "name": "foo" - }, - "value": { - "type": "Identifier", - "loc": { - "start": { - "line": 6, - "column": 9 - }, - "end": { - "line": 6, - "column": 12 - } - }, - "range": [ - 47, - 50 - ], - "name": "foo" - }, - "kind": "init" - }, - { - "type": "Property", - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 12 - } - }, - "range": [ - 56, - 64 - ], - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 7 - } - }, - "range": [ - 56, - 59 - ], - "name": "get" - }, - "value": { - "type": "Identifier", - "loc": { - "start": { - "line": 7, - "column": 9 - }, - "end": { - "line": 7, - "column": 12 - } - }, - "range": [ - 61, - 64 - ], - "name": "get" - }, - "kind": "init" - }, - { - "type": "ExperimentalSpreadProperty", - "loc": { - "start": { - "line": 8, - "column": 4 - }, - "end": { - "line": 8, - "column": 10 - } - }, - "range": [ - 70, - 76 - ], - "argument": { - "type": "Identifier", - "loc": { - "start": { - "line": 8, - "column": 7 - }, - "end": { - "line": 8, - "column": 10 - } - }, - "range": [ - 73, - 76 - ], - "name": "set" - } - } - ] - } - } - ], - "kind": "var" - } - ], - "sourceType": "script", - "tokens": [ - { - "type": "Keyword", - "value": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - }, - "range": [ - 0, - 3 - ] - }, - { - "type": "Identifier", - "value": "foo", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, - "range": [ - 4, - 7 - ] - }, - { - "type": "Punctuator", - "value": ",", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - }, - "range": [ - 7, - 8 - ] - }, - { - "type": "Identifier", - "value": "get", - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - } - }, - "range": [ - 13, - 16 - ] - }, - { - "type": "Punctuator", - "value": ",", - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - } - }, - "range": [ - 16, - 17 - ] - }, - { - "type": "Identifier", - "value": "set", - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 7 - } - }, - "range": [ - 22, - 25 - ] - }, - { - "type": "Punctuator", - "value": ";", - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - } - }, - "range": [ - 25, - 26 - ] - }, - { - "type": "Keyword", - "value": "var", - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 3 - } - }, - "range": [ - 28, - 31 - ] - }, - { - "type": "Identifier", - "value": "x", - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 5 - } - }, - "range": [ - 32, - 33 - ] - }, - { - "type": "Punctuator", - "value": "=", - "loc": { - "start": { - "line": 5, - "column": 6 - }, - "end": { - "line": 5, - "column": 7 - } - }, - "range": [ - 34, - 35 - ] - }, - { - "type": "Punctuator", - "value": "{", - "loc": { - "start": { - "line": 5, - "column": 8 - }, - "end": { - "line": 5, - "column": 9 - } - }, - "range": [ - 36, - 37 - ] - }, - { - "type": "Identifier", - "value": "foo", - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 7 - } - }, - "range": [ - 42, - 45 - ] - }, - { - "type": "Punctuator", - "value": ":", - "loc": { - "start": { - "line": 6, - "column": 7 - }, - "end": { - "line": 6, - "column": 8 - } - }, - "range": [ - 45, - 46 - ] - }, - { - "type": "Identifier", - "value": "foo", - "loc": { - "start": { - "line": 6, - "column": 9 - }, - "end": { - "line": 6, - "column": 12 - } - }, - "range": [ - 47, - 50 - ] - }, - { - "type": "Punctuator", - "value": ",", - "loc": { - "start": { - "line": 6, - "column": 12 - }, - "end": { - "line": 6, - "column": 13 - } - }, - "range": [ - 50, - 51 - ] - }, - { - "type": "Identifier", - "value": "get", - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 7 - } - }, - "range": [ - 56, - 59 - ] - }, - { - "type": "Punctuator", - "value": ":", - "loc": { - "start": { - "line": 7, - "column": 7 - }, - "end": { - "line": 7, - "column": 8 - } - }, - "range": [ - 59, - 60 - ] - }, - { - "type": "Identifier", - "value": "get", - "loc": { - "start": { - "line": 7, - "column": 9 - }, - "end": { - "line": 7, - "column": 12 - } - }, - "range": [ - 61, - 64 - ] - }, - { - "type": "Punctuator", - "value": ",", - "loc": { - "start": { - "line": 7, - "column": 12 - }, - "end": { - "line": 7, - "column": 13 - } - }, - "range": [ - 64, - 65 - ] - }, - { - "type": "Punctuator", - "value": "...", - "loc": { - "start": { - "line": 8, - "column": 4 - }, - "end": { - "line": 8, - "column": 7 - } - }, - "range": [ - 70, - 73 - ] - }, - { - "type": "Identifier", - "value": "set", - "loc": { - "start": { - "line": 8, - "column": 7 - }, - "end": { - "line": 8, - "column": 10 - } - }, - "range": [ - 73, - 76 - ] - }, - { - "type": "Punctuator", - "value": "}", - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - } - }, - "range": [ - 77, - 78 - ] - }, - { - "type": "Punctuator", - "value": ";", - "loc": { - "start": { - "line": 9, - "column": 1 - }, - "end": { - "line": 9, - "column": 2 - } - }, - "range": [ - 78, - 79 - ] - } - ] -}; \ No newline at end of file diff --git a/tests/fixtures/ecma-features/experimentalObjectRestSpread/single-spread.src.js b/tests/fixtures/ecma-features/experimentalObjectRestSpread/single-spread.src.js deleted file mode 100644 index e287012c..00000000 --- a/tests/fixtures/ecma-features/experimentalObjectRestSpread/single-spread.src.js +++ /dev/null @@ -1,9 +0,0 @@ -var foo, - get, - set; - -var x = { - foo: foo, - get: get, - ...set -}; diff --git a/tests/fixtures/ecma-features/experimentalObjectRestSpread/spread-trailing-comma.result.js b/tests/fixtures/ecma-features/experimentalObjectRestSpread/spread-trailing-comma.result.js deleted file mode 100644 index d0f8b471..00000000 --- a/tests/fixtures/ecma-features/experimentalObjectRestSpread/spread-trailing-comma.result.js +++ /dev/null @@ -1,449 +0,0 @@ -module.exports = { - "type": "Program", - "start": 0, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - }, - "range": [ - 0, - 17 - ], - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 17 - } - }, - "range": [ - 0, - 17 - ], - "expression": { - "type": "ObjectExpression", - "start": 1, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 16 - } - }, - "range": [ - 1, - 16 - ], - "properties": [ - { - "type": "Property", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - }, - "range": [ - 3, - 4 - ], - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - }, - "range": [ - 3, - 4 - ], - "name": "a" - }, - "kind": "init", - "value": { - "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - }, - "range": [ - 3, - 4 - ], - "name": "a" - } - }, - { - "type": "Property", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, - "range": [ - 6, - 7 - ], - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, - "range": [ - 6, - 7 - ], - "name": "b" - }, - "kind": "init", - "value": { - "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, - "range": [ - 6, - 7 - ], - "name": "b" - } - }, - { - "type": "ExperimentalSpreadProperty", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "range": [ - 9, - 13 - ], - "argument": { - "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "range": [ - 12, - 13 - ], - "name": "c" - } - } - ] - } - } - ], - "sourceType": "script", - "tokens": [ - { - "type": "Punctuator", - "value": "(", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - }, - "range": [ - 0, - 1 - ] - }, - { - "type": "Punctuator", - "value": "{", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - }, - "range": [ - 1, - 2 - ] - }, - { - "type": "Identifier", - "value": "a", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - }, - "range": [ - 3, - 4 - ] - }, - { - "type": "Punctuator", - "value": ",", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - }, - "range": [ - 4, - 5 - ] - }, - { - "type": "Identifier", - "value": "b", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, - "range": [ - 6, - 7 - ] - }, - { - "type": "Punctuator", - "value": ",", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - }, - "range": [ - 7, - 8 - ] - }, - { - "type": "Punctuator", - "value": "...", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, - "range": [ - 9, - 12 - ] - }, - { - "type": "Identifier", - "value": "c", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "range": [ - 12, - 13 - ] - }, - { - "type": "Punctuator", - "value": ",", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - }, - "range": [ - 13, - 14 - ] - }, - { - "type": "Punctuator", - "value": "}", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, - "range": [ - 15, - 16 - ] - }, - { - "type": "Punctuator", - "value": ")", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, - "range": [ - 16, - 17 - ] - } - ] -}; diff --git a/tests/fixtures/ecma-features/experimentalObjectRestSpread/spread-trailing-comma.src.js b/tests/fixtures/ecma-features/experimentalObjectRestSpread/spread-trailing-comma.src.js deleted file mode 100644 index a2841df6..00000000 --- a/tests/fixtures/ecma-features/experimentalObjectRestSpread/spread-trailing-comma.src.js +++ /dev/null @@ -1 +0,0 @@ -({ a, b, ...c, }) diff --git a/tests/fixtures/ecma-features/experimentalObjectRestSpread/two-spread.result.js b/tests/fixtures/ecma-features/experimentalObjectRestSpread/two-spread.result.js deleted file mode 100644 index 15a02348..00000000 --- a/tests/fixtures/ecma-features/experimentalObjectRestSpread/two-spread.result.js +++ /dev/null @@ -1,747 +0,0 @@ -module.exports = { - "type": "Program", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 2 - } - }, - "range": [ - 0, - 77 - ], - "body": [ - { - "type": "VariableDeclaration", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 8 - } - }, - "range": [ - 0, - 26 - ], - "declarations": [ - { - "type": "VariableDeclarator", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, - "range": [ - 4, - 7 - ], - "id": { - "type": "Identifier", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, - "range": [ - 4, - 7 - ], - "name": "foo" - }, - "init": null - }, - { - "type": "VariableDeclarator", - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - } - }, - "range": [ - 13, - 16 - ], - "id": { - "type": "Identifier", - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - } - }, - "range": [ - 13, - 16 - ], - "name": "get" - }, - "init": null - }, - { - "type": "VariableDeclarator", - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 7 - } - }, - "range": [ - 22, - 25 - ], - "id": { - "type": "Identifier", - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 7 - } - }, - "range": [ - 22, - 25 - ], - "name": "set" - }, - "init": null - } - ], - "kind": "var" - }, - { - "type": "VariableDeclaration", - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 9, - "column": 2 - } - }, - "range": [ - 28, - 77 - ], - "declarations": [ - { - "type": "VariableDeclarator", - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 9, - "column": 1 - } - }, - "range": [ - 32, - 76 - ], - "id": { - "type": "Identifier", - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 5 - } - }, - "range": [ - 32, - 33 - ], - "name": "x" - }, - "init": { - "type": "ObjectExpression", - "loc": { - "start": { - "line": 5, - "column": 8 - }, - "end": { - "line": 9, - "column": 1 - } - }, - "range": [ - 36, - 76 - ], - "properties": [ - { - "type": "Property", - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 12 - } - }, - "range": [ - 42, - 50 - ], - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 7 - } - }, - "range": [ - 42, - 45 - ], - "name": "foo" - }, - "value": { - "type": "Identifier", - "loc": { - "start": { - "line": 6, - "column": 9 - }, - "end": { - "line": 6, - "column": 12 - } - }, - "range": [ - 47, - 50 - ], - "name": "foo" - }, - "kind": "init" - }, - { - "type": "ExperimentalSpreadProperty", - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 10 - } - }, - "range": [ - 56, - 62 - ], - "argument": { - "type": "Identifier", - "loc": { - "start": { - "line": 7, - "column": 7 - }, - "end": { - "line": 7, - "column": 10 - } - }, - "range": [ - 59, - 62 - ], - "name": "get" - } - }, - { - "type": "ExperimentalSpreadProperty", - "loc": { - "start": { - "line": 8, - "column": 4 - }, - "end": { - "line": 8, - "column": 10 - } - }, - "range": [ - 68, - 74 - ], - "argument": { - "type": "Identifier", - "loc": { - "start": { - "line": 8, - "column": 7 - }, - "end": { - "line": 8, - "column": 10 - } - }, - "range": [ - 71, - 74 - ], - "name": "set" - } - } - ] - } - } - ], - "kind": "var" - } - ], - "sourceType": "script", - "tokens": [ - { - "type": "Keyword", - "value": "var", - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - }, - "range": [ - 0, - 3 - ] - }, - { - "type": "Identifier", - "value": "foo", - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, - "range": [ - 4, - 7 - ] - }, - { - "type": "Punctuator", - "value": ",", - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - }, - "range": [ - 7, - 8 - ] - }, - { - "type": "Identifier", - "value": "get", - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - } - }, - "range": [ - 13, - 16 - ] - }, - { - "type": "Punctuator", - "value": ",", - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - } - }, - "range": [ - 16, - 17 - ] - }, - { - "type": "Identifier", - "value": "set", - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 7 - } - }, - "range": [ - 22, - 25 - ] - }, - { - "type": "Punctuator", - "value": ";", - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - } - }, - "range": [ - 25, - 26 - ] - }, - { - "type": "Keyword", - "value": "var", - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 3 - } - }, - "range": [ - 28, - 31 - ] - }, - { - "type": "Identifier", - "value": "x", - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 5 - } - }, - "range": [ - 32, - 33 - ] - }, - { - "type": "Punctuator", - "value": "=", - "loc": { - "start": { - "line": 5, - "column": 6 - }, - "end": { - "line": 5, - "column": 7 - } - }, - "range": [ - 34, - 35 - ] - }, - { - "type": "Punctuator", - "value": "{", - "loc": { - "start": { - "line": 5, - "column": 8 - }, - "end": { - "line": 5, - "column": 9 - } - }, - "range": [ - 36, - 37 - ] - }, - { - "type": "Identifier", - "value": "foo", - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 7 - } - }, - "range": [ - 42, - 45 - ] - }, - { - "type": "Punctuator", - "value": ":", - "loc": { - "start": { - "line": 6, - "column": 7 - }, - "end": { - "line": 6, - "column": 8 - } - }, - "range": [ - 45, - 46 - ] - }, - { - "type": "Identifier", - "value": "foo", - "loc": { - "start": { - "line": 6, - "column": 9 - }, - "end": { - "line": 6, - "column": 12 - } - }, - "range": [ - 47, - 50 - ] - }, - { - "type": "Punctuator", - "value": ",", - "loc": { - "start": { - "line": 6, - "column": 12 - }, - "end": { - "line": 6, - "column": 13 - } - }, - "range": [ - 50, - 51 - ] - }, - { - "type": "Punctuator", - "value": "...", - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 7 - } - }, - "range": [ - 56, - 59 - ] - }, - { - "type": "Identifier", - "value": "get", - "loc": { - "start": { - "line": 7, - "column": 7 - }, - "end": { - "line": 7, - "column": 10 - } - }, - "range": [ - 59, - 62 - ] - }, - { - "type": "Punctuator", - "value": ",", - "loc": { - "start": { - "line": 7, - "column": 10 - }, - "end": { - "line": 7, - "column": 11 - } - }, - "range": [ - 62, - 63 - ] - }, - { - "type": "Punctuator", - "value": "...", - "loc": { - "start": { - "line": 8, - "column": 4 - }, - "end": { - "line": 8, - "column": 7 - } - }, - "range": [ - 68, - 71 - ] - }, - { - "type": "Identifier", - "value": "set", - "loc": { - "start": { - "line": 8, - "column": 7 - }, - "end": { - "line": 8, - "column": 10 - } - }, - "range": [ - 71, - 74 - ] - }, - { - "type": "Punctuator", - "value": "}", - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - } - }, - "range": [ - 75, - 76 - ] - }, - { - "type": "Punctuator", - "value": ";", - "loc": { - "start": { - "line": 9, - "column": 1 - }, - "end": { - "line": 9, - "column": 2 - } - }, - "range": [ - 76, - 77 - ] - } - ] -}; \ No newline at end of file diff --git a/tests/fixtures/ecma-features/experimentalObjectRestSpread/two-spread.src.js b/tests/fixtures/ecma-features/experimentalObjectRestSpread/two-spread.src.js deleted file mode 100644 index 85d5f34a..00000000 --- a/tests/fixtures/ecma-features/experimentalObjectRestSpread/two-spread.src.js +++ /dev/null @@ -1,9 +0,0 @@ -var foo, - get, - set; - -var x = { - foo: foo, - ...get, - ...set -}; diff --git a/tests/lib/ecma-features.js b/tests/lib/ecma-features.js index e1096b6a..15b0806e 100644 --- a/tests/lib/ecma-features.js +++ b/tests/lib/ecma-features.js @@ -82,16 +82,4 @@ describe("ecmaFeatures", function() { }); }); - - describe("combination with 'ecmaVersion:2018' and 'ecmaFeatures.experimentalObjectRestSpread:true'", function() { - it("should generate ExperimentalRestProperty/ExperimentalSpreadProperty.", function() { - config.ecmaVersion = 2018; - config.ecmaFeatures.experimentalObjectRestSpread = true; - - var ast = espree.parse("({...rest} = {...spread})", config); - - assert.strictEqual(ast.body[0].expression.left.properties[0].type, "ExperimentalRestProperty"); - assert.strictEqual(ast.body[0].expression.right.properties[0].type, "ExperimentalSpreadProperty"); - }); - }); });