From da68897a2baec61a90b75c8f5bd112b4998bd321 Mon Sep 17 00:00:00 2001 From: James Henry Date: Sun, 3 Jun 2018 22:22:03 -0400 Subject: [PATCH] Breaking: Set minimum node version to 6 --- .travis.yml | 1 - package.json | 12 +- tests/lib/__snapshots__/ecma-features.js.snap | 8177 ++++++++--------- tests/lib/ecma-features.js | 48 +- 4 files changed, 3803 insertions(+), 4435 deletions(-) diff --git a/.travis.yml b/.travis.yml index cd7025c..4a6efad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,6 @@ language: node_js sudo: false node_js: - "6" - - "7" - "8" - "9" after_success: diff --git a/package.json b/package.json index 111f40d..1c253a4 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "parser.js" ], "engines": { - "node": ">=4" + "node": "^6.14.0 || ^8.10.0 || >=9.10.0" }, "repository": "eslint/typescript-eslint-parser", "bugs": { @@ -21,15 +21,15 @@ "babel-code-frame": "6.26.0", "babylon": "7.0.0-beta.39", "dedent": "0.7.0", - "eslint": "4.17.0", + "eslint": "4.19.1", "eslint-config-eslint": "4.0.0", - "eslint-plugin-node": "6.0.0", - "eslint-release": "0.10.3", + "eslint-plugin-node": "6.0.1", + "eslint-release": "0.11.1", "glob": "7.1.2", - "jest": "22.2.1", + "jest": "23.1.0", "lodash.isplainobject": "4.0.6", "npm-license": "0.3.3", - "shelljs": "0.8.1", + "shelljs": "0.8.2", "shelljs-nodecli": "0.1.1", "typescript": "~2.9.1" }, diff --git a/tests/lib/__snapshots__/ecma-features.js.snap b/tests/lib/__snapshots__/ecma-features.js.snap index 0f57b86..2436e0d 100644 --- a/tests/lib/__snapshots__/ecma-features.js.snap +++ b/tests/lib/__snapshots__/ecma-features.js.snap @@ -1,73 +1,89 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`ecmaFeatures REGEXP FLAG - NODE VERSION <6: fixtures/regexUFlag/regex-u-extended-escape.src 1`] = ` +exports[`ecmaFeatures fixtures/arrowFunctions/as-param.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, + "expression": Object { + "arguments": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, }, + "range": Array [ + 10, + 12, + ], + "type": "BlockStatement", }, - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "init": Object { + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 40, + "column": 12, "line": 1, }, "start": Object { - "column": 8, + "column": 4, "line": 1, }, }, + "params": Array [], "range": Array [ - 8, - 40, + 4, + 12, ], - "raw": "/[\\\\u{0000000000000061}-\\\\u{7A}]/u", - "regex": Object { - "flags": "u", - "pattern": "[\\\\u{0000000000000061}-\\\\u{7A}]", - }, - "type": "Literal", - "value": null, + "type": "ArrowFunctionExpression", }, + ], + "callee": Object { "loc": Object { "end": Object { - "column": 40, + "column": 3, "line": 1, }, "start": Object { - "column": 4, + "column": 0, "line": 1, }, }, + "name": "foo", "range": Array [ - 4, - 40, + 0, + 3, ], - "type": "VariableDeclarator", + "type": "Identifier", }, - ], - "kind": "var", + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "CallExpression", + }, "loc": Object { "end": Object { - "column": 41, + "column": 14, "line": 1, }, "start": Object { @@ -77,15 +93,15 @@ Object { }, "range": Array [ 0, - 41, + 14, ], - "type": "VariableDeclaration", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 2, + "column": 14, + "line": 1, }, "start": Object { "column": 0, @@ -94,7 +110,7 @@ Object { }, "range": Array [ 0, - 42, + 14, ], "sourceType": "script", "tokens": Array [ @@ -113,278 +129,149 @@ Object { 0, 3, ], - "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 5, - ], "type": "Identifier", - "value": "x", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 4, "line": 1, }, "start": Object { - "column": 6, + "column": 3, "line": 1, }, }, "range": Array [ - 6, - 7, + 3, + 4, ], "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 40, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 40, - ], - "regex": Object { - "flags": "u", - "pattern": "[\\\\u{0000000000000061}-\\\\u{7A}]", - }, - "type": "RegularExpression", - "value": "/[\\\\u{0000000000000061}-\\\\u{7A}]/u", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 41, + "column": 5, "line": 1, }, "start": Object { - "column": 40, + "column": 4, "line": 1, }, }, "range": Array [ - 40, - 41, + 4, + 5, ], "type": "Punctuator", - "value": ";", + "value": "(", }, - ], - "type": "Program", -} -`; - -exports[`ecmaFeatures REGEXP FLAG - NODE VERSION <6: fixtures/regexUFlag/regex-u-simple.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 16, - ], - "raw": "/foo/u", - "regex": Object { - "flags": "u", - "pattern": "foo", - }, - "type": "Literal", - "value": null, - }, - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 16, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", "loc": Object { "end": Object { - "column": 17, + "column": 6, "line": 1, }, "start": Object { - "column": 0, + "column": 5, "line": 1, }, }, "range": Array [ - 0, - 17, + 5, + 6, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": ")", }, - }, - "range": Array [ - 0, - 18, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 9, "line": 1, }, "start": Object { - "column": 0, + "column": 7, "line": 1, }, }, "range": Array [ - 0, - 3, + 7, + 9, ], - "type": "Keyword", - "value": "var", + "type": "Punctuator", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 11, "line": 1, }, "start": Object { - "column": 4, + "column": 10, "line": 1, }, }, "range": Array [ - 4, - 7, + 10, + 11, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 12, "line": 1, }, "start": Object { - "column": 8, + "column": 11, "line": 1, }, }, "range": Array [ - 8, - 9, + 11, + 12, ], "type": "Punctuator", - "value": "=", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 13, "line": 1, }, "start": Object { - "column": 10, + "column": 12, "line": 1, }, }, "range": Array [ - 10, - 16, + 12, + 13, ], - "regex": Object { - "flags": "u", - "pattern": "foo", - }, - "type": "RegularExpression", - "value": "/foo/u", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 14, "line": 1, }, "start": Object { - "column": 16, + "column": 13, "line": 1, }, }, "range": Array [ - 16, - 17, + 13, + 14, ], "type": "Punctuator", "value": ";", @@ -394,74 +281,127 @@ Object { } `; -exports[`ecmaFeatures REGEXP FLAG - NODE VERSION <6: fixtures/regexYFlag/regexp-y-simple.src 1`] = ` +exports[`ecmaFeatures fixtures/arrowFunctions/as-param-with-params.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, + "expression": Object { + "arguments": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, }, + "range": Array [ + 14, + 16, + ], + "type": "BlockStatement", }, - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "init": Object { + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { "column": 16, "line": 1, }, "start": Object { - "column": 10, + "column": 4, "line": 1, }, }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + }, + ], "range": Array [ - 10, + 4, 16, ], - "raw": "/foo/y", - "regex": Object { - "flags": "y", - "pattern": "foo", - }, - "type": "Literal", - "value": null, + "type": "ArrowFunctionExpression", }, + ], + "callee": Object { "loc": Object { "end": Object { - "column": 16, + "column": 3, "line": 1, }, "start": Object { - "column": 4, + "column": 0, "line": 1, }, }, + "name": "foo", "range": Array [ - 4, - 16, + 0, + 3, ], - "type": "VariableDeclarator", + "type": "Identifier", }, - ], - "kind": "var", + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "type": "CallExpression", + }, "loc": Object { "end": Object { - "column": 17, + "column": 18, "line": 1, }, "start": Object { @@ -471,15 +411,15 @@ Object { }, "range": Array [ 0, - 17, + 18, ], - "type": "VariableDeclaration", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 2, + "column": 18, + "line": 1, }, "start": Object { "column": 0, @@ -507,278 +447,203 @@ Object { 0, 3, ], - "type": "Keyword", - "value": "var", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 4, "line": 1, }, "start": Object { - "column": 4, + "column": 3, "line": 1, }, }, "range": Array [ + 3, 4, - 7, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 5, "line": 1, }, "start": Object { - "column": 8, + "column": 4, "line": 1, }, }, "range": Array [ - 8, - 9, + 4, + 5, ], "type": "Punctuator", - "value": "=", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 6, "line": 1, }, "start": Object { - "column": 10, + "column": 5, "line": 1, }, }, "range": Array [ - 10, - 16, + 5, + 6, ], - "regex": Object { - "flags": "y", - "pattern": "foo", - }, - "type": "RegularExpression", - "value": "/foo/y", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 7, "line": 1, }, "start": Object { - "column": 16, + "column": 6, "line": 1, }, }, "range": Array [ - 16, - 17, + 6, + 7, ], "type": "Punctuator", - "value": ";", + "value": ",", }, - ], - "type": "Program", -} -`; - -exports[`ecmaFeatures REGEXP FLAG - NODE VERSION >=6: fixtures/regexUFlag/regex-u-extended-escape.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 40, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 40, - ], - "raw": "/[\\\\u{0000000000000061}-\\\\u{7A}]/u", - "regex": Object { - "flags": "u", - "pattern": "[\\\\u{0000000000000061}-\\\\u{7A}]", - }, - "type": "Literal", - "value": Object {}, - }, - "loc": Object { - "end": Object { - "column": 40, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 40, - ], - "type": "VariableDeclarator", + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, }, + }, + "range": Array [ + 8, + 9, ], - "kind": "var", + "type": "Identifier", + "value": "y", + }, + Object { "loc": Object { "end": Object { - "column": 41, + "column": 10, "line": 1, }, "start": Object { - "column": 0, + "column": 9, "line": 1, }, }, "range": Array [ - 0, - 41, + 9, + 10, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": ")", }, - }, - "range": Array [ - 0, - 42, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 13, "line": 1, }, "start": Object { - "column": 0, + "column": 11, "line": 1, }, }, "range": Array [ - 0, - 3, + 11, + 13, ], - "type": "Keyword", - "value": "var", + "type": "Punctuator", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 15, "line": 1, }, "start": Object { - "column": 4, + "column": 14, "line": 1, }, }, "range": Array [ - 4, - 5, + 14, + 15, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 16, "line": 1, }, "start": Object { - "column": 6, + "column": 15, "line": 1, }, }, "range": Array [ - 6, - 7, + 15, + 16, ], "type": "Punctuator", - "value": "=", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 40, + "column": 17, "line": 1, }, "start": Object { - "column": 8, + "column": 16, "line": 1, }, }, "range": Array [ - 8, - 40, + 16, + 17, ], - "regex": Object { - "flags": "u", - "pattern": "[\\\\u{0000000000000061}-\\\\u{7A}]", - }, - "type": "RegularExpression", - "value": "/[\\\\u{0000000000000061}-\\\\u{7A}]/u", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 41, + "column": 18, "line": 1, }, "start": Object { - "column": 40, + "column": 17, "line": 1, }, }, "range": Array [ - 40, - 41, + 17, + 18, ], "type": "Punctuator", "value": ";", @@ -788,74 +653,54 @@ Object { } `; -exports[`ecmaFeatures REGEXP FLAG - NODE VERSION >=6: fixtures/regexUFlag/regex-u-simple.src 1`] = ` +exports[`ecmaFeatures fixtures/arrowFunctions/basic.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 16, - ], - "raw": "/foo/u", - "regex": Object { - "flags": "u", - "pattern": "foo", - }, - "type": "Literal", - "value": Object {}, - }, + "expression": Object { + "async": false, + "body": Object { "loc": Object { "end": Object { - "column": 16, + "column": 12, "line": 1, }, "start": Object { - "column": 4, + "column": 6, "line": 1, }, }, "range": Array [ - 4, - 16, + 6, + 12, ], - "type": "VariableDeclarator", + "raw": "\\"test\\"", + "type": "Literal", + "value": "test", }, - ], - "kind": "var", + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 0, + 12, + ], + "type": "ArrowFunctionExpression", + }, "loc": Object { "end": Object { - "column": 17, + "column": 13, "line": 1, }, "start": Object { @@ -865,15 +710,15 @@ Object { }, "range": Array [ 0, - 17, + 13, ], - "type": "VariableDeclaration", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 2, + "column": 13, + "line": 1, }, "start": Object { "column": 0, @@ -882,14 +727,14 @@ Object { }, "range": Array [ 0, - 18, + 13, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 1, "line": 1, }, "start": Object { @@ -899,83 +744,79 @@ Object { }, "range": Array [ 0, - 3, + 1, ], - "type": "Keyword", - "value": "var", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 2, "line": 1, }, "start": Object { - "column": 4, + "column": 1, "line": 1, }, }, "range": Array [ - 4, - 7, + 1, + 2, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 5, "line": 1, }, "start": Object { - "column": 8, + "column": 3, "line": 1, }, }, "range": Array [ - 8, - 9, + 3, + 5, ], "type": "Punctuator", - "value": "=", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 12, "line": 1, }, "start": Object { - "column": 10, + "column": 6, "line": 1, }, }, "range": Array [ - 10, - 16, + 6, + 12, ], - "regex": Object { - "flags": "u", - "pattern": "foo", - }, - "type": "RegularExpression", - "value": "/foo/u", + "type": "String", + "value": "\\"test\\"", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 13, "line": 1, }, "start": Object { - "column": 16, + "column": 12, "line": 1, }, }, "range": Array [ - 16, - 17, + 12, + 13, ], "type": "Punctuator", "value": ";", @@ -985,108 +826,109 @@ Object { } `; -exports[`ecmaFeatures REGEXP FLAG - NODE VERSION >=6: fixtures/regexYFlag/regexp-y-simple.src 1`] = ` +exports[`ecmaFeatures fixtures/arrowFunctions/basic-in-binary-expression.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { + "expression": Object { + "left": Object { + "async": false, + "body": Object { "loc": Object { "end": Object { - "column": 7, + "column": 9, "line": 1, }, "start": Object { - "column": 4, + "column": 7, "line": 1, }, }, - "name": "foo", + "properties": Array [], "range": Array [ - 4, 7, + 9, ], - "type": "Identifier", + "type": "ObjectExpression", }, - "init": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 10, + "line": 1, }, - "range": Array [ - 10, - 16, - ], - "raw": "/foo/y", - "regex": Object { - "flags": "y", - "pattern": "foo", + "start": Object { + "column": 1, + "line": 1, }, - "type": "Literal", - "value": Object {}, }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 1, + 10, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "+", + "range": Array [ + 0, + 15, + ], + "right": Object { "loc": Object { "end": Object { - "column": 16, + "column": 15, "line": 1, }, "start": Object { - "column": 4, + "column": 14, "line": 1, }, }, "range": Array [ - 4, - 16, + 14, + 15, ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "raw": "1", + "type": "Literal", + "value": 1, }, + "type": "BinaryExpression", }, - "range": Array [ - 0, - 17, - ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 18, - ], - "sourceType": "script", - "tokens": Array [ - Object { "loc": Object { "end": Object { - "column": 3, + "column": 16, "line": 1, }, "start": Object { @@ -1096,194 +938,128 @@ Object { }, "range": Array [ 0, - 3, - ], - "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 9, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, 16, ], - "regex": Object { - "flags": "y", - "pattern": "foo", - }, - "type": "RegularExpression", - "value": "/foo/y", + "type": "ExpressionStatement", }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 17, - ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`ecmaFeatures fixtures/arrowFunctions/as-param.src 1`] = ` -Object { - "body": Array [ Object { "expression": Object { - "arguments": Array [ - Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 12, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, + "left": Object { + "async": false, + "body": Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 10, + "line": 2, }, "start": Object { - "column": 4, - "line": 1, + "column": 8, + "line": 2, }, }, - "params": Array [], + "properties": Array [], "range": Array [ - 4, - 12, + 25, + 27, ], - "type": "ArrowFunctionExpression", + "type": "ObjectExpression", }, - ], - "callee": Object { + "expression": true, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 3, - "line": 1, + "column": 11, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 2, + "line": 2, }, }, - "name": "foo", + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "a", + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + }, + ], "range": Array [ - 0, - 3, + 19, + 28, ], - "type": "Identifier", + "type": "ArrowFunctionExpression", }, "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 1, + "line": 2, }, }, + "operator": "+", "range": Array [ - 0, - 13, + 18, + 33, ], - "type": "CallExpression", + "right": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 32, + 33, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "type": "BinaryExpression", }, "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 18, + "line": 2, }, "start": Object { "column": 0, - "line": 1, + "line": 2, }, }, "range": Array [ - 0, - 14, + 17, + 35, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 0, + "line": 3, }, "start": Object { "column": 0, @@ -1292,14 +1068,14 @@ Object { }, "range": Array [ 0, - 14, + 36, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 1, "line": 1, }, "start": Object { @@ -1309,15 +1085,33 @@ Object { }, "range": Array [ 0, - 3, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, ], "type": "Identifier", - "value": "foo", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 4, + "column": 5, "line": 1, }, "start": Object { @@ -1327,25 +1121,25 @@ Object { }, "range": Array [ 3, - 4, + 5, ], "type": "Punctuator", - "value": "(", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 7, "line": 1, }, "start": Object { - "column": 4, + "column": 6, "line": 1, }, }, "range": Array [ - 4, - 5, + 6, + 7, ], "type": "Punctuator", "value": "(", @@ -1353,20 +1147,20 @@ Object { Object { "loc": Object { "end": Object { - "column": 6, + "column": 8, "line": 1, }, "start": Object { - "column": 5, + "column": 7, "line": 1, }, }, "range": Array [ - 5, - 6, + 7, + 8, ], "type": "Punctuator", - "value": ")", + "value": "{", }, Object { "loc": Object { @@ -1375,52 +1169,52 @@ Object { "line": 1, }, "start": Object { - "column": 7, + "column": 8, "line": 1, }, }, "range": Array [ - 7, + 8, 9, ], "type": "Punctuator", - "value": "=>", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 10, "line": 1, }, "start": Object { - "column": 10, + "column": 9, "line": 1, }, }, "range": Array [ + 9, 10, - 11, ], "type": "Punctuator", - "value": "{", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 11, "line": 1, }, "start": Object { - "column": 11, + "column": 10, "line": 1, }, }, "range": Array [ + 10, 11, - 12, ], "type": "Punctuator", - "value": "}", + "value": ")", }, Object { "loc": Object { @@ -1438,214 +1232,76 @@ Object { 13, ], "type": "Punctuator", - "value": ")", + "value": "+", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 15, "line": 1, }, "start": Object { - "column": 13, + "column": 14, "line": 1, }, }, "range": Array [ - 13, 14, + 15, ], - "type": "Punctuator", - "value": ";", + "type": "Numeric", + "value": "1", }, - ], - "type": "Program", -} -`; - -exports[`ecmaFeatures fixtures/arrowFunctions/as-param-with-params.src 1`] = ` -Object { - "body": Array [ Object { - "expression": Object { - "arguments": Array [ - Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 16, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "y", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - ], - "range": Array [ - 4, - 16, - ], - "type": "ArrowFunctionExpression", - }, - ], - "callee": Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 0, - 3, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 17, - ], - "type": "CallExpression", - }, "loc": Object { "end": Object { - "column": 18, + "column": 16, "line": 1, }, "start": Object { - "column": 0, + "column": 15, "line": 1, }, }, "range": Array [ - 0, - 18, + 15, + 16, ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": ";", }, - }, - "range": Array [ - 0, - 18, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, - "line": 1, + "column": 1, + "line": 2, }, "start": Object { "column": 0, - "line": 1, + "line": 2, }, }, "range": Array [ - 0, - 3, + 17, + 18, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 4, - "line": 1, + "column": 2, + "line": 2, }, "start": Object { - "column": 3, - "line": 1, + "column": 1, + "line": 2, }, }, "range": Array [ - 3, - 4, + 18, + 19, ], "type": "Punctuator", "value": "(", @@ -1653,161 +1309,179 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 3, + "line": 2, }, "start": Object { - "column": 4, - "line": 1, + "column": 2, + "line": 2, }, }, "range": Array [ - 4, - 5, + 19, + 20, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { "column": 6, - "line": 1, + "line": 2, }, "start": Object { - "column": 5, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 5, - 6, + 21, + 23, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 8, + "line": 2, }, "start": Object { - "column": 6, - "line": 1, + "column": 7, + "line": 2, }, }, "range": Array [ - 6, - 7, + 24, + 25, ], "type": "Punctuator", - "value": ",", + "value": "(", }, Object { "loc": Object { "end": Object { "column": 9, - "line": 1, + "line": 2, }, "start": Object { "column": 8, - "line": 1, + "line": 2, }, }, "range": Array [ - 8, - 9, + 25, + 26, ], - "type": "Identifier", - "value": "y", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { "column": 10, - "line": 1, + "line": 2, }, "start": Object { "column": 9, - "line": 1, + "line": 2, }, }, "range": Array [ - 9, - 10, + 26, + 27, ], "type": "Punctuator", - "value": ")", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 11, + "line": 2, }, "start": Object { - "column": 11, - "line": 1, + "column": 10, + "line": 2, }, }, "range": Array [ - 11, - 13, + 27, + 28, ], "type": "Punctuator", - "value": "=>", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 12, + "line": 2, }, "start": Object { - "column": 14, - "line": 1, + "column": 11, + "line": 2, }, }, "range": Array [ - 14, - 15, + 28, + 29, ], "type": "Punctuator", - "value": "{", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 14, + "line": 2, }, "start": Object { - "column": 15, - "line": 1, + "column": 13, + "line": 2, }, }, "range": Array [ - 15, - 16, + 30, + 31, ], "type": "Punctuator", - "value": "}", + "value": "+", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Numeric", + "value": "1", }, Object { "loc": Object { "end": Object { "column": 17, - "line": 1, + "line": 2, }, "start": Object { "column": 16, - "line": 1, + "line": 2, }, }, "range": Array [ - 16, - 17, + 33, + 34, ], "type": "Punctuator", "value": ")", @@ -1816,16 +1490,16 @@ Object { "loc": Object { "end": Object { "column": 18, - "line": 1, + "line": 2, }, "start": Object { "column": 17, - "line": 1, + "line": 2, }, }, "range": Array [ - 17, - 18, + 34, + 35, ], "type": "Punctuator", "value": ";", @@ -1835,32 +1509,68 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/basic.src 1`] = ` +exports[`ecmaFeatures fixtures/arrowFunctions/block-body.src 1`] = ` Object { "body": Array [ Object { "expression": Object { "async": false, "body": Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 9, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 10, + ], + "type": "ExpressionStatement", + }, + ], "loc": Object { "end": Object { "column": 12, "line": 1, }, "start": Object { - "column": 6, + "column": 5, "line": 1, }, }, "range": Array [ - 6, + 5, 12, ], - "raw": "\\"test\\"", - "type": "Literal", - "value": "test", + "type": "BlockStatement", }, - "expression": true, + "expression": false, "generator": false, "id": null, "loc": Object { @@ -1873,7 +1583,26 @@ Object { "line": 1, }, }, - "params": Array [], + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "e", + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + }, + ], "range": Array [ 0, 12, @@ -1928,44 +1657,80 @@ Object { 0, 1, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "e", }, Object { "loc": Object { "end": Object { - "column": 2, + "column": 4, "line": 1, }, "start": Object { - "column": 1, + "column": 2, "line": 1, }, }, "range": Array [ - 1, 2, + 4, ], "type": "Punctuator", - "value": ")", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 6, "line": 1, }, "start": Object { - "column": 3, + "column": 5, "line": 1, }, }, "range": Array [ - 3, 5, + 6, ], "type": "Punctuator", - "value": "=>", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 9, + ], + "type": "Numeric", + "value": "42", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { @@ -1974,16 +1739,16 @@ Object { "line": 1, }, "start": Object { - "column": 6, + "column": 11, "line": 1, }, }, "range": Array [ - 6, + 11, 12, ], - "type": "String", - "value": "\\"test\\"", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { @@ -2008,240 +1773,162 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/basic-in-binary-expression.src 1`] = ` +exports[`ecmaFeatures fixtures/arrowFunctions/block-body-not-object.src 1`] = ` Object { "body": Array [ Object { "expression": Object { - "left": Object { - "async": false, - "body": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, + "async": false, + "body": Object { + "body": Array [ + Object { + "body": Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 16, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 16, + ], + "type": "ExpressionStatement", }, - "start": Object { - "column": 7, - "line": 1, + "label": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "label", + "range": Array [ + 7, + 12, + ], + "type": "Identifier", }, - }, - "properties": Array [], - "range": Array [ - 7, - 9, - ], - "type": "ObjectExpression", - }, - "expression": true, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "params": Array [ - Object { "loc": Object { "end": Object { - "column": 2, + "column": 16, "line": 1, }, "start": Object { - "column": 1, + "column": 7, "line": 1, }, }, - "name": "a", "range": Array [ - 1, - 2, + 7, + 16, ], - "type": "Identifier", + "type": "LabeledStatement", }, ], - "range": Array [ - 1, - 10, - ], - "type": "ArrowFunctionExpression", - }, - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "operator": "+", - "range": Array [ - 0, - 15, - ], - "right": Object { "loc": Object { "end": Object { - "column": 15, + "column": 18, "line": 1, }, "start": Object { - "column": 14, + "column": 5, "line": 1, }, }, "range": Array [ - 14, - 15, + 5, + 18, ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "type": "BinaryExpression", - }, - "loc": Object { - "end": Object { - "column": 16, - "line": 1, + "type": "BlockStatement", }, - "start": Object { - "column": 0, - "line": 1, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, }, - }, - "range": Array [ - 0, - 16, - ], - "type": "ExpressionStatement", - }, - Object { - "expression": Object { - "left": Object { - "async": false, - "body": Object { + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 10, - "line": 2, + "column": 1, + "line": 1, }, "start": Object { - "column": 8, - "line": 2, + "column": 0, + "line": 1, }, }, - "properties": Array [], + "name": "e", "range": Array [ - 25, - 27, + 0, + 1, ], - "type": "ObjectExpression", - }, - "expression": true, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "name": "a", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - ], - "range": Array [ - 19, - 28, - ], - "type": "ArrowFunctionExpression", - }, - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 1, - "line": 2, + "type": "Identifier", }, - }, - "operator": "+", + ], "range": Array [ + 0, 18, - 33, ], - "right": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 15, - "line": 2, - }, - }, - "range": Array [ - 32, - 33, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "type": "BinaryExpression", + "type": "ArrowFunctionExpression", }, "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 19, + "line": 1, }, "start": Object { "column": 0, - "line": 2, + "line": 1, }, }, "range": Array [ - 17, - 35, + 0, + 19, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 3, + "column": 19, + "line": 1, }, "start": Object { "column": 0, @@ -2250,7 +1937,7 @@ Object { }, "range": Array [ 0, - 36, + 19, ], "sourceType": "script", "tokens": Array [ @@ -2269,203 +1956,250 @@ Object { 0, 1, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "e", }, Object { "loc": Object { "end": Object { - "column": 2, + "column": 4, "line": 1, }, "start": Object { - "column": 1, + "column": 2, "line": 1, }, }, "range": Array [ - 1, 2, + 4, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 6, "line": 1, }, "start": Object { - "column": 3, + "column": 5, "line": 1, }, }, "range": Array [ - 3, 5, + 6, ], "type": "Punctuator", - "value": "=>", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 12, "line": 1, }, "start": Object { - "column": 6, + "column": 7, "line": 1, }, }, "range": Array [ - 6, 7, + 12, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "label", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 13, "line": 1, }, "start": Object { - "column": 7, + "column": 12, "line": 1, }, }, "range": Array [ - 7, - 8, + 12, + 13, ], "type": "Punctuator", - "value": "{", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 16, "line": 1, }, "start": Object { - "column": 8, + "column": 14, "line": 1, }, }, "range": Array [ - 8, - 9, + 14, + 16, ], - "type": "Punctuator", - "value": "}", + "type": "Numeric", + "value": "42", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 18, "line": 1, }, "start": Object { - "column": 9, + "column": 17, "line": 1, }, }, "range": Array [ - 9, - 10, + 17, + 18, ], "type": "Punctuator", - "value": ")", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 19, "line": 1, }, "start": Object { - "column": 10, + "column": 18, "line": 1, }, }, "range": Array [ - 10, - 11, + 18, + 19, ], "type": "Punctuator", - "value": ")", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/expression.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, + "expression": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", }, - "start": Object { - "column": 12, - "line": 1, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 1, + 7, + ], + "type": "ArrowFunctionExpression", }, - "range": Array [ - 12, - 13, - ], - "type": "Punctuator", - "value": "+", - }, - Object { "loc": Object { "end": Object { - "column": 15, + "column": 9, "line": 1, }, "start": Object { - "column": 14, + "column": 0, "line": 1, }, }, "range": Array [ - 14, - 15, + 0, + 9, ], - "type": "Numeric", - "value": "1", + "type": "ExpressionStatement", }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 16, - ], - "type": "Punctuator", - "value": ";", + ], + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 9, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { "column": 1, - "line": 2, + "line": 1, }, "start": Object { "column": 0, - "line": 2, + "line": 1, }, }, "range": Array [ - 17, - 18, + 0, + 1, ], "type": "Punctuator", "value": "(", @@ -2474,52 +2208,34 @@ Object { "loc": Object { "end": Object { "column": 2, - "line": 2, + "line": 1, }, "start": Object { "column": 1, - "line": 2, - }, - }, - "range": Array [ - 18, - 19, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, + "line": 1, }, }, "range": Array [ - 19, - 20, + 1, + 2, ], "type": "Identifier", - "value": "a", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 2, + "column": 5, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 3, + "line": 1, }, }, "range": Array [ - 21, - 23, + 3, + 5, ], "type": "Punctuator", "value": "=>", @@ -2527,143 +2243,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, - }, - "start": Object { "column": 7, - "line": 2, - }, - }, - "range": Array [ - 24, - 25, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "range": Array [ - 25, - 26, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "range": Array [ - 26, - 27, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 2, - }, - }, - "range": Array [ - 27, - 28, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 11, - "line": 2, - }, - }, - "range": Array [ - 28, - 29, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 13, - "line": 2, - }, - }, - "range": Array [ - 30, - 31, - ], - "type": "Punctuator", - "value": "+", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, + "line": 1, }, "start": Object { - "column": 15, - "line": 2, + "column": 6, + "line": 1, }, }, "range": Array [ - 32, - 33, + 6, + 7, ], - "type": "Numeric", - "value": "1", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 8, + "line": 1, }, "start": Object { - "column": 16, - "line": 2, + "column": 7, + "line": 1, }, }, "range": Array [ - 33, - 34, + 7, + 8, ], "type": "Punctuator", "value": ")", @@ -2671,17 +2279,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 9, + "line": 1, }, "start": Object { - "column": 17, - "line": 2, + "column": 8, + "line": 1, }, }, "range": Array [ - 34, - 35, + 8, + 9, ], "type": "Punctuator", "value": ";", @@ -2691,73 +2299,95 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/block-body.src 1`] = ` +exports[`ecmaFeatures fixtures/arrowFunctions/iife.src 1`] = ` Object { "body": Array [ Object { "expression": Object { "async": false, "body": Object { - "body": Array [ + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "properties": Array [ Object { - "expression": Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 9, + "column": 16, "line": 1, }, "start": Object { - "column": 7, + "column": 8, "line": 1, }, }, + "name": "property", "range": Array [ - 7, - 9, + 8, + 16, ], - "raw": "42", - "type": "Literal", - "value": 42, + "type": "Identifier", }, + "kind": "init", "loc": Object { "end": Object { - "column": 10, + "column": 20, "line": 1, }, "start": Object { - "column": 7, + "column": 8, "line": 1, }, }, + "method": false, "range": Array [ - 7, - 10, + 8, + 20, ], - "type": "ExpressionStatement", + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 20, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, }, ], - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, "range": Array [ - 5, - 12, + 6, + 22, ], - "type": "BlockStatement", + "type": "ObjectExpression", }, - "expression": false, + "expression": true, "generator": false, "id": null, "loc": Object { "end": Object { - "column": 12, + "column": 23, "line": 1, }, "start": Object { @@ -2787,13 +2417,13 @@ Object { ], "range": Array [ 0, - 12, + 23, ], "type": "ArrowFunctionExpression", }, "loc": Object { "end": Object { - "column": 13, + "column": 24, "line": 1, }, "start": Object { @@ -2803,14 +2433,14 @@ Object { }, "range": Array [ 0, - 13, + 24, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 13, + "column": 24, "line": 1, }, "start": Object { @@ -2820,7 +2450,7 @@ Object { }, "range": Array [ 0, - 13, + 24, ], "sourceType": "script", "tokens": Array [ @@ -2876,58 +2506,94 @@ Object { 6, ], "type": "Punctuator", - "value": "{", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 7, "line": 1, }, "start": Object { - "column": 7, + "column": 6, "line": 1, }, }, "range": Array [ + 6, 7, - 9, ], - "type": "Numeric", - "value": "42", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 16, "line": 1, }, "start": Object { - "column": 9, + "column": 8, "line": 1, }, }, "range": Array [ - 9, - 10, + 8, + 16, + ], + "type": "Identifier", + "value": "property", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, ], "type": "Punctuator", - "value": ";", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 20, "line": 1, }, "start": Object { - "column": 11, + "column": 18, "line": 1, }, }, "range": Array [ - 11, - 12, + 18, + 20, + ], + "type": "Numeric", + "value": "42", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, ], "type": "Punctuator", "value": "}", @@ -2935,128 +2601,75 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 23, "line": 1, }, "start": Object { - "column": 12, + "column": 22, "line": 1, }, }, "range": Array [ - 12, - 13, + 22, + 23, ], "type": "Punctuator", - "value": ";", + "value": ")", }, - ], - "type": "Program", -} -`; - -exports[`ecmaFeatures fixtures/arrowFunctions/block-body-not-object.src 1`] = ` -Object { - "body": Array [ Object { - "expression": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "body": Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 16, - ], - "raw": "42", - "type": "Literal", - "value": 42, - }, - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 16, - ], - "type": "ExpressionStatement", - }, - "label": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "name": "label", - "range": Array [ - 7, - 12, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 16, - ], - "type": "LabeledStatement", - }, - ], + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/multiple-params.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { "loc": Object { "end": Object { - "column": 18, + "column": 16, "line": 1, }, "start": Object { - "column": 5, + "column": 10, "line": 1, }, }, "range": Array [ - 5, - 18, + 10, + 16, ], - "type": "BlockStatement", + "raw": "\\"test\\"", + "type": "Literal", + "value": "test", }, - "expression": false, + "expression": true, "generator": false, "id": null, "loc": Object { "end": Object { - "column": 18, + "column": 16, "line": 1, }, "start": Object { @@ -3068,31 +2681,49 @@ Object { Object { "loc": Object { "end": Object { - "column": 1, + "column": 2, "line": 1, }, "start": Object { - "column": 0, + "column": 1, "line": 1, }, }, - "name": "e", + "name": "a", "range": Array [ - 0, 1, + 2, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 4, + 5, ], "type": "Identifier", }, ], "range": Array [ 0, - 18, + 16, ], "type": "ArrowFunctionExpression", }, "loc": Object { "end": Object { - "column": 19, + "column": 17, "line": 1, }, "start": Object { @@ -3102,14 +2733,14 @@ Object { }, "range": Array [ 0, - 19, + 17, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 19, + "column": 17, "line": 1, }, "start": Object { @@ -3119,7 +2750,7 @@ Object { }, "range": Array [ 0, - 19, + 17, ], "sourceType": "script", "tokens": Array [ @@ -3138,131 +2769,131 @@ Object { 0, 1, ], - "type": "Identifier", - "value": "e", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 4, + "column": 2, "line": 1, }, "start": Object { - "column": 2, + "column": 1, "line": 1, }, }, "range": Array [ + 1, 2, - 4, ], - "type": "Punctuator", - "value": "=>", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 3, "line": 1, }, "start": Object { - "column": 5, + "column": 2, "line": 1, }, }, "range": Array [ - 5, - 6, + 2, + 3, ], "type": "Punctuator", - "value": "{", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 5, "line": 1, }, "start": Object { - "column": 7, + "column": 4, "line": 1, }, }, "range": Array [ - 7, - 12, + 4, + 5, ], "type": "Identifier", - "value": "label", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 6, "line": 1, }, "start": Object { - "column": 12, + "column": 5, "line": 1, }, }, "range": Array [ - 12, - 13, + 5, + 6, ], "type": "Punctuator", - "value": ":", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 9, "line": 1, }, "start": Object { - "column": 14, + "column": 7, "line": 1, }, }, "range": Array [ - 14, - 16, + 7, + 9, ], - "type": "Numeric", - "value": "42", + "type": "Punctuator", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 16, "line": 1, }, "start": Object { - "column": 17, + "column": 10, "line": 1, }, }, "range": Array [ - 17, - 18, + 10, + 16, ], - "type": "Punctuator", - "value": "}", + "type": "String", + "value": "\\"test\\"", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 17, "line": 1, }, "start": Object { - "column": 18, + "column": 16, "line": 1, }, }, "range": Array [ - 18, - 19, + 16, + 17, ], "type": "Punctuator", "value": ";", @@ -3272,40 +2903,77 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/expression.src 1`] = ` +exports[`ecmaFeatures fixtures/arrowFunctions/no-auto-return.src 1`] = ` Object { "body": Array [ Object { "expression": Object { "async": false, "body": Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 14, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 15, + ], + "type": "ExpressionStatement", + }, + ], "loc": Object { "end": Object { - "column": 7, + "column": 17, "line": 1, }, "start": Object { - "column": 6, + "column": 10, "line": 1, }, }, - "name": "x", "range": Array [ - 6, - 7, + 10, + 17, ], - "type": "Identifier", + "type": "BlockStatement", }, - "expression": true, + "expression": false, "generator": false, "id": null, "loc": Object { "end": Object { - "column": 7, + "column": 17, "line": 1, }, "start": Object { - "column": 1, + "column": 0, "line": 1, }, }, @@ -3321,23 +2989,41 @@ Object { "line": 1, }, }, - "name": "x", + "name": "a", "range": Array [ 1, 2, ], "type": "Identifier", }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, ], "range": Array [ - 1, - 7, + 0, + 17, ], "type": "ArrowFunctionExpression", }, "loc": Object { "end": Object { - "column": 9, + "column": 18, "line": 1, }, "start": Object { @@ -3347,14 +3033,14 @@ Object { }, "range": Array [ 0, - 9, + 18, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 9, + "column": 18, "line": 1, }, "start": Object { @@ -3364,7 +3050,7 @@ Object { }, "range": Array [ 0, - 9, + 18, ], "sourceType": "script", "tokens": Array [ @@ -3402,58 +3088,58 @@ Object { 2, ], "type": "Identifier", - "value": "x", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 3, "line": 1, }, "start": Object { - "column": 3, + "column": 2, "line": 1, }, }, "range": Array [ + 2, 3, - 5, ], "type": "Punctuator", - "value": "=>", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 5, "line": 1, }, "start": Object { - "column": 6, + "column": 4, "line": 1, }, }, "range": Array [ - 6, - 7, + 4, + 5, ], "type": "Identifier", - "value": "x", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 6, "line": 1, }, "start": Object { - "column": 7, + "column": 5, "line": 1, }, }, "range": Array [ - 7, - 8, + 5, + 6, ], "type": "Punctuator", "value": ")", @@ -3465,353 +3151,277 @@ Object { "line": 1, }, "start": Object { - "column": 8, + "column": 7, "line": 1, }, }, "range": Array [ - 8, + 7, 9, ], "type": "Punctuator", - "value": ";", + "value": "=>", }, - ], - "type": "Program", -} -`; - -exports[`ecmaFeatures fixtures/arrowFunctions/iife.src 1`] = ` -Object { - "body": Array [ Object { - "expression": Object { - "async": false, - "body": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "property", - "range": Array [ - 8, - 16, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 8, - 20, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 20, - ], - "raw": "42", - "type": "Literal", - "value": 42, - }, - }, - ], - "range": Array [ - 6, - 22, - ], - "type": "ObjectExpression", - }, - "expression": true, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "name": "e", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", - }, - ], - "range": Array [ - 0, - 23, - ], - "type": "ArrowFunctionExpression", - }, "loc": Object { "end": Object { - "column": 24, + "column": 11, "line": 1, }, "start": Object { - "column": 0, + "column": 10, "line": 1, }, }, "range": Array [ - 0, - 24, + 10, + 11, ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "{", }, - }, - "range": Array [ - 0, - 24, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 14, "line": 1, }, "start": Object { - "column": 0, + "column": 12, "line": 1, }, }, "range": Array [ - 0, - 1, - ], - "type": "Identifier", - "value": "e", + 12, + 14, + ], + "type": "Numeric", + "value": "42", }, Object { "loc": Object { "end": Object { - "column": 4, + "column": 15, "line": 1, }, "start": Object { - "column": 2, + "column": 14, "line": 1, }, }, "range": Array [ - 2, - 4, + 14, + 15, ], "type": "Punctuator", - "value": "=>", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 17, "line": 1, }, "start": Object { - "column": 5, + "column": 16, "line": 1, }, }, "range": Array [ - 5, - 6, + 16, + 17, ], "type": "Punctuator", - "value": "(", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 18, "line": 1, }, "start": Object { - "column": 6, + "column": 17, "line": 1, }, }, "range": Array [ - 6, - 7, + 17, + 18, ], "type": "Punctuator", - "value": "{", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/not-strict-arguments.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, + "expression": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 15, + ], + "raw": "42", + "type": "Literal", + "value": 42, }, - "start": Object { - "column": 8, - "line": 1, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "arguments", + "range": Array [ + 0, + 9, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 0, + 15, + ], + "type": "ArrowFunctionExpression", }, - "range": Array [ - 8, - 16, - ], - "type": "Identifier", - "value": "property", - }, - Object { "loc": Object { "end": Object { - "column": 17, + "column": 16, "line": 1, }, "start": Object { - "column": 16, + "column": 0, "line": 1, }, }, "range": Array [ + 0, 16, - 17, ], - "type": "Punctuator", - "value": ":", + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 16, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 20, + "column": 9, "line": 1, }, "start": Object { - "column": 18, + "column": 0, "line": 1, }, }, "range": Array [ - 18, - 20, + 0, + 9, ], - "type": "Numeric", - "value": "42", + "type": "Identifier", + "value": "arguments", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 12, "line": 1, }, "start": Object { - "column": 21, + "column": 10, "line": 1, }, }, "range": Array [ - 21, - 22, + 10, + 12, ], "type": "Punctuator", - "value": "}", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 15, "line": 1, }, "start": Object { - "column": 22, + "column": 13, "line": 1, }, }, "range": Array [ - 22, - 23, + 13, + 15, ], - "type": "Punctuator", - "value": ")", + "type": "Numeric", + "value": "42", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 16, "line": 1, }, "start": Object { - "column": 23, + "column": 15, "line": 1, }, }, "range": Array [ - 23, - 24, + 15, + 16, ], "type": "Punctuator", "value": ";", @@ -3821,7 +3431,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/multiple-params.src 1`] = ` +exports[`ecmaFeatures fixtures/arrowFunctions/not-strict-eval.src 1`] = ` Object { "body": Array [ Object { @@ -3830,28 +3440,28 @@ Object { "body": Object { "loc": Object { "end": Object { - "column": 16, + "column": 10, "line": 1, }, "start": Object { - "column": 10, + "column": 8, "line": 1, }, }, "range": Array [ + 8, 10, - 16, ], - "raw": "\\"test\\"", + "raw": "42", "type": "Literal", - "value": "test", + "value": 42, }, "expression": true, "generator": false, "id": null, "loc": Object { "end": Object { - "column": 16, + "column": 10, "line": 1, }, "start": Object { @@ -3863,49 +3473,31 @@ Object { Object { "loc": Object { "end": Object { - "column": 2, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 1, - 2, - ], - "type": "Identifier", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, + "column": 4, "line": 1, }, "start": Object { - "column": 4, + "column": 0, "line": 1, }, }, - "name": "b", + "name": "eval", "range": Array [ + 0, 4, - 5, ], "type": "Identifier", }, ], "range": Array [ 0, - 16, + 10, ], "type": "ArrowFunctionExpression", }, "loc": Object { "end": Object { - "column": 17, + "column": 11, "line": 1, }, "start": Object { @@ -3915,14 +3507,14 @@ Object { }, "range": Array [ 0, - 17, + 11, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 17, + "column": 11, "line": 1, }, "start": Object { @@ -3932,14 +3524,14 @@ Object { }, "range": Array [ 0, - 17, + 11, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 4, "line": 1, }, "start": Object { @@ -3949,69 +3541,15 @@ Object { }, "range": Array [ 0, - 1, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "range": Array [ - 1, - 2, - ], - "type": "Identifier", - "value": "a", - }, - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 1, - }, - "start": Object { - "column": 2, - "line": 1, - }, - }, - "range": Array [ - 2, - 3, - ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ 4, - 5, ], "type": "Identifier", - "value": "b", + "value": "eval", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 7, "line": 1, }, "start": Object { @@ -4021,25 +3559,7 @@ Object { }, "range": Array [ 5, - 6, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ 7, - 9, ], "type": "Punctuator", "value": "=>", @@ -4047,35 +3567,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 16, + "column": 10, "line": 1, }, "start": Object { - "column": 10, + "column": 8, "line": 1, }, }, "range": Array [ + 8, 10, - 16, ], - "type": "String", - "value": "\\"test\\"", + "type": "Numeric", + "value": "42", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 11, "line": 1, }, "start": Object { - "column": 16, + "column": 10, "line": 1, }, }, "range": Array [ - 16, - 17, + 10, + 11, ], "type": "Punctuator", "value": ";", @@ -4085,73 +3605,37 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/no-auto-return.src 1`] = ` +exports[`ecmaFeatures fixtures/arrowFunctions/not-strict-eval-params.src 1`] = ` Object { "body": Array [ Object { "expression": Object { "async": false, "body": Object { - "body": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 14, - ], - "raw": "42", - "type": "Literal", - "value": 42, - }, - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 15, - ], - "type": "ExpressionStatement", - }, - ], "loc": Object { "end": Object { - "column": 17, + "column": 15, "line": 1, }, "start": Object { - "column": 10, + "column": 13, "line": 1, }, }, "range": Array [ - 10, - 17, + 13, + 15, ], - "type": "BlockStatement", + "raw": "42", + "type": "Literal", + "value": 42, }, - "expression": false, + "expression": true, "generator": false, "id": null, "loc": Object { "end": Object { - "column": 17, + "column": 15, "line": 1, }, "start": Object { @@ -4163,7 +3647,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 2, + "column": 5, "line": 1, }, "start": Object { @@ -4171,41 +3655,41 @@ Object { "line": 1, }, }, - "name": "a", + "name": "eval", "range": Array [ 1, - 2, + 5, ], "type": "Identifier", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 8, "line": 1, }, "start": Object { - "column": 4, + "column": 7, "line": 1, }, }, - "name": "b", + "name": "a", "range": Array [ - 4, - 5, + 7, + 8, ], "type": "Identifier", }, ], "range": Array [ 0, - 17, + 15, ], "type": "ArrowFunctionExpression", }, "loc": Object { "end": Object { - "column": 18, + "column": 16, "line": 1, }, "start": Object { @@ -4215,14 +3699,14 @@ Object { }, "range": Array [ 0, - 18, + 16, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 18, + "column": 16, "line": 1, }, "start": Object { @@ -4232,7 +3716,7 @@ Object { }, "range": Array [ 0, - 18, + 16, ], "sourceType": "script", "tokens": Array [ @@ -4257,7 +3741,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 2, + "column": 5, "line": 1, }, "start": Object { @@ -4267,46 +3751,10 @@ Object { }, "range": Array [ 1, - 2, - ], - "type": "Identifier", - "value": "a", - }, - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 1, - }, - "start": Object { - "column": 2, - "line": 1, - }, - }, - "range": Array [ - 2, - 3, - ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, 5, ], "type": "Identifier", - "value": "b", + "value": "eval", }, Object { "loc": Object { @@ -4324,12 +3772,12 @@ Object { 6, ], "type": "Punctuator", - "value": ")", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 8, "line": 1, }, "start": Object { @@ -4339,46 +3787,46 @@ Object { }, "range": Array [ 7, - 9, + 8, ], - "type": "Punctuator", - "value": "=>", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 9, "line": 1, }, "start": Object { - "column": 10, + "column": 8, "line": 1, }, }, "range": Array [ - 10, - 11, + 8, + 9, ], "type": "Punctuator", - "value": "{", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 12, "line": 1, }, "start": Object { - "column": 12, + "column": 10, "line": 1, }, }, "range": Array [ + 10, 12, - 14, ], - "type": "Numeric", - "value": "42", + "type": "Punctuator", + "value": "=>", }, Object { "loc": Object { @@ -4387,89 +3835,71 @@ Object { "line": 1, }, "start": Object { - "column": 14, + "column": 13, "line": 1, }, }, "range": Array [ - 14, + 13, 15, ], - "type": "Punctuator", - "value": ";", + "type": "Numeric", + "value": "42", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 16, "line": 1, }, "start": Object { - "column": 16, + "column": 15, "line": 1, }, }, "range": Array [ + 15, 16, - 17, ], "type": "Punctuator", - "value": "}", + "value": ";", }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 18, - ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`ecmaFeatures fixtures/arrowFunctions/not-strict-arguments.src 1`] = ` -Object { - "body": Array [ + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/not-strict-octal.src 1`] = ` +Object { + "body": Array [ Object { "expression": Object { "async": false, "body": Object { "loc": Object { "end": Object { - "column": 15, + "column": 9, "line": 1, }, "start": Object { - "column": 13, + "column": 7, "line": 1, }, }, "range": Array [ - 13, - 15, + 7, + 9, ], - "raw": "42", + "raw": "00", "type": "Literal", - "value": 42, + "value": 0, }, "expression": true, "generator": false, "id": null, "loc": Object { "end": Object { - "column": 15, + "column": 9, "line": 1, }, "start": Object { @@ -4481,31 +3911,31 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 2, "line": 1, }, "start": Object { - "column": 0, + "column": 1, "line": 1, }, }, - "name": "arguments", + "name": "a", "range": Array [ - 0, - 9, + 1, + 2, ], "type": "Identifier", }, ], "range": Array [ 0, - 15, + 9, ], "type": "ArrowFunctionExpression", }, "loc": Object { "end": Object { - "column": 16, + "column": 10, "line": 1, }, "start": Object { @@ -4515,14 +3945,14 @@ Object { }, "range": Array [ 0, - 16, + 10, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 16, + "column": 10, "line": 1, }, "start": Object { @@ -4532,14 +3962,14 @@ Object { }, "range": Array [ 0, - 16, + 10, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 9, + "column": 1, "line": 1, }, "start": Object { @@ -4549,25 +3979,61 @@ Object { }, "range": Array [ 0, - 9, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, ], "type": "Identifier", - "value": "arguments", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 3, "line": 1, }, "start": Object { - "column": 10, + "column": 2, "line": 1, }, }, "range": Array [ - 10, - 12, + 2, + 3, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 6, ], "type": "Punctuator", "value": "=>", @@ -4575,35 +4041,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, + "column": 9, "line": 1, }, "start": Object { - "column": 13, + "column": 7, "line": 1, }, }, "range": Array [ - 13, - 15, + 7, + 9, ], "type": "Numeric", - "value": "42", + "value": "00", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 10, "line": 1, }, "start": Object { - "column": 15, + "column": 9, "line": 1, }, }, "range": Array [ - 15, - 16, + 9, + 10, ], "type": "Punctuator", "value": ";", @@ -4613,37 +4079,78 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/not-strict-eval.src 1`] = ` +exports[`ecmaFeatures fixtures/arrowFunctions/return-arrow-function.src 1`] = ` Object { "body": Array [ Object { "expression": Object { "async": false, "body": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 12, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, + "expression": true, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 10, + "column": 12, "line": 1, }, "start": Object { - "column": 8, + "column": 5, "line": 1, }, }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + ], "range": Array [ - 8, - 10, + 5, + 12, ], - "raw": "42", - "type": "Literal", - "value": 42, + "type": "ArrowFunctionExpression", }, "expression": true, "generator": false, "id": null, "loc": Object { "end": Object { - "column": 10, + "column": 12, "line": 1, }, "start": Object { @@ -4655,7 +4162,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 4, + "column": 1, "line": 1, }, "start": Object { @@ -4663,23 +4170,23 @@ Object { "line": 1, }, }, - "name": "eval", + "name": "x", "range": Array [ 0, - 4, + 1, ], "type": "Identifier", }, ], "range": Array [ 0, - 10, + 12, ], "type": "ArrowFunctionExpression", }, "loc": Object { "end": Object { - "column": 11, + "column": 13, "line": 1, }, "start": Object { @@ -4689,14 +4196,14 @@ Object { }, "range": Array [ 0, - 11, + 13, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 11, + "column": 13, "line": 1, }, "start": Object { @@ -4706,14 +4213,14 @@ Object { }, "range": Array [ 0, - 11, + 13, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 4, + "column": 1, "line": 1, }, "start": Object { @@ -4723,15 +4230,33 @@ Object { }, "range": Array [ 0, - 4, + 1, ], "type": "Identifier", - "value": "eval", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 4, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 4, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, "line": 1, }, "start": Object { @@ -4741,7 +4266,25 @@ Object { }, "range": Array [ 5, + 6, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ 7, + 9, ], "type": "Punctuator", "value": "=>", @@ -4749,17 +4292,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, + "column": 12, "line": 1, }, "start": Object { - "column": 8, + "column": 10, "line": 1, }, }, "range": Array [ - 8, 10, + 12, ], "type": "Numeric", "value": "42", @@ -4767,17 +4310,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, + "column": 13, "line": 1, }, "start": Object { - "column": 10, + "column": 12, "line": 1, }, }, "range": Array [ - 10, - 11, + 12, + 13, ], "type": "Punctuator", "value": ";", @@ -4787,37 +4330,150 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/not-strict-eval-params.src 1`] = ` +exports[`ecmaFeatures fixtures/arrowFunctions/return-sequence.src 1`] = ` Object { "body": Array [ Object { "expression": Object { "async": false, "body": Object { + "async": false, + "body": Object { + "expressions": Array [ + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 26, + ], + "type": "SequenceExpression", + }, + "expression": true, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 15, + "column": 27, "line": 1, }, "start": Object { - "column": 13, + "column": 8, "line": 1, }, }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + ], "range": Array [ - 13, - 15, + 8, + 27, ], - "raw": "42", - "type": "Literal", - "value": 42, + "type": "ArrowFunctionExpression", }, "expression": true, "generator": false, "id": null, "loc": Object { "end": Object { - "column": 15, + "column": 28, "line": 1, }, "start": Object { @@ -4829,7 +4485,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, + "column": 2, "line": 1, }, "start": Object { @@ -4837,41 +4493,23 @@ Object { "line": 1, }, }, - "name": "eval", + "name": "x", "range": Array [ 1, - 5, - ], - "type": "Identifier", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 7, - 8, + 2, ], "type": "Identifier", }, ], "range": Array [ 0, - 15, + 28, ], "type": "ArrowFunctionExpression", }, "loc": Object { "end": Object { - "column": 16, + "column": 29, "line": 1, }, "start": Object { @@ -4881,14 +4519,14 @@ Object { }, "range": Array [ 0, - 16, + 29, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 16, + "column": 29, "line": 1, }, "start": Object { @@ -4898,7 +4536,7 @@ Object { }, "range": Array [ 0, - 16, + 29, ], "sourceType": "script", "tokens": Array [ @@ -4923,7 +4561,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, + "column": 2, "line": 1, }, "start": Object { @@ -4933,10 +4571,28 @@ Object { }, "range": Array [ 1, - 5, + 2, ], "type": "Identifier", - "value": "eval", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { @@ -4945,16 +4601,16 @@ Object { "line": 1, }, "start": Object { - "column": 5, + "column": 4, "line": 1, }, }, "range": Array [ - 5, + 4, 6, ], "type": "Punctuator", - "value": ",", + "value": "=>", }, Object { "loc": Object { @@ -4971,8 +4627,8 @@ Object { 7, 8, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { @@ -4990,12 +4646,30 @@ Object { 9, ], "type": "Punctuator", - "value": ")", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, "line": 1, }, "start": Object { @@ -5005,15 +4679,33 @@ Object { }, "range": Array [ 10, - 12, + 11, ], "type": "Punctuator", - "value": "=>", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, "line": 1, }, "start": Object { @@ -5023,15 +4715,15 @@ Object { }, "range": Array [ 13, - 15, + 14, ], - "type": "Numeric", - "value": "42", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 17, "line": 1, }, "start": Object { @@ -5041,217 +4733,169 @@ Object { }, "range": Array [ 15, - 16, + 17, ], "type": "Punctuator", - "value": ";", + "value": "=>", }, - ], - "type": "Program", -} -`; - -exports[`ecmaFeatures fixtures/arrowFunctions/not-strict-octal.src 1`] = ` -Object { - "body": Array [ Object { - "expression": Object { - "async": false, - "body": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 9, - ], - "raw": "00", - "type": "Literal", - "value": 0, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, }, - "expression": true, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, + "start": Object { + "column": 18, + "line": 1, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 1, - 2, - ], - "type": "Identifier", - }, - ], - "range": Array [ - 0, - 9, - ], - "type": "ArrowFunctionExpression", }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "(", + }, + Object { "loc": Object { "end": Object { - "column": 10, + "column": 20, "line": 1, }, "start": Object { - "column": 0, + "column": 19, "line": 1, }, }, "range": Array [ - 0, - 10, + 19, + 20, ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "x", }, - }, - "range": Array [ - 0, - 10, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 21, "line": 1, }, "start": Object { - "column": 0, + "column": 20, "line": 1, }, }, "range": Array [ - 0, - 1, + 20, + 21, ], "type": "Punctuator", - "value": "(", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 2, + "column": 23, "line": 1, }, "start": Object { - "column": 1, + "column": 22, "line": 1, }, }, "range": Array [ - 1, - 2, + 22, + 23, ], "type": "Identifier", - "value": "a", + "value": "y", }, Object { "loc": Object { "end": Object { - "column": 3, + "column": 24, "line": 1, }, "start": Object { - "column": 2, + "column": 23, "line": 1, }, }, "range": Array [ - 2, - 3, + 23, + 24, ], "type": "Punctuator", - "value": ")", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 26, "line": 1, }, "start": Object { - "column": 4, + "column": 25, "line": 1, }, }, "range": Array [ - 4, - 6, + 25, + 26, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, ], "type": "Punctuator", - "value": "=>", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 28, "line": 1, }, "start": Object { - "column": 7, + "column": 27, "line": 1, }, }, "range": Array [ - 7, - 9, + 27, + 28, ], - "type": "Numeric", - "value": "00", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 29, "line": 1, }, "start": Object { - "column": 9, + "column": 28, "line": 1, }, }, "range": Array [ - 9, - 10, + 28, + 29, ], "type": "Punctuator", "value": ";", @@ -5261,39 +4905,16 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/return-arrow-function.src 1`] = ` +exports[`ecmaFeatures fixtures/arrowFunctions/single-param.src 1`] = ` Object { "body": Array [ Object { "expression": Object { "async": false, "body": Object { - "async": false, - "body": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 12, - ], - "raw": "42", - "type": "Literal", - "value": 42, - }, - "expression": true, - "generator": false, - "id": null, "loc": Object { "end": Object { - "column": 12, + "column": 11, "line": 1, }, "start": Object { @@ -5301,38 +4922,20 @@ Object { "line": 1, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "y", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - ], "range": Array [ 5, - 12, + 11, ], - "type": "ArrowFunctionExpression", + "raw": "\\"test\\"", + "type": "Literal", + "value": "test", }, "expression": true, "generator": false, "id": null, "loc": Object { "end": Object { - "column": 12, + "column": 11, "line": 1, }, "start": Object { @@ -5352,7 +4955,7 @@ Object { "line": 1, }, }, - "name": "x", + "name": "e", "range": Array [ 0, 1, @@ -5362,13 +4965,13 @@ Object { ], "range": Array [ 0, - 12, + 11, ], "type": "ArrowFunctionExpression", }, "loc": Object { "end": Object { - "column": 13, + "column": 12, "line": 1, }, "start": Object { @@ -5378,14 +4981,14 @@ Object { }, "range": Array [ 0, - 13, + 12, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 13, + "column": 12, "line": 1, }, "start": Object { @@ -5395,7 +4998,7 @@ Object { }, "range": Array [ 0, - 13, + 12, ], "sourceType": "script", "tokens": Array [ @@ -5415,7 +5018,7 @@ Object { 1, ], "type": "Identifier", - "value": "x", + "value": "e", }, Object { "loc": Object { @@ -5438,7 +5041,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 6, + "column": 11, "line": 1, }, "start": Object { @@ -5448,28 +5051,10 @@ Object { }, "range": Array [ 5, - 6, - ], - "type": "Identifier", - "value": "y", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 9, + 11, ], - "type": "Punctuator", - "value": "=>", + "type": "String", + "value": "\\"test\\"", }, Object { "loc": Object { @@ -5478,31 +5063,13 @@ Object { "line": 1, }, "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 12, - ], - "type": "Numeric", - "value": "42", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, + "column": 11, "line": 1, }, }, "range": Array [ + 11, 12, - 13, ], "type": "Punctuator", "value": ";", @@ -5512,150 +5079,37 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/return-sequence.src 1`] = ` +exports[`ecmaFeatures fixtures/arrowFunctions/single-param-parens.src 1`] = ` Object { "body": Array [ Object { "expression": Object { "async": false, "body": Object { - "async": false, - "body": Object { - "expressions": Array [ - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "name": "y", - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - }, - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "name": "z", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - ], - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 26, - ], - "type": "SequenceExpression", - }, - "expression": true, - "generator": false, - "id": null, "loc": Object { "end": Object { - "column": 27, + "column": 13, "line": 1, }, "start": Object { - "column": 8, + "column": 7, "line": 1, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "y", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "z", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - ], "range": Array [ - 8, - 27, + 7, + 13, ], - "type": "ArrowFunctionExpression", + "raw": "\\"test\\"", + "type": "Literal", + "value": "test", }, "expression": true, "generator": false, "id": null, "loc": Object { "end": Object { - "column": 28, + "column": 13, "line": 1, }, "start": Object { @@ -5675,7 +5129,7 @@ Object { "line": 1, }, }, - "name": "x", + "name": "e", "range": Array [ 1, 2, @@ -5685,13 +5139,13 @@ Object { ], "range": Array [ 0, - 28, + 13, ], "type": "ArrowFunctionExpression", }, "loc": Object { "end": Object { - "column": 29, + "column": 14, "line": 1, }, "start": Object { @@ -5701,14 +5155,14 @@ Object { }, "range": Array [ 0, - 29, + 14, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 29, + "column": 14, "line": 1, }, "start": Object { @@ -5718,7 +5172,7 @@ Object { }, "range": Array [ 0, - 29, + 14, ], "sourceType": "script", "tokens": Array [ @@ -5756,7 +5210,7 @@ Object { 2, ], "type": "Identifier", - "value": "x", + "value": "e", }, Object { "loc": Object { @@ -5797,7 +5251,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, + "column": 13, "line": 1, }, "start": Object { @@ -5807,277 +5261,333 @@ Object { }, "range": Array [ 7, - 8, + 13, ], - "type": "Punctuator", - "value": "(", + "type": "String", + "value": "\\"test\\"", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 14, "line": 1, }, "start": Object { - "column": 8, + "column": 13, "line": 1, }, }, "range": Array [ - 8, - 9, + 13, + 14, ], "type": "Punctuator", - "value": "(", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/single-param-return-identifier.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, + "expression": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "earth", + "range": Array [ + 9, + 14, + ], + "type": "Identifier", }, - }, - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - "value": "y", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "sun", + "range": Array [ + 1, + 4, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 0, + 14, + ], + "type": "ArrowFunctionExpression", }, - "range": Array [ - 10, - 11, - ], - "type": "Punctuator", - "value": ",", - }, - Object { "loc": Object { "end": Object { - "column": 13, + "column": 15, "line": 1, }, "start": Object { - "column": 12, + "column": 0, "line": 1, }, }, "range": Array [ - 12, - 13, + 0, + 15, ], - "type": "Identifier", - "value": "z", + "type": "ExpressionStatement", }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 14, - ], - "type": "Punctuator", - "value": ")", + ], + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 15, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 17, + "column": 1, "line": 1, }, "start": Object { - "column": 15, + "column": 0, "line": 1, }, }, "range": Array [ - 15, - 17, + 0, + 1, ], "type": "Punctuator", - "value": "=>", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 4, "line": 1, }, "start": Object { - "column": 18, + "column": 1, "line": 1, }, }, "range": Array [ - 18, - 19, + 1, + 4, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "sun", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 5, "line": 1, }, "start": Object { - "column": 19, + "column": 4, "line": 1, }, }, "range": Array [ - 19, - 20, + 4, + 5, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 8, "line": 1, }, "start": Object { - "column": 20, + "column": 6, "line": 1, }, }, "range": Array [ - 20, - 21, + 6, + 8, ], "type": "Punctuator", - "value": ",", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 14, "line": 1, }, "start": Object { - "column": 22, + "column": 9, "line": 1, }, }, "range": Array [ - 22, - 23, + 9, + 14, ], "type": "Identifier", - "value": "y", + "value": "earth", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 15, "line": 1, }, "start": Object { - "column": 23, + "column": 14, "line": 1, }, }, "range": Array [ - 23, - 24, + 14, + 15, ], "type": "Punctuator", - "value": ",", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/binaryLiterals/invalid.src 1`] = `"';' expected."`; + +exports[`ecmaFeatures fixtures/binaryLiterals/lowercase.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, + "expression": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, }, + "range": Array [ + 0, + 5, + ], + "raw": "0b101", + "type": "Literal", + "value": 5, }, - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - "value": "z", - }, - Object { "loc": Object { "end": Object { - "column": 27, + "column": 6, "line": 1, }, "start": Object { - "column": 26, + "column": 0, "line": 1, }, }, "range": Array [ - 26, - 27, + 0, + 6, ], - "type": "Punctuator", - "value": ")", + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 7, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 28, + "column": 5, "line": 1, }, "start": Object { - "column": 27, + "column": 0, "line": 1, }, }, "range": Array [ - 27, - 28, + 0, + 5, ], - "type": "Punctuator", - "value": ")", + "type": "Numeric", + "value": "0b101", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 6, "line": 1, }, "start": Object { - "column": 28, + "column": 5, "line": 1, }, }, "range": Array [ - 28, - 29, + 5, + 6, ], "type": "Punctuator", "value": ";", @@ -6087,37 +5597,14 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/single-param.src 1`] = ` +exports[`ecmaFeatures fixtures/binaryLiterals/uppercase.src 1`] = ` Object { "body": Array [ Object { "expression": Object { - "async": false, - "body": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "range": Array [ - 5, - 11, - ], - "raw": "\\"test\\"", - "type": "Literal", - "value": "test", - }, - "expression": true, - "generator": false, - "id": null, "loc": Object { "end": Object { - "column": 11, + "column": 5, "line": 1, }, "start": Object { @@ -6125,35 +5612,17 @@ Object { "line": 1, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "name": "e", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", - }, - ], "range": Array [ 0, - 11, + 5, ], - "type": "ArrowFunctionExpression", + "raw": "0B101", + "type": "Literal", + "value": 5, }, "loc": Object { "end": Object { - "column": 12, + "column": 6, "line": 1, }, "start": Object { @@ -6163,15 +5632,15 @@ Object { }, "range": Array [ 0, - 12, + 6, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -6180,14 +5649,14 @@ Object { }, "range": Array [ 0, - 12, + 7, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 5, "line": 1, }, "start": Object { @@ -6197,33 +5666,15 @@ Object { }, "range": Array [ 0, - 1, - ], - "type": "Identifier", - "value": "e", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 1, - }, - "start": Object { - "column": 2, - "line": 1, - }, - }, - "range": Array [ - 2, - 4, + 5, ], - "type": "Punctuator", - "value": "=>", + "type": "Numeric", + "value": "0B101", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 6, "line": 1, }, "start": Object { @@ -6233,25 +5684,7 @@ Object { }, "range": Array [ 5, - 11, - ], - "type": "String", - "value": "\\"test\\"", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 12, + 6, ], "type": "Punctuator", "value": ";", @@ -6261,73 +5694,69 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/single-param-parens.src 1`] = ` +exports[`ecmaFeatures fixtures/blockBindings/const.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "async": false, - "body": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, }, + "name": "foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", }, - "range": Array [ - 7, - 13, - ], - "raw": "\\"test\\"", - "type": "Literal", - "value": "test", - }, - "expression": true, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ - Object { + "init": Object { "loc": Object { "end": Object { - "column": 2, + "column": 15, "line": 1, }, "start": Object { - "column": 1, + "column": 12, "line": 1, }, }, - "name": "e", + "name": "bar", "range": Array [ - 1, - 2, + 12, + 15, ], "type": "Identifier", }, - ], - "range": Array [ - 0, - 13, - ], - "type": "ArrowFunctionExpression", - }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 15, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", "loc": Object { "end": Object { - "column": 14, + "column": 16, "line": 1, }, "start": Object { @@ -6337,15 +5766,15 @@ Object { }, "range": Array [ 0, - 14, + 16, ], - "type": "ExpressionStatement", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -6354,14 +5783,14 @@ Object { }, "range": Array [ 0, - 14, + 17, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 5, "line": 1, }, "start": Object { @@ -6371,97 +5800,79 @@ Object { }, "range": Array [ 0, - 1, + 5, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 2, + "column": 9, "line": 1, }, "start": Object { - "column": 1, + "column": 6, "line": 1, }, }, "range": Array [ - 1, - 2, + 6, + 9, ], "type": "Identifier", - "value": "e", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 3, + "column": 11, "line": 1, }, "start": Object { - "column": 2, + "column": 10, "line": 1, }, }, "range": Array [ - 2, - 3, + 10, + 11, ], "type": "Punctuator", - "value": ")", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 15, "line": 1, }, "start": Object { - "column": 4, + "column": 12, "line": 1, }, }, "range": Array [ - 4, - 6, + 12, + 15, ], - "type": "Punctuator", - "value": "=>", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 16, "line": 1, }, "start": Object { - "column": 7, + "column": 15, "line": 1, }, }, "range": Array [ - 7, - 13, - ], - "type": "String", - "value": "\\"test\\"", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 14, + 15, + 16, ], "type": "Punctuator", "value": ";", @@ -6471,72 +5882,69 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/single-param-return-identifier.src 1`] = ` +exports[`ecmaFeatures fixtures/blockBindings/let.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "async": false, - "body": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, }, + "name": "foo", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", }, - "name": "earth", - "range": Array [ - 9, - 14, - ], - "type": "Identifier", - }, - "expression": true, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ - Object { + "init": Object { "loc": Object { "end": Object { - "column": 4, + "column": 13, "line": 1, }, "start": Object { - "column": 1, + "column": 10, "line": 1, }, }, - "name": "sun", + "name": "bar", "range": Array [ - 1, - 4, + 10, + 13, ], "type": "Identifier", }, - ], - "range": Array [ - 0, - 14, - ], - "type": "ArrowFunctionExpression", - }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 13, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", "loc": Object { "end": Object { - "column": 15, + "column": 14, "line": 1, }, "start": Object { @@ -6546,15 +5954,15 @@ Object { }, "range": Array [ 0, - 15, + 14, ], - "type": "ExpressionStatement", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -6570,7 +5978,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 1, + "column": 3, "line": 1, }, "start": Object { @@ -6580,97 +5988,79 @@ Object { }, "range": Array [ 0, - 1, + 3, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 4, + "column": 7, "line": 1, }, "start": Object { - "column": 1, + "column": 4, "line": 1, }, }, "range": Array [ - 1, 4, + 7, ], "type": "Identifier", - "value": "sun", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 9, "line": 1, }, "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 5, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { "column": 8, "line": 1, }, - "start": Object { - "column": 6, - "line": 1, - }, }, "range": Array [ - 6, 8, + 9, ], "type": "Punctuator", - "value": "=>", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 13, "line": 1, }, "start": Object { - "column": 9, + "column": 10, "line": 1, }, }, "range": Array [ - 9, - 14, + 10, + 13, ], "type": "Identifier", - "value": "earth", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 14, "line": 1, }, "start": Object { - "column": 14, + "column": 13, "line": 1, }, }, "range": Array [ + 13, 14, - 15, ], "type": "Punctuator", "value": ";", @@ -6680,34 +6070,163 @@ Object { } `; -exports[`ecmaFeatures fixtures/binaryLiterals/invalid.src 1`] = `"';' expected."`; - -exports[`ecmaFeatures fixtures/binaryLiterals/lowercase.src 1`] = ` +exports[`ecmaFeatures fixtures/blockBindings/let-in-switchcase.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { + "cases": Array [ + Object { + "consequent": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "name": "t", + "range": Array [ + 31, + 32, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 37, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 37, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 38, + ], + "type": "VariableDeclaration", + }, + Object { + "label": null, + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 45, + ], + "type": "BreakStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 45, + ], + "test": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 25, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, + "type": "SwitchCase", + }, + ], + "discriminant": Object { "loc": Object { "end": Object { - "column": 5, + "column": 14, "line": 1, }, "start": Object { - "column": 0, + "column": 8, "line": 1, }, }, + "name": "answer", "range": Array [ - 0, - 5, + 8, + 14, ], - "raw": "0b101", - "type": "Literal", - "value": 5, + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 6, + "column": 47, "line": 1, }, "start": Object { @@ -6717,9 +6236,9 @@ Object { }, "range": Array [ 0, - 6, + 47, ], - "type": "ExpressionStatement", + "type": "SwitchStatement", }, ], "loc": Object { @@ -6734,14 +6253,14 @@ Object { }, "range": Array [ 0, - 7, + 48, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 6, "line": 1, }, "start": Object { @@ -6751,647 +6270,471 @@ Object { }, "range": Array [ 0, - 5, + 6, ], - "type": "Numeric", - "value": "0b101", + "type": "Keyword", + "value": "switch", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 8, "line": 1, }, "start": Object { - "column": 5, + "column": 7, "line": 1, }, }, "range": Array [ - 5, - 6, + 7, + 8, ], "type": "Punctuator", - "value": ";", + "value": "(", }, - ], - "type": "Program", -} -`; - -exports[`ecmaFeatures fixtures/binaryLiterals/uppercase.src 1`] = ` -Object { - "body": Array [ Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 5, - ], - "raw": "0B101", - "type": "Literal", - "value": 5, - }, "loc": Object { "end": Object { - "column": 6, + "column": 14, "line": 1, }, "start": Object { - "column": 0, + "column": 8, "line": 1, }, }, "range": Array [ - 0, - 6, + 8, + 14, ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "answer", }, - }, - "range": Array [ - 0, - 7, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 15, "line": 1, }, "start": Object { - "column": 0, + "column": 14, "line": 1, }, }, "range": Array [ - 0, - 5, + 14, + 15, ], - "type": "Numeric", - "value": "0B101", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 17, "line": 1, }, "start": Object { - "column": 5, + "column": 16, "line": 1, }, }, "range": Array [ - 5, - 6, + 16, + 17, ], "type": "Punctuator", - "value": ";", + "value": "{", }, - ], - "type": "Program", -} -`; - -exports[`ecmaFeatures fixtures/blockBindings/const.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 12, - 15, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 15, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", "loc": Object { "end": Object { - "column": 16, + "column": 22, "line": 1, }, "start": Object { - "column": 0, + "column": 18, "line": 1, }, }, "range": Array [ - 0, - 16, + 18, + 22, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Keyword", + "value": "case", }, - }, - "range": Array [ - 0, - 17, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 25, "line": 1, }, "start": Object { - "column": 0, + "column": 23, "line": 1, }, }, "range": Array [ - 0, - 5, + 23, + 25, ], - "type": "Keyword", - "value": "const", + "type": "Numeric", + "value": "42", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 26, "line": 1, }, "start": Object { - "column": 6, + "column": 25, "line": 1, }, }, "range": Array [ - 6, - 9, + 25, + 26, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 30, "line": 1, }, "start": Object { - "column": 10, + "column": 27, "line": 1, }, }, "range": Array [ - 10, - 11, + 27, + 30, ], - "type": "Punctuator", - "value": "=", + "type": "Keyword", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 32, "line": 1, }, "start": Object { - "column": 12, + "column": 31, "line": 1, }, }, "range": Array [ - 12, - 15, + 31, + 32, ], "type": "Identifier", - "value": "bar", + "value": "t", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 34, "line": 1, }, "start": Object { - "column": 15, + "column": 33, "line": 1, }, }, "range": Array [ - 15, - 16, + 33, + 34, ], "type": "Punctuator", - "value": ";", + "value": "=", }, - ], - "type": "Program", -} -`; - -exports[`ecmaFeatures fixtures/blockBindings/let.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 10, - 13, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 13, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "let", "loc": Object { "end": Object { - "column": 14, + "column": 37, "line": 1, }, "start": Object { - "column": 0, + "column": 35, "line": 1, }, }, "range": Array [ - 0, - 14, + 35, + 37, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Numeric", + "value": "42", }, - }, - "range": Array [ - 0, - 15, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 38, "line": 1, }, "start": Object { - "column": 0, + "column": 37, "line": 1, }, }, "range": Array [ - 0, - 3, + 37, + 38, ], - "type": "Keyword", - "value": "let", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 44, "line": 1, }, "start": Object { - "column": 4, + "column": 39, "line": 1, }, }, "range": Array [ - 4, - 7, + 39, + 44, ], - "type": "Identifier", - "value": "foo", + "type": "Keyword", + "value": "break", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 45, "line": 1, }, "start": Object { - "column": 8, + "column": 44, "line": 1, }, }, "range": Array [ - 8, - 9, + 44, + 45, ], "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 13, - ], - "type": "Identifier", - "value": "bar", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 47, "line": 1, }, "start": Object { - "column": 13, + "column": 46, "line": 1, }, }, "range": Array [ - 13, - 14, + 46, + 47, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`ecmaFeatures fixtures/blockBindings/let-in-switchcase.src 1`] = ` +exports[`ecmaFeatures fixtures/classes/class-accessor-properties.src 1`] = ` Object { "body": Array [ Object { - "cases": Array [ - Object { - "consequent": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 31, - "line": 1, - }, - }, - "name": "t", - "range": Array [ - 31, - 32, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 35, - "line": 1, - }, - }, - "range": Array [ - 35, - 37, - ], - "raw": "42", - "type": "Literal", - "value": 42, + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "kind": "get", + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 18, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 18, + "line": 1, }, - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 31, - "line": 1, - }, + "start": Object { + "column": 16, + "line": 1, }, - "range": Array [ - 31, - 37, - ], - "type": "VariableDeclarator", }, - ], - "kind": "let", + "range": Array [ + 16, + 18, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 38, + "column": 18, "line": 1, }, "start": Object { - "column": 27, + "column": 14, "line": 1, }, }, + "params": Array [], "range": Array [ - 27, - 38, + 14, + 18, ], - "type": "VariableDeclaration", + "type": "FunctionExpression", }, - Object { - "label": null, + }, + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 45, + "column": 24, "line": 1, }, "start": Object { - "column": 39, + "column": 23, "line": 1, }, }, + "name": "b", "range": Array [ - 39, - 45, + 23, + 24, ], - "type": "BreakStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 45, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, + "type": "Identifier", }, - }, - "range": Array [ - 18, - 45, - ], - "test": Object { + "kind": "set", "loc": Object { "end": Object { - "column": 25, + "column": 29, "line": 1, }, "start": Object { - "column": 23, + "column": 19, "line": 1, }, }, "range": Array [ - 23, - 25, + 19, + 29, ], - "raw": "42", - "type": "Literal", - "value": 42, + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 29, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "c", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 24, + 29, + ], + "type": "FunctionExpression", + }, }, - "type": "SwitchCase", - }, - ], - "discriminant": Object { + ], "loc": Object { "end": Object { - "column": 14, + "column": 31, "line": 1, }, "start": Object { @@ -7399,16 +6742,33 @@ Object { "line": 1, }, }, - "name": "answer", "range": Array [ 8, - 14, + 31, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 47, + "column": 31, "line": 1, }, "start": Object { @@ -7418,15 +6778,33 @@ Object { }, "range": Array [ 0, - 47, + 31, ], - "type": "SwitchStatement", + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "EmptyStatement", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 2, + "column": 32, + "line": 1, }, "start": Object { "column": 0, @@ -7435,14 +6813,14 @@ Object { }, "range": Array [ 0, - 48, + 32, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 5, "line": 1, }, "start": Object { @@ -7452,28 +6830,64 @@ Object { }, "range": Array [ 0, - 6, + 5, ], "type": "Keyword", - "value": "switch", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 7, "line": 1, }, "start": Object { - "column": 7, + "column": 6, "line": 1, }, }, "range": Array [ + 6, 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ 8, + 9, ], "type": "Punctuator", - "value": "(", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + "value": "get", }, Object { "loc": Object { @@ -7482,16 +6896,16 @@ Object { "line": 1, }, "start": Object { - "column": 8, + "column": 13, "line": 1, }, }, "range": Array [ - 8, + 13, 14, ], "type": "Identifier", - "value": "answer", + "value": "a", }, Object { "loc": Object { @@ -7509,6 +6923,24 @@ Object { 15, ], "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", "value": ")", }, Object { @@ -7532,236 +6964,236 @@ Object { Object { "loc": Object { "end": Object { - "column": 22, + "column": 18, "line": 1, }, "start": Object { - "column": 18, + "column": 17, "line": 1, }, }, "range": Array [ + 17, 18, - 22, ], - "type": "Keyword", - "value": "case", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 22, "line": 1, }, "start": Object { - "column": 23, + "column": 19, "line": 1, }, }, "range": Array [ - 23, - 25, + 19, + 22, ], - "type": "Numeric", - "value": "42", + "type": "Identifier", + "value": "set", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 24, "line": 1, }, "start": Object { - "column": 25, + "column": 23, "line": 1, }, }, "range": Array [ - 25, - 26, + 23, + 24, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 25, "line": 1, }, "start": Object { - "column": 27, + "column": 24, "line": 1, }, }, "range": Array [ - 27, - 30, + 24, + 25, ], - "type": "Keyword", - "value": "let", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 32, + "column": 26, "line": 1, }, "start": Object { - "column": 31, + "column": 25, "line": 1, }, }, "range": Array [ - 31, - 32, + 25, + 26, ], "type": "Identifier", - "value": "t", + "value": "c", }, Object { "loc": Object { "end": Object { - "column": 34, + "column": 27, "line": 1, }, "start": Object { - "column": 33, + "column": 26, "line": 1, }, }, "range": Array [ - 33, - 34, + 26, + 27, ], "type": "Punctuator", - "value": "=", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 37, + "column": 28, "line": 1, }, "start": Object { - "column": 35, + "column": 27, "line": 1, }, }, "range": Array [ - 35, - 37, + 27, + 28, ], - "type": "Numeric", - "value": "42", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 38, + "column": 29, "line": 1, }, "start": Object { - "column": 37, + "column": 28, "line": 1, }, }, "range": Array [ - 37, - 38, + 28, + 29, ], "type": "Punctuator", - "value": ";", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 44, + "column": 30, "line": 1, }, "start": Object { - "column": 39, + "column": 29, "line": 1, }, }, "range": Array [ - 39, - 44, + 29, + 30, ], - "type": "Keyword", - "value": "break", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 45, + "column": 31, "line": 1, }, "start": Object { - "column": 44, + "column": 30, "line": 1, }, }, "range": Array [ - 44, - 45, + 30, + 31, ], "type": "Punctuator", - "value": ";", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 47, + "column": 32, "line": 1, }, "start": Object { - "column": 46, + "column": 31, "line": 1, }, }, "range": Array [ - 46, - 47, + 31, + 32, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`ecmaFeatures fixtures/classes/class-accessor-properties.src 1`] = ` +exports[`ecmaFeatures fixtures/classes/class-computed-static-method.src 1`] = ` Object { "body": Array [ Object { "body": Object { "body": Array [ Object { - "computed": false, + "computed": true, "key": Object { "loc": Object { "end": Object { - "column": 14, + "column": 18, "line": 1, }, "start": Object { - "column": 13, + "column": 17, "line": 1, }, }, "name": "a", "range": Array [ - 13, - 14, + 17, + 18, ], "type": "Identifier", }, - "kind": "get", + "kind": "method", "loc": Object { "end": Object { - "column": 18, + "column": 23, "line": 1, }, "start": Object { @@ -7771,9 +7203,9 @@ Object { }, "range": Array [ 9, - 18, + 23, ], - "static": false, + "static": true, "type": "MethodDefinition", "value": Object { "async": false, @@ -7781,17 +7213,17 @@ Object { "body": Array [], "loc": Object { "end": Object { - "column": 18, + "column": 23, "line": 1, }, "start": Object { - "column": 16, + "column": 21, "line": 1, }, }, "range": Array [ - 16, - 18, + 21, + 23, ], "type": "BlockStatement", }, @@ -7800,115 +7232,18 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 18, + "column": 23, "line": 1, }, "start": Object { - "column": 14, + "column": 19, "line": 1, }, }, "params": Array [], "range": Array [ - 14, - 18, - ], - "type": "FunctionExpression", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "name": "b", - "range": Array [ + 19, 23, - 24, - ], - "type": "Identifier", - }, - "kind": "set", - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 29, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 27, - "line": 1, - }, - }, - "range": Array [ - 27, - 29, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "name": "c", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - ], - "range": Array [ - 24, - 29, ], "type": "FunctionExpression", }, @@ -7916,7 +7251,7 @@ Object { ], "loc": Object { "end": Object { - "column": 31, + "column": 25, "line": 1, }, "start": Object { @@ -7926,7 +7261,7 @@ Object { }, "range": Array [ 8, - 31, + 25, ], "type": "ClassBody", }, @@ -7950,7 +7285,7 @@ Object { }, "loc": Object { "end": Object { - "column": 31, + "column": 25, "line": 1, }, "start": Object { @@ -7960,7 +7295,7 @@ Object { }, "range": Array [ 0, - 31, + 25, ], "superClass": null, "type": "ClassDeclaration", @@ -7968,24 +7303,24 @@ Object { Object { "loc": Object { "end": Object { - "column": 32, + "column": 26, "line": 1, }, "start": Object { - "column": 31, + "column": 25, "line": 1, }, }, "range": Array [ - 31, - 32, + 25, + 26, ], "type": "EmptyStatement", }, ], "loc": Object { "end": Object { - "column": 32, + "column": 26, "line": 1, }, "start": Object { @@ -7995,7 +7330,7 @@ Object { }, "range": Array [ 0, - 32, + 26, ], "sourceType": "script", "tokens": Array [ @@ -8056,7 +7391,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 15, "line": 1, }, "start": Object { @@ -8066,64 +7401,10 @@ Object { }, "range": Array [ 9, - 12, - ], - "type": "Identifier", - "value": "get", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - "value": "a", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 15, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ 15, - 16, ], - "type": "Punctuator", - "value": ")", + "type": "Keyword", + "value": "static", }, Object { "loc": Object { @@ -8141,7 +7422,7 @@ Object { 17, ], "type": "Punctuator", - "value": "{", + "value": "[", }, Object { "loc": Object { @@ -8158,59 +7439,41 @@ Object { 17, 18, ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 22, - ], "type": "Identifier", - "value": "set", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 19, "line": 1, }, "start": Object { - "column": 23, + "column": 18, "line": 1, }, }, "range": Array [ - 23, - 24, + 18, + 19, ], - "type": "Identifier", - "value": "b", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 20, "line": 1, }, "start": Object { - "column": 24, + "column": 19, "line": 1, }, }, "range": Array [ - 24, - 25, + 19, + 20, ], "type": "Punctuator", "value": "(", @@ -8218,35 +7481,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - "value": "c", - }, - Object { - "loc": Object { - "end": Object { - "column": 27, + "column": 21, "line": 1, }, "start": Object { - "column": 26, + "column": 20, "line": 1, }, }, "range": Array [ - 26, - 27, + 20, + 21, ], "type": "Punctuator", "value": ")", @@ -8254,17 +7499,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 28, + "column": 22, "line": 1, }, "start": Object { - "column": 27, + "column": 21, "line": 1, }, }, "range": Array [ - 27, - 28, + 21, + 22, ], "type": "Punctuator", "value": "{", @@ -8272,17 +7517,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 29, + "column": 23, "line": 1, }, "start": Object { - "column": 28, + "column": 22, "line": 1, }, }, "range": Array [ - 28, - 29, + 22, + 23, ], "type": "Punctuator", "value": "}", @@ -8290,17 +7535,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 30, + "column": 24, "line": 1, }, "start": Object { - "column": 29, + "column": 23, "line": 1, }, }, "range": Array [ - 29, - 30, + 23, + 24, ], "type": "Punctuator", "value": ";", @@ -8308,17 +7553,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 31, + "column": 25, "line": 1, }, "start": Object { - "column": 30, + "column": 24, "line": 1, }, }, "range": Array [ - 30, - 31, + 24, + 25, ], "type": "Punctuator", "value": "}", @@ -8326,17 +7571,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 32, + "column": 26, "line": 1, }, "start": Object { - "column": 31, + "column": 25, "line": 1, }, }, "range": Array [ - 31, - 32, + 25, + 26, ], "type": "Punctuator", "value": ";", @@ -8346,434 +7591,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/classes/class-computed-static-method.src 1`] = ` -Object { - "body": Array [ - Object { - "body": Object { - "body": Array [ - Object { - "computed": true, - "key": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - "kind": "method", - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 23, - ], - "static": true, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 23, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 19, - 23, - ], - "type": "FunctionExpression", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 25, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 25, - ], - "superClass": null, - "type": "ClassDeclaration", - }, - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 26, - ], - "type": "EmptyStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 26, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 5, - ], - "type": "Keyword", - "value": "class", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - "value": "A", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 9, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 15, - ], - "type": "Keyword", - "value": "static", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 17, - ], - "type": "Punctuator", - "value": "[", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - "value": "a", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 19, - ], - "type": "Punctuator", - "value": "]", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 20, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 21, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 22, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 23, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 24, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 25, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 26, - ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`ecmaFeatures fixtures/classes/class-expression.src 1`] = ` +exports[`ecmaFeatures fixtures/classes/class-expression.src 1`] = ` Object { "body": Array [ Object { @@ -88770,107 +87588,669 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, - "line": 6, + "column": 8, + "line": 6, + }, + "start": Object { + "column": 7, + "line": 6, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "range": Array [ + 51, + 54, + ], + "type": "Identifier", + "value": "get", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 7, + }, + "start": Object { + "column": 7, + "line": 7, + }, + }, + "range": Array [ + 54, + 55, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "range": Array [ + 60, + 63, + ], + "type": "Identifier", + "value": "set", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 9, + }, + }, + "range": Array [ + 64, + 65, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 9, + }, + "start": Object { + "column": 1, + "line": 9, + }, + }, + "range": Array [ + 65, + 66, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/octalLiterals/invalid.src 1`] = `"';' expected."`; + +exports[`ecmaFeatures fixtures/octalLiterals/lowercase.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "raw": "0o717", + "type": "Literal", + "value": 463, + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Numeric", + "value": "0o717", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/octalLiterals/strict-uppercase.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 14, + 19, + ], + "raw": "0O717", + "type": "Literal", + "value": 463, + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 14, + 20, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "type": "String", + "value": "\\"use strict\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 14, + 19, + ], + "type": "Numeric", + "value": "0O717", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/octalLiterals/uppercase.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "raw": "0O717", + "type": "Literal", + "value": 463, + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Numeric", + "value": "0O717", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/regex/regexp-simple.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 16, + ], + "raw": "/foo./", + "regex": Object { + "flags": "", + "pattern": "foo.", + }, + "type": "Literal", + "value": Object {}, + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 16, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, }, "start": Object { - "column": 7, - "line": 6, + "column": 0, + "line": 1, }, }, "range": Array [ - 45, - 46, + 0, + 3, ], - "type": "Punctuator", - "value": ",", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { "column": 7, - "line": 7, + "line": 1, }, "start": Object { "column": 4, - "line": 7, + "line": 1, }, }, "range": Array [ - 51, - 54, + 4, + 7, ], "type": "Identifier", - "value": "get", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 7, + "column": 9, + "line": 1, }, "start": Object { - "column": 7, - "line": 7, + "column": 8, + "line": 1, }, }, "range": Array [ - 54, - 55, + 8, + 9, ], "type": "Punctuator", - "value": ",", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 8, + "column": 16, + "line": 1, }, "start": Object { - "column": 4, - "line": 8, + "column": 10, + "line": 1, }, }, "range": Array [ - 60, - 63, + 10, + 16, ], - "type": "Identifier", - "value": "set", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 9, - }, - "start": Object { - "column": 0, - "line": 9, - }, + "regex": Object { + "flags": "", + "pattern": "foo.", }, - "range": Array [ - 64, - 65, - ], - "type": "Punctuator", - "value": "}", + "type": "RegularExpression", + "value": "/foo./", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 9, + "column": 17, + "line": 1, }, "start": Object { - "column": 1, - "line": 9, + "column": 16, + "line": 1, }, }, "range": Array [ - 65, - 66, + 16, + 17, ], "type": "Punctuator", "value": ";", @@ -88880,34 +88260,74 @@ Object { } `; -exports[`ecmaFeatures fixtures/octalLiterals/invalid.src 1`] = `"';' expected."`; - -exports[`ecmaFeatures fixtures/octalLiterals/lowercase.src 1`] = ` +exports[`ecmaFeatures fixtures/regexUFlag/regex-u-extended-escape.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", }, - "start": Object { - "column": 0, - "line": 1, + "init": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 40, + ], + "raw": "/[\\\\u{0000000000000061}-\\\\u{7A}]/u", + "regex": Object { + "flags": "u", + "pattern": "[\\\\u{0000000000000061}-\\\\u{7A}]", + }, + "type": "Literal", + "value": Object {}, + }, + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, }, + "range": Array [ + 4, + 40, + ], + "type": "VariableDeclarator", }, - "range": Array [ - 0, - 5, - ], - "raw": "0o717", - "type": "Literal", - "value": 463, - }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 6, + "column": 41, "line": 1, }, "start": Object { @@ -88917,9 +88337,9 @@ Object { }, "range": Array [ 0, - 6, + 41, ], - "type": "ExpressionStatement", + "type": "VariableDeclaration", }, ], "loc": Object { @@ -88934,14 +88354,14 @@ Object { }, "range": Array [ 0, - 7, + 42, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 3, "line": 1, }, "start": Object { @@ -88951,114 +88371,178 @@ Object { }, "range": Array [ 0, - 5, + 3, ], - "type": "Numeric", - "value": "0o717", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 5, "line": 1, }, "start": Object { - "column": 5, + "column": 4, "line": 1, }, }, "range": Array [ + 4, 5, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ 6, + 7, ], "type": "Punctuator", - "value": ";", + "value": "=", }, - ], - "type": "Program", -} -`; - -exports[`ecmaFeatures fixtures/octalLiterals/strict-uppercase.src 1`] = ` -Object { - "body": Array [ Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 40, + "line": 1, }, - "range": Array [ - 0, - 12, - ], - "raw": "\\"use strict\\"", - "type": "Literal", - "value": "use strict", + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 40, + ], + "regex": Object { + "flags": "u", + "pattern": "[\\\\u{0000000000000061}-\\\\u{7A}]", }, + "type": "RegularExpression", + "value": "/[\\\\u{0000000000000061}-\\\\u{7A}]/u", + }, + Object { "loc": Object { "end": Object { - "column": 13, + "column": 41, "line": 1, }, "start": Object { - "column": 0, + "column": 40, "line": 1, }, }, "range": Array [ - 0, - 13, + 40, + 41, ], - "type": "ExpressionStatement", + "type": "Punctuator", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/regexUFlag/regex-u-simple.src 1`] = ` +Object { + "body": Array [ Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 2, + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", }, - "start": Object { - "column": 0, - "line": 2, + "init": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 16, + ], + "raw": "/foo/u", + "regex": Object { + "flags": "u", + "pattern": "foo", + }, + "type": "Literal", + "value": Object {}, + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, }, + "range": Array [ + 4, + 16, + ], + "type": "VariableDeclarator", }, - "range": Array [ - 14, - 19, - ], - "raw": "0O717", - "type": "Literal", - "value": 463, - }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 6, - "line": 2, + "column": 17, + "line": 1, }, "start": Object { "column": 0, - "line": 2, + "line": 1, }, }, "range": Array [ - 14, - 20, + 0, + 17, ], - "type": "ExpressionStatement", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 3, + "line": 2, }, "start": Object { "column": 0, @@ -89067,14 +88551,14 @@ Object { }, "range": Array [ 0, - 21, + 18, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 12, + "column": 3, "line": 1, }, "start": Object { @@ -89084,158 +88568,83 @@ Object { }, "range": Array [ 0, - 12, + 3, ], - "type": "String", - "value": "\\"use strict\\"", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 7, "line": 1, }, "start": Object { - "column": 12, + "column": 4, "line": 1, }, }, "range": Array [ - 12, - 13, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ - 14, - 19, - ], - "type": "Numeric", - "value": "0O717", - }, - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, - }, - }, - "range": Array [ - 19, - 20, + 4, + 7, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "foo", }, - ], - "type": "Program", -} -`; - -exports[`ecmaFeatures fixtures/octalLiterals/uppercase.src 1`] = ` -Object { - "body": Array [ Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 5, - ], - "raw": "0O717", - "type": "Literal", - "value": 463, - }, "loc": Object { "end": Object { - "column": 6, + "column": 9, "line": 1, }, "start": Object { - "column": 0, + "column": 8, "line": 1, }, }, "range": Array [ - 0, - 6, + 8, + 9, ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "=", }, - }, - "range": Array [ - 0, - 7, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 16, "line": 1, }, "start": Object { - "column": 0, + "column": 10, "line": 1, }, }, "range": Array [ - 0, - 5, + 10, + 16, ], - "type": "Numeric", - "value": "0O717", + "regex": Object { + "flags": "u", + "pattern": "foo", + }, + "type": "RegularExpression", + "value": "/foo/u", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 17, "line": 1, }, "start": Object { - "column": 5, + "column": 16, "line": 1, }, }, "range": Array [ - 5, - 6, + 16, + 17, ], "type": "Punctuator", "value": ";", @@ -89245,7 +88654,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/regex/regexp-simple.src 1`] = ` +exports[`ecmaFeatures fixtures/regexYFlag/regexp-y-simple.src 1`] = ` Object { "body": Array [ Object { @@ -89284,10 +88693,10 @@ Object { 10, 16, ], - "raw": "/foo./", + "raw": "/foo/y", "regex": Object { - "flags": "", - "pattern": "foo.", + "flags": "y", + "pattern": "foo", }, "type": "Literal", "value": Object {}, @@ -89413,11 +88822,11 @@ Object { 16, ], "regex": Object { - "flags": "", - "pattern": "foo.", + "flags": "y", + "pattern": "foo", }, "type": "RegularExpression", - "value": "/foo./", + "value": "/foo/y", }, Object { "loc": Object { diff --git a/tests/lib/ecma-features.js b/tests/lib/ecma-features.js index 8e41717..8b12884 100644 --- a/tests/lib/ecma-features.js +++ b/tests/lib/ecma-features.js @@ -28,12 +28,6 @@ const testFiles = shelljs.find(FIXTURES_DIR) .map(filename => filename.substring(FIXTURES_DIR.length - 1, filename.length - 7)) .filter(filename => !(/error-|invalid-|globalReturn/.test(filename))); -const regexFilenames = [ - "regexYFlag/regexp-y-simple", - "regexUFlag/regex-u-simple", - "regexUFlag/regex-u-extended-escape" -]; - //------------------------------------------------------------------------------ // Tests //------------------------------------------------------------------------------ @@ -54,43 +48,9 @@ describe("ecmaFeatures", () => { errorOnUnknownASTType: true }; - if (regexFilenames.indexOf(filename) === -1) { - test(`fixtures/${filename}.src`, () => { - config.ecmaFeatures[feature] = true; - testUtils.createSnapshotTestBlock(code, config)(); - }); - return; - } - - /** - * Some regexp flags have different ASTs depending on the current node version, - * so we need to account for this in our test cases. - * - * NOTE: When running the tests for node v5, for example, the snapshots for node v6 - * are irrelevant. Therefore, in order to prevent Jest from marking them as obsolete - * (which would cause the tests to exit with code 1), we make use of `test.skip`. - */ - const nodeVersions = process.versions; - const nodeVersionParts = nodeVersions.node.split("."); - const nodeMajorVersion = parseInt(nodeVersionParts[0], 10); - const NODE_6_AND_ABOVE = `REGEXP FLAG - NODE VERSION >=6: fixtures/${filename}.src`; - const NODE_PRE_6 = `REGEXP FLAG - NODE VERSION <6: fixtures/${filename}.src`; - - if (nodeMajorVersion >= 6) { - test.skip(NODE_PRE_6); - test(NODE_6_AND_ABOVE, () => { - config.ecmaFeatures[feature] = true; - testUtils.createSnapshotTestBlock(code, config)(); - }); - } else { - test.skip(NODE_6_AND_ABOVE); - test(NODE_PRE_6, () => { - config.ecmaFeatures[feature] = true; - testUtils.createSnapshotTestBlock(code, config)(); - }); - } - + test(`fixtures/${filename}.src`, () => { + config.ecmaFeatures[feature] = true; + testUtils.createSnapshotTestBlock(code, config)(); + }); }); - - });