From fd79ac58798bdb52e918639494f7d39353484dc3 Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Mon, 27 Oct 2014 02:20:23 +0200 Subject: [PATCH 01/47] Move comprehension support under `ecmaVersion: 7` as per spec. --- acorn.js | 4 ++-- test/tests-harmony.js | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/acorn.js b/acorn.js index 4bcb199a42..a36b5dac1a 100644 --- a/acorn.js +++ b/acorn.js @@ -2024,7 +2024,7 @@ var tokStartLoc1 = tokStartLoc, tokStart1 = tokStart, val, exprList; next(); // check whether this is generator comprehension or regular expression - if (options.ecmaVersion >= 6 && tokType === _for) { + if (options.ecmaVersion >= 7 && tokType === _for) { val = parseComprehension(startNodeAt(start), true); } else { var oldParenL = ++metParenL; @@ -2061,7 +2061,7 @@ var node = startNode(); next(); // check whether this is array comprehension or regular array - if (options.ecmaVersion >= 6 && tokType === _for) { + if (options.ecmaVersion >= 7 && tokType === _for) { return parseComprehension(node, false); } node.elements = parseExprList(_bracketR, true, true); diff --git a/test/tests-harmony.js b/test/tests-harmony.js index 1a883ee051..66a802be25 100644 --- a/test/tests-harmony.js +++ b/test/tests-harmony.js @@ -3577,7 +3577,7 @@ test("[for (x of array) x]", { end: {line: 1, column: 20} } }, { - ecmaVersion: 6, + ecmaVersion: 7, ranges: true, locations: true }); @@ -3699,7 +3699,7 @@ test("[for (x of array) for (y of array2) if (x === test) x]", { end: {line: 1, column: 54} } }, { - ecmaVersion: 6, + ecmaVersion: 7, ranges: true, locations: true }); @@ -3821,7 +3821,7 @@ test("(for (x of array) for (y of array2) if (x === test) x)", { end: {line: 1, column: 54} } }, { - ecmaVersion: 6, + ecmaVersion: 7, ranges: true, locations: true }); @@ -4025,7 +4025,7 @@ test("[for ([,x] of array) for ({[start.x]: x, [start.y]: y} of array2) x]", { end: {line: 1, column: 68} } }, { - ecmaVersion: 6, + ecmaVersion: 7, ranges: true, locations: true }); @@ -15127,17 +15127,17 @@ testFail("`hello ${10;test`", "Unexpected token (1:11)", {ecmaVersion: 6}); testFail("function a() 1 // expression closure is not supported", "Unexpected token (1:13)", {ecmaVersion: 6}); -testFail("[for (let x of []) x]", "Unexpected token (1:6)", {ecmaVersion: 6}); +testFail("[for (let x of []) x]", "Unexpected token (1:6)", {ecmaVersion: 7}); -testFail("[for (const x of []) x]", "Unexpected token (1:6)", {ecmaVersion: 6}); +testFail("[for (const x of []) x]", "Unexpected token (1:6)", {ecmaVersion: 7}); -testFail("[for (var x of []) x]", "Unexpected token (1:6)", {ecmaVersion: 6}); +testFail("[for (var x of []) x]", "Unexpected token (1:6)", {ecmaVersion: 7}); -testFail("[for (a in []) x] // (a,b) ", "Unexpected token (1:8)", {ecmaVersion: 6}); +testFail("[for (a in []) x] // (a,b) ", "Unexpected token (1:8)", {ecmaVersion: 7}); testFail("var a = [if (x) x]", "Unexpected token (1:9)", {ecmaVersion: 6}); -testFail("[for (x of [])] // no expression", "Unexpected token (1:14)", {ecmaVersion: 6}); +testFail("[for (x of [])] // no expression", "Unexpected token (1:14)", {ecmaVersion: 7}); testFail("({ \"chance\" }) = obj", "Unexpected token (1:12)", {ecmaVersion: 6}); @@ -15412,4 +15412,4 @@ test("(for (x of array) for (y of array2) if (x === test) x)", { type: "ComprehensionExpression" } }] -}, {ecmaVersion: 6, preserveParens: true}); +}, {ecmaVersion: 7, preserveParens: true}); From f48503cd31826f8cfb0f0e2b6964879dbe318385 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sun, 19 Oct 2014 18:01:34 +1100 Subject: [PATCH 02/47] add unicode flag support to regex --- acorn.js | 38 ++++++++++++++++++++++++++---- test/tests-harmony.js | 29 +++++++++++++++++++++++ test/tests.js | 54 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 117 insertions(+), 4 deletions(-) diff --git a/acorn.js b/acorn.js index a36b5dac1a..efd9e42369 100644 --- a/acorn.js +++ b/acorn.js @@ -934,14 +934,36 @@ // Need to use `readWord1` because '\uXXXX' sequences are allowed // here (don't ask). var mods = readWord1(); - if (mods && !/^[gmsiy]*$/.test(mods)) raise(start, "Invalid regular expression flag"); + var tmp = content; + if (mods) { + var validFlags = /^[gmsiy]*$/; + if (options.ecmaVersion >= 6) validFlags = /^[gmsiyu]*$/; + if (!validFlags.test(mods)) raise(start, "Invalid regular expression flag"); + if (mods.indexOf('u') >= 0) { + // Replace each astral symbol and every Unicode code point + // escape sequence that represents such a symbol with a single + // ASCII symbol to avoid throwing on regular expressions that + // are only valid in combination with the `/u` flag. + tmp = tmp + .replace(/\\u\{([0-9a-fA-F]{5,6})\}/g, 'x') + .replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, 'x'); + } + } + // Detect invalid regular expressions. try { - var value = new RegExp(content, mods); + new RegExp(tmp); } catch (e) { if (e instanceof SyntaxError) raise(start, "Error parsing regular expression: " + e.message); raise(e); } - return finishToken(_regexp, value); + // Get a regular expression object for this pattern-flag pair, or `null` in + // case the current environment doesn't support the flags it uses. + try { + var value = new RegExp(content, mods); + } catch (err) { + value = null; + } + return finishToken(_regexp, {pattern: content, flags: mods, value: value}); } // Read an integer in the given radix. Return null if zero digits @@ -2005,7 +2027,15 @@ } return id; - case _num: case _string: case _regexp: + case _regexp: + var node = startNode(); + node.regex = {pattern: tokVal.pattern, flags: tokVal.flags}; + node.value = tokVal.value; + node.raw = input.slice(tokStart, tokEnd); + next(); + return finishNode(node, "Literal"); + + case _num: case _string: var node = startNode(); node.value = tokVal; node.raw = input.slice(tokStart, tokEnd); diff --git a/test/tests-harmony.js b/test/tests-harmony.js index 66a802be25..b35c91920f 100644 --- a/test/tests-harmony.js +++ b/test/tests-harmony.js @@ -14792,6 +14792,35 @@ test("func(...a, b)", { locations: true }); +test("/[a-z]/u", { + type: "Program", + body: [ + { + type: "ExpressionStatement", + expression: { + type: "Literal", + regex: { + pattern: "[a-z]", + flags: "u" + }, + loc: { + start: { + line: 1, + column: 0 + }, + end: { + line: 1, + column: 8 + } + } + } + } + ] +}, { + locations: true, + ecmaVersion: 6 +}); + // Harmony Invalid syntax testFail("0o", "Expected number in radix 8 (1:2)", {ecmaVersion: 6}); diff --git a/test/tests.js b/test/tests.js index 4fedc72ca1..287d98f84d 100644 --- a/test/tests.js +++ b/test/tests.js @@ -135,6 +135,60 @@ test("\n 42\n\n", { } }); +test("/foobar/", { + type: "Program", + body: [ + { + type: "ExpressionStatement", + expression: { + type: "Literal", + value: /foobar/, + regex: { + pattern: "foobar", + flags: "" + }, + loc: { + start: { + line: 1, + column: 0 + }, + end: { + line: 1, + column: 8 + } + } + } + } + ] +}); + +test("/[a-z]/g", { + type: "Program", + body: [ + { + type: "ExpressionStatement", + expression: { + type: "Literal", + value: /[a-z]/, + regex: { + pattern: "[a-z]", + flags: "g" + }, + loc: { + start: { + line: 1, + column: 0 + }, + end: { + line: 1, + column: 8 + } + } + } + } + ] +}); + test("(1 + 2 ) * 3", { type: "Program", body: [ From 5d1db2e9937e779bef32e3a91bd0a7ba15367a32 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Mon, 27 Oct 2014 10:54:46 +0100 Subject: [PATCH 03/47] Only apply kludge from f48503cd31826f8cfb0f0e2b6964879dbe318385 when unicode regexps are not supported --- acorn.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/acorn.js b/acorn.js index efd9e42369..a244d10faf 100644 --- a/acorn.js +++ b/acorn.js @@ -912,6 +912,10 @@ finishToken(type, str); } + var regexpUnicodeSupport = false; + try { new RegExp("\uffff", "u"); regexpUnicodeSupport = true; } + catch(e) {} + // Parse a regular expression. Some context-awareness is necessary, // since a '/' inside a '[]' set does not end the expression. @@ -939,14 +943,14 @@ var validFlags = /^[gmsiy]*$/; if (options.ecmaVersion >= 6) validFlags = /^[gmsiyu]*$/; if (!validFlags.test(mods)) raise(start, "Invalid regular expression flag"); - if (mods.indexOf('u') >= 0) { + if (mods.indexOf('u') >= 0 && !regexpUnicodeSupport) { // Replace each astral symbol and every Unicode code point // escape sequence that represents such a symbol with a single // ASCII symbol to avoid throwing on regular expressions that // are only valid in combination with the `/u` flag. tmp = tmp - .replace(/\\u\{([0-9a-fA-F]{5,6})\}/g, 'x') - .replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, 'x'); + .replace(/\\u\{([0-9a-fA-F]{5,6})\}/g, "x") + .replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, "x"); } } // Detect invalid regular expressions. From f26b656ea5440ec54cf79a4a48f1a579b45b0fd8 Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Sun, 26 Oct 2014 16:53:41 +0200 Subject: [PATCH 04/47] Remove property name clash check in ES6 as per Draft Rev 26. See https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-06/jun-6.md#conclusionresolution-3 for details. Conflicts: test/tests-harmony.js --- acorn.js | 5 +- test/tests-harmony.js | 161 +++++++++++++++++++++++++++++++++++++++--- 2 files changed, 152 insertions(+), 14 deletions(-) diff --git a/acorn.js b/acorn.js index a244d10faf..8013c92685 100644 --- a/acorn.js +++ b/acorn.js @@ -1433,7 +1433,7 @@ // strict mode, init properties are also not allowed to be repeated. function checkPropClash(prop, propHash) { - if (prop.computed) return; + if (options.ecmaVersion >= 6) return; var key = prop.key, name; switch (key.type) { case "Identifier": name = key.name; break; @@ -2389,7 +2389,7 @@ next(); node.id = tokType === _name ? parseIdent() : isStatement ? unexpected() : null; node.superClass = eat(_extends) ? parseExpression() : null; - var classBody = startNode(), methodHash = {}, staticMethodHash = {}; + var classBody = startNode(); classBody.body = []; expect(_braceL); while (!eat(_braceR)) { @@ -2411,7 +2411,6 @@ method.kind = ""; } method.value = parseMethod(isGenerator); - checkPropClash(method, method['static'] ? staticMethodHash : methodHash); classBody.body.push(finishNode(method, "MethodDefinition")); eat(_semi); } diff --git a/test/tests-harmony.js b/test/tests-harmony.js index b35c91920f..0f5ed5447b 100644 --- a/test/tests-harmony.js +++ b/test/tests-harmony.js @@ -9386,17 +9386,156 @@ test("class A { set foo(v) {} get foo() {} }", { locations: true }); -testFail("class A { get foo() {} get foo() {} }", "Redefinition of property (1:27)", {ecmaVersion: 6}); - -testFail("class A { set foo(v) {} set foo(v) {} }", "Redefinition of property (1:28)", {ecmaVersion: 6}); - -testFail("class A { get foo() {} foo() {} }", "Redefinition of property (1:23)", {ecmaVersion: 6}); - -testFail("class A { foo() {} get foo() {} }", "Redefinition of property (1:23)", {ecmaVersion: 6}); - -testFail("class A { set foo(v) {} foo() {} }", "Redefinition of property (1:24)", {ecmaVersion: 6}); - -testFail("class A { foo() {} set foo(v) {} }", "Redefinition of property (1:23)", {ecmaVersion: 6}); +test("class A { foo() {} get foo() {} }",{ + type: "Program", + start: 0, + end: 33, + loc: { + start: {line: 1, column: 0}, + end: {line: 1, column: 33} + }, + range: [0, 33], + body: [{ + type: "ClassDeclaration", + start: 0, + end: 33, + loc: { + start: {line: 1, column: 0}, + end: {line: 1, column: 33} + }, + range: [0, 33], + id: { + type: "Identifier", + start: 6, + end: 7, + loc: { + start: {line: 1, column: 6}, + end: {line: 1, column: 7} + }, + range: [6, 7], + name: "A" + }, + superClass: null, + body: { + type: "ClassBody", + start: 8, + end: 33, + loc: { + start: {line: 1, column: 8}, + end: {line: 1, column: 33} + }, + range: [8, 33], + body: [ + { + type: "MethodDefinition", + start: 10, + end: 18, + loc: { + start: {line: 1, column: 10}, + end: {line: 1, column: 18} + }, + range: [10, 18], + static: false, + computed: false, + key: { + type: "Identifier", + start: 10, + end: 13, + loc: { + start: {line: 1, column: 10}, + end: {line: 1, column: 13} + }, + range: [10, 13], + name: "foo" + }, + kind: "", + value: { + type: "FunctionExpression", + start: 13, + end: 18, + loc: { + start: {line: 1, column: 13}, + end: {line: 1, column: 18} + }, + range: [13, 18], + id: null, + params: [], + defaults: [], + rest: null, + generator: false, + body: { + type: "BlockStatement", + start: 16, + end: 18, + loc: { + start: {line: 1, column: 16}, + end: {line: 1, column: 18} + }, + range: [16, 18], + body: [] + }, + expression: false + } + }, + { + type: "MethodDefinition", + start: 19, + end: 31, + loc: { + start: {line: 1, column: 19}, + end: {line: 1, column: 31} + }, + range: [19, 31], + static: false, + computed: false, + key: { + type: "Identifier", + start: 23, + end: 26, + loc: { + start: {line: 1, column: 23}, + end: {line: 1, column: 26} + }, + range: [23, 26], + name: "foo" + }, + kind: "get", + value: { + type: "FunctionExpression", + start: 26, + end: 31, + loc: { + start: {line: 1, column: 26}, + end: {line: 1, column: 31} + }, + range: [26, 31], + id: null, + params: [], + defaults: [], + rest: null, + generator: false, + body: { + type: "BlockStatement", + start: 29, + end: 31, + loc: { + start: {line: 1, column: 29}, + end: {line: 1, column: 31} + }, + range: [29, 31], + body: [] + }, + expression: false + } + } + ] + } + }] +},{ + ecmaVersion: 6, + ranges: true, + locations: true +}); // ES6: Computed Properties From 8a799c60770e25b167941e83f1bd56f863486db4 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Mon, 27 Oct 2014 10:59:16 +0100 Subject: [PATCH 05/47] Remove redundant range info from tests --- test/tests-harmony.js | 1624 ----------------------------------------- 1 file changed, 1624 deletions(-) diff --git a/test/tests-harmony.js b/test/tests-harmony.js index 0f5ed5447b..539418f870 100644 --- a/test/tests-harmony.js +++ b/test/tests-harmony.js @@ -55,19 +55,16 @@ test("\"\\u{714E}\\u{8336}\"", { type: "Literal", value: "煎茶", raw: "\"\\u{714E}\\u{8336}\"", - range: [0, 18], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 18} } }, - range: [0, 18], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 18} } }], - range: [0, 18], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 18} @@ -86,19 +83,16 @@ test("\"\\u{20BB7}\\u{91CE}\\u{5BB6}\"", { type: "Literal", value: "𠮷野家", raw: "\"\\u{20BB7}\\u{91CE}\\u{5BB6}\"", - range: [0, 27], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 27} } }, - range: [0, 27], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 27} } }], - range: [0, 27], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 27} @@ -119,19 +113,16 @@ test("00", { type: "Literal", value: 0, raw: "00", - range: [0, 2], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 2} } }, - range: [0, 2], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 2} } }], - range: [0, 2], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 2} @@ -150,19 +141,16 @@ test("0o0", { type: "Literal", value: 0, raw: "0o0", - range: [0, 3], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 3} } }, - range: [0, 3], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 3} } }], - range: [0, 3], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 3} @@ -180,7 +168,6 @@ test("function test() {'use strict'; 0o0; }", { id: { type: "Identifier", name: "test", - range: [9, 13], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 13} @@ -197,13 +184,11 @@ test("function test() {'use strict'; 0o0; }", { type: "Literal", value: "use strict", raw: "'use strict'", - range: [17, 29], loc: { start: {line: 1, column: 17}, end: {line: 1, column: 29} } }, - range: [17, 30], loc: { start: {line: 1, column: 17}, end: {line: 1, column: 30} @@ -215,20 +200,17 @@ test("function test() {'use strict'; 0o0; }", { type: "Literal", value: 0, raw: "0o0", - range: [31, 34], loc: { start: {line: 1, column: 31}, end: {line: 1, column: 34} } }, - range: [31, 35], loc: { start: {line: 1, column: 31}, end: {line: 1, column: 35} } } ], - range: [16, 37], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 37} @@ -237,13 +219,11 @@ test("function test() {'use strict'; 0o0; }", { rest: null, generator: false, expression: false, - range: [0, 37], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 37} } }], - range: [0, 37], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 37} @@ -262,19 +242,16 @@ test("0o2", { type: "Literal", value: 2, raw: "0o2", - range: [0, 3], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 3} } }, - range: [0, 3], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 3} } }], - range: [0, 3], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 3} @@ -293,19 +270,16 @@ test("0o12", { type: "Literal", value: 10, raw: "0o12", - range: [0, 4], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 4} } }, - range: [0, 4], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 4} } }], - range: [0, 4], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 4} @@ -324,19 +298,16 @@ test("0O0", { type: "Literal", value: 0, raw: "0O0", - range: [0, 3], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 3} } }, - range: [0, 3], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 3} } }], - range: [0, 3], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 3} @@ -354,7 +325,6 @@ test("function test() {'use strict'; 0O0; }", { id: { type: "Identifier", name: "test", - range: [9, 13], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 13} @@ -371,13 +341,11 @@ test("function test() {'use strict'; 0O0; }", { type: "Literal", value: "use strict", raw: "'use strict'", - range: [17, 29], loc: { start: {line: 1, column: 17}, end: {line: 1, column: 29} } }, - range: [17, 30], loc: { start: {line: 1, column: 17}, end: {line: 1, column: 30} @@ -389,20 +357,17 @@ test("function test() {'use strict'; 0O0; }", { type: "Literal", value: 0, raw: "0O0", - range: [31, 34], loc: { start: {line: 1, column: 31}, end: {line: 1, column: 34} } }, - range: [31, 35], loc: { start: {line: 1, column: 31}, end: {line: 1, column: 35} } } ], - range: [16, 37], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 37} @@ -411,13 +376,11 @@ test("function test() {'use strict'; 0O0; }", { rest: null, generator: false, expression: false, - range: [0, 37], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 37} } }], - range: [0, 37], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 37} @@ -436,19 +399,16 @@ test("0O2", { type: "Literal", value: 2, raw: "0O2", - range: [0, 3], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 3} } }, - range: [0, 3], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 3} } }], - range: [0, 3], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 3} @@ -467,19 +427,16 @@ test("0O12", { type: "Literal", value: 10, raw: "0O12", - range: [0, 4], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 4} } }, - range: [0, 4], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 4} } }], - range: [0, 4], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 4} @@ -498,19 +455,16 @@ test("0b0", { type: "Literal", value: 0, raw: "0b0", - range: [0, 3], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 3} } }, - range: [0, 3], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 3} } }], - range: [0, 3], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 3} @@ -529,19 +483,16 @@ test("0b1", { type: "Literal", value: 1, raw: "0b1", - range: [0, 3], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 3} } }, - range: [0, 3], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 3} } }], - range: [0, 3], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 3} @@ -560,19 +511,16 @@ test("0b10", { type: "Literal", value: 2, raw: "0b10", - range: [0, 4], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 4} } }, - range: [0, 4], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 4} } }], - range: [0, 4], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 4} @@ -591,19 +539,16 @@ test("0B0", { type: "Literal", value: 0, raw: "0B0", - range: [0, 3], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 3} } }, - range: [0, 3], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 3} } }], - range: [0, 3], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 3} @@ -622,19 +567,16 @@ test("0B1", { type: "Literal", value: 1, raw: "0B1", - range: [0, 3], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 3} } }, - range: [0, 3], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 3} } }], - range: [0, 3], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 3} @@ -653,19 +595,16 @@ test("0B10", { type: "Literal", value: 2, raw: "0B10", - range: [0, 4], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 4} } }, - range: [0, 4], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 4} } }], - range: [0, 4], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 4} @@ -688,26 +627,22 @@ test("`42`", { type: "TemplateElement", value: {raw: "42", cooked: "42"}, tail: true, - range: [1, 3], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 3} } }], expressions: [], - range: [0, 4], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 4} } }, - range: [0, 4], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 4} } }], - range: [0, 4], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 4} @@ -727,7 +662,6 @@ test("raw`42`", { tag: { type: "Identifier", name: "raw", - range: [0, 3], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 3} @@ -739,32 +673,27 @@ test("raw`42`", { type: "TemplateElement", value: {raw: "42", cooked: "42"}, tail: true, - range: [4, 6], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 6} } }], expressions: [], - range: [3, 7], loc: { start: {line: 1, column: 3}, end: {line: 1, column: 7} } }, - range: [0, 7], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 7} } }, - range: [0, 7], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 7} } }], - range: [0, 7], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 7} @@ -784,7 +713,6 @@ test("raw`hello ${name}`", { tag: { type: "Identifier", name: "raw", - range: [0, 3], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 3} @@ -797,7 +725,6 @@ test("raw`hello ${name}`", { type: "TemplateElement", value: {raw: "hello ", cooked: "hello "}, tail: false, - range: [4, 10], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 10} @@ -807,7 +734,6 @@ test("raw`hello ${name}`", { type: "TemplateElement", value: {raw: "", cooked: ""}, tail: true, - range: [17, 17], loc: { start: {line: 1, column: 17}, end: {line: 1, column: 17} @@ -817,31 +743,26 @@ test("raw`hello ${name}`", { expressions: [{ type: "Identifier", name: "name", - range: [12, 16], loc: { start: {line: 1, column: 12}, end: {line: 1, column: 16} } }], - range: [3, 18], loc: { start: {line: 1, column: 3}, end: {line: 1, column: 18} } }, - range: [0, 18], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 18} } }, - range: [0, 18], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 18} } }], - range: [0, 18], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 18} @@ -862,26 +783,22 @@ test("`$`", { type: "TemplateElement", value: {raw: "$", cooked: "$"}, tail: true, - range: [1, 2], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 2} } }], expressions: [], - range: [0, 3], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 3} } }, - range: [0, 3], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 3} } }], - range: [0, 3], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 3} @@ -902,26 +819,22 @@ test("`\\n\\r\\b\\v\\t\\f\\\n\\\r\n`", { type: "TemplateElement", value: {raw: "\\n\\r\\b\\v\\t\\f\\\n\\\r\n", cooked: "\n\r\b\u000b\t\f"}, tail: true, - range: [1, 18], loc: { start: {line: 1, column: 1}, end: {line: 3, column: 0} } }], expressions: [], - range: [0, 19], loc: { start: {line: 1, column: 0}, end: {line: 3, column: 1} } }, - range: [0, 19], loc: { start: {line: 1, column: 0}, end: {line: 3, column: 1} } }], - range: [0, 19], loc: { start: {line: 1, column: 0}, end: {line: 3, column: 1} @@ -942,26 +855,22 @@ test("`\n\r\n`", { type: "TemplateElement", value: {raw: "\n\r\n", cooked: "\n\n"}, tail: true, - range: [1, 4], loc: { start: {line: 1, column: 1}, end: {line: 3, column: 0} } }], expressions: [], - range: [0, 5], loc: { start: {line: 1, column: 0}, end: {line: 3, column: 1} } }, - range: [0, 5], loc: { start: {line: 1, column: 0}, end: {line: 3, column: 1} } }], - range: [0, 5], loc: { start: {line: 1, column: 0}, end: {line: 3, column: 1} @@ -982,26 +891,22 @@ test("`\\u{000042}\\u0042\\x42u0\\102\\A`", { type: "TemplateElement", value: {raw: "\\u{000042}\\u0042\\x42u0\\102\\A", cooked: "BBBu0BA"}, tail: true, - range: [1, 29], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 29} } }], expressions: [], - range: [0, 30], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 30} } }, - range: [0, 30], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 30} } }], - range: [0, 30], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 30} @@ -1023,7 +928,6 @@ test("new raw`42`", { tag: { type: "Identifier", name: "raw", - range: [4, 7], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 7} @@ -1035,39 +939,33 @@ test("new raw`42`", { type: "TemplateElement", value: {raw: "42", cooked: "42"}, tail: true, - range: [8, 10], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 10} } }], expressions: [], - range: [7, 11], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 11} } }, - range: [4, 11], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 11} } }, arguments: [], - range: [0, 11], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 11} } }, - range: [0, 11], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 11} } }], - range: [0, 11], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 11} @@ -1087,7 +985,6 @@ test("switch (answer) { case 42: let t = 42; break; }", { discriminant: { type: "Identifier", name: "answer", - range: [8, 14], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 14} @@ -1099,7 +996,6 @@ test("switch (answer) { case 42: let t = 42; break; }", { type: "Literal", value: 42, raw: "42", - range: [23, 25], loc: { start: {line: 1, column: 23}, end: {line: 1, column: 25} @@ -1113,7 +1009,6 @@ test("switch (answer) { case 42: let t = 42; break; }", { id: { type: "Identifier", name: "t", - range: [31, 32], loc: { start: {line: 1, column: 31}, end: {line: 1, column: 32} @@ -1123,20 +1018,17 @@ test("switch (answer) { case 42: let t = 42; break; }", { type: "Literal", value: 42, raw: "42", - range: [35, 37], loc: { start: {line: 1, column: 35}, end: {line: 1, column: 37} } }, - range: [31, 37], loc: { start: {line: 1, column: 31}, end: {line: 1, column: 37} } }], kind: "let", - range: [27, 38], loc: { start: {line: 1, column: 27}, end: {line: 1, column: 38} @@ -1145,26 +1037,22 @@ test("switch (answer) { case 42: let t = 42; break; }", { { type: "BreakStatement", label: null, - range: [39, 45], loc: { start: {line: 1, column: 39}, end: {line: 1, column: 45} } } ], - range: [18, 45], loc: { start: {line: 1, column: 18}, end: {line: 1, column: 45} } }], - range: [0, 47], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 47} } }], - range: [0, 47], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 47} @@ -1190,7 +1078,6 @@ test("() => \"test\"", { type: "Literal", value: "test", raw: "\"test\"", - range: [6, 12], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 12} @@ -1199,19 +1086,16 @@ test("() => \"test\"", { rest: null, generator: false, expression: true, - range: [0, 12], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 12} } }, - range: [0, 12], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 12} } }], - range: [0, 12], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 12} @@ -1232,7 +1116,6 @@ test("e => \"test\"", { params: [{ type: "Identifier", name: "e", - range: [0, 1], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 1} @@ -1243,7 +1126,6 @@ test("e => \"test\"", { type: "Literal", value: "test", raw: "\"test\"", - range: [5, 11], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 11} @@ -1252,19 +1134,16 @@ test("e => \"test\"", { rest: null, generator: false, expression: true, - range: [0, 11], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 11} } }, - range: [0, 11], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 11} } }], - range: [0, 11], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 11} @@ -1285,7 +1164,6 @@ test("(e) => \"test\"", { params: [{ type: "Identifier", name: "e", - range: [1, 2], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 2} @@ -1296,7 +1174,6 @@ test("(e) => \"test\"", { type: "Literal", value: "test", raw: "\"test\"", - range: [7, 13], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 13} @@ -1305,19 +1182,16 @@ test("(e) => \"test\"", { rest: null, generator: false, expression: true, - range: [0, 13], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 13} } }, - range: [0, 13], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 13} } }], - range: [0, 13], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 13} @@ -1339,7 +1213,6 @@ test("(a, b) => \"test\"", { { type: "Identifier", name: "a", - range: [1, 2], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 2} @@ -1348,7 +1221,6 @@ test("(a, b) => \"test\"", { { type: "Identifier", name: "b", - range: [4, 5], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 5} @@ -1360,7 +1232,6 @@ test("(a, b) => \"test\"", { type: "Literal", value: "test", raw: "\"test\"", - range: [10, 16], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 16} @@ -1369,19 +1240,16 @@ test("(a, b) => \"test\"", { rest: null, generator: false, expression: true, - range: [0, 16], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 16} } }, - range: [0, 16], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 16} } }], - range: [0, 16], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 16} @@ -1402,7 +1270,6 @@ test("e => { 42; }", { params: [{ type: "Identifier", name: "e", - range: [0, 1], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 1} @@ -1417,19 +1284,16 @@ test("e => { 42; }", { type: "Literal", value: 42, raw: "42", - range: [7, 9], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 9} } }, - range: [7, 10], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 10} } }], - range: [5, 12], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 12} @@ -1438,19 +1302,16 @@ test("e => { 42; }", { rest: null, generator: false, expression: false, - range: [0, 12], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 12} } }, - range: [0, 12], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 12} } }], - range: [0, 12], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 12} @@ -1471,7 +1332,6 @@ test("e => ({ property: 42 })", { params: [{ type: "Identifier", name: "e", - range: [0, 1], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 1} @@ -1485,7 +1345,6 @@ test("e => ({ property: 42 })", { key: { type: "Identifier", name: "property", - range: [8, 16], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 16} @@ -1495,7 +1354,6 @@ test("e => ({ property: 42 })", { type: "Literal", value: 42, raw: "42", - range: [18, 20], loc: { start: {line: 1, column: 18}, end: {line: 1, column: 20} @@ -1505,13 +1363,11 @@ test("e => ({ property: 42 })", { method: false, shorthand: false, computed: false, - range: [8, 20], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 20} } }], - range: [6, 22], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 22} @@ -1520,19 +1376,16 @@ test("e => ({ property: 42 })", { rest: null, generator: false, expression: true, - range: [0, 23], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 23} } }, - range: [0, 23], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 23} } }], - range: [0, 23], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 23} @@ -1553,7 +1406,6 @@ test("e => { label: 42 }", { params: [{ type: "Identifier", name: "e", - range: [0, 1], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 1} @@ -1567,7 +1419,6 @@ test("e => { label: 42 }", { label: { type: "Identifier", name: "label", - range: [7, 12], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 12} @@ -1579,25 +1430,21 @@ test("e => { label: 42 }", { type: "Literal", value: 42, raw: "42", - range: [14, 16], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 16} } }, - range: [14, 16], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 16} } }, - range: [7, 16], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 16} } }], - range: [5, 18], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 18} @@ -1606,19 +1453,16 @@ test("e => { label: 42 }", { rest: null, generator: false, expression: false, - range: [0, 18], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 18} } }, - range: [0, 18], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 18} } }], - range: [0, 18], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 18} @@ -1640,7 +1484,6 @@ test("(a, b) => { 42; }", { { type: "Identifier", name: "a", - range: [1, 2], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 2} @@ -1649,7 +1492,6 @@ test("(a, b) => { 42; }", { { type: "Identifier", name: "b", - range: [4, 5], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 5} @@ -1665,19 +1507,16 @@ test("(a, b) => { 42; }", { type: "Literal", value: 42, raw: "42", - range: [12, 14], loc: { start: {line: 1, column: 12}, end: {line: 1, column: 14} } }, - range: [12, 15], loc: { start: {line: 1, column: 12}, end: {line: 1, column: 15} } }], - range: [10, 17], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 17} @@ -1686,19 +1525,16 @@ test("(a, b) => { 42; }", { rest: null, generator: false, expression: false, - range: [0, 17], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 17} } }, - range: [0, 17], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 17} } }], - range: [0, 17], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 17} @@ -1722,7 +1558,6 @@ test("([a, , b]) => 42", { { type: "Identifier", name: "a", - range: [2, 3], loc: { start: {line: 1, column: 2}, end: {line: 1, column: 3} @@ -1732,14 +1567,12 @@ test("([a, , b]) => 42", { { type: "Identifier", name: "b", - range: [7, 8], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 8} } } ], - range: [1, 9], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 9} @@ -1750,7 +1583,6 @@ test("([a, , b]) => 42", { type: "Literal", value: 42, raw: "42", - range: [14, 16], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 16} @@ -1759,19 +1591,16 @@ test("([a, , b]) => 42", { rest: null, generator: false, expression: true, - range: [0, 16], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 16} } }, - range: [0, 16], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 16} } }], - range: [0, 16], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 16} @@ -1797,7 +1626,6 @@ test("([a.a]) => 42", { object: { type: "Identifier", name: "a", - range: [2, 3], loc: { start: {line: 1, column: 2}, end: {line: 1, column: 3} @@ -1806,19 +1634,16 @@ test("([a.a]) => 42", { property: { type: "Identifier", name: "a", - range: [4, 5], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 5} } }, - range: [2, 5], loc: { start: {line: 1, column: 2}, end: {line: 1, column: 5} } }], - range: [1, 6], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 6} @@ -1829,7 +1654,6 @@ test("([a.a]) => 42", { type: "Literal", value: 42, raw: "42", - range: [11, 13], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 13} @@ -1838,19 +1662,16 @@ test("([a.a]) => 42", { rest: null, generator: false, expression: true, - range: [0, 13], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 13} } }, - range: [0, 13], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 13} } }], - range: [0, 13], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 13} @@ -1871,7 +1692,6 @@ test("(x=1) => x * x", { params: [{ type: "Identifier", name: "x", - range: [1, 2], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 2} @@ -1881,7 +1701,6 @@ test("(x=1) => x * x", { type: "Literal", value: 1, raw: "1", - range: [3, 4], loc: { start: {line: 1, column: 3}, end: {line: 1, column: 4} @@ -1893,7 +1712,6 @@ test("(x=1) => x * x", { left: { type: "Identifier", name: "x", - range: [9, 10], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 10} @@ -1902,13 +1720,11 @@ test("(x=1) => x * x", { right: { type: "Identifier", name: "x", - range: [13, 14], loc: { start: {line: 1, column: 13}, end: {line: 1, column: 14} } }, - range: [9, 14], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 14} @@ -1917,19 +1733,16 @@ test("(x=1) => x * x", { rest: null, generator: false, expression: true, - range: [0, 14], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 14} } }, - range: [0, 14], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 14} } }], - range: [0, 14], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 14} @@ -1950,7 +1763,6 @@ test("eval => 42", { params: [{ type: "Identifier", name: "eval", - range: [0, 4], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 4} @@ -1961,7 +1773,6 @@ test("eval => 42", { type: "Literal", value: 42, raw: "42", - range: [8, 10], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 10} @@ -1970,19 +1781,16 @@ test("eval => 42", { rest: null, generator: false, expression: true, - range: [0, 10], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 10} } }, - range: [0, 10], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 10} } }], - range: [0, 10], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 10} @@ -2003,7 +1811,6 @@ test("arguments => 42", { params: [{ type: "Identifier", name: "arguments", - range: [0, 9], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 9} @@ -2014,7 +1821,6 @@ test("arguments => 42", { type: "Literal", value: 42, raw: "42", - range: [13, 15], loc: { start: {line: 1, column: 13}, end: {line: 1, column: 15} @@ -2023,19 +1829,16 @@ test("arguments => 42", { rest: null, generator: false, expression: true, - range: [0, 15], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 15} } }, - range: [0, 15], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 15} } }], - range: [0, 15], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 15} @@ -2056,7 +1859,6 @@ test("(a) => 00", { params: [{ type: "Identifier", name: "a", - range: [1, 2], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 2} @@ -2067,7 +1869,6 @@ test("(a) => 00", { type: "Literal", value: 0, raw: "00", - range: [7, 9], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 9} @@ -2076,19 +1877,16 @@ test("(a) => 00", { rest: null, generator: false, expression: true, - range: [0, 9], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 9} } }, - range: [0, 9], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 9} } }], - range: [0, 9], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 9} @@ -2110,7 +1908,6 @@ test("(eval, a) => 42", { { type: "Identifier", name: "eval", - range: [1, 5], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 5} @@ -2119,7 +1916,6 @@ test("(eval, a) => 42", { { type: "Identifier", name: "a", - range: [7, 8], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 8} @@ -2131,7 +1927,6 @@ test("(eval, a) => 42", { type: "Literal", value: 42, raw: "42", - range: [13, 15], loc: { start: {line: 1, column: 13}, end: {line: 1, column: 15} @@ -2140,19 +1935,16 @@ test("(eval, a) => 42", { rest: null, generator: false, expression: true, - range: [0, 15], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 15} } }, - range: [0, 15], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 15} } }], - range: [0, 15], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 15} @@ -2173,7 +1965,6 @@ test("(eval = 10) => 42", { params: [{ type: "Identifier", name: "eval", - range: [1, 5], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 5} @@ -2183,7 +1974,6 @@ test("(eval = 10) => 42", { type: "Literal", value: 10, raw: "10", - range: [8, 10], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 10} @@ -2193,7 +1983,6 @@ test("(eval = 10) => 42", { type: "Literal", value: 42, raw: "42", - range: [15, 17], loc: { start: {line: 1, column: 15}, end: {line: 1, column: 17} @@ -2202,19 +1991,16 @@ test("(eval = 10) => 42", { rest: null, generator: false, expression: true, - range: [0, 17], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 17} } }, - range: [0, 17], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 17} } }], - range: [0, 17], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 17} @@ -2236,7 +2022,6 @@ test("(eval, a = 10) => 42", { { type: "Identifier", name: "eval", - range: [1, 5], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 5} @@ -2245,7 +2030,6 @@ test("(eval, a = 10) => 42", { { type: "Identifier", name: "a", - range: [7, 8], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 8} @@ -2258,7 +2042,6 @@ test("(eval, a = 10) => 42", { type: "Literal", value: 10, raw: "10", - range: [11, 13], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 13} @@ -2269,7 +2052,6 @@ test("(eval, a = 10) => 42", { type: "Literal", value: 42, raw: "42", - range: [18, 20], loc: { start: {line: 1, column: 18}, end: {line: 1, column: 20} @@ -2278,19 +2060,16 @@ test("(eval, a = 10) => 42", { rest: null, generator: false, expression: true, - range: [0, 20], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 20} } }, - range: [0, 20], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 20} } }], - range: [0, 20], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 20} @@ -2311,7 +2090,6 @@ test("(x => x)", { params: [{ type: "Identifier", name: "x", - range: [1, 2], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 2} @@ -2321,7 +2099,6 @@ test("(x => x)", { body: { type: "Identifier", name: "x", - range: [6, 7], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} @@ -2330,19 +2107,16 @@ test("(x => x)", { rest: null, generator: false, expression: true, - range: [1, 7], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 7} } }, - range: [0, 8], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 8} } }], - range: [0, 8], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 8} @@ -2363,7 +2137,6 @@ test("x => y => 42", { params: [{ type: "Identifier", name: "x", - range: [0, 1], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 1} @@ -2376,7 +2149,6 @@ test("x => y => 42", { params: [{ type: "Identifier", name: "y", - range: [5, 6], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 6} @@ -2387,7 +2159,6 @@ test("x => y => 42", { type: "Literal", value: 42, raw: "42", - range: [10, 12], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 12} @@ -2396,7 +2167,6 @@ test("x => y => 42", { rest: null, generator: false, expression: true, - range: [5, 12], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 12} @@ -2405,19 +2175,16 @@ test("x => y => 42", { rest: null, generator: false, expression: true, - range: [0, 12], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 12} } }, - range: [0, 12], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 12} } }], - range: [0, 12], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 12} @@ -2438,7 +2205,6 @@ test("(x) => ((y, z) => (x, y, z))", { params: [{ type: "Identifier", name: "x", - range: [1, 2], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 2} @@ -2452,7 +2218,6 @@ test("(x) => ((y, z) => (x, y, z))", { { type: "Identifier", name: "y", - range: [9, 10], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 10} @@ -2461,7 +2226,6 @@ test("(x) => ((y, z) => (x, y, z))", { { type: "Identifier", name: "z", - range: [12, 13], loc: { start: {line: 1, column: 12}, end: {line: 1, column: 13} @@ -2475,7 +2239,6 @@ test("(x) => ((y, z) => (x, y, z))", { { type: "Identifier", name: "x", - range: [19, 20], loc: { start: {line: 1, column: 19}, end: {line: 1, column: 20} @@ -2484,7 +2247,6 @@ test("(x) => ((y, z) => (x, y, z))", { { type: "Identifier", name: "y", - range: [22, 23], loc: { start: {line: 1, column: 22}, end: {line: 1, column: 23} @@ -2493,14 +2255,12 @@ test("(x) => ((y, z) => (x, y, z))", { { type: "Identifier", name: "z", - range: [25, 26], loc: { start: {line: 1, column: 25}, end: {line: 1, column: 26} } } ], - range: [19, 26], loc: { start: {line: 1, column: 19}, end: {line: 1, column: 26} @@ -2509,7 +2269,6 @@ test("(x) => ((y, z) => (x, y, z))", { rest: null, generator: false, expression: true, - range: [8, 27], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 27} @@ -2518,19 +2277,16 @@ test("(x) => ((y, z) => (x, y, z))", { rest: null, generator: false, expression: true, - range: [0, 28], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 28} } }, - range: [0, 28], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 28} } }], - range: [0, 28], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 28} @@ -2550,7 +2306,6 @@ test("foo(() => {})", { callee: { type: "Identifier", name: "foo", - range: [0, 3], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 3} @@ -2564,7 +2319,6 @@ test("foo(() => {})", { body: { type: "BlockStatement", body: [], - range: [10, 12], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 12} @@ -2573,25 +2327,21 @@ test("foo(() => {})", { rest: null, generator: false, expression: false, - range: [4, 12], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 12} } }], - range: [0, 13], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 13} } }, - range: [0, 13], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 13} } }], - range: [0, 13], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 13} @@ -2611,7 +2361,6 @@ test("foo((x, y) => {})", { callee: { type: "Identifier", name: "foo", - range: [0, 3], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 3} @@ -2624,7 +2373,6 @@ test("foo((x, y) => {})", { { type: "Identifier", name: "x", - range: [5, 6], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 6} @@ -2633,7 +2381,6 @@ test("foo((x, y) => {})", { { type: "Identifier", name: "y", - range: [8, 9], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 9} @@ -2644,7 +2391,6 @@ test("foo((x, y) => {})", { body: { type: "BlockStatement", body: [], - range: [14, 16], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 16} @@ -2653,25 +2399,21 @@ test("foo((x, y) => {})", { rest: null, generator: false, expression: false, - range: [4, 16], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 16} } }], - range: [0, 17], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 17} } }, - range: [0, 17], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 17} } }], - range: [0, 17], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 17} @@ -2688,21 +2430,18 @@ test("(a, a) => 42", { start: {line: 1, column: 0}, end: {line: 1, column: 12} }, - range: [0, 12], body: [{ type: "ExpressionStatement", loc: { start: {line: 1, column: 0}, end: {line: 1, column: 12} }, - range: [0, 12], expression: { type: "ArrowFunctionExpression", loc: { start: {line: 1, column: 0}, end: {line: 1, column: 12} }, - range: [0, 12], id: null, params: [ { @@ -2711,7 +2450,6 @@ test("(a, a) => 42", { start: {line: 1, column: 1}, end: {line: 1, column: 2} }, - range: [1, 2], name: "a" }, { @@ -2720,7 +2458,6 @@ test("(a, a) => 42", { start: {line: 1, column: 4}, end: {line: 1, column: 5} }, - range: [4, 5], name: "a" } ], @@ -2733,7 +2470,6 @@ test("(a, a) => 42", { start: {line: 1, column: 10}, end: {line: 1, column: 12} }, - range: [10, 12], value: 42, raw: "42" }, @@ -2758,7 +2494,6 @@ test("x = { method() { } }", { left: { type: "Identifier", name: "x", - range: [0, 1], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 1} @@ -2771,7 +2506,6 @@ test("x = { method() { } }", { key: { type: "Identifier", name: "method", - range: [6, 12], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 12} @@ -2785,7 +2519,6 @@ test("x = { method() { } }", { body: { type: "BlockStatement", body: [], - range: [15, 18], loc: { start: {line: 1, column: 15}, end: {line: 1, column: 18} @@ -2794,7 +2527,6 @@ test("x = { method() { } }", { rest: null, generator: false, expression: false, - range: [12, 18], loc: { start: {line: 1, column: 12}, end: {line: 1, column: 18} @@ -2804,31 +2536,26 @@ test("x = { method() { } }", { method: true, shorthand: false, computed: false, - range: [6, 18], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 18} } }], - range: [4, 20], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 20} } }, - range: [0, 20], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 20} } }, - range: [0, 20], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 20} } }], - range: [0, 20], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 20} @@ -2849,7 +2576,6 @@ test("x = { method(test) { } }", { left: { type: "Identifier", name: "x", - range: [0, 1], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 1} @@ -2862,7 +2588,6 @@ test("x = { method(test) { } }", { key: { type: "Identifier", name: "method", - range: [6, 12], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 12} @@ -2874,7 +2599,6 @@ test("x = { method(test) { } }", { params: [{ type: "Identifier", name: "test", - range: [13, 17], loc: { start: {line: 1, column: 13}, end: {line: 1, column: 17} @@ -2884,7 +2608,6 @@ test("x = { method(test) { } }", { body: { type: "BlockStatement", body: [], - range: [19, 22], loc: { start: {line: 1, column: 19}, end: {line: 1, column: 22} @@ -2893,7 +2616,6 @@ test("x = { method(test) { } }", { rest: null, generator: false, expression: false, - range: [12, 22], loc: { start: {line: 1, column: 12}, end: {line: 1, column: 22} @@ -2903,31 +2625,26 @@ test("x = { method(test) { } }", { method: true, shorthand: false, computed: false, - range: [6, 22], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 22} } }], - range: [4, 24], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 24} } }, - range: [0, 24], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 24} } }, - range: [0, 24], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 24} } }], - range: [0, 24], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 24} @@ -2948,7 +2665,6 @@ test("x = { 'method'() { } }", { left: { type: "Identifier", name: "x", - range: [0, 1], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 1} @@ -2962,7 +2678,6 @@ test("x = { 'method'() { } }", { type: "Literal", value: "method", raw: "'method'", - range: [6, 14], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 14} @@ -2976,7 +2691,6 @@ test("x = { 'method'() { } }", { body: { type: "BlockStatement", body: [], - range: [17, 20], loc: { start: {line: 1, column: 17}, end: {line: 1, column: 20} @@ -2985,7 +2699,6 @@ test("x = { 'method'() { } }", { rest: null, generator: false, expression: false, - range: [14, 20], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 20} @@ -2995,31 +2708,26 @@ test("x = { 'method'() { } }", { method: true, shorthand: false, computed: false, - range: [6, 20], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 20} } }], - range: [4, 22], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 22} } }, - range: [0, 22], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 22} } }, - range: [0, 22], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 22} } }], - range: [0, 22], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 22} @@ -3040,7 +2748,6 @@ test("x = { get() { } }", { left: { type: "Identifier", name: "x", - range: [0, 1], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 1} @@ -3053,7 +2760,6 @@ test("x = { get() { } }", { key: { type: "Identifier", name: "get", - range: [6, 9], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 9} @@ -3067,7 +2773,6 @@ test("x = { get() { } }", { body: { type: "BlockStatement", body: [], - range: [12, 15], loc: { start: {line: 1, column: 12}, end: {line: 1, column: 15} @@ -3076,7 +2781,6 @@ test("x = { get() { } }", { rest: null, generator: false, expression: false, - range: [9, 15], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 15} @@ -3086,31 +2790,26 @@ test("x = { get() { } }", { method: true, shorthand: false, computed: false, - range: [6, 15], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 15} } }], - range: [4, 17], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 17} } }, - range: [0, 17], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 17} } }, - range: [0, 17], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 17} } }], - range: [0, 17], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 17} @@ -3131,7 +2830,6 @@ test("x = { set() { } }", { left: { type: "Identifier", name: "x", - range: [0, 1], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 1} @@ -3144,7 +2842,6 @@ test("x = { set() { } }", { key: { type: "Identifier", name: "set", - range: [6, 9], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 9} @@ -3158,7 +2855,6 @@ test("x = { set() { } }", { body: { type: "BlockStatement", body: [], - range: [12, 15], loc: { start: {line: 1, column: 12}, end: {line: 1, column: 15} @@ -3167,7 +2863,6 @@ test("x = { set() { } }", { rest: null, generator: false, expression: false, - range: [9, 15], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 15} @@ -3177,31 +2872,26 @@ test("x = { set() { } }", { method: true, shorthand: false, computed: false, - range: [6, 15], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 15} } }], - range: [4, 17], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 17} } }, - range: [0, 17], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 17} } }, - range: [0, 17], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 17} } }], - range: [0, 17], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 17} @@ -3222,7 +2912,6 @@ test("x = { method() 42 }", { left: { type: "Identifier", name: "x", - range: [0, 1], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 1} @@ -3235,7 +2924,6 @@ test("x = { method() 42 }", { key: { type: "Identifier", name: "method", - range: [6, 12], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 12} @@ -3250,7 +2938,6 @@ test("x = { method() 42 }", { type: "Literal", value: 42, raw: "42", - range: [15, 17], loc: { start: {line: 1, column: 15}, end: {line: 1, column: 17} @@ -3259,7 +2946,6 @@ test("x = { method() 42 }", { rest: null, generator: false, expression: true, - range: [12, 17], loc: { start: {line: 1, column: 12}, end: {line: 1, column: 17} @@ -3269,31 +2955,26 @@ test("x = { method() 42 }", { method: true, shorthand: false, computed: false, - range: [6, 17], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 17} } }], - range: [4, 19], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 19} } }, - range: [0, 19], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 19} } }, - range: [0, 19], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 19} } }], - range: [0, 19], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 19} @@ -3314,7 +2995,6 @@ test("x = { get method() 42 }", { left: { type: "Identifier", name: "x", - range: [0, 1], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 1} @@ -3327,7 +3007,6 @@ test("x = { get method() 42 }", { key: { type: "Identifier", name: "method", - range: [10, 16], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 16} @@ -3342,7 +3021,6 @@ test("x = { get method() 42 }", { type: "Literal", value: 42, raw: "42", - range: [19, 21], loc: { start: {line: 1, column: 19}, end: {line: 1, column: 21} @@ -3351,7 +3029,6 @@ test("x = { get method() 42 }", { rest: null, generator: false, expression: true, - range: [16, 21], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 21} @@ -3361,31 +3038,26 @@ test("x = { get method() 42 }", { method: false, shorthand: false, computed: false, - range: [6, 21], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 21} } }], - range: [4, 23], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 23} } }, - range: [0, 23], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 23} } }, - range: [0, 23], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 23} } }], - range: [0, 23], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 23} @@ -3406,7 +3078,6 @@ test("x = { set method(val) v = val }", { left: { type: "Identifier", name: "x", - range: [0, 1], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 1} @@ -3419,7 +3090,6 @@ test("x = { set method(val) v = val }", { key: { type: "Identifier", name: "method", - range: [10, 16], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 16} @@ -3431,7 +3101,6 @@ test("x = { set method(val) v = val }", { params: [{ type: "Identifier", name: "val", - range: [17, 20], loc: { start: {line: 1, column: 17}, end: {line: 1, column: 20} @@ -3444,7 +3113,6 @@ test("x = { set method(val) v = val }", { left: { type: "Identifier", name: "v", - range: [22, 23], loc: { start: {line: 1, column: 22}, end: {line: 1, column: 23} @@ -3453,13 +3121,11 @@ test("x = { set method(val) v = val }", { right: { type: "Identifier", name: "val", - range: [26, 29], loc: { start: {line: 1, column: 26}, end: {line: 1, column: 29} } }, - range: [22, 29], loc: { start: {line: 1, column: 22}, end: {line: 1, column: 29} @@ -3468,7 +3134,6 @@ test("x = { set method(val) v = val }", { rest: null, generator: false, expression: true, - range: [16, 29], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 29} @@ -3478,31 +3143,26 @@ test("x = { set method(val) v = val }", { method: false, shorthand: false, computed: false, - range: [6, 29], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 29} } }], - range: [4, 31], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 31} } }, - range: [0, 31], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 31} } }, - range: [0, 31], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 31} } }], - range: [0, 31], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 31} @@ -3527,7 +3187,6 @@ test("[for (x of array) x]", { left: { type: "Identifier", name: "x", - range: [6, 7], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} @@ -3536,13 +3195,11 @@ test("[for (x of array) x]", { right: { type: "Identifier", name: "array", - range: [11, 16], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 16} } }, - range: [1, 17], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 17} @@ -3552,26 +3209,22 @@ test("[for (x of array) x]", { body: { type: "Identifier", name: "x", - range: [18, 19], loc: { start: {line: 1, column: 18}, end: {line: 1, column: 19} } }, generator: false, - range: [0, 20], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 20} } }, - range: [0, 20], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 20} } }], - range: [0, 20], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 20} @@ -3594,7 +3247,6 @@ test("[for (x of array) for (y of array2) if (x === test) x]", { left: { type: "Identifier", name: "x", - range: [40, 41], loc: { start: {line: 1, column: 40}, end: {line: 1, column: 41} @@ -3603,13 +3255,11 @@ test("[for (x of array) for (y of array2) if (x === test) x]", { right: { type: "Identifier", name: "test", - range: [46, 50], loc: { start: {line: 1, column: 46}, end: {line: 1, column: 50} } }, - range: [40, 50], loc: { start: {line: 1, column: 40}, end: {line: 1, column: 50} @@ -3621,7 +3271,6 @@ test("[for (x of array) for (y of array2) if (x === test) x]", { left: { type: "Identifier", name: "x", - range: [6, 7], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} @@ -3630,13 +3279,11 @@ test("[for (x of array) for (y of array2) if (x === test) x]", { right: { type: "Identifier", name: "array", - range: [11, 16], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 16} } }, - range: [1, 17], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 17} @@ -3648,7 +3295,6 @@ test("[for (x of array) for (y of array2) if (x === test) x]", { left: { type: "Identifier", name: "y", - range: [23, 24], loc: { start: {line: 1, column: 23}, end: {line: 1, column: 24} @@ -3657,13 +3303,11 @@ test("[for (x of array) for (y of array2) if (x === test) x]", { right: { type: "Identifier", name: "array2", - range: [28, 34], loc: { start: {line: 1, column: 28}, end: {line: 1, column: 34} } }, - range: [18, 35], loc: { start: {line: 1, column: 18}, end: {line: 1, column: 35} @@ -3674,26 +3318,22 @@ test("[for (x of array) for (y of array2) if (x === test) x]", { body: { type: "Identifier", name: "x", - range: [52, 53], loc: { start: {line: 1, column: 52}, end: {line: 1, column: 53} } }, generator: false, - range: [0, 54], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 54} } }, - range: [0, 54], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 54} } }], - range: [0, 54], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 54} @@ -3716,7 +3356,6 @@ test("(for (x of array) for (y of array2) if (x === test) x)", { left: { type: "Identifier", name: "x", - range: [40, 41], loc: { start: {line: 1, column: 40}, end: {line: 1, column: 41} @@ -3725,13 +3364,11 @@ test("(for (x of array) for (y of array2) if (x === test) x)", { right: { type: "Identifier", name: "test", - range: [46, 50], loc: { start: {line: 1, column: 46}, end: {line: 1, column: 50} } }, - range: [40, 50], loc: { start: {line: 1, column: 40}, end: {line: 1, column: 50} @@ -3743,7 +3380,6 @@ test("(for (x of array) for (y of array2) if (x === test) x)", { left: { type: "Identifier", name: "x", - range: [6, 7], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} @@ -3752,13 +3388,11 @@ test("(for (x of array) for (y of array2) if (x === test) x)", { right: { type: "Identifier", name: "array", - range: [11, 16], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 16} } }, - range: [1, 17], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 17} @@ -3770,7 +3404,6 @@ test("(for (x of array) for (y of array2) if (x === test) x)", { left: { type: "Identifier", name: "y", - range: [23, 24], loc: { start: {line: 1, column: 23}, end: {line: 1, column: 24} @@ -3779,13 +3412,11 @@ test("(for (x of array) for (y of array2) if (x === test) x)", { right: { type: "Identifier", name: "array2", - range: [28, 34], loc: { start: {line: 1, column: 28}, end: {line: 1, column: 34} } }, - range: [18, 35], loc: { start: {line: 1, column: 18}, end: {line: 1, column: 35} @@ -3796,26 +3427,22 @@ test("(for (x of array) for (y of array2) if (x === test) x)", { body: { type: "Identifier", name: "x", - range: [52, 53], loc: { start: {line: 1, column: 52}, end: {line: 1, column: 53} } }, generator: true, - range: [0, 54], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 54} } }, - range: [0, 54], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 54} } }], - range: [0, 54], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 54} @@ -3843,14 +3470,12 @@ test("[for ([,x] of array) for ({[start.x]: x, [start.y]: y} of array2) x]", { { type: "Identifier", name: "x", - range: [8, 9], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 9} } } ], - range: [6, 10], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 10} @@ -3859,13 +3484,11 @@ test("[for ([,x] of array) for ({[start.x]: x, [start.y]: y} of array2) x]", { right: { type: "Identifier", name: "array", - range: [14, 19], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 19} } }, - range: [1, 20], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 20} @@ -3885,7 +3508,6 @@ test("[for ([,x] of array) for ({[start.x]: x, [start.y]: y} of array2) x]", { object: { type: "Identifier", name: "start", - range: [28, 33], loc: { start: {line: 1, column: 28}, end: {line: 1, column: 33} @@ -3894,13 +3516,11 @@ test("[for ([,x] of array) for ({[start.x]: x, [start.y]: y} of array2) x]", { property: { type: "Identifier", name: "x", - range: [34, 35], loc: { start: {line: 1, column: 34}, end: {line: 1, column: 35} } }, - range: [28, 35], loc: { start: {line: 1, column: 28}, end: {line: 1, column: 35} @@ -3909,7 +3529,6 @@ test("[for ([,x] of array) for ({[start.x]: x, [start.y]: y} of array2) x]", { value: { type: "Identifier", name: "x", - range: [38, 39], loc: { start: {line: 1, column: 38}, end: {line: 1, column: 39} @@ -3919,7 +3538,6 @@ test("[for ([,x] of array) for ({[start.x]: x, [start.y]: y} of array2) x]", { method: false, shorthand: false, computed: true, - range: [27, 39], loc: { start: {line: 1, column: 27}, end: {line: 1, column: 39} @@ -3933,7 +3551,6 @@ test("[for ([,x] of array) for ({[start.x]: x, [start.y]: y} of array2) x]", { object: { type: "Identifier", name: "start", - range: [42, 47], loc: { start: {line: 1, column: 42}, end: {line: 1, column: 47} @@ -3942,13 +3559,11 @@ test("[for ([,x] of array) for ({[start.x]: x, [start.y]: y} of array2) x]", { property: { type: "Identifier", name: "y", - range: [48, 49], loc: { start: {line: 1, column: 48}, end: {line: 1, column: 49} } }, - range: [42, 49], loc: { start: {line: 1, column: 42}, end: {line: 1, column: 49} @@ -3957,7 +3572,6 @@ test("[for ([,x] of array) for ({[start.x]: x, [start.y]: y} of array2) x]", { value: { type: "Identifier", name: "y", - range: [52, 53], loc: { start: {line: 1, column: 52}, end: {line: 1, column: 53} @@ -3967,14 +3581,12 @@ test("[for ([,x] of array) for ({[start.x]: x, [start.y]: y} of array2) x]", { method: false, shorthand: false, computed: true, - range: [41, 53], loc: { start: {line: 1, column: 41}, end: {line: 1, column: 53} } } ], - range: [26, 54], loc: { start: {line: 1, column: 26}, end: {line: 1, column: 54} @@ -3983,13 +3595,11 @@ test("[for ([,x] of array) for ({[start.x]: x, [start.y]: y} of array2) x]", { right: { type: "Identifier", name: "array2", - range: [58, 64], loc: { start: {line: 1, column: 58}, end: {line: 1, column: 64} } }, - range: [21, 65], loc: { start: {line: 1, column: 21}, end: {line: 1, column: 65} @@ -4000,26 +3610,22 @@ test("[for ([,x] of array) for ({[start.x]: x, [start.y]: y} of array2) x]", { body: { type: "Identifier", name: "x", - range: [66, 67], loc: { start: {line: 1, column: 66}, end: {line: 1, column: 67} } }, generator: false, - range: [0, 68], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 68} } }, - range: [0, 68], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 68} } }], - range: [0, 68], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 68} @@ -4042,7 +3648,6 @@ test("x = { y, z }", { left: { type: "Identifier", name: "x", - range: [0, 1], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 1} @@ -4056,7 +3661,6 @@ test("x = { y, z }", { key: { type: "Identifier", name: "y", - range: [6, 7], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} @@ -4065,7 +3669,6 @@ test("x = { y, z }", { value: { type: "Identifier", name: "y", - range: [6, 7], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} @@ -4075,7 +3678,6 @@ test("x = { y, z }", { method: false, shorthand: true, computed: false, - range: [6, 7], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} @@ -4086,7 +3688,6 @@ test("x = { y, z }", { key: { type: "Identifier", name: "z", - range: [9, 10], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 10} @@ -4095,7 +3696,6 @@ test("x = { y, z }", { value: { type: "Identifier", name: "z", - range: [9, 10], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 10} @@ -4105,32 +3705,27 @@ test("x = { y, z }", { method: false, shorthand: true, computed: false, - range: [9, 10], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 10} } } ], - range: [4, 12], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 12} } }, - range: [0, 12], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 12} } }, - range: [0, 12], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 12} } }], - range: [0, 12], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 12} @@ -4156,7 +3751,6 @@ test("[a, b] = [b, a]", { { type: "Identifier", name: "a", - range: [1, 2], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 2} @@ -4165,14 +3759,12 @@ test("[a, b] = [b, a]", { { type: "Identifier", name: "b", - range: [4, 5], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 5} } } ], - range: [0, 6], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 6} @@ -4184,7 +3776,6 @@ test("[a, b] = [b, a]", { { type: "Identifier", name: "b", - range: [10, 11], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 11} @@ -4193,32 +3784,27 @@ test("[a, b] = [b, a]", { { type: "Identifier", name: "a", - range: [13, 14], loc: { start: {line: 1, column: 13}, end: {line: 1, column: 14} } } ], - range: [9, 15], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 15} } }, - range: [0, 15], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 15} } }, - range: [0, 15], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 15} } }], - range: [0, 15], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 15} @@ -4243,7 +3829,6 @@ test("({ responseText: text }) = res", { key: { type: "Identifier", name: "responseText", - range: [3, 15], loc: { start: {line: 1, column: 3}, end: {line: 1, column: 15} @@ -4252,7 +3837,6 @@ test("({ responseText: text }) = res", { value: { type: "Identifier", name: "text", - range: [17, 21], loc: { start: {line: 1, column: 17}, end: {line: 1, column: 21} @@ -4262,13 +3846,11 @@ test("({ responseText: text }) = res", { method: false, shorthand: false, computed: false, - range: [3, 21], loc: { start: {line: 1, column: 3}, end: {line: 1, column: 21} } }], - range: [1, 23], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 23} @@ -4277,25 +3859,21 @@ test("({ responseText: text }) = res", { right: { type: "Identifier", name: "res", - range: [27, 30], loc: { start: {line: 1, column: 27}, end: {line: 1, column: 30} } }, - range: [0, 30], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 30} } }, - range: [0, 30], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 30} } }], - range: [0, 30], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 30} @@ -4319,7 +3897,6 @@ test("const {a} = {}", { key: { type: "Identifier", name: "a", - range: [7, 8], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 8} @@ -4328,7 +3905,6 @@ test("const {a} = {}", { value: { type: "Identifier", name: "a", - range: [7, 8], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 8} @@ -4338,13 +3914,11 @@ test("const {a} = {}", { method: false, shorthand: true, computed: false, - range: [7, 8], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 8} } }], - range: [6, 9], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 9} @@ -4353,26 +3927,22 @@ test("const {a} = {}", { init: { type: "ObjectExpression", properties: [], - range: [12, 14], loc: { start: {line: 1, column: 12}, end: {line: 1, column: 14} } }, - range: [6, 14], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 14} } }], kind: "const", - range: [0, 14], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 14} } }], - range: [0, 14], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 14} @@ -4394,13 +3964,11 @@ test("const [a] = []", { elements: [{ type: "Identifier", name: "a", - range: [7, 8], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 8} } }], - range: [6, 9], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 9} @@ -4409,26 +3977,22 @@ test("const [a] = []", { init: { type: "ArrayExpression", elements: [], - range: [12, 14], loc: { start: {line: 1, column: 12}, end: {line: 1, column: 14} } }, - range: [6, 14], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 14} } }], kind: "const", - range: [0, 14], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 14} } }], - range: [0, 14], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 14} @@ -4452,7 +4016,6 @@ test("let {a} = {}", { key: { type: "Identifier", name: "a", - range: [5, 6], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 6} @@ -4461,7 +4024,6 @@ test("let {a} = {}", { value: { type: "Identifier", name: "a", - range: [5, 6], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 6} @@ -4471,13 +4033,11 @@ test("let {a} = {}", { method: false, shorthand: true, computed: false, - range: [5, 6], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 6} } }], - range: [4, 7], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 7} @@ -4486,26 +4046,22 @@ test("let {a} = {}", { init: { type: "ObjectExpression", properties: [], - range: [10, 12], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 12} } }, - range: [4, 12], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 12} } }], kind: "let", - range: [0, 12], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 12} } }], - range: [0, 12], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 12} @@ -4527,13 +4083,11 @@ test("let [a] = []", { elements: [{ type: "Identifier", name: "a", - range: [5, 6], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 6} } }], - range: [4, 7], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 7} @@ -4542,26 +4096,22 @@ test("let [a] = []", { init: { type: "ArrayExpression", elements: [], - range: [10, 12], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 12} } }, - range: [4, 12], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 12} } }], kind: "let", - range: [0, 12], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 12} } }], - range: [0, 12], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 12} @@ -4585,7 +4135,6 @@ test("var {a} = {}", { key: { type: "Identifier", name: "a", - range: [5, 6], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 6} @@ -4594,7 +4143,6 @@ test("var {a} = {}", { value: { type: "Identifier", name: "a", - range: [5, 6], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 6} @@ -4604,13 +4152,11 @@ test("var {a} = {}", { method: false, shorthand: true, computed: false, - range: [5, 6], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 6} } }], - range: [4, 7], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 7} @@ -4619,26 +4165,22 @@ test("var {a} = {}", { init: { type: "ObjectExpression", properties: [], - range: [10, 12], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 12} } }, - range: [4, 12], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 12} } }], kind: "var", - range: [0, 12], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 12} } }], - range: [0, 12], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 12} @@ -4660,13 +4202,11 @@ test("var [a] = []", { elements: [{ type: "Identifier", name: "a", - range: [5, 6], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 6} } }], - range: [4, 7], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 7} @@ -4675,26 +4215,22 @@ test("var [a] = []", { init: { type: "ArrayExpression", elements: [], - range: [10, 12], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 12} } }, - range: [4, 12], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 12} } }], kind: "var", - range: [0, 12], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 12} } }], - range: [0, 12], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 12} @@ -4718,7 +4254,6 @@ test("const {a:b} = {}", { key: { type: "Identifier", name: "a", - range: [7, 8], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 8} @@ -4727,7 +4262,6 @@ test("const {a:b} = {}", { value: { type: "Identifier", name: "b", - range: [9, 10], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 10} @@ -4737,13 +4271,11 @@ test("const {a:b} = {}", { method: false, shorthand: false, computed: false, - range: [7, 10], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 10} } }], - range: [6, 11], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 11} @@ -4752,26 +4284,22 @@ test("const {a:b} = {}", { init: { type: "ObjectExpression", properties: [], - range: [14, 16], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 16} } }, - range: [6, 16], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 16} } }], kind: "const", - range: [0, 16], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 16} } }], - range: [0, 16], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 16} @@ -4795,7 +4323,6 @@ test("let {a:b} = {}", { key: { type: "Identifier", name: "a", - range: [5, 6], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 6} @@ -4804,7 +4331,6 @@ test("let {a:b} = {}", { value: { type: "Identifier", name: "b", - range: [7, 8], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 8} @@ -4814,13 +4340,11 @@ test("let {a:b} = {}", { method: false, shorthand: false, computed: false, - range: [5, 8], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 8} } }], - range: [4, 9], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 9} @@ -4829,26 +4353,22 @@ test("let {a:b} = {}", { init: { type: "ObjectExpression", properties: [], - range: [12, 14], loc: { start: {line: 1, column: 12}, end: {line: 1, column: 14} } }, - range: [4, 14], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 14} } }], kind: "let", - range: [0, 14], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 14} } }], - range: [0, 14], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 14} @@ -4872,7 +4392,6 @@ test("var {a:b} = {}", { key: { type: "Identifier", name: "a", - range: [5, 6], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 6} @@ -4881,7 +4400,6 @@ test("var {a:b} = {}", { value: { type: "Identifier", name: "b", - range: [7, 8], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 8} @@ -4891,13 +4409,11 @@ test("var {a:b} = {}", { method: false, shorthand: false, computed: false, - range: [5, 8], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 8} } }], - range: [4, 9], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 9} @@ -4906,26 +4422,22 @@ test("var {a:b} = {}", { init: { type: "ObjectExpression", properties: [], - range: [12, 14], loc: { start: {line: 1, column: 12}, end: {line: 1, column: 14} } }, - range: [4, 14], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 14} } }], kind: "var", - range: [0, 14], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 14} } }], - range: [0, 14], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 14} @@ -4949,21 +4461,18 @@ test("export var document", { id: { type: "Identifier", name: "document", - range: [11, 19], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 19} } }, init: null, - range: [11, 19], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 19} } }], kind: "var", - range: [7, 19], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 19} @@ -4972,13 +4481,11 @@ test("export var document", { default: false, specifiers: null, source: null, - range: [0, 19], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 19} } }], - range: [0, 19], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 19} @@ -5000,7 +4507,6 @@ test("export var document = { }", { id: { type: "Identifier", name: "document", - range: [11, 19], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 19} @@ -5009,20 +4515,17 @@ test("export var document = { }", { init: { type: "ObjectExpression", properties: [], - range: [22, 25], loc: { start: {line: 1, column: 22}, end: {line: 1, column: 25} } }, - range: [11, 25], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 25} } }], kind: "var", - range: [7, 25], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 25} @@ -5031,13 +4534,11 @@ test("export var document = { }", { default: false, specifiers: null, source: null, - range: [0, 25], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 25} } }], - range: [0, 25], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 25} @@ -5059,21 +4560,18 @@ test("export let document", { id: { type: "Identifier", name: "document", - range: [11, 19], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 19} } }, init: null, - range: [11, 19], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 19} } }], kind: "let", - range: [7, 19], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 19} @@ -5082,13 +4580,11 @@ test("export let document", { default: false, specifiers: null, source: null, - range: [0, 19], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 19} } }], - range: [0, 19], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 19} @@ -5110,7 +4606,6 @@ test("export let document = { }", { id: { type: "Identifier", name: "document", - range: [11, 19], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 19} @@ -5119,20 +4614,17 @@ test("export let document = { }", { init: { type: "ObjectExpression", properties: [], - range: [22, 25], loc: { start: {line: 1, column: 22}, end: {line: 1, column: 25} } }, - range: [11, 25], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 25} } }], kind: "let", - range: [7, 25], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 25} @@ -5141,13 +4633,11 @@ test("export let document = { }", { default: false, specifiers: null, source: null, - range: [0, 25], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 25} } }], - range: [0, 25], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 25} @@ -5169,7 +4659,6 @@ test("export const document = { }", { id: { type: "Identifier", name: "document", - range: [13, 21], loc: { start: {line: 1, column: 13}, end: {line: 1, column: 21} @@ -5178,20 +4667,17 @@ test("export const document = { }", { init: { type: "ObjectExpression", properties: [], - range: [24, 27], loc: { start: {line: 1, column: 24}, end: {line: 1, column: 27} } }, - range: [13, 27], loc: { start: {line: 1, column: 13}, end: {line: 1, column: 27} } }], kind: "const", - range: [7, 27], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 27} @@ -5200,13 +4686,11 @@ test("export const document = { }", { default: false, specifiers: null, source: null, - range: [0, 27], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 27} } }], - range: [0, 27], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 27} @@ -5226,7 +4710,6 @@ test("export function parse() { }", { id: { type: "Identifier", name: "parse", - range: [16, 21], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 21} @@ -5237,7 +4720,6 @@ test("export function parse() { }", { body: { type: "BlockStatement", body: [], - range: [24, 27], loc: { start: {line: 1, column: 24}, end: {line: 1, column: 27} @@ -5246,7 +4728,6 @@ test("export function parse() { }", { rest: null, generator: false, expression: false, - range: [7, 27], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 27} @@ -5255,13 +4736,11 @@ test("export function parse() { }", { default: false, specifiers: null, source: null, - range: [0, 27], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 27} } }], - range: [0, 27], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 27} @@ -5281,7 +4760,6 @@ test("export class Class {}", { id: { type: "Identifier", name: "Class", - range: [13, 18], loc: { start: {line: 1, column: 13}, end: {line: 1, column: 18} @@ -5291,13 +4769,11 @@ test("export class Class {}", { body: { type: "ClassBody", body: [], - range: [19, 21], loc: { start: {line: 1, column: 19}, end: {line: 1, column: 21} } }, - range: [7, 21], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 21} @@ -5306,13 +4782,11 @@ test("export class Class {}", { default: false, specifiers: null, source: null, - range: [0, 21], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 21} } }], - range: [0, 21], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 21} @@ -5331,7 +4805,6 @@ test("export default 42", { type: "Literal", value: 42, raw: "42", - range: [15, 17], loc: { start: {line: 1, column: 15}, end: {line: 1, column: 17} @@ -5340,13 +4813,11 @@ test("export default 42", { default: true, specifiers: null, source: null, - range: [0, 17], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 17} } }], - range: [0, 17], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 17} @@ -5366,7 +4837,6 @@ test("export * from \"crypto\"", { declaration: null, specifiers: [{ type: "ExportBatchSpecifier", - range: [7, 8], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 8} @@ -5376,19 +4846,16 @@ test("export * from \"crypto\"", { type: "Literal", value: "crypto", raw: "\"crypto\"", - range: [14, 22], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 22} } }, - range: [0, 22], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 22} } }], - range: [0, 22], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 22} @@ -5409,27 +4876,23 @@ test("export { encrypt }", { id: { type: "Identifier", name: "encrypt", - range: [9, 16], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 16} } }, name: null, - range: [9, 16], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 16} } }], source: null, - range: [0, 18], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 18} } }], - range: [0, 18], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 18} @@ -5451,14 +4914,12 @@ test("export { encrypt, decrypt }", { id: { type: "Identifier", name: "encrypt", - range: [9, 16], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 16} } }, name: null, - range: [9, 16], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 16} @@ -5469,14 +4930,12 @@ test("export { encrypt, decrypt }", { id: { type: "Identifier", name: "decrypt", - range: [18, 25], loc: { start: {line: 1, column: 18}, end: {line: 1, column: 25} } }, name: null, - range: [18, 25], loc: { start: {line: 1, column: 18}, end: {line: 1, column: 25} @@ -5484,13 +4943,11 @@ test("export { encrypt, decrypt }", { } ], source: null, - range: [0, 27], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 27} } }], - range: [0, 27], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 27} @@ -5511,7 +4968,6 @@ test("export { encrypt as default }", { id: { type: "Identifier", name: "encrypt", - range: [9, 16], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 16} @@ -5520,26 +4976,22 @@ test("export { encrypt as default }", { name: { type: "Identifier", name: "default", - range: [20, 27], loc: { start: {line: 1, column: 20}, end: {line: 1, column: 27} } }, - range: [9, 27], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 27} } }], source: null, - range: [0, 29], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 29} } }], - range: [0, 29], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 29} @@ -5561,14 +5013,12 @@ test("export { encrypt, decrypt as dec }", { id: { type: "Identifier", name: "encrypt", - range: [9, 16], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 16} } }, name: null, - range: [9, 16], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 16} @@ -5579,7 +5029,6 @@ test("export { encrypt, decrypt as dec }", { id: { type: "Identifier", name: "decrypt", - range: [18, 25], loc: { start: {line: 1, column: 18}, end: {line: 1, column: 25} @@ -5588,13 +5037,11 @@ test("export { encrypt, decrypt as dec }", { name: { type: "Identifier", name: "dec", - range: [29, 32], loc: { start: {line: 1, column: 29}, end: {line: 1, column: 32} } }, - range: [18, 32], loc: { start: {line: 1, column: 18}, end: {line: 1, column: 32} @@ -5602,13 +5049,11 @@ test("export { encrypt, decrypt as dec }", { } ], source: null, - range: [0, 34], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 34} } }], - range: [0, 34], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 34} @@ -5628,19 +5073,16 @@ test("import \"jquery\"", { type: "Literal", value: "jquery", raw: "\"jquery\"", - range: [7, 15], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 15} } }, - range: [0, 15], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 15} } }], - range: [0, 15], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 15} @@ -5660,14 +5102,12 @@ test("import $ from \"jquery\"", { id: { type: "Identifier", name: "$", - range: [7, 8], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 8} } }, name: null, - range: [7, 8], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 8} @@ -5678,19 +5118,16 @@ test("import $ from \"jquery\"", { type: "Literal", value: "jquery", raw: "\"jquery\"", - range: [14, 22], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 22} } }, - range: [0, 22], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 22} } }], - range: [0, 22], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 22} @@ -5711,14 +5148,12 @@ test("import { encrypt, decrypt } from \"crypto\"", { id: { type: "Identifier", name: "encrypt", - range: [9, 16], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 16} } }, name: null, - range: [9, 16], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 16} @@ -5729,14 +5164,12 @@ test("import { encrypt, decrypt } from \"crypto\"", { id: { type: "Identifier", name: "decrypt", - range: [18, 25], loc: { start: {line: 1, column: 18}, end: {line: 1, column: 25} } }, name: null, - range: [18, 25], loc: { start: {line: 1, column: 18}, end: {line: 1, column: 25} @@ -5748,19 +5181,16 @@ test("import { encrypt, decrypt } from \"crypto\"", { type: "Literal", value: "crypto", raw: "\"crypto\"", - range: [33, 41], loc: { start: {line: 1, column: 33}, end: {line: 1, column: 41} } }, - range: [0, 41], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 41} } }], - range: [0, 41], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 41} @@ -5780,7 +5210,6 @@ test("import { encrypt as enc } from \"crypto\"", { id: { type: "Identifier", name: "encrypt", - range: [9, 16], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 16} @@ -5789,13 +5218,11 @@ test("import { encrypt as enc } from \"crypto\"", { name: { type: "Identifier", name: "enc", - range: [20, 23], loc: { start: {line: 1, column: 20}, end: {line: 1, column: 23} } }, - range: [9, 23], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 23} @@ -5806,19 +5233,16 @@ test("import { encrypt as enc } from \"crypto\"", { type: "Literal", value: "crypto", raw: "\"crypto\"", - range: [31, 39], loc: { start: {line: 1, column: 31}, end: {line: 1, column: 39} } }, - range: [0, 39], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 39} } }], - range: [0, 39], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 39} @@ -5831,41 +5255,29 @@ test("import { encrypt as enc } from \"crypto\"", { test("import crypto, { decrypt, encrypt as enc } from \"crypto\"", { type: "Program", - start: 0, - end: 56, loc: { start: {line: 1, column: 0}, end: {line: 1, column: 56} }, - range: [0, 56], body: [{ type: "ImportDeclaration", - start: 0, - end: 56, loc: { start: {line: 1, column: 0}, end: {line: 1, column: 56} }, - range: [0, 56], specifiers: [ { type: "ImportSpecifier", - start: 7, - end: 13, loc: { start: {line: 1, column: 7}, end: {line: 1, column: 13} }, - range: [7, 13], id: { type: "Identifier", - start: 7, - end: 13, loc: { start: {line: 1, column: 7}, end: {line: 1, column: 13} }, - range: [7, 13], name: "crypto" }, name: null, @@ -5873,22 +5285,16 @@ test("import crypto, { decrypt, encrypt as enc } from \"crypto\"", { }, { type: "ImportSpecifier", - start: 17, - end: 24, loc: { start: {line: 1, column: 17}, end: {line: 1, column: 24} }, - range: [17, 24], id: { type: "Identifier", - start: 17, - end: 24, loc: { start: {line: 1, column: 17}, end: {line: 1, column: 24} }, - range: [17, 24], name: "decrypt" }, name: null, @@ -5896,33 +5302,24 @@ test("import crypto, { decrypt, encrypt as enc } from \"crypto\"", { }, { type: "ImportSpecifier", - start: 26, - end: 40, loc: { start: {line: 1, column: 26}, end: {line: 1, column: 40} }, - range: [26, 40], id: { type: "Identifier", - start: 26, - end: 33, loc: { start: {line: 1, column: 26}, end: {line: 1, column: 33} }, - range: [26, 33], name: "encrypt" }, name: { type: "Identifier", - start: 37, - end: 40, loc: { start: {line: 1, column: 37}, end: {line: 1, column: 40} }, - range: [37, 40], name: "enc" }, default: false @@ -5930,13 +5327,10 @@ test("import crypto, { decrypt, encrypt as enc } from \"crypto\"", { ], source: { type: "Literal", - start: 48, - end: 56, loc: { start: {line: 1, column: 48}, end: {line: 1, column: 56} }, - range: [48, 56], value: "crypto", raw: "\"crypto\"" }, @@ -5959,7 +5353,6 @@ test("import { null as nil } from \"bar\"", { id: { type: "Identifier", name: "null", - range: [9, 13], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 13} @@ -5968,13 +5361,11 @@ test("import { null as nil } from \"bar\"", { name: { type: "Identifier", name: "nil", - range: [17, 20], loc: { start: {line: 1, column: 17}, end: {line: 1, column: 20} } }, - range: [9, 20], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 20} @@ -5985,19 +5376,16 @@ test("import { null as nil } from \"bar\"", { type: "Literal", value: "bar", raw: "\"bar\"", - range: [28, 33], loc: { start: {line: 1, column: 28}, end: {line: 1, column: 33} } }, - range: [0, 33], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 33} } }], - range: [0, 33], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 33} @@ -6010,52 +5398,37 @@ test("import { null as nil } from \"bar\"", { test("import * as crypto from \"crypto\"", { type: "Program", - start: 0, - end: 32, loc: { start: {line: 1, column: 0}, end: {line: 1, column: 32} }, - range: [0, 32], body: [{ type: "ImportDeclaration", - start: 0, - end: 32, loc: { start: {line: 1, column: 0}, end: {line: 1, column: 32} }, - range: [0, 32], specifiers: [{ type: "ImportBatchSpecifier", - start: 7, - end: 18, loc: { start: {line: 1, column: 7}, end: {line: 1, column: 18} }, - range: [7, 18], name: { type: "Identifier", - start: 12, - end: 18, loc: { start: {line: 1, column: 12}, end: {line: 1, column: 18} }, - range: [12, 18], name: "crypto" } }], source: { type: "Literal", - start: 24, - end: 32, loc: { start: {line: 1, column: 24}, end: {line: 1, column: 32} }, - range: [24, 32], value: "crypto", raw: "\"crypto\"" }, @@ -6087,26 +5460,22 @@ test("(function* () { yield v })", { argument: { type: "Identifier", name: "v", - range: [22, 23], loc: { start: {line: 1, column: 22}, end: {line: 1, column: 23} } }, delegate: false, - range: [16, 23], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 23} } }, - range: [16, 23], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 23} } }], - range: [14, 25], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 25} @@ -6115,19 +5484,16 @@ test("(function* () { yield v })", { rest: null, generator: true, expression: false, - range: [1, 25], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 25} } }, - range: [0, 26], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 26} } }], - range: [0, 26], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 26} @@ -6156,13 +5522,11 @@ test("(function* () { yield\nv })", { type: "YieldExpression", argument: null, delegate: false, - range: [16, 21], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 21} } }, - range: [16, 21], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 21} @@ -6173,20 +5537,17 @@ test("(function* () { yield\nv })", { expression: { type: "Identifier", name: "v", - range: [22, 23], loc: { start: {line: 2, column: 0}, end: {line: 2, column: 1} } }, - range: [22, 23], loc: { start: {line: 2, column: 0}, end: {line: 2, column: 1} } } ], - range: [14, 25], loc: { start: {line: 1, column: 14}, end: {line: 2, column: 3} @@ -6195,19 +5556,16 @@ test("(function* () { yield\nv })", { rest: null, generator: true, expression: false, - range: [1, 25], loc: { start: {line: 1, column: 1}, end: {line: 2, column: 3} } }, - range: [0, 26], loc: { start: {line: 1, column: 0}, end: {line: 2, column: 4} } }], - range: [0, 26], loc: { start: {line: 1, column: 0}, end: {line: 2, column: 4} @@ -6236,26 +5594,22 @@ test("(function* () { yield *v })", { argument: { type: "Identifier", name: "v", - range: [23, 24], loc: { start: {line: 1, column: 23}, end: {line: 1, column: 24} } }, delegate: true, - range: [16, 24], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 24} } }, - range: [16, 24], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 24} } }], - range: [14, 26], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 26} @@ -6264,19 +5618,16 @@ test("(function* () { yield *v })", { rest: null, generator: true, expression: false, - range: [1, 26], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 26} } }, - range: [0, 27], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 27} } }], - range: [0, 27], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 27} @@ -6294,7 +5645,6 @@ test("function* test () { yield *v }", { id: { type: "Identifier", name: "test", - range: [10, 14], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 14} @@ -6311,26 +5661,22 @@ test("function* test () { yield *v }", { argument: { type: "Identifier", name: "v", - range: [27, 28], loc: { start: {line: 1, column: 27}, end: {line: 1, column: 28} } }, delegate: true, - range: [20, 28], loc: { start: {line: 1, column: 20}, end: {line: 1, column: 28} } }, - range: [20, 28], loc: { start: {line: 1, column: 20}, end: {line: 1, column: 28} } }], - range: [18, 30], loc: { start: {line: 1, column: 18}, end: {line: 1, column: 30} @@ -6339,13 +5685,11 @@ test("function* test () { yield *v }", { rest: null, generator: true, expression: false, - range: [0, 30], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 30} } }], - range: [0, 30], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 30} @@ -6365,7 +5709,6 @@ test("var x = { *test () { yield *v } };", { id: { type: "Identifier", name: "x", - range: [4, 5], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 5} @@ -6378,7 +5721,6 @@ test("var x = { *test () { yield *v } };", { key: { type: "Identifier", name: "test", - range: [11, 15], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 15} @@ -6398,26 +5740,22 @@ test("var x = { *test () { yield *v } };", { argument: { type: "Identifier", name: "v", - range: [28, 29], loc: { start: {line: 1, column: 28}, end: {line: 1, column: 29} } }, delegate: true, - range: [21, 29], loc: { start: {line: 1, column: 21}, end: {line: 1, column: 29} } }, - range: [21, 29], loc: { start: {line: 1, column: 21}, end: {line: 1, column: 29} } }], - range: [19, 31], loc: { start: {line: 1, column: 19}, end: {line: 1, column: 31} @@ -6426,7 +5764,6 @@ test("var x = { *test () { yield *v } };", { rest: null, generator: true, expression: false, - range: [16, 31], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 31} @@ -6436,32 +5773,27 @@ test("var x = { *test () { yield *v } };", { method: true, shorthand: false, computed: false, - range: [10, 31], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 31} } }], - range: [8, 33], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 33} } }, - range: [4, 33], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 33} } }], kind: "var", - range: [0, 34], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 34} } }], - range: [0, 34], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 34} @@ -6479,7 +5811,6 @@ test("function* t() {}", { id: { type: "Identifier", name: "t", - range: [10, 11], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 11} @@ -6490,7 +5821,6 @@ test("function* t() {}", { body: { type: "BlockStatement", body: [], - range: [14, 16], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 16} @@ -6499,13 +5829,11 @@ test("function* t() {}", { rest: null, generator: true, expression: false, - range: [0, 16], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 16} } }], - range: [0, 16], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 16} @@ -6537,33 +5865,28 @@ test("(function* () { yield yield 10 })", { type: "Literal", value: 10, raw: "10", - range: [28, 30], loc: { start: {line: 1, column: 28}, end: {line: 1, column: 30} } }, delegate: false, - range: [22, 30], loc: { start: {line: 1, column: 22}, end: {line: 1, column: 30} } }, delegate: false, - range: [16, 30], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 30} } }, - range: [16, 30], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 30} } }], - range: [14, 32], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 32} @@ -6572,19 +5895,16 @@ test("(function* () { yield yield 10 })", { rest: null, generator: true, expression: false, - range: [1, 32], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 32} } }, - range: [0, 33], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 33} } }], - range: [0, 33], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 33} @@ -6604,7 +5924,6 @@ test("for(x of list) process(x);", { left: { type: "Identifier", name: "x", - range: [4, 5], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 5} @@ -6613,7 +5932,6 @@ test("for(x of list) process(x);", { right: { type: "Identifier", name: "list", - range: [9, 13], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 13} @@ -6626,7 +5944,6 @@ test("for(x of list) process(x);", { callee: { type: "Identifier", name: "process", - range: [15, 22], loc: { start: {line: 1, column: 15}, end: {line: 1, column: 22} @@ -6635,31 +5952,26 @@ test("for(x of list) process(x);", { arguments: [{ type: "Identifier", name: "x", - range: [23, 24], loc: { start: {line: 1, column: 23}, end: {line: 1, column: 24} } }], - range: [15, 25], loc: { start: {line: 1, column: 15}, end: {line: 1, column: 25} } }, - range: [15, 26], loc: { start: {line: 1, column: 15}, end: {line: 1, column: 26} } }, - range: [0, 26], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 26} } }], - range: [0, 26], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 26} @@ -6681,21 +5993,18 @@ test("for (var x of list) process(x);", { id: { type: "Identifier", name: "x", - range: [9, 10], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 10} } }, init: null, - range: [9, 10], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 10} } }], kind: "var", - range: [5, 10], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 10} @@ -6704,7 +6013,6 @@ test("for (var x of list) process(x);", { right: { type: "Identifier", name: "list", - range: [14, 18], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 18} @@ -6717,7 +6025,6 @@ test("for (var x of list) process(x);", { callee: { type: "Identifier", name: "process", - range: [20, 27], loc: { start: {line: 1, column: 20}, end: {line: 1, column: 27} @@ -6726,31 +6033,26 @@ test("for (var x of list) process(x);", { arguments: [{ type: "Identifier", name: "x", - range: [28, 29], loc: { start: {line: 1, column: 28}, end: {line: 1, column: 29} } }], - range: [20, 30], loc: { start: {line: 1, column: 20}, end: {line: 1, column: 30} } }, - range: [20, 31], loc: { start: {line: 1, column: 20}, end: {line: 1, column: 31} } }, - range: [0, 31], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 31} } }], - range: [0, 31], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 31} @@ -6772,7 +6074,6 @@ test("for (var x = 42 of list) process(x);", { id: { type: "Identifier", name: "x", - range: [9, 10], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 10} @@ -6782,20 +6083,17 @@ test("for (var x = 42 of list) process(x);", { type: "Literal", value: 42, raw: "42", - range: [13, 15], loc: { start: {line: 1, column: 13}, end: {line: 1, column: 15} } }, - range: [9, 15], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 15} } }], kind: "var", - range: [5, 15], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 15} @@ -6804,7 +6102,6 @@ test("for (var x = 42 of list) process(x);", { right: { type: "Identifier", name: "list", - range: [19, 23], loc: { start: {line: 1, column: 19}, end: {line: 1, column: 23} @@ -6817,7 +6114,6 @@ test("for (var x = 42 of list) process(x);", { callee: { type: "Identifier", name: "process", - range: [25, 32], loc: { start: {line: 1, column: 25}, end: {line: 1, column: 32} @@ -6826,31 +6122,26 @@ test("for (var x = 42 of list) process(x);", { arguments: [{ type: "Identifier", name: "x", - range: [33, 34], loc: { start: {line: 1, column: 33}, end: {line: 1, column: 34} } }], - range: [25, 35], loc: { start: {line: 1, column: 25}, end: {line: 1, column: 35} } }, - range: [25, 36], loc: { start: {line: 1, column: 25}, end: {line: 1, column: 36} } }, - range: [0, 36], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 36} } }], - range: [0, 36], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 36} @@ -6872,21 +6163,18 @@ test("for (let x of list) process(x);", { id: { type: "Identifier", name: "x", - range: [9, 10], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 10} } }, init: null, - range: [9, 10], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 10} } }], kind: "let", - range: [5, 10], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 10} @@ -6895,7 +6183,6 @@ test("for (let x of list) process(x);", { right: { type: "Identifier", name: "list", - range: [14, 18], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 18} @@ -6908,7 +6195,6 @@ test("for (let x of list) process(x);", { callee: { type: "Identifier", name: "process", - range: [20, 27], loc: { start: {line: 1, column: 20}, end: {line: 1, column: 27} @@ -6917,31 +6203,26 @@ test("for (let x of list) process(x);", { arguments: [{ type: "Identifier", name: "x", - range: [28, 29], loc: { start: {line: 1, column: 28}, end: {line: 1, column: 29} } }], - range: [20, 30], loc: { start: {line: 1, column: 20}, end: {line: 1, column: 30} } }, - range: [20, 31], loc: { start: {line: 1, column: 20}, end: {line: 1, column: 31} } }, - range: [0, 31], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 31} } }], - range: [0, 31], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 31} @@ -6963,7 +6244,6 @@ test("var A = class extends B {}", { id: { type: "Identifier", name: "A", - range: [4, 5], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 5} @@ -6974,7 +6254,6 @@ test("var A = class extends B {}", { superClass: { type: "Identifier", name: "B", - range: [22, 23], loc: { start: {line: 1, column: 22}, end: {line: 1, column: 23} @@ -6983,32 +6262,27 @@ test("var A = class extends B {}", { body: { type: "ClassBody", body: [], - range: [24, 26], loc: { start: {line: 1, column: 24}, end: {line: 1, column: 26} } }, - range: [8, 26], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 26} } }, - range: [4, 26], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 26} } }], kind: "var", - range: [0, 26], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 26} } }], - range: [0, 26], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 26} @@ -7026,7 +6300,6 @@ test("class A extends class B extends C {} {}", { id: { type: "Identifier", name: "A", - range: [6, 7], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} @@ -7037,7 +6310,6 @@ test("class A extends class B extends C {} {}", { id: { type: "Identifier", name: "B", - range: [22, 23], loc: { start: {line: 1, column: 22}, end: {line: 1, column: 23} @@ -7046,7 +6318,6 @@ test("class A extends class B extends C {} {}", { superClass: { type: "Identifier", name: "C", - range: [32, 33], loc: { start: {line: 1, column: 32}, end: {line: 1, column: 33} @@ -7055,13 +6326,11 @@ test("class A extends class B extends C {} {}", { body: { type: "ClassBody", body: [], - range: [34, 36], loc: { start: {line: 1, column: 34}, end: {line: 1, column: 36} } }, - range: [16, 36], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 36} @@ -7070,19 +6339,16 @@ test("class A extends class B extends C {} {}", { body: { type: "ClassBody", body: [], - range: [37, 39], loc: { start: {line: 1, column: 37}, end: {line: 1, column: 39} } }, - range: [0, 39], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 39} } }], - range: [0, 39], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 39} @@ -7100,7 +6366,6 @@ test("class A {get() {}}", { id: { type: "Identifier", name: "A", - range: [6, 7], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} @@ -7115,7 +6380,6 @@ test("class A {get() {}}", { key: { type: "Identifier", name: "get", - range: [9, 12], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 12} @@ -7129,7 +6393,6 @@ test("class A {get() {}}", { body: { type: "BlockStatement", body: [], - range: [15, 17], loc: { start: {line: 1, column: 15}, end: {line: 1, column: 17} @@ -7138,7 +6401,6 @@ test("class A {get() {}}", { rest: null, generator: false, expression: false, - range: [12, 17], loc: { start: {line: 1, column: 12}, end: {line: 1, column: 17} @@ -7146,25 +6408,21 @@ test("class A {get() {}}", { }, kind: "", static: false, - range: [9, 17], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 17} } }], - range: [8, 18], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 18} } }, - range: [0, 18], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 18} } }], - range: [0, 18], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 18} @@ -7182,7 +6440,6 @@ test("class A { static get() {}}", { id: { type: "Identifier", name: "A", - range: [6, 7], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} @@ -7197,7 +6454,6 @@ test("class A { static get() {}}", { key: { type: "Identifier", name: "get", - range: [17, 20], loc: { start: {line: 1, column: 17}, end: {line: 1, column: 20} @@ -7211,7 +6467,6 @@ test("class A { static get() {}}", { body: { type: "BlockStatement", body: [], - range: [23, 25], loc: { start: {line: 1, column: 23}, end: {line: 1, column: 25} @@ -7220,7 +6475,6 @@ test("class A { static get() {}}", { rest: null, generator: false, expression: false, - range: [20, 25], loc: { start: {line: 1, column: 20}, end: {line: 1, column: 25} @@ -7228,25 +6482,21 @@ test("class A { static get() {}}", { }, kind: "", static: true, - range: [10, 25], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 25} } }], - range: [8, 26], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 26} } }, - range: [0, 26], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 26} } }], - range: [0, 26], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 26} @@ -7264,7 +6514,6 @@ test("class A extends B {get foo() {}}", { id: { type: "Identifier", name: "A", - range: [6, 7], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} @@ -7273,7 +6522,6 @@ test("class A extends B {get foo() {}}", { superClass: { type: "Identifier", name: "B", - range: [16, 17], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 17} @@ -7287,7 +6535,6 @@ test("class A extends B {get foo() {}}", { key: { type: "Identifier", name: "foo", - range: [23, 26], loc: { start: {line: 1, column: 23}, end: {line: 1, column: 26} @@ -7301,7 +6548,6 @@ test("class A extends B {get foo() {}}", { body: { type: "BlockStatement", body: [], - range: [29, 31], loc: { start: {line: 1, column: 29}, end: {line: 1, column: 31} @@ -7310,7 +6556,6 @@ test("class A extends B {get foo() {}}", { rest: null, generator: false, expression: false, - range: [26, 31], loc: { start: {line: 1, column: 26}, end: {line: 1, column: 31} @@ -7318,25 +6563,21 @@ test("class A extends B {get foo() {}}", { }, kind: "get", static: false, - range: [19, 31], loc: { start: {line: 1, column: 19}, end: {line: 1, column: 31} } }], - range: [18, 32], loc: { start: {line: 1, column: 18}, end: {line: 1, column: 32} } }, - range: [0, 32], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 32} } }], - range: [0, 32], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 32} @@ -7354,7 +6595,6 @@ test("class A extends B { static get foo() {}}", { id: { type: "Identifier", name: "A", - range: [6, 7], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} @@ -7363,7 +6603,6 @@ test("class A extends B { static get foo() {}}", { superClass: { type: "Identifier", name: "B", - range: [16, 17], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 17} @@ -7377,7 +6616,6 @@ test("class A extends B { static get foo() {}}", { key: { type: "Identifier", name: "foo", - range: [31, 34], loc: { start: {line: 1, column: 31}, end: {line: 1, column: 34} @@ -7391,7 +6629,6 @@ test("class A extends B { static get foo() {}}", { body: { type: "BlockStatement", body: [], - range: [37, 39], loc: { start: {line: 1, column: 37}, end: {line: 1, column: 39} @@ -7400,7 +6637,6 @@ test("class A extends B { static get foo() {}}", { rest: null, generator: false, expression: false, - range: [34, 39], loc: { start: {line: 1, column: 34}, end: {line: 1, column: 39} @@ -7408,25 +6644,21 @@ test("class A extends B { static get foo() {}}", { }, kind: "get", static: true, - range: [20, 39], loc: { start: {line: 1, column: 20}, end: {line: 1, column: 39} } }], - range: [18, 40], loc: { start: {line: 1, column: 18}, end: {line: 1, column: 40} } }, - range: [0, 40], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 40} } }], - range: [0, 40], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 40} @@ -7444,7 +6676,6 @@ test("class A {set a(v) {}}", { id: { type: "Identifier", name: "A", - range: [6, 7], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} @@ -7459,7 +6690,6 @@ test("class A {set a(v) {}}", { key: { type: "Identifier", name: "a", - range: [13, 14], loc: { start: {line: 1, column: 13}, end: {line: 1, column: 14} @@ -7471,7 +6701,6 @@ test("class A {set a(v) {}}", { params: [{ type: "Identifier", name: "v", - range: [15, 16], loc: { start: {line: 1, column: 15}, end: {line: 1, column: 16} @@ -7481,7 +6710,6 @@ test("class A {set a(v) {}}", { body: { type: "BlockStatement", body: [], - range: [18, 20], loc: { start: {line: 1, column: 18}, end: {line: 1, column: 20} @@ -7490,7 +6718,6 @@ test("class A {set a(v) {}}", { rest: null, generator: false, expression: false, - range: [14, 20], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 20} @@ -7498,25 +6725,21 @@ test("class A {set a(v) {}}", { }, kind: "set", static: false, - range: [9, 20], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 20} } }], - range: [8, 21], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 21} } }, - range: [0, 21], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 21} } }], - range: [0, 21], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 21} @@ -7534,7 +6757,6 @@ test("class A { static set a(v) {}}", { id: { type: "Identifier", name: "A", - range: [6, 7], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} @@ -7549,7 +6771,6 @@ test("class A { static set a(v) {}}", { key: { type: "Identifier", name: "a", - range: [21, 22], loc: { start: {line: 1, column: 21}, end: {line: 1, column: 22} @@ -7561,7 +6782,6 @@ test("class A { static set a(v) {}}", { params: [{ type: "Identifier", name: "v", - range: [23, 24], loc: { start: {line: 1, column: 23}, end: {line: 1, column: 24} @@ -7571,7 +6791,6 @@ test("class A { static set a(v) {}}", { body: { type: "BlockStatement", body: [], - range: [26, 28], loc: { start: {line: 1, column: 26}, end: {line: 1, column: 28} @@ -7580,7 +6799,6 @@ test("class A { static set a(v) {}}", { rest: null, generator: false, expression: false, - range: [22, 28], loc: { start: {line: 1, column: 22}, end: {line: 1, column: 28} @@ -7588,25 +6806,21 @@ test("class A { static set a(v) {}}", { }, kind: "set", static: true, - range: [10, 28], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 28} } }], - range: [8, 29], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 29} } }, - range: [0, 29], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 29} } }], - range: [0, 29], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 29} @@ -7624,7 +6838,6 @@ test("class A {set(v) {};}", { id: { type: "Identifier", name: "A", - range: [6, 7], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} @@ -7639,7 +6852,6 @@ test("class A {set(v) {};}", { key: { type: "Identifier", name: "set", - range: [9, 12], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 12} @@ -7651,7 +6863,6 @@ test("class A {set(v) {};}", { params: [{ type: "Identifier", name: "v", - range: [13, 14], loc: { start: {line: 1, column: 13}, end: {line: 1, column: 14} @@ -7661,7 +6872,6 @@ test("class A {set(v) {};}", { body: { type: "BlockStatement", body: [], - range: [16, 18], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 18} @@ -7670,7 +6880,6 @@ test("class A {set(v) {};}", { rest: null, generator: false, expression: false, - range: [12, 18], loc: { start: {line: 1, column: 12}, end: {line: 1, column: 18} @@ -7678,25 +6887,21 @@ test("class A {set(v) {};}", { }, kind: "", static: false, - range: [9, 18], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 18} } }], - range: [8, 20], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 20} } }, - range: [0, 20], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 20} } }], - range: [0, 20], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 20} @@ -7714,7 +6919,6 @@ test("class A { static set(v) {};}", { id: { type: "Identifier", name: "A", - range: [6, 7], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} @@ -7729,7 +6933,6 @@ test("class A { static set(v) {};}", { key: { type: "Identifier", name: "set", - range: [17, 20], loc: { start: {line: 1, column: 17}, end: {line: 1, column: 20} @@ -7741,7 +6944,6 @@ test("class A { static set(v) {};}", { params: [{ type: "Identifier", name: "v", - range: [21, 22], loc: { start: {line: 1, column: 21}, end: {line: 1, column: 22} @@ -7751,7 +6953,6 @@ test("class A { static set(v) {};}", { body: { type: "BlockStatement", body: [], - range: [24, 26], loc: { start: {line: 1, column: 24}, end: {line: 1, column: 26} @@ -7760,7 +6961,6 @@ test("class A { static set(v) {};}", { rest: null, generator: false, expression: false, - range: [20, 26], loc: { start: {line: 1, column: 20}, end: {line: 1, column: 26} @@ -7768,25 +6968,21 @@ test("class A { static set(v) {};}", { }, kind: "", static: true, - range: [10, 26], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 26} } }], - range: [8, 28], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 28} } }, - range: [0, 28], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 28} } }], - range: [0, 28], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 28} @@ -7804,7 +7000,6 @@ test("class A {*gen(v) { yield v; }}", { id: { type: "Identifier", name: "A", - range: [6, 7], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} @@ -7819,7 +7014,6 @@ test("class A {*gen(v) { yield v; }}", { key: { type: "Identifier", name: "gen", - range: [10, 13], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 13} @@ -7831,7 +7025,6 @@ test("class A {*gen(v) { yield v; }}", { params: [{ type: "Identifier", name: "v", - range: [14, 15], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 15} @@ -7847,26 +7040,22 @@ test("class A {*gen(v) { yield v; }}", { argument: { type: "Identifier", name: "v", - range: [25, 26], loc: { start: {line: 1, column: 25}, end: {line: 1, column: 26} } }, delegate: false, - range: [19, 26], loc: { start: {line: 1, column: 19}, end: {line: 1, column: 26} } }, - range: [19, 27], loc: { start: {line: 1, column: 19}, end: {line: 1, column: 27} } }], - range: [17, 29], loc: { start: {line: 1, column: 17}, end: {line: 1, column: 29} @@ -7875,7 +7064,6 @@ test("class A {*gen(v) { yield v; }}", { rest: null, generator: true, expression: false, - range: [13, 29], loc: { start: {line: 1, column: 13}, end: {line: 1, column: 29} @@ -7883,25 +7071,21 @@ test("class A {*gen(v) { yield v; }}", { }, kind: "", static: false, - range: [9, 29], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 29} } }], - range: [8, 30], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 30} } }, - range: [0, 30], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 30} } }], - range: [0, 30], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 30} @@ -7919,7 +7103,6 @@ test("class A { static *gen(v) { yield v; }}", { id: { type: "Identifier", name: "A", - range: [6, 7], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} @@ -7934,7 +7117,6 @@ test("class A { static *gen(v) { yield v; }}", { key: { type: "Identifier", name: "gen", - range: [18, 21], loc: { start: {line: 1, column: 18}, end: {line: 1, column: 21} @@ -7946,7 +7128,6 @@ test("class A { static *gen(v) { yield v; }}", { params: [{ type: "Identifier", name: "v", - range: [22, 23], loc: { start: {line: 1, column: 22}, end: {line: 1, column: 23} @@ -7962,26 +7143,22 @@ test("class A { static *gen(v) { yield v; }}", { argument: { type: "Identifier", name: "v", - range: [33, 34], loc: { start: {line: 1, column: 33}, end: {line: 1, column: 34} } }, delegate: false, - range: [27, 34], loc: { start: {line: 1, column: 27}, end: {line: 1, column: 34} } }, - range: [27, 35], loc: { start: {line: 1, column: 27}, end: {line: 1, column: 35} } }], - range: [25, 37], loc: { start: {line: 1, column: 25}, end: {line: 1, column: 37} @@ -7990,7 +7167,6 @@ test("class A { static *gen(v) { yield v; }}", { rest: null, generator: true, expression: false, - range: [21, 37], loc: { start: {line: 1, column: 21}, end: {line: 1, column: 37} @@ -7998,25 +7174,21 @@ test("class A { static *gen(v) { yield v; }}", { }, kind: "", static: true, - range: [10, 37], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 37} } }], - range: [8, 38], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 38} } }, - range: [0, 38], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 38} } }], - range: [0, 38], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 38} @@ -8036,13 +7208,11 @@ test("\"use strict\"; (class A {constructor() { super() }})", { type: "Literal", value: "use strict", raw: "\"use strict\"", - range: [0, 12], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 12} } }, - range: [0, 13], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 13} @@ -8055,7 +7225,6 @@ test("\"use strict\"; (class A {constructor() { super() }})", { id: { type: "Identifier", name: "A", - range: [21, 22], loc: { start: {line: 1, column: 21}, end: {line: 1, column: 22} @@ -8070,7 +7239,6 @@ test("\"use strict\"; (class A {constructor() { super() }})", { key: { type: "Identifier", name: "constructor", - range: [24, 35], loc: { start: {line: 1, column: 24}, end: {line: 1, column: 35} @@ -8090,26 +7258,22 @@ test("\"use strict\"; (class A {constructor() { super() }})", { callee: { type: "Identifier", name: "super", - range: [40, 45], loc: { start: {line: 1, column: 40}, end: {line: 1, column: 45} } }, arguments: [], - range: [40, 47], loc: { start: {line: 1, column: 40}, end: {line: 1, column: 47} } }, - range: [40, 47], loc: { start: {line: 1, column: 40}, end: {line: 1, column: 47} } }], - range: [38, 49], loc: { start: {line: 1, column: 38}, end: {line: 1, column: 49} @@ -8118,7 +7282,6 @@ test("\"use strict\"; (class A {constructor() { super() }})", { rest: null, generator: false, expression: false, - range: [35, 49], loc: { start: {line: 1, column: 35}, end: {line: 1, column: 49} @@ -8126,32 +7289,27 @@ test("\"use strict\"; (class A {constructor() { super() }})", { }, kind: "", static: false, - range: [24, 49], loc: { start: {line: 1, column: 24}, end: {line: 1, column: 49} } }], - range: [23, 50], loc: { start: {line: 1, column: 23}, end: {line: 1, column: 50} } }, - range: [15, 50], loc: { start: {line: 1, column: 15}, end: {line: 1, column: 50} } }, - range: [14, 51], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 51} } } ], - range: [0, 51], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 51} @@ -8169,7 +7327,6 @@ test("class A {static foo() {}}", { id: { type: "Identifier", name: "A", - range: [6, 7], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} @@ -8184,7 +7341,6 @@ test("class A {static foo() {}}", { key: { type: "Identifier", name: "foo", - range: [16, 19], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 19} @@ -8198,7 +7354,6 @@ test("class A {static foo() {}}", { body: { type: "BlockStatement", body: [], - range: [22, 24], loc: { start: {line: 1, column: 22}, end: {line: 1, column: 24} @@ -8207,7 +7362,6 @@ test("class A {static foo() {}}", { rest: null, generator: false, expression: false, - range: [19, 24], loc: { start: {line: 1, column: 19}, end: {line: 1, column: 24} @@ -8215,25 +7369,21 @@ test("class A {static foo() {}}", { }, kind: "", static: true, - range: [9, 24], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 24} } }], - range: [8, 25], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 25} } }, - range: [0, 25], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 25} } }], - range: [0, 25], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 25} @@ -8251,7 +7401,6 @@ test("class A {foo() {} static bar() {}}", { id: { type: "Identifier", name: "A", - range: [6, 7], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} @@ -8267,7 +7416,6 @@ test("class A {foo() {} static bar() {}}", { key: { type: "Identifier", name: "foo", - range: [9, 12], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 12} @@ -8281,7 +7429,6 @@ test("class A {foo() {} static bar() {}}", { body: { type: "BlockStatement", body: [], - range: [15, 17], loc: { start: {line: 1, column: 15}, end: {line: 1, column: 17} @@ -8290,7 +7437,6 @@ test("class A {foo() {} static bar() {}}", { rest: null, generator: false, expression: false, - range: [12, 17], loc: { start: {line: 1, column: 12}, end: {line: 1, column: 17} @@ -8298,7 +7444,6 @@ test("class A {foo() {} static bar() {}}", { }, kind: "", static: false, - range: [9, 17], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 17} @@ -8310,7 +7455,6 @@ test("class A {foo() {} static bar() {}}", { key: { type: "Identifier", name: "bar", - range: [25, 28], loc: { start: {line: 1, column: 25}, end: {line: 1, column: 28} @@ -8324,7 +7468,6 @@ test("class A {foo() {} static bar() {}}", { body: { type: "BlockStatement", body: [], - range: [31, 33], loc: { start: {line: 1, column: 31}, end: {line: 1, column: 33} @@ -8333,7 +7476,6 @@ test("class A {foo() {} static bar() {}}", { rest: null, generator: false, expression: false, - range: [28, 33], loc: { start: {line: 1, column: 28}, end: {line: 1, column: 33} @@ -8341,26 +7483,22 @@ test("class A {foo() {} static bar() {}}", { }, kind: "", static: true, - range: [18, 33], loc: { start: {line: 1, column: 18}, end: {line: 1, column: 33} } } ], - range: [8, 34], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 34} } }, - range: [0, 34], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 34} } }], - range: [0, 34], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 34} @@ -8380,13 +7518,11 @@ test("\"use strict\"; (class A { static constructor() { super() }})", { type: "Literal", value: "use strict", raw: "\"use strict\"", - range: [0, 12], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 12} } }, - range: [0, 13], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 13} @@ -8399,7 +7535,6 @@ test("\"use strict\"; (class A { static constructor() { super() }})", { id: { type: "Identifier", name: "A", - range: [21, 22], loc: { start: {line: 1, column: 21}, end: {line: 1, column: 22} @@ -8414,7 +7549,6 @@ test("\"use strict\"; (class A { static constructor() { super() }})", { key: { type: "Identifier", name: "constructor", - range: [32, 43], loc: { start: {line: 1, column: 32}, end: {line: 1, column: 43} @@ -8434,26 +7568,22 @@ test("\"use strict\"; (class A { static constructor() { super() }})", { callee: { type: "Identifier", name: "super", - range: [48, 53], loc: { start: {line: 1, column: 48}, end: {line: 1, column: 53} } }, arguments: [], - range: [48, 55], loc: { start: {line: 1, column: 48}, end: {line: 1, column: 55} } }, - range: [48, 55], loc: { start: {line: 1, column: 48}, end: {line: 1, column: 55} } }], - range: [46, 57], loc: { start: {line: 1, column: 46}, end: {line: 1, column: 57} @@ -8462,7 +7592,6 @@ test("\"use strict\"; (class A { static constructor() { super() }})", { rest: null, generator: false, expression: false, - range: [43, 57], loc: { start: {line: 1, column: 43}, end: {line: 1, column: 57} @@ -8470,32 +7599,27 @@ test("\"use strict\"; (class A { static constructor() { super() }})", { }, kind: "", static: true, - range: [25, 57], loc: { start: {line: 1, column: 25}, end: {line: 1, column: 57} } }], - range: [23, 58], loc: { start: {line: 1, column: 23}, end: {line: 1, column: 58} } }, - range: [15, 58], loc: { start: {line: 1, column: 15}, end: {line: 1, column: 58} } }, - range: [14, 59], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 59} } } ], - range: [0, 59], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 59} @@ -8513,7 +7637,6 @@ test("class A { foo() {} bar() {}}", { id: { type: "Identifier", name: "A", - range: [6, 7], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} @@ -8529,7 +7652,6 @@ test("class A { foo() {} bar() {}}", { key: { type: "Identifier", name: "foo", - range: [10, 13], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 13} @@ -8543,7 +7665,6 @@ test("class A { foo() {} bar() {}}", { body: { type: "BlockStatement", body: [], - range: [16, 18], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 18} @@ -8552,7 +7673,6 @@ test("class A { foo() {} bar() {}}", { rest: null, generator: false, expression: false, - range: [13, 18], loc: { start: {line: 1, column: 13}, end: {line: 1, column: 18} @@ -8560,7 +7680,6 @@ test("class A { foo() {} bar() {}}", { }, kind: "", static: false, - range: [10, 18], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 18} @@ -8572,7 +7691,6 @@ test("class A { foo() {} bar() {}}", { key: { type: "Identifier", name: "bar", - range: [19, 22], loc: { start: {line: 1, column: 19}, end: {line: 1, column: 22} @@ -8586,7 +7704,6 @@ test("class A { foo() {} bar() {}}", { body: { type: "BlockStatement", body: [], - range: [25, 27], loc: { start: {line: 1, column: 25}, end: {line: 1, column: 27} @@ -8595,7 +7712,6 @@ test("class A { foo() {} bar() {}}", { rest: null, generator: false, expression: false, - range: [22, 27], loc: { start: {line: 1, column: 22}, end: {line: 1, column: 27} @@ -8603,26 +7719,22 @@ test("class A { foo() {} bar() {}}", { }, kind: "", static: false, - range: [19, 27], loc: { start: {line: 1, column: 19}, end: {line: 1, column: 27} } } ], - range: [8, 28], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 28} } }, - range: [0, 28], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 28} } }], - range: [0, 28], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 28} @@ -8640,7 +7752,6 @@ test("class A { get foo() {} set foo(v) {}}", { id: { type: "Identifier", name: "A", - range: [6, 7], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} @@ -8656,7 +7767,6 @@ test("class A { get foo() {} set foo(v) {}}", { key: { type: "Identifier", name: "foo", - range: [14, 17], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 17} @@ -8670,7 +7780,6 @@ test("class A { get foo() {} set foo(v) {}}", { body: { type: "BlockStatement", body: [], - range: [20, 22], loc: { start: {line: 1, column: 20}, end: {line: 1, column: 22} @@ -8679,7 +7788,6 @@ test("class A { get foo() {} set foo(v) {}}", { rest: null, generator: false, expression: false, - range: [17, 22], loc: { start: {line: 1, column: 17}, end: {line: 1, column: 22} @@ -8687,7 +7795,6 @@ test("class A { get foo() {} set foo(v) {}}", { }, kind: "get", static: false, - range: [10, 22], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 22} @@ -8699,7 +7806,6 @@ test("class A { get foo() {} set foo(v) {}}", { key: { type: "Identifier", name: "foo", - range: [27, 30], loc: { start: {line: 1, column: 27}, end: {line: 1, column: 30} @@ -8711,7 +7817,6 @@ test("class A { get foo() {} set foo(v) {}}", { params: [{ type: "Identifier", name: "v", - range: [31, 32], loc: { start: {line: 1, column: 31}, end: {line: 1, column: 32} @@ -8721,7 +7826,6 @@ test("class A { get foo() {} set foo(v) {}}", { body: { type: "BlockStatement", body: [], - range: [34, 36], loc: { start: {line: 1, column: 34}, end: {line: 1, column: 36} @@ -8730,7 +7834,6 @@ test("class A { get foo() {} set foo(v) {}}", { rest: null, generator: false, expression: false, - range: [30, 36], loc: { start: {line: 1, column: 30}, end: {line: 1, column: 36} @@ -8738,26 +7841,22 @@ test("class A { get foo() {} set foo(v) {}}", { }, kind: "set", static: false, - range: [23, 36], loc: { start: {line: 1, column: 23}, end: {line: 1, column: 36} } } ], - range: [8, 37], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 37} } }, - range: [0, 37], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 37} } }], - range: [0, 37], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 37} @@ -8775,7 +7874,6 @@ test("class A { static get foo() {} get foo() {}}", { id: { type: "Identifier", name: "A", - range: [6, 7], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} @@ -8791,7 +7889,6 @@ test("class A { static get foo() {} get foo() {}}", { key: { type: "Identifier", name: "foo", - range: [21, 24], loc: { start: {line: 1, column: 21}, end: {line: 1, column: 24} @@ -8805,7 +7902,6 @@ test("class A { static get foo() {} get foo() {}}", { body: { type: "BlockStatement", body: [], - range: [27, 29], loc: { start: {line: 1, column: 27}, end: {line: 1, column: 29} @@ -8814,7 +7910,6 @@ test("class A { static get foo() {} get foo() {}}", { rest: null, generator: false, expression: false, - range: [24, 29], loc: { start: {line: 1, column: 24}, end: {line: 1, column: 29} @@ -8822,7 +7917,6 @@ test("class A { static get foo() {} get foo() {}}", { }, kind: "get", static: true, - range: [10, 29], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 29} @@ -8834,7 +7928,6 @@ test("class A { static get foo() {} get foo() {}}", { key: { type: "Identifier", name: "foo", - range: [34, 37], loc: { start: {line: 1, column: 34}, end: {line: 1, column: 37} @@ -8848,7 +7941,6 @@ test("class A { static get foo() {} get foo() {}}", { body: { type: "BlockStatement", body: [], - range: [40, 42], loc: { start: {line: 1, column: 40}, end: {line: 1, column: 42} @@ -8857,7 +7949,6 @@ test("class A { static get foo() {} get foo() {}}", { rest: null, generator: false, expression: false, - range: [37, 42], loc: { start: {line: 1, column: 37}, end: {line: 1, column: 42} @@ -8865,26 +7956,22 @@ test("class A { static get foo() {} get foo() {}}", { }, kind: "get", static: false, - range: [30, 42], loc: { start: {line: 1, column: 30}, end: {line: 1, column: 42} } } ], - range: [8, 43], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 43} } }, - range: [0, 43], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 43} } }], - range: [0, 43], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 43} @@ -8902,7 +7989,6 @@ test("class A { static get foo() {} static get bar() {} }", { id: { type: "Identifier", name: "A", - range: [6, 7], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} @@ -8918,7 +8004,6 @@ test("class A { static get foo() {} static get bar() {} }", { key: { type: "Identifier", name: "foo", - range: [21, 24], loc: { start: {line: 1, column: 21}, end: {line: 1, column: 24} @@ -8932,7 +8017,6 @@ test("class A { static get foo() {} static get bar() {} }", { body: { type: "BlockStatement", body: [], - range: [27, 29], loc: { start: {line: 1, column: 27}, end: {line: 1, column: 29} @@ -8941,7 +8025,6 @@ test("class A { static get foo() {} static get bar() {} }", { rest: null, generator: false, expression: false, - range: [24, 29], loc: { start: {line: 1, column: 24}, end: {line: 1, column: 29} @@ -8949,7 +8032,6 @@ test("class A { static get foo() {} static get bar() {} }", { }, kind: "get", static: true, - range: [10, 29], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 29} @@ -8961,7 +8043,6 @@ test("class A { static get foo() {} static get bar() {} }", { key: { type: "Identifier", name: "bar", - range: [41, 44], loc: { start: {line: 1, column: 41}, end: {line: 1, column: 44} @@ -8975,7 +8056,6 @@ test("class A { static get foo() {} static get bar() {} }", { body: { type: "BlockStatement", body: [], - range: [47, 49], loc: { start: {line: 1, column: 47}, end: {line: 1, column: 49} @@ -8984,7 +8064,6 @@ test("class A { static get foo() {} static get bar() {} }", { rest: null, generator: false, expression: false, - range: [44, 49], loc: { start: {line: 1, column: 44}, end: {line: 1, column: 49} @@ -8992,26 +8071,22 @@ test("class A { static get foo() {} static get bar() {} }", { }, kind: "get", static: true, - range: [30, 49], loc: { start: {line: 1, column: 30}, end: {line: 1, column: 49} } } ], - range: [8, 51], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 51} } }, - range: [0, 51], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 51} } }], - range: [0, 51], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 51} @@ -9029,7 +8104,6 @@ test("class A { static get foo() {} static set foo(v) {} get foo() {} set foo(v) id: { type: "Identifier", name: "A", - range: [6, 7], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} @@ -9045,7 +8119,6 @@ test("class A { static get foo() {} static set foo(v) {} get foo() {} set foo(v) key: { type: "Identifier", name: "foo", - range: [21, 24], loc: { start: {line: 1, column: 21}, end: {line: 1, column: 24} @@ -9059,7 +8132,6 @@ test("class A { static get foo() {} static set foo(v) {} get foo() {} set foo(v) body: { type: "BlockStatement", body: [], - range: [27, 29], loc: { start: {line: 1, column: 27}, end: {line: 1, column: 29} @@ -9068,7 +8140,6 @@ test("class A { static get foo() {} static set foo(v) {} get foo() {} set foo(v) rest: null, generator: false, expression: false, - range: [24, 29], loc: { start: {line: 1, column: 24}, end: {line: 1, column: 29} @@ -9076,7 +8147,6 @@ test("class A { static get foo() {} static set foo(v) {} get foo() {} set foo(v) }, kind: "get", static: true, - range: [10, 29], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 29} @@ -9088,7 +8158,6 @@ test("class A { static get foo() {} static set foo(v) {} get foo() {} set foo(v) key: { type: "Identifier", name: "foo", - range: [41, 44], loc: { start: {line: 1, column: 41}, end: {line: 1, column: 44} @@ -9100,7 +8169,6 @@ test("class A { static get foo() {} static set foo(v) {} get foo() {} set foo(v) params: [{ type: "Identifier", name: "v", - range: [45, 46], loc: { start: {line: 1, column: 45}, end: {line: 1, column: 46} @@ -9110,7 +8178,6 @@ test("class A { static get foo() {} static set foo(v) {} get foo() {} set foo(v) body: { type: "BlockStatement", body: [], - range: [48, 50], loc: { start: {line: 1, column: 48}, end: {line: 1, column: 50} @@ -9119,7 +8186,6 @@ test("class A { static get foo() {} static set foo(v) {} get foo() {} set foo(v) rest: null, generator: false, expression: false, - range: [44, 50], loc: { start: {line: 1, column: 44}, end: {line: 1, column: 50} @@ -9127,7 +8193,6 @@ test("class A { static get foo() {} static set foo(v) {} get foo() {} set foo(v) }, kind: "set", static: true, - range: [30, 50], loc: { start: {line: 1, column: 30}, end: {line: 1, column: 50} @@ -9139,7 +8204,6 @@ test("class A { static get foo() {} static set foo(v) {} get foo() {} set foo(v) key: { type: "Identifier", name: "foo", - range: [55, 58], loc: { start: {line: 1, column: 55}, end: {line: 1, column: 58} @@ -9153,7 +8217,6 @@ test("class A { static get foo() {} static set foo(v) {} get foo() {} set foo(v) body: { type: "BlockStatement", body: [], - range: [61, 63], loc: { start: {line: 1, column: 61}, end: {line: 1, column: 63} @@ -9162,7 +8225,6 @@ test("class A { static get foo() {} static set foo(v) {} get foo() {} set foo(v) rest: null, generator: false, expression: false, - range: [58, 63], loc: { start: {line: 1, column: 58}, end: {line: 1, column: 63} @@ -9170,7 +8232,6 @@ test("class A { static get foo() {} static set foo(v) {} get foo() {} set foo(v) }, kind: "get", static: false, - range: [51, 63], loc: { start: {line: 1, column: 51}, end: {line: 1, column: 63} @@ -9182,7 +8243,6 @@ test("class A { static get foo() {} static set foo(v) {} get foo() {} set foo(v) key: { type: "Identifier", name: "foo", - range: [68, 71], loc: { start: {line: 1, column: 68}, end: {line: 1, column: 71} @@ -9194,7 +8254,6 @@ test("class A { static get foo() {} static set foo(v) {} get foo() {} set foo(v) params: [{ type: "Identifier", name: "v", - range: [72, 73], loc: { start: {line: 1, column: 72}, end: {line: 1, column: 73} @@ -9204,7 +8263,6 @@ test("class A { static get foo() {} static set foo(v) {} get foo() {} set foo(v) body: { type: "BlockStatement", body: [], - range: [75, 77], loc: { start: {line: 1, column: 75}, end: {line: 1, column: 77} @@ -9213,7 +8271,6 @@ test("class A { static get foo() {} static set foo(v) {} get foo() {} set foo(v) rest: null, generator: false, expression: false, - range: [71, 77], loc: { start: {line: 1, column: 71}, end: {line: 1, column: 77} @@ -9221,26 +8278,22 @@ test("class A { static get foo() {} static set foo(v) {} get foo() {} set foo(v) }, kind: "set", static: false, - range: [64, 77], loc: { start: {line: 1, column: 64}, end: {line: 1, column: 77} } } ], - range: [8, 78], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 78} } }, - range: [0, 78], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 78} } }], - range: [0, 78], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 78} @@ -9258,7 +8311,6 @@ test("class A { set foo(v) {} get foo() {} }", { id: { type: "Identifier", name: "A", - range: [6, 7], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} @@ -9274,7 +8326,6 @@ test("class A { set foo(v) {} get foo() {} }", { key: { type: "Identifier", name: "foo", - range: [14, 17], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 17} @@ -9286,7 +8337,6 @@ test("class A { set foo(v) {} get foo() {} }", { params: [{ type: "Identifier", name: "v", - range: [18, 19], loc: { start: {line: 1, column: 18}, end: {line: 1, column: 19} @@ -9296,7 +8346,6 @@ test("class A { set foo(v) {} get foo() {} }", { body: { type: "BlockStatement", body: [], - range: [21, 23], loc: { start: {line: 1, column: 21}, end: {line: 1, column: 23} @@ -9305,7 +8354,6 @@ test("class A { set foo(v) {} get foo() {} }", { rest: null, generator: false, expression: false, - range: [17, 23], loc: { start: {line: 1, column: 17}, end: {line: 1, column: 23} @@ -9313,7 +8361,6 @@ test("class A { set foo(v) {} get foo() {} }", { }, kind: "set", static: false, - range: [10, 23], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 23} @@ -9325,7 +8372,6 @@ test("class A { set foo(v) {} get foo() {} }", { key: { type: "Identifier", name: "foo", - range: [28, 31], loc: { start: {line: 1, column: 28}, end: {line: 1, column: 31} @@ -9339,7 +8385,6 @@ test("class A { set foo(v) {} get foo() {} }", { body: { type: "BlockStatement", body: [], - range: [34, 36], loc: { start: {line: 1, column: 34}, end: {line: 1, column: 36} @@ -9348,7 +8393,6 @@ test("class A { set foo(v) {} get foo() {} }", { rest: null, generator: false, expression: false, - range: [31, 36], loc: { start: {line: 1, column: 31}, end: {line: 1, column: 36} @@ -9356,26 +8400,22 @@ test("class A { set foo(v) {} get foo() {} }", { }, kind: "get", static: false, - range: [24, 36], loc: { start: {line: 1, column: 24}, end: {line: 1, column: 36} } } ], - range: [8, 38], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 38} } }, - range: [0, 38], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 38} } }], - range: [0, 38], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 38} @@ -9388,76 +8428,55 @@ test("class A { set foo(v) {} get foo() {} }", { test("class A { foo() {} get foo() {} }",{ type: "Program", - start: 0, - end: 33, loc: { start: {line: 1, column: 0}, end: {line: 1, column: 33} }, - range: [0, 33], body: [{ type: "ClassDeclaration", - start: 0, - end: 33, loc: { start: {line: 1, column: 0}, end: {line: 1, column: 33} }, - range: [0, 33], id: { type: "Identifier", - start: 6, - end: 7, loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} }, - range: [6, 7], name: "A" }, superClass: null, body: { type: "ClassBody", - start: 8, - end: 33, loc: { start: {line: 1, column: 8}, end: {line: 1, column: 33} }, - range: [8, 33], body: [ { type: "MethodDefinition", - start: 10, - end: 18, loc: { start: {line: 1, column: 10}, end: {line: 1, column: 18} }, - range: [10, 18], static: false, computed: false, key: { type: "Identifier", - start: 10, - end: 13, loc: { start: {line: 1, column: 10}, end: {line: 1, column: 13} }, - range: [10, 13], name: "foo" }, kind: "", value: { type: "FunctionExpression", - start: 13, - end: 18, loc: { start: {line: 1, column: 13}, end: {line: 1, column: 18} }, - range: [13, 18], id: null, params: [], defaults: [], @@ -9465,13 +8484,10 @@ test("class A { foo() {} get foo() {} }",{ generator: false, body: { type: "BlockStatement", - start: 16, - end: 18, loc: { start: {line: 1, column: 16}, end: {line: 1, column: 18} }, - range: [16, 18], body: [] }, expression: false @@ -9479,36 +8495,27 @@ test("class A { foo() {} get foo() {} }",{ }, { type: "MethodDefinition", - start: 19, - end: 31, loc: { start: {line: 1, column: 19}, end: {line: 1, column: 31} }, - range: [19, 31], static: false, computed: false, key: { type: "Identifier", - start: 23, - end: 26, loc: { start: {line: 1, column: 23}, end: {line: 1, column: 26} }, - range: [23, 26], name: "foo" }, kind: "get", value: { type: "FunctionExpression", - start: 26, - end: 31, loc: { start: {line: 1, column: 26}, end: {line: 1, column: 31} }, - range: [26, 31], id: null, params: [], defaults: [], @@ -9516,13 +8523,10 @@ test("class A { foo() {} get foo() {} }",{ generator: false, body: { type: "BlockStatement", - start: 29, - end: 31, loc: { start: {line: 1, column: 29}, end: {line: 1, column: 31} }, - range: [29, 31], body: [] }, expression: false @@ -9550,7 +8554,6 @@ test("({[x]: 10})", { key: { type: "Identifier", name: "x", - range: [3, 4], loc: { start: {line: 1, column: 3}, end: {line: 1, column: 4} @@ -9560,7 +8563,6 @@ test("({[x]: 10})", { type: "Literal", value: 10, raw: "10", - range: [7, 9], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 9} @@ -9570,25 +8572,21 @@ test("({[x]: 10})", { method: false, shorthand: false, computed: true, - range: [2, 9], loc: { start: {line: 1, column: 2}, end: {line: 1, column: 9} } }], - range: [1, 10], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 10} } }, - range: [0, 11], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 11} } }], - range: [0, 11], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 11} @@ -9614,7 +8612,6 @@ test("({[\"x\" + \"y\"]: 10})", { type: "Literal", value: "x", raw: "\"x\"", - range: [3, 6], loc: { start: {line: 1, column: 3}, end: {line: 1, column: 6} @@ -9624,13 +8621,11 @@ test("({[\"x\" + \"y\"]: 10})", { type: "Literal", value: "y", raw: "\"y\"", - range: [9, 12], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 12} } }, - range: [3, 12], loc: { start: {line: 1, column: 3}, end: {line: 1, column: 12} @@ -9640,7 +8635,6 @@ test("({[\"x\" + \"y\"]: 10})", { type: "Literal", value: 10, raw: "10", - range: [15, 17], loc: { start: {line: 1, column: 15}, end: {line: 1, column: 17} @@ -9650,25 +8644,21 @@ test("({[\"x\" + \"y\"]: 10})", { method: false, shorthand: false, computed: true, - range: [2, 17], loc: { start: {line: 1, column: 2}, end: {line: 1, column: 17} } }], - range: [1, 18], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 18} } }, - range: [0, 19], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 19} } }], - range: [0, 19], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 19} @@ -9690,7 +8680,6 @@ test("({[x]: function() {}})", { key: { type: "Identifier", name: "x", - range: [3, 4], loc: { start: {line: 1, column: 3}, end: {line: 1, column: 4} @@ -9704,7 +8693,6 @@ test("({[x]: function() {}})", { body: { type: "BlockStatement", body: [], - range: [18, 20], loc: { start: {line: 1, column: 18}, end: {line: 1, column: 20} @@ -9713,7 +8701,6 @@ test("({[x]: function() {}})", { rest: null, generator: false, expression: false, - range: [7, 20], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 20} @@ -9723,25 +8710,21 @@ test("({[x]: function() {}})", { method: false, shorthand: false, computed: true, - range: [2, 20], loc: { start: {line: 1, column: 2}, end: {line: 1, column: 20} } }], - range: [1, 21], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 21} } }, - range: [0, 22], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 22} } }], - range: [0, 22], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 22} @@ -9764,7 +8747,6 @@ test("({[x]: 10, y: 20})", { key: { type: "Identifier", name: "x", - range: [3, 4], loc: { start: {line: 1, column: 3}, end: {line: 1, column: 4} @@ -9774,7 +8756,6 @@ test("({[x]: 10, y: 20})", { type: "Literal", value: 10, raw: "10", - range: [7, 9], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 9} @@ -9784,7 +8765,6 @@ test("({[x]: 10, y: 20})", { method: false, shorthand: false, computed: true, - range: [2, 9], loc: { start: {line: 1, column: 2}, end: {line: 1, column: 9} @@ -9795,7 +8775,6 @@ test("({[x]: 10, y: 20})", { key: { type: "Identifier", name: "y", - range: [11, 12], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 12} @@ -9805,7 +8784,6 @@ test("({[x]: 10, y: 20})", { type: "Literal", value: 20, raw: "20", - range: [14, 16], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 16} @@ -9815,26 +8793,22 @@ test("({[x]: 10, y: 20})", { method: false, shorthand: false, computed: false, - range: [11, 16], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 16} } } ], - range: [1, 17], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 17} } }, - range: [0, 18], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 18} } }], - range: [0, 18], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 18} @@ -9857,7 +8831,6 @@ test("({get [x]() {}, set [x](v) {}})", { key: { type: "Identifier", name: "x", - range: [7, 8], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 8} @@ -9871,7 +8844,6 @@ test("({get [x]() {}, set [x](v) {}})", { body: { type: "BlockStatement", body: [], - range: [12, 14], loc: { start: {line: 1, column: 12}, end: {line: 1, column: 14} @@ -9880,7 +8852,6 @@ test("({get [x]() {}, set [x](v) {}})", { rest: null, generator: false, expression: false, - range: [9, 14], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 14} @@ -9890,7 +8861,6 @@ test("({get [x]() {}, set [x](v) {}})", { method: false, shorthand: false, computed: true, - range: [2, 14], loc: { start: {line: 1, column: 2}, end: {line: 1, column: 14} @@ -9901,7 +8871,6 @@ test("({get [x]() {}, set [x](v) {}})", { key: { type: "Identifier", name: "x", - range: [21, 22], loc: { start: {line: 1, column: 21}, end: {line: 1, column: 22} @@ -9913,7 +8882,6 @@ test("({get [x]() {}, set [x](v) {}})", { params: [{ type: "Identifier", name: "v", - range: [24, 25], loc: { start: {line: 1, column: 24}, end: {line: 1, column: 25} @@ -9923,7 +8891,6 @@ test("({get [x]() {}, set [x](v) {}})", { body: { type: "BlockStatement", body: [], - range: [27, 29], loc: { start: {line: 1, column: 27}, end: {line: 1, column: 29} @@ -9932,7 +8899,6 @@ test("({get [x]() {}, set [x](v) {}})", { rest: null, generator: false, expression: false, - range: [23, 29], loc: { start: {line: 1, column: 23}, end: {line: 1, column: 29} @@ -9942,26 +8908,22 @@ test("({get [x]() {}, set [x](v) {}})", { method: false, shorthand: false, computed: true, - range: [16, 29], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 29} } } ], - range: [1, 30], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 30} } }, - range: [0, 31], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 31} } }], - range: [0, 31], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 31} @@ -9983,7 +8945,6 @@ test("({[x]() {}})", { key: { type: "Identifier", name: "x", - range: [3, 4], loc: { start: {line: 1, column: 3}, end: {line: 1, column: 4} @@ -9997,7 +8958,6 @@ test("({[x]() {}})", { body: { type: "BlockStatement", body: [], - range: [8, 10], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 10} @@ -10006,7 +8966,6 @@ test("({[x]() {}})", { rest: null, generator: false, expression: false, - range: [5, 10], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 10} @@ -10016,25 +8975,21 @@ test("({[x]() {}})", { method: true, shorthand: false, computed: true, - range: [2, 10], loc: { start: {line: 1, column: 2}, end: {line: 1, column: 10} } }], - range: [1, 11], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 11} } }, - range: [0, 12], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 12} } }], - range: [0, 12], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 12} @@ -10058,7 +9013,6 @@ test("var {[x]: y} = {y}", { key: { type: "Identifier", name: "x", - range: [6, 7], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} @@ -10067,7 +9021,6 @@ test("var {[x]: y} = {y}", { value: { type: "Identifier", name: "y", - range: [10, 11], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 11} @@ -10077,13 +9030,11 @@ test("var {[x]: y} = {y}", { method: false, shorthand: false, computed: true, - range: [5, 11], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 11} } }], - range: [4, 12], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 12} @@ -10096,7 +9047,6 @@ test("var {[x]: y} = {y}", { key: { type: "Identifier", name: "y", - range: [16, 17], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 17} @@ -10105,7 +9055,6 @@ test("var {[x]: y} = {y}", { value: { type: "Identifier", name: "y", - range: [16, 17], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 17} @@ -10115,32 +9064,27 @@ test("var {[x]: y} = {y}", { method: false, shorthand: true, computed: false, - range: [16, 17], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 17} } }], - range: [15, 18], loc: { start: {line: 1, column: 15}, end: {line: 1, column: 18} } }, - range: [4, 18], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 18} } }], kind: "var", - range: [0, 18], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 18} } }], - range: [0, 18], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 18} @@ -10158,7 +9102,6 @@ test("function f({[x]: y}) {}", { id: { type: "Identifier", name: "f", - range: [9, 10], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 10} @@ -10171,7 +9114,6 @@ test("function f({[x]: y}) {}", { key: { type: "Identifier", name: "x", - range: [13, 14], loc: { start: {line: 1, column: 13}, end: {line: 1, column: 14} @@ -10180,7 +9122,6 @@ test("function f({[x]: y}) {}", { value: { type: "Identifier", name: "y", - range: [17, 18], loc: { start: {line: 1, column: 17}, end: {line: 1, column: 18} @@ -10190,13 +9131,11 @@ test("function f({[x]: y}) {}", { method: false, shorthand: false, computed: true, - range: [12, 18], loc: { start: {line: 1, column: 12}, end: {line: 1, column: 18} } }], - range: [11, 19], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 19} @@ -10206,7 +9145,6 @@ test("function f({[x]: y}) {}", { body: { type: "BlockStatement", body: [], - range: [21, 23], loc: { start: {line: 1, column: 21}, end: {line: 1, column: 23} @@ -10215,13 +9153,11 @@ test("function f({[x]: y}) {}", { rest: null, generator: false, expression: false, - range: [0, 23], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 23} } }], - range: [0, 23], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 23} @@ -10241,7 +9177,6 @@ test("var x = {*[test]() { yield *v; }}", { id: { type: "Identifier", name: "x", - range: [4, 5], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 5} @@ -10254,7 +9189,6 @@ test("var x = {*[test]() { yield *v; }}", { key: { type: "Identifier", name: "test", - range: [11, 15], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 15} @@ -10274,26 +9208,22 @@ test("var x = {*[test]() { yield *v; }}", { argument: { type: "Identifier", name: "v", - range: [28, 29], loc: { start: {line: 1, column: 28}, end: {line: 1, column: 29} } }, delegate: true, - range: [21, 29], loc: { start: {line: 1, column: 21}, end: {line: 1, column: 29} } }, - range: [21, 30], loc: { start: {line: 1, column: 21}, end: {line: 1, column: 30} } }], - range: [19, 32], loc: { start: {line: 1, column: 19}, end: {line: 1, column: 32} @@ -10302,7 +9232,6 @@ test("var x = {*[test]() { yield *v; }}", { rest: null, generator: true, expression: false, - range: [16, 32], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 32} @@ -10312,32 +9241,27 @@ test("var x = {*[test]() { yield *v; }}", { method: true, shorthand: false, computed: true, - range: [9, 32], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 32} } }], - range: [8, 33], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 33} } }, - range: [4, 33], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 33} } }], kind: "var", - range: [0, 33], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 33} } }], - range: [0, 33], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 33} @@ -10350,75 +9274,54 @@ test("var x = {*[test]() { yield *v; }}", { test("class A {[x]() {}}", { type: "Program", - start: 0, - end: 18, loc: { start: {line: 1, column: 0}, end: {line: 1, column: 18} }, - range: [0, 18], body: [{ type: "ClassDeclaration", - start: 0, - end: 18, loc: { start: {line: 1, column: 0}, end: {line: 1, column: 18} }, - range: [0, 18], id: { type: "Identifier", - start: 6, - end: 7, loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} }, - range: [6, 7], name: "A" }, superClass: null, body: { type: "ClassBody", - start: 8, - end: 18, loc: { start: {line: 1, column: 8}, end: {line: 1, column: 18} }, - range: [8, 18], body: [{ type: "MethodDefinition", - start: 9, - end: 17, loc: { start: {line: 1, column: 9}, end: {line: 1, column: 17} }, - range: [9, 17], static: false, computed: true, key: { type: "Identifier", - start: 10, - end: 11, loc: { start: {line: 1, column: 10}, end: {line: 1, column: 11} }, - range: [10, 11], name: "x" }, kind: "", value: { type: "FunctionExpression", - start: 12, - end: 17, loc: { start: {line: 1, column: 12}, end: {line: 1, column: 17} }, - range: [12, 17], id: null, params: [], defaults: [], @@ -10426,13 +9329,10 @@ test("class A {[x]() {}}", { generator: false, body: { type: "BlockStatement", - start: 15, - end: 17, loc: { start: {line: 1, column: 15}, end: {line: 1, column: 17} }, - range: [15, 17], body: [] }, expression: false @@ -10457,7 +9357,6 @@ test("function f([x] = [1]) {}", { id: { type: "Identifier", name: "f", - range: [9, 10], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 10} @@ -10468,13 +9367,11 @@ test("function f([x] = [1]) {}", { elements: [{ type: "Identifier", name: "x", - range: [12, 13], loc: { start: {line: 1, column: 12}, end: {line: 1, column: 13} } }], - range: [11, 14], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 14} @@ -10486,13 +9383,11 @@ test("function f([x] = [1]) {}", { type: "Literal", value: 1, raw: "1", - range: [18, 19], loc: { start: {line: 1, column: 18}, end: {line: 1, column: 19} } }], - range: [17, 20], loc: { start: {line: 1, column: 17}, end: {line: 1, column: 20} @@ -10501,7 +9396,6 @@ test("function f([x] = [1]) {}", { body: { type: "BlockStatement", body: [], - range: [22, 24], loc: { start: {line: 1, column: 22}, end: {line: 1, column: 24} @@ -10510,13 +9404,11 @@ test("function f([x] = [1]) {}", { rest: null, generator: false, expression: false, - range: [0, 24], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 24} } }], - range: [0, 24], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 24} @@ -10534,7 +9426,6 @@ test("function f({x} = {x: 10}) {}", { id: { type: "Identifier", name: "f", - range: [9, 10], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 10} @@ -10547,7 +9438,6 @@ test("function f({x} = {x: 10}) {}", { key: { type: "Identifier", name: "x", - range: [12, 13], loc: { start: {line: 1, column: 12}, end: {line: 1, column: 13} @@ -10556,7 +9446,6 @@ test("function f({x} = {x: 10}) {}", { value: { type: "Identifier", name: "x", - range: [12, 13], loc: { start: {line: 1, column: 12}, end: {line: 1, column: 13} @@ -10566,13 +9455,11 @@ test("function f({x} = {x: 10}) {}", { method: false, shorthand: true, computed: false, - range: [12, 13], loc: { start: {line: 1, column: 12}, end: {line: 1, column: 13} } }], - range: [11, 14], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 14} @@ -10585,7 +9472,6 @@ test("function f({x} = {x: 10}) {}", { key: { type: "Identifier", name: "x", - range: [18, 19], loc: { start: {line: 1, column: 18}, end: {line: 1, column: 19} @@ -10595,7 +9481,6 @@ test("function f({x} = {x: 10}) {}", { type: "Literal", value: 10, raw: "10", - range: [21, 23], loc: { start: {line: 1, column: 21}, end: {line: 1, column: 23} @@ -10605,13 +9490,11 @@ test("function f({x} = {x: 10}) {}", { method: false, shorthand: false, computed: false, - range: [18, 23], loc: { start: {line: 1, column: 18}, end: {line: 1, column: 23} } }], - range: [17, 24], loc: { start: {line: 1, column: 17}, end: {line: 1, column: 24} @@ -10620,7 +9503,6 @@ test("function f({x} = {x: 10}) {}", { body: { type: "BlockStatement", body: [], - range: [26, 28], loc: { start: {line: 1, column: 26}, end: {line: 1, column: 28} @@ -10629,13 +9511,11 @@ test("function f({x} = {x: 10}) {}", { rest: null, generator: false, expression: false, - range: [0, 28], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 28} } }], - range: [0, 28], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 28} @@ -10656,7 +9536,6 @@ test("f = function({x} = {x: 10}) {}", { left: { type: "Identifier", name: "f", - range: [0, 1], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 1} @@ -10672,7 +9551,6 @@ test("f = function({x} = {x: 10}) {}", { key: { type: "Identifier", name: "x", - range: [14, 15], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 15} @@ -10681,7 +9559,6 @@ test("f = function({x} = {x: 10}) {}", { value: { type: "Identifier", name: "x", - range: [14, 15], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 15} @@ -10691,13 +9568,11 @@ test("f = function({x} = {x: 10}) {}", { method: false, shorthand: true, computed: false, - range: [14, 15], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 15} } }], - range: [13, 16], loc: { start: {line: 1, column: 13}, end: {line: 1, column: 16} @@ -10710,7 +9585,6 @@ test("f = function({x} = {x: 10}) {}", { key: { type: "Identifier", name: "x", - range: [20, 21], loc: { start: {line: 1, column: 20}, end: {line: 1, column: 21} @@ -10720,7 +9594,6 @@ test("f = function({x} = {x: 10}) {}", { type: "Literal", value: 10, raw: "10", - range: [23, 25], loc: { start: {line: 1, column: 23}, end: {line: 1, column: 25} @@ -10730,13 +9603,11 @@ test("f = function({x} = {x: 10}) {}", { method: false, shorthand: false, computed: false, - range: [20, 25], loc: { start: {line: 1, column: 20}, end: {line: 1, column: 25} } }], - range: [19, 26], loc: { start: {line: 1, column: 19}, end: {line: 1, column: 26} @@ -10745,7 +9616,6 @@ test("f = function({x} = {x: 10}) {}", { body: { type: "BlockStatement", body: [], - range: [28, 30], loc: { start: {line: 1, column: 28}, end: {line: 1, column: 30} @@ -10754,25 +9624,21 @@ test("f = function({x} = {x: 10}) {}", { rest: null, generator: false, expression: false, - range: [4, 30], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 30} } }, - range: [0, 30], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 30} } }, - range: [0, 30], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 30} } }], - range: [0, 30], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 30} @@ -10794,7 +9660,6 @@ test("({f: function({x} = {x: 10}) {}})", { key: { type: "Identifier", name: "f", - range: [2, 3], loc: { start: {line: 1, column: 2}, end: {line: 1, column: 3} @@ -10810,7 +9675,6 @@ test("({f: function({x} = {x: 10}) {}})", { key: { type: "Identifier", name: "x", - range: [15, 16], loc: { start: {line: 1, column: 15}, end: {line: 1, column: 16} @@ -10819,7 +9683,6 @@ test("({f: function({x} = {x: 10}) {}})", { value: { type: "Identifier", name: "x", - range: [15, 16], loc: { start: {line: 1, column: 15}, end: {line: 1, column: 16} @@ -10829,13 +9692,11 @@ test("({f: function({x} = {x: 10}) {}})", { method: false, shorthand: true, computed: false, - range: [15, 16], loc: { start: {line: 1, column: 15}, end: {line: 1, column: 16} } }], - range: [14, 17], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 17} @@ -10848,7 +9709,6 @@ test("({f: function({x} = {x: 10}) {}})", { key: { type: "Identifier", name: "x", - range: [21, 22], loc: { start: {line: 1, column: 21}, end: {line: 1, column: 22} @@ -10858,7 +9718,6 @@ test("({f: function({x} = {x: 10}) {}})", { type: "Literal", value: 10, raw: "10", - range: [24, 26], loc: { start: {line: 1, column: 24}, end: {line: 1, column: 26} @@ -10868,13 +9727,11 @@ test("({f: function({x} = {x: 10}) {}})", { method: false, shorthand: false, computed: false, - range: [21, 26], loc: { start: {line: 1, column: 21}, end: {line: 1, column: 26} } }], - range: [20, 27], loc: { start: {line: 1, column: 20}, end: {line: 1, column: 27} @@ -10883,7 +9740,6 @@ test("({f: function({x} = {x: 10}) {}})", { body: { type: "BlockStatement", body: [], - range: [29, 31], loc: { start: {line: 1, column: 29}, end: {line: 1, column: 31} @@ -10892,7 +9748,6 @@ test("({f: function({x} = {x: 10}) {}})", { rest: null, generator: false, expression: false, - range: [5, 31], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 31} @@ -10902,25 +9757,21 @@ test("({f: function({x} = {x: 10}) {}})", { method: false, shorthand: false, computed: false, - range: [2, 31], loc: { start: {line: 1, column: 2}, end: {line: 1, column: 31} } }], - range: [1, 32], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 32} } }, - range: [0, 33], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 33} } }], - range: [0, 33], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 33} @@ -10942,7 +9793,6 @@ test("({f({x} = {x: 10}) {}})", { key: { type: "Identifier", name: "f", - range: [2, 3], loc: { start: {line: 1, column: 2}, end: {line: 1, column: 3} @@ -10958,7 +9808,6 @@ test("({f({x} = {x: 10}) {}})", { key: { type: "Identifier", name: "x", - range: [5, 6], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 6} @@ -10967,7 +9816,6 @@ test("({f({x} = {x: 10}) {}})", { value: { type: "Identifier", name: "x", - range: [5, 6], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 6} @@ -10977,13 +9825,11 @@ test("({f({x} = {x: 10}) {}})", { method: false, shorthand: true, computed: false, - range: [5, 6], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 6} } }], - range: [4, 7], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 7} @@ -10996,7 +9842,6 @@ test("({f({x} = {x: 10}) {}})", { key: { type: "Identifier", name: "x", - range: [11, 12], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 12} @@ -11006,7 +9851,6 @@ test("({f({x} = {x: 10}) {}})", { type: "Literal", value: 10, raw: "10", - range: [14, 16], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 16} @@ -11016,13 +9860,11 @@ test("({f({x} = {x: 10}) {}})", { method: false, shorthand: false, computed: false, - range: [11, 16], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 16} } }], - range: [10, 17], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 17} @@ -11031,7 +9873,6 @@ test("({f({x} = {x: 10}) {}})", { body: { type: "BlockStatement", body: [], - range: [19, 21], loc: { start: {line: 1, column: 19}, end: {line: 1, column: 21} @@ -11040,7 +9881,6 @@ test("({f({x} = {x: 10}) {}})", { rest: null, generator: false, expression: false, - range: [3, 21], loc: { start: {line: 1, column: 3}, end: {line: 1, column: 21} @@ -11050,25 +9890,21 @@ test("({f({x} = {x: 10}) {}})", { method: true, shorthand: false, computed: false, - range: [2, 21], loc: { start: {line: 1, column: 2}, end: {line: 1, column: 21} } }], - range: [1, 22], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 22} } }, - range: [0, 23], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 23} } }], - range: [0, 23], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 23} @@ -11094,7 +9930,6 @@ test("(class {f({x} = {x: 10}) {}})", { key: { type: "Identifier", name: "f", - range: [8, 9], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 9} @@ -11110,7 +9945,6 @@ test("(class {f({x} = {x: 10}) {}})", { key: { type: "Identifier", name: "x", - range: [11, 12], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 12} @@ -11119,7 +9953,6 @@ test("(class {f({x} = {x: 10}) {}})", { value: { type: "Identifier", name: "x", - range: [11, 12], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 12} @@ -11129,13 +9962,11 @@ test("(class {f({x} = {x: 10}) {}})", { method: false, shorthand: true, computed: false, - range: [11, 12], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 12} } }], - range: [10, 13], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 13} @@ -11148,7 +9979,6 @@ test("(class {f({x} = {x: 10}) {}})", { key: { type: "Identifier", name: "x", - range: [17, 18], loc: { start: {line: 1, column: 17}, end: {line: 1, column: 18} @@ -11158,7 +9988,6 @@ test("(class {f({x} = {x: 10}) {}})", { type: "Literal", value: 10, raw: "10", - range: [20, 22], loc: { start: {line: 1, column: 20}, end: {line: 1, column: 22} @@ -11168,13 +9997,11 @@ test("(class {f({x} = {x: 10}) {}})", { method: false, shorthand: false, computed: false, - range: [17, 22], loc: { start: {line: 1, column: 17}, end: {line: 1, column: 22} } }], - range: [16, 23], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 23} @@ -11183,7 +10010,6 @@ test("(class {f({x} = {x: 10}) {}})", { body: { type: "BlockStatement", body: [], - range: [25, 27], loc: { start: {line: 1, column: 25}, end: {line: 1, column: 27} @@ -11192,7 +10018,6 @@ test("(class {f({x} = {x: 10}) {}})", { rest: null, generator: false, expression: false, - range: [9, 27], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 27} @@ -11200,31 +10025,26 @@ test("(class {f({x} = {x: 10}) {}})", { }, kind: "", static: false, - range: [8, 27], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 27} } }], - range: [7, 28], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 28} } }, - range: [1, 28], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 28} } }, - range: [0, 29], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 29} } }], - range: [0, 29], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 29} @@ -11249,7 +10069,6 @@ test("(({x} = {x: 10}) => {})", { key: { type: "Identifier", name: "x", - range: [3, 4], loc: { start: {line: 1, column: 3}, end: {line: 1, column: 4} @@ -11258,7 +10077,6 @@ test("(({x} = {x: 10}) => {})", { value: { type: "Identifier", name: "x", - range: [3, 4], loc: { start: {line: 1, column: 3}, end: {line: 1, column: 4} @@ -11268,13 +10086,11 @@ test("(({x} = {x: 10}) => {})", { method: false, shorthand: true, computed: false, - range: [3, 4], loc: { start: {line: 1, column: 3}, end: {line: 1, column: 4} } }], - range: [2, 5], loc: { start: {line: 1, column: 2}, end: {line: 1, column: 5} @@ -11287,7 +10103,6 @@ test("(({x} = {x: 10}) => {})", { key: { type: "Identifier", name: "x", - range: [9, 10], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 10} @@ -11297,7 +10112,6 @@ test("(({x} = {x: 10}) => {})", { type: "Literal", value: 10, raw: "10", - range: [12, 14], loc: { start: {line: 1, column: 12}, end: {line: 1, column: 14} @@ -11307,13 +10121,11 @@ test("(({x} = {x: 10}) => {})", { method: false, shorthand: false, computed: false, - range: [9, 14], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 14} } }], - range: [8, 15], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 15} @@ -11322,7 +10134,6 @@ test("(({x} = {x: 10}) => {})", { body: { type: "BlockStatement", body: [], - range: [20, 22], loc: { start: {line: 1, column: 20}, end: {line: 1, column: 22} @@ -11331,19 +10142,16 @@ test("(({x} = {x: 10}) => {})", { rest: null, generator: false, expression: false, - range: [1, 22], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 22} } }, - range: [0, 23], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 23} } }], - range: [0, 23], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 23} @@ -11364,7 +10172,6 @@ test("x = function(y = 1) {}", { left: { type: "Identifier", name: "x", - range: [0, 1], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 1} @@ -11376,7 +10183,6 @@ test("x = function(y = 1) {}", { params: [{ type: "Identifier", name: "y", - range: [13, 14], loc: { start: {line: 1, column: 13}, end: {line: 1, column: 14} @@ -11386,7 +10192,6 @@ test("x = function(y = 1) {}", { type: "Literal", value: 1, raw: "1", - range: [17, 18], loc: { start: {line: 1, column: 17}, end: {line: 1, column: 18} @@ -11395,7 +10200,6 @@ test("x = function(y = 1) {}", { body: { type: "BlockStatement", body: [], - range: [20, 22], loc: { start: {line: 1, column: 20}, end: {line: 1, column: 22} @@ -11404,25 +10208,21 @@ test("x = function(y = 1) {}", { rest: null, generator: false, expression: false, - range: [4, 22], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 22} } }, - range: [0, 22], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 22} } }, - range: [0, 22], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 22} } }], - range: [0, 22], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 22} @@ -11440,7 +10240,6 @@ test("function f(a = 1) {}", { id: { type: "Identifier", name: "f", - range: [9, 10], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 10} @@ -11449,7 +10248,6 @@ test("function f(a = 1) {}", { params: [{ type: "Identifier", name: "a", - range: [11, 12], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 12} @@ -11459,7 +10257,6 @@ test("function f(a = 1) {}", { type: "Literal", value: 1, raw: "1", - range: [15, 16], loc: { start: {line: 1, column: 15}, end: {line: 1, column: 16} @@ -11468,7 +10265,6 @@ test("function f(a = 1) {}", { body: { type: "BlockStatement", body: [], - range: [18, 20], loc: { start: {line: 1, column: 18}, end: {line: 1, column: 20} @@ -11477,13 +10273,11 @@ test("function f(a = 1) {}", { rest: null, generator: false, expression: false, - range: [0, 20], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 20} } }], - range: [0, 20], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 20} @@ -11504,7 +10298,6 @@ test("x = { f: function(a=1) {} }", { left: { type: "Identifier", name: "x", - range: [0, 1], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 1} @@ -11517,7 +10310,6 @@ test("x = { f: function(a=1) {} }", { key: { type: "Identifier", name: "f", - range: [6, 7], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} @@ -11529,7 +10321,6 @@ test("x = { f: function(a=1) {} }", { params: [{ type: "Identifier", name: "a", - range: [18, 19], loc: { start: {line: 1, column: 18}, end: {line: 1, column: 19} @@ -11539,7 +10330,6 @@ test("x = { f: function(a=1) {} }", { type: "Literal", value: 1, raw: "1", - range: [20, 21], loc: { start: {line: 1, column: 20}, end: {line: 1, column: 21} @@ -11548,7 +10338,6 @@ test("x = { f: function(a=1) {} }", { body: { type: "BlockStatement", body: [], - range: [23, 25], loc: { start: {line: 1, column: 23}, end: {line: 1, column: 25} @@ -11557,7 +10346,6 @@ test("x = { f: function(a=1) {} }", { rest: null, generator: false, expression: false, - range: [9, 25], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 25} @@ -11567,31 +10355,26 @@ test("x = { f: function(a=1) {} }", { method: false, shorthand: false, computed: false, - range: [6, 25], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 25} } }], - range: [4, 27], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 27} } }, - range: [0, 27], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 27} } }, - range: [0, 27], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 27} } }], - range: [0, 27], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 27} @@ -11612,7 +10395,6 @@ test("x = { f(a=1) {} }", { left: { type: "Identifier", name: "x", - range: [0, 1], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 1} @@ -11625,7 +10407,6 @@ test("x = { f(a=1) {} }", { key: { type: "Identifier", name: "f", - range: [6, 7], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} @@ -11637,7 +10418,6 @@ test("x = { f(a=1) {} }", { params: [{ type: "Identifier", name: "a", - range: [8, 9], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 9} @@ -11647,7 +10427,6 @@ test("x = { f(a=1) {} }", { type: "Literal", value: 1, raw: "1", - range: [10, 11], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 11} @@ -11656,7 +10435,6 @@ test("x = { f(a=1) {} }", { body: { type: "BlockStatement", body: [], - range: [13, 15], loc: { start: {line: 1, column: 13}, end: {line: 1, column: 15} @@ -11665,7 +10443,6 @@ test("x = { f(a=1) {} }", { rest: null, generator: false, expression: false, - range: [7, 15], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 15} @@ -11675,31 +10452,26 @@ test("x = { f(a=1) {} }", { method: true, shorthand: false, computed: false, - range: [6, 15], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 15} } }], - range: [4, 17], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 17} } }, - range: [0, 17], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 17} } }, - range: [0, 17], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 17} } }], - range: [0, 17], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 17} @@ -11719,7 +10491,6 @@ test("function f(a, ...b) {}", { id: { type: "Identifier", name: "f", - range: [9, 10], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 10} @@ -11728,7 +10499,6 @@ test("function f(a, ...b) {}", { params: [{ type: "Identifier", name: "a", - range: [11, 12], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 12} @@ -11738,7 +10508,6 @@ test("function f(a, ...b) {}", { body: { type: "BlockStatement", body: [], - range: [20, 22], loc: { start: {line: 1, column: 20}, end: {line: 1, column: 22} @@ -11747,7 +10516,6 @@ test("function f(a, ...b) {}", { rest: { type: "Identifier", name: "b", - range: [17, 18], loc: { start: {line: 1, column: 17}, end: {line: 1, column: 18} @@ -11755,13 +10523,11 @@ test("function f(a, ...b) {}", { }, generator: false, expression: false, - range: [0, 22], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 22} } }], - range: [0, 22], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 22} @@ -11781,7 +10547,6 @@ test("function x([ a, b ]){}", { id: { type: "Identifier", name: "x", - range: [9, 10], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 10} @@ -11793,7 +10558,6 @@ test("function x([ a, b ]){}", { { type: "Identifier", name: "a", - range: [13, 14], loc: { start: {line: 1, column: 13}, end: {line: 1, column: 14} @@ -11802,14 +10566,12 @@ test("function x([ a, b ]){}", { { type: "Identifier", name: "b", - range: [16, 17], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 17} } } ], - range: [11, 19], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 19} @@ -11819,7 +10581,6 @@ test("function x([ a, b ]){}", { body: { type: "BlockStatement", body: [], - range: [20, 22], loc: { start: {line: 1, column: 20}, end: {line: 1, column: 22} @@ -11828,13 +10589,11 @@ test("function x([ a, b ]){}", { rest: null, generator: false, expression: false, - range: [0, 22], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 22} } }], - range: [0, 22], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 22} @@ -11852,7 +10611,6 @@ test("function x({ a, b }){}", { id: { type: "Identifier", name: "x", - range: [9, 10], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 10} @@ -11866,7 +10624,6 @@ test("function x({ a, b }){}", { key: { type: "Identifier", name: "a", - range: [13, 14], loc: { start: {line: 1, column: 13}, end: {line: 1, column: 14} @@ -11875,7 +10632,6 @@ test("function x({ a, b }){}", { value: { type: "Identifier", name: "a", - range: [13, 14], loc: { start: {line: 1, column: 13}, end: {line: 1, column: 14} @@ -11885,7 +10641,6 @@ test("function x({ a, b }){}", { method: false, shorthand: true, computed: false, - range: [13, 14], loc: { start: {line: 1, column: 13}, end: {line: 1, column: 14} @@ -11896,7 +10651,6 @@ test("function x({ a, b }){}", { key: { type: "Identifier", name: "b", - range: [16, 17], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 17} @@ -11905,7 +10659,6 @@ test("function x({ a, b }){}", { value: { type: "Identifier", name: "b", - range: [16, 17], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 17} @@ -11915,14 +10668,12 @@ test("function x({ a, b }){}", { method: false, shorthand: true, computed: false, - range: [16, 17], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 17} } } ], - range: [11, 19], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 19} @@ -11932,7 +10683,6 @@ test("function x({ a, b }){}", { body: { type: "BlockStatement", body: [], - range: [20, 22], loc: { start: {line: 1, column: 20}, end: {line: 1, column: 22} @@ -11941,13 +10691,11 @@ test("function x({ a, b }){}", { rest: null, generator: false, expression: false, - range: [0, 22], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 22} } }], - range: [0, 22], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 22} @@ -11965,7 +10713,6 @@ test("function x(a, { a }){}", { id: { type: "Identifier", name: "x", - range: [9, 10], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 10} @@ -11975,7 +10722,6 @@ test("function x(a, { a }){}", { { type: "Identifier", name: "a", - range: [11, 12], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 12} @@ -11988,7 +10734,6 @@ test("function x(a, { a }){}", { key: { type: "Identifier", name: "a", - range: [16, 17], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 17} @@ -11997,7 +10742,6 @@ test("function x(a, { a }){}", { value: { type: "Identifier", name: "a", - range: [16, 17], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 17} @@ -12007,13 +10751,11 @@ test("function x(a, { a }){}", { method: false, shorthand: true, computed: false, - range: [16, 17], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 17} } }], - range: [14, 19], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 19} @@ -12024,7 +10766,6 @@ test("function x(a, { a }){}", { body: { type: "BlockStatement", body: [], - range: [20, 22], loc: { start: {line: 1, column: 20}, end: {line: 1, column: 22} @@ -12033,13 +10774,11 @@ test("function x(a, { a }){}", { rest: null, generator: false, expression: false, - range: [0, 22], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 22} } }], - range: [0, 22], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 22} @@ -12057,7 +10796,6 @@ test("function x(...[ a, b ]){}", { id: { type: "Identifier", name: "x", - range: [9, 10], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 10} @@ -12068,7 +10806,6 @@ test("function x(...[ a, b ]){}", { body: { type: "BlockStatement", body: [], - range: [23, 25], loc: { start: {line: 1, column: 23}, end: {line: 1, column: 25} @@ -12080,7 +10817,6 @@ test("function x(...[ a, b ]){}", { { type: "Identifier", name: "a", - range: [16, 17], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 17} @@ -12089,14 +10825,12 @@ test("function x(...[ a, b ]){}", { { type: "Identifier", name: "b", - range: [19, 20], loc: { start: {line: 1, column: 19}, end: {line: 1, column: 20} } } ], - range: [14, 22], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 22} @@ -12104,13 +10838,11 @@ test("function x(...[ a, b ]){}", { }, generator: false, expression: false, - range: [0, 25], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 25} } }], - range: [0, 25], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 25} @@ -12128,7 +10860,6 @@ test("function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){}", { id: { type: "Identifier", name: "x", - range: [9, 10], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 10} @@ -12142,7 +10873,6 @@ test("function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){}", { key: { type: "Identifier", name: "a", - range: [13, 14], loc: { start: {line: 1, column: 13}, end: {line: 1, column: 14} @@ -12156,7 +10886,6 @@ test("function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){}", { key: { type: "Identifier", name: "w", - range: [18, 19], loc: { start: {line: 1, column: 18}, end: {line: 1, column: 19} @@ -12165,7 +10894,6 @@ test("function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){}", { value: { type: "Identifier", name: "w", - range: [18, 19], loc: { start: {line: 1, column: 18}, end: {line: 1, column: 19} @@ -12175,7 +10903,6 @@ test("function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){}", { method: false, shorthand: true, computed: false, - range: [18, 19], loc: { start: {line: 1, column: 18}, end: {line: 1, column: 19} @@ -12186,7 +10913,6 @@ test("function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){}", { key: { type: "Identifier", name: "x", - range: [21, 22], loc: { start: {line: 1, column: 21}, end: {line: 1, column: 22} @@ -12195,7 +10921,6 @@ test("function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){}", { value: { type: "Identifier", name: "x", - range: [21, 22], loc: { start: {line: 1, column: 21}, end: {line: 1, column: 22} @@ -12205,14 +10930,12 @@ test("function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){}", { method: false, shorthand: true, computed: false, - range: [21, 22], loc: { start: {line: 1, column: 21}, end: {line: 1, column: 22} } } ], - range: [16, 24], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 24} @@ -12222,7 +10945,6 @@ test("function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){}", { method: false, shorthand: false, computed: false, - range: [13, 24], loc: { start: {line: 1, column: 13}, end: {line: 1, column: 24} @@ -12233,7 +10955,6 @@ test("function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){}", { key: { type: "Identifier", name: "b", - range: [26, 27], loc: { start: {line: 1, column: 26}, end: {line: 1, column: 27} @@ -12245,7 +10966,6 @@ test("function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){}", { { type: "Identifier", name: "y", - range: [30, 31], loc: { start: {line: 1, column: 30}, end: {line: 1, column: 31} @@ -12254,14 +10974,12 @@ test("function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){}", { { type: "Identifier", name: "z", - range: [33, 34], loc: { start: {line: 1, column: 33}, end: {line: 1, column: 34} } } ], - range: [29, 35], loc: { start: {line: 1, column: 29}, end: {line: 1, column: 35} @@ -12271,14 +10989,12 @@ test("function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){}", { method: false, shorthand: false, computed: false, - range: [26, 35], loc: { start: {line: 1, column: 26}, end: {line: 1, column: 35} } } ], - range: [11, 37], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 37} @@ -12288,7 +11004,6 @@ test("function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){}", { body: { type: "BlockStatement", body: [], - range: [52, 54], loc: { start: {line: 1, column: 52}, end: {line: 1, column: 54} @@ -12300,7 +11015,6 @@ test("function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){}", { { type: "Identifier", name: "a", - range: [43, 44], loc: { start: {line: 1, column: 43}, end: {line: 1, column: 44} @@ -12309,7 +11023,6 @@ test("function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){}", { { type: "Identifier", name: "b", - range: [46, 47], loc: { start: {line: 1, column: 46}, end: {line: 1, column: 47} @@ -12318,14 +11031,12 @@ test("function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){}", { { type: "Identifier", name: "c", - range: [49, 50], loc: { start: {line: 1, column: 49}, end: {line: 1, column: 50} } } ], - range: [42, 51], loc: { start: {line: 1, column: 42}, end: {line: 1, column: 51} @@ -12333,13 +11044,11 @@ test("function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){}", { }, generator: false, expression: false, - range: [0, 54], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 54} } }], - range: [0, 54], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 54} @@ -12359,7 +11068,6 @@ test("(function x([ a, b ]){})", { id: { type: "Identifier", name: "x", - range: [10, 11], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 11} @@ -12371,7 +11079,6 @@ test("(function x([ a, b ]){})", { { type: "Identifier", name: "a", - range: [14, 15], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 15} @@ -12380,14 +11087,12 @@ test("(function x([ a, b ]){})", { { type: "Identifier", name: "b", - range: [17, 18], loc: { start: {line: 1, column: 17}, end: {line: 1, column: 18} } } ], - range: [12, 20], loc: { start: {line: 1, column: 12}, end: {line: 1, column: 20} @@ -12397,7 +11102,6 @@ test("(function x([ a, b ]){})", { body: { type: "BlockStatement", body: [], - range: [21, 23], loc: { start: {line: 1, column: 21}, end: {line: 1, column: 23} @@ -12406,19 +11110,16 @@ test("(function x([ a, b ]){})", { rest: null, generator: false, expression: false, - range: [1, 23], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 23} } }, - range: [0, 24], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 24} } }], - range: [0, 24], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 24} @@ -12438,7 +11139,6 @@ test("(function x({ a, b }){})", { id: { type: "Identifier", name: "x", - range: [10, 11], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 11} @@ -12452,7 +11152,6 @@ test("(function x({ a, b }){})", { key: { type: "Identifier", name: "a", - range: [14, 15], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 15} @@ -12461,7 +11160,6 @@ test("(function x({ a, b }){})", { value: { type: "Identifier", name: "a", - range: [14, 15], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 15} @@ -12471,7 +11169,6 @@ test("(function x({ a, b }){})", { method: false, shorthand: true, computed: false, - range: [14, 15], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 15} @@ -12482,7 +11179,6 @@ test("(function x({ a, b }){})", { key: { type: "Identifier", name: "b", - range: [17, 18], loc: { start: {line: 1, column: 17}, end: {line: 1, column: 18} @@ -12491,7 +11187,6 @@ test("(function x({ a, b }){})", { value: { type: "Identifier", name: "b", - range: [17, 18], loc: { start: {line: 1, column: 17}, end: {line: 1, column: 18} @@ -12501,14 +11196,12 @@ test("(function x({ a, b }){})", { method: false, shorthand: true, computed: false, - range: [17, 18], loc: { start: {line: 1, column: 17}, end: {line: 1, column: 18} } } ], - range: [12, 20], loc: { start: {line: 1, column: 12}, end: {line: 1, column: 20} @@ -12518,7 +11211,6 @@ test("(function x({ a, b }){})", { body: { type: "BlockStatement", body: [], - range: [21, 23], loc: { start: {line: 1, column: 21}, end: {line: 1, column: 23} @@ -12527,19 +11219,16 @@ test("(function x({ a, b }){})", { rest: null, generator: false, expression: false, - range: [1, 23], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 23} } }, - range: [0, 24], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 24} } }], - range: [0, 24], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 24} @@ -12559,7 +11248,6 @@ test("(function x(...[ a, b ]){})", { id: { type: "Identifier", name: "x", - range: [10, 11], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 11} @@ -12570,7 +11258,6 @@ test("(function x(...[ a, b ]){})", { body: { type: "BlockStatement", body: [], - range: [24, 26], loc: { start: {line: 1, column: 24}, end: {line: 1, column: 26} @@ -12582,7 +11269,6 @@ test("(function x(...[ a, b ]){})", { { type: "Identifier", name: "a", - range: [17, 18], loc: { start: {line: 1, column: 17}, end: {line: 1, column: 18} @@ -12591,14 +11277,12 @@ test("(function x(...[ a, b ]){})", { { type: "Identifier", name: "b", - range: [20, 21], loc: { start: {line: 1, column: 20}, end: {line: 1, column: 21} } } ], - range: [15, 23], loc: { start: {line: 1, column: 15}, end: {line: 1, column: 23} @@ -12606,19 +11290,16 @@ test("(function x(...[ a, b ]){})", { }, generator: false, expression: false, - range: [1, 26], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 26} } }, - range: [0, 27], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 27} } }], - range: [0, 27], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 27} @@ -12638,7 +11319,6 @@ test("(function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){})", { id: { type: "Identifier", name: "x", - range: [10, 11], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 11} @@ -12652,7 +11332,6 @@ test("(function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){})", { key: { type: "Identifier", name: "a", - range: [14, 15], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 15} @@ -12666,7 +11345,6 @@ test("(function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){})", { key: { type: "Identifier", name: "w", - range: [19, 20], loc: { start: {line: 1, column: 19}, end: {line: 1, column: 20} @@ -12675,7 +11353,6 @@ test("(function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){})", { value: { type: "Identifier", name: "w", - range: [19, 20], loc: { start: {line: 1, column: 19}, end: {line: 1, column: 20} @@ -12685,7 +11362,6 @@ test("(function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){})", { method: false, shorthand: true, computed: false, - range: [19, 20], loc: { start: {line: 1, column: 19}, end: {line: 1, column: 20} @@ -12696,7 +11372,6 @@ test("(function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){})", { key: { type: "Identifier", name: "x", - range: [22, 23], loc: { start: {line: 1, column: 22}, end: {line: 1, column: 23} @@ -12705,7 +11380,6 @@ test("(function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){})", { value: { type: "Identifier", name: "x", - range: [22, 23], loc: { start: {line: 1, column: 22}, end: {line: 1, column: 23} @@ -12715,14 +11389,12 @@ test("(function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){})", { method: false, shorthand: true, computed: false, - range: [22, 23], loc: { start: {line: 1, column: 22}, end: {line: 1, column: 23} } } ], - range: [17, 25], loc: { start: {line: 1, column: 17}, end: {line: 1, column: 25} @@ -12732,7 +11404,6 @@ test("(function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){})", { method: false, shorthand: false, computed: false, - range: [14, 25], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 25} @@ -12743,7 +11414,6 @@ test("(function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){})", { key: { type: "Identifier", name: "b", - range: [27, 28], loc: { start: {line: 1, column: 27}, end: {line: 1, column: 28} @@ -12755,7 +11425,6 @@ test("(function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){})", { { type: "Identifier", name: "y", - range: [31, 32], loc: { start: {line: 1, column: 31}, end: {line: 1, column: 32} @@ -12764,14 +11433,12 @@ test("(function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){})", { { type: "Identifier", name: "z", - range: [34, 35], loc: { start: {line: 1, column: 34}, end: {line: 1, column: 35} } } ], - range: [30, 36], loc: { start: {line: 1, column: 30}, end: {line: 1, column: 36} @@ -12781,14 +11448,12 @@ test("(function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){})", { method: false, shorthand: false, computed: false, - range: [27, 36], loc: { start: {line: 1, column: 27}, end: {line: 1, column: 36} } } ], - range: [12, 38], loc: { start: {line: 1, column: 12}, end: {line: 1, column: 38} @@ -12798,7 +11463,6 @@ test("(function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){})", { body: { type: "BlockStatement", body: [], - range: [53, 55], loc: { start: {line: 1, column: 53}, end: {line: 1, column: 55} @@ -12810,7 +11474,6 @@ test("(function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){})", { { type: "Identifier", name: "a", - range: [44, 45], loc: { start: {line: 1, column: 44}, end: {line: 1, column: 45} @@ -12819,7 +11482,6 @@ test("(function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){})", { { type: "Identifier", name: "b", - range: [47, 48], loc: { start: {line: 1, column: 47}, end: {line: 1, column: 48} @@ -12828,14 +11490,12 @@ test("(function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){})", { { type: "Identifier", name: "c", - range: [50, 51], loc: { start: {line: 1, column: 50}, end: {line: 1, column: 51} } } ], - range: [43, 52], loc: { start: {line: 1, column: 43}, end: {line: 1, column: 52} @@ -12843,19 +11503,16 @@ test("(function x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){})", { }, generator: false, expression: false, - range: [1, 55], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 55} } }, - range: [0, 56], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 56} } }], - range: [0, 56], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 56} @@ -12877,7 +11534,6 @@ test("({ x([ a, b ]){} })", { key: { type: "Identifier", name: "x", - range: [3, 4], loc: { start: {line: 1, column: 3}, end: {line: 1, column: 4} @@ -12892,7 +11548,6 @@ test("({ x([ a, b ]){} })", { { type: "Identifier", name: "a", - range: [7, 8], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 8} @@ -12901,14 +11556,12 @@ test("({ x([ a, b ]){} })", { { type: "Identifier", name: "b", - range: [10, 11], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 11} } } ], - range: [5, 13], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 13} @@ -12918,7 +11571,6 @@ test("({ x([ a, b ]){} })", { body: { type: "BlockStatement", body: [], - range: [14, 16], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 16} @@ -12927,7 +11579,6 @@ test("({ x([ a, b ]){} })", { rest: null, generator: false, expression: false, - range: [4, 16], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 16} @@ -12937,25 +11588,21 @@ test("({ x([ a, b ]){} })", { method: true, shorthand: false, computed: false, - range: [3, 16], loc: { start: {line: 1, column: 3}, end: {line: 1, column: 16} } }], - range: [1, 18], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 18} } }, - range: [0, 19], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 19} } }], - range: [0, 19], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 19} @@ -12977,7 +11624,6 @@ test("({ x(...[ a, b ]){} })", { key: { type: "Identifier", name: "x", - range: [3, 4], loc: { start: {line: 1, column: 3}, end: {line: 1, column: 4} @@ -12991,7 +11637,6 @@ test("({ x(...[ a, b ]){} })", { body: { type: "BlockStatement", body: [], - range: [17, 19], loc: { start: {line: 1, column: 17}, end: {line: 1, column: 19} @@ -13003,7 +11648,6 @@ test("({ x(...[ a, b ]){} })", { { type: "Identifier", name: "a", - range: [10, 11], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 11} @@ -13012,14 +11656,12 @@ test("({ x(...[ a, b ]){} })", { { type: "Identifier", name: "b", - range: [13, 14], loc: { start: {line: 1, column: 13}, end: {line: 1, column: 14} } } ], - range: [8, 16], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 16} @@ -13027,7 +11669,6 @@ test("({ x(...[ a, b ]){} })", { }, generator: false, expression: false, - range: [4, 19], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 19} @@ -13037,25 +11678,21 @@ test("({ x(...[ a, b ]){} })", { method: true, shorthand: false, computed: false, - range: [3, 19], loc: { start: {line: 1, column: 3}, end: {line: 1, column: 19} } }], - range: [1, 21], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 21} } }, - range: [0, 22], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 22} } }], - range: [0, 22], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 22} @@ -13077,7 +11714,6 @@ test("({ x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){} })", { key: { type: "Identifier", name: "x", - range: [3, 4], loc: { start: {line: 1, column: 3}, end: {line: 1, column: 4} @@ -13094,7 +11730,6 @@ test("({ x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){} })", { key: { type: "Identifier", name: "a", - range: [7, 8], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 8} @@ -13108,7 +11743,6 @@ test("({ x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){} })", { key: { type: "Identifier", name: "w", - range: [12, 13], loc: { start: {line: 1, column: 12}, end: {line: 1, column: 13} @@ -13117,7 +11751,6 @@ test("({ x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){} })", { value: { type: "Identifier", name: "w", - range: [12, 13], loc: { start: {line: 1, column: 12}, end: {line: 1, column: 13} @@ -13127,7 +11760,6 @@ test("({ x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){} })", { method: false, shorthand: true, computed: false, - range: [12, 13], loc: { start: {line: 1, column: 12}, end: {line: 1, column: 13} @@ -13138,7 +11770,6 @@ test("({ x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){} })", { key: { type: "Identifier", name: "x", - range: [15, 16], loc: { start: {line: 1, column: 15}, end: {line: 1, column: 16} @@ -13147,7 +11778,6 @@ test("({ x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){} })", { value: { type: "Identifier", name: "x", - range: [15, 16], loc: { start: {line: 1, column: 15}, end: {line: 1, column: 16} @@ -13157,14 +11787,12 @@ test("({ x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){} })", { method: false, shorthand: true, computed: false, - range: [15, 16], loc: { start: {line: 1, column: 15}, end: {line: 1, column: 16} } } ], - range: [10, 18], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 18} @@ -13174,7 +11802,6 @@ test("({ x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){} })", { method: false, shorthand: false, computed: false, - range: [7, 18], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 18} @@ -13185,7 +11812,6 @@ test("({ x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){} })", { key: { type: "Identifier", name: "b", - range: [20, 21], loc: { start: {line: 1, column: 20}, end: {line: 1, column: 21} @@ -13197,7 +11823,6 @@ test("({ x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){} })", { { type: "Identifier", name: "y", - range: [24, 25], loc: { start: {line: 1, column: 24}, end: {line: 1, column: 25} @@ -13206,14 +11831,12 @@ test("({ x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){} })", { { type: "Identifier", name: "z", - range: [27, 28], loc: { start: {line: 1, column: 27}, end: {line: 1, column: 28} } } ], - range: [23, 29], loc: { start: {line: 1, column: 23}, end: {line: 1, column: 29} @@ -13223,14 +11846,12 @@ test("({ x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){} })", { method: false, shorthand: false, computed: false, - range: [20, 29], loc: { start: {line: 1, column: 20}, end: {line: 1, column: 29} } } ], - range: [5, 31], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 31} @@ -13240,7 +11861,6 @@ test("({ x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){} })", { body: { type: "BlockStatement", body: [], - range: [46, 48], loc: { start: {line: 1, column: 46}, end: {line: 1, column: 48} @@ -13252,7 +11872,6 @@ test("({ x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){} })", { { type: "Identifier", name: "a", - range: [37, 38], loc: { start: {line: 1, column: 37}, end: {line: 1, column: 38} @@ -13261,7 +11880,6 @@ test("({ x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){} })", { { type: "Identifier", name: "b", - range: [40, 41], loc: { start: {line: 1, column: 40}, end: {line: 1, column: 41} @@ -13270,14 +11888,12 @@ test("({ x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){} })", { { type: "Identifier", name: "c", - range: [43, 44], loc: { start: {line: 1, column: 43}, end: {line: 1, column: 44} } } ], - range: [36, 45], loc: { start: {line: 1, column: 36}, end: {line: 1, column: 45} @@ -13285,7 +11901,6 @@ test("({ x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){} })", { }, generator: false, expression: false, - range: [4, 48], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 48} @@ -13295,25 +11910,21 @@ test("({ x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){} })", { method: true, shorthand: false, computed: false, - range: [3, 48], loc: { start: {line: 1, column: 3}, end: {line: 1, column: 48} } }], - range: [1, 50], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 50} } }, - range: [0, 51], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 51} } }], - range: [0, 51], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 51} @@ -13336,7 +11947,6 @@ test("(...a) => {}", { body: { type: "BlockStatement", body: [], - range: [10, 12], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 12} @@ -13345,7 +11955,6 @@ test("(...a) => {}", { rest: { type: "Identifier", name: "a", - range: [4, 5], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 5} @@ -13353,19 +11962,16 @@ test("(...a) => {}", { }, generator: false, expression: false, - range: [0, 12], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 12} } }, - range: [0, 12], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 12} } }], - range: [0, 12], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 12} @@ -13386,7 +11992,6 @@ test("(a, ...b) => {}", { params: [{ type: "Identifier", name: "a", - range: [1, 2], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 2} @@ -13396,7 +12001,6 @@ test("(a, ...b) => {}", { body: { type: "BlockStatement", body: [], - range: [13, 15], loc: { start: {line: 1, column: 13}, end: {line: 1, column: 15} @@ -13405,7 +12009,6 @@ test("(a, ...b) => {}", { rest: { type: "Identifier", name: "b", - range: [7, 8], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 8} @@ -13413,19 +12016,16 @@ test("(a, ...b) => {}", { }, generator: false, expression: false, - range: [0, 15], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 15} } }, - range: [0, 15], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 15} } }], - range: [0, 15], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 15} @@ -13450,7 +12050,6 @@ test("({ a }) => {}", { key: { type: "Identifier", name: "a", - range: [3, 4], loc: { start: {line: 1, column: 3}, end: {line: 1, column: 4} @@ -13459,7 +12058,6 @@ test("({ a }) => {}", { value: { type: "Identifier", name: "a", - range: [3, 4], loc: { start: {line: 1, column: 3}, end: {line: 1, column: 4} @@ -13469,13 +12067,11 @@ test("({ a }) => {}", { method: false, shorthand: true, computed: false, - range: [3, 4], loc: { start: {line: 1, column: 3}, end: {line: 1, column: 4} } }], - range: [1, 6], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 6} @@ -13485,7 +12081,6 @@ test("({ a }) => {}", { body: { type: "BlockStatement", body: [], - range: [11, 13], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 13} @@ -13494,19 +12089,16 @@ test("({ a }) => {}", { rest: null, generator: false, expression: false, - range: [0, 13], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 13} } }, - range: [0, 13], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 13} } }], - range: [0, 13], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 13} @@ -13531,7 +12123,6 @@ test("({ a }, ...b) => {}", { key: { type: "Identifier", name: "a", - range: [3, 4], loc: { start: {line: 1, column: 3}, end: {line: 1, column: 4} @@ -13540,7 +12131,6 @@ test("({ a }, ...b) => {}", { value: { type: "Identifier", name: "a", - range: [3, 4], loc: { start: {line: 1, column: 3}, end: {line: 1, column: 4} @@ -13550,13 +12140,11 @@ test("({ a }, ...b) => {}", { method: false, shorthand: true, computed: false, - range: [3, 4], loc: { start: {line: 1, column: 3}, end: {line: 1, column: 4} } }], - range: [1, 6], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 6} @@ -13566,7 +12154,6 @@ test("({ a }, ...b) => {}", { body: { type: "BlockStatement", body: [], - range: [17, 19], loc: { start: {line: 1, column: 17}, end: {line: 1, column: 19} @@ -13575,7 +12162,6 @@ test("({ a }, ...b) => {}", { rest: { type: "Identifier", name: "b", - range: [11, 12], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 12} @@ -13583,19 +12169,16 @@ test("({ a }, ...b) => {}", { }, generator: false, expression: false, - range: [0, 19], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 19} } }, - range: [0, 19], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 19} } }], - range: [0, 19], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 19} @@ -13618,7 +12201,6 @@ test("(...[a, b]) => {}", { body: { type: "BlockStatement", body: [], - range: [15, 17], loc: { start: {line: 1, column: 15}, end: {line: 1, column: 17} @@ -13630,7 +12212,6 @@ test("(...[a, b]) => {}", { { type: "Identifier", name: "a", - range: [5, 6], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 6} @@ -13639,14 +12220,12 @@ test("(...[a, b]) => {}", { { type: "Identifier", name: "b", - range: [8, 9], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 9} } } ], - range: [4, 10], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 10} @@ -13654,19 +12233,16 @@ test("(...[a, b]) => {}", { }, generator: false, expression: false, - range: [0, 17], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 17} } }, - range: [0, 17], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 17} } }], - range: [0, 17], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 17} @@ -13687,7 +12263,6 @@ test("(a, ...[b]) => {}", { params: [{ type: "Identifier", name: "a", - range: [1, 2], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 2} @@ -13697,7 +12272,6 @@ test("(a, ...[b]) => {}", { body: { type: "BlockStatement", body: [], - range: [15, 17], loc: { start: {line: 1, column: 15}, end: {line: 1, column: 17} @@ -13708,13 +12282,11 @@ test("(a, ...[b]) => {}", { elements: [{ type: "Identifier", name: "b", - range: [8, 9], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 9} } }], - range: [7, 10], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 10} @@ -13722,19 +12294,16 @@ test("(a, ...[b]) => {}", { }, generator: false, expression: false, - range: [0, 17], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 17} } }, - range: [0, 17], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 17} } }], - range: [0, 17], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 17} @@ -13759,7 +12328,6 @@ test("({ a: [a, b] }, ...c) => {}", { key: { type: "Identifier", name: "a", - range: [3, 4], loc: { start: {line: 1, column: 3}, end: {line: 1, column: 4} @@ -13771,7 +12339,6 @@ test("({ a: [a, b] }, ...c) => {}", { { type: "Identifier", name: "a", - range: [7, 8], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 8} @@ -13780,14 +12347,12 @@ test("({ a: [a, b] }, ...c) => {}", { { type: "Identifier", name: "b", - range: [10, 11], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 11} } } ], - range: [6, 12], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 12} @@ -13797,13 +12362,11 @@ test("({ a: [a, b] }, ...c) => {}", { method: false, shorthand: false, computed: false, - range: [3, 12], loc: { start: {line: 1, column: 3}, end: {line: 1, column: 12} } }], - range: [1, 14], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 14} @@ -13813,7 +12376,6 @@ test("({ a: [a, b] }, ...c) => {}", { body: { type: "BlockStatement", body: [], - range: [25, 27], loc: { start: {line: 1, column: 25}, end: {line: 1, column: 27} @@ -13822,7 +12384,6 @@ test("({ a: [a, b] }, ...c) => {}", { rest: { type: "Identifier", name: "c", - range: [19, 20], loc: { start: {line: 1, column: 19}, end: {line: 1, column: 20} @@ -13830,19 +12391,16 @@ test("({ a: [a, b] }, ...c) => {}", { }, generator: false, expression: false, - range: [0, 27], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 27} } }, - range: [0, 27], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 27} } }], - range: [0, 27], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 27} @@ -13869,7 +12427,6 @@ test("({ a: b, c }, [d, e], ...f) => {}", { key: { type: "Identifier", name: "a", - range: [3, 4], loc: { start: {line: 1, column: 3}, end: {line: 1, column: 4} @@ -13878,7 +12435,6 @@ test("({ a: b, c }, [d, e], ...f) => {}", { value: { type: "Identifier", name: "b", - range: [6, 7], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} @@ -13888,7 +12444,6 @@ test("({ a: b, c }, [d, e], ...f) => {}", { method: false, shorthand: false, computed: false, - range: [3, 7], loc: { start: {line: 1, column: 3}, end: {line: 1, column: 7} @@ -13899,7 +12454,6 @@ test("({ a: b, c }, [d, e], ...f) => {}", { key: { type: "Identifier", name: "c", - range: [9, 10], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 10} @@ -13908,7 +12462,6 @@ test("({ a: b, c }, [d, e], ...f) => {}", { value: { type: "Identifier", name: "c", - range: [9, 10], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 10} @@ -13918,14 +12471,12 @@ test("({ a: b, c }, [d, e], ...f) => {}", { method: false, shorthand: true, computed: false, - range: [9, 10], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 10} } } ], - range: [1, 12], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 12} @@ -13937,7 +12488,6 @@ test("({ a: b, c }, [d, e], ...f) => {}", { { type: "Identifier", name: "d", - range: [15, 16], loc: { start: {line: 1, column: 15}, end: {line: 1, column: 16} @@ -13946,14 +12496,12 @@ test("({ a: b, c }, [d, e], ...f) => {}", { { type: "Identifier", name: "e", - range: [18, 19], loc: { start: {line: 1, column: 18}, end: {line: 1, column: 19} } } ], - range: [14, 20], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 20} @@ -13964,7 +12512,6 @@ test("({ a: b, c }, [d, e], ...f) => {}", { body: { type: "BlockStatement", body: [], - range: [31, 33], loc: { start: {line: 1, column: 31}, end: {line: 1, column: 33} @@ -13973,7 +12520,6 @@ test("({ a: b, c }, [d, e], ...f) => {}", { rest: { type: "Identifier", name: "f", - range: [25, 26], loc: { start: {line: 1, column: 25}, end: {line: 1, column: 26} @@ -13981,19 +12527,16 @@ test("({ a: b, c }, [d, e], ...f) => {}", { }, generator: false, expression: false, - range: [0, 33], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 33} } }, - range: [0, 33], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 33} } }], - range: [0, 33], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 33} @@ -14020,19 +12563,16 @@ test("[...a] = b", { argument: { type: "Identifier", name: "a", - range: [4, 5], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 5} } }, - range: [1, 5], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 5} } }], - range: [0, 6], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 6} @@ -14041,25 +12581,21 @@ test("[...a] = b", { right: { type: "Identifier", name: "b", - range: [9, 10], loc: { start: {line: 1, column: 9}, end: {line: 1, column: 10} } }, - range: [0, 10], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 10} } }, - range: [0, 10], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 10} } }], - range: [0, 10], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 10} @@ -14083,7 +12619,6 @@ test("[a, ...b] = c", { { type: "Identifier", name: "a", - range: [1, 2], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 2} @@ -14094,20 +12629,17 @@ test("[a, ...b] = c", { argument: { type: "Identifier", name: "b", - range: [7, 8], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 8} } }, - range: [4, 8], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 8} } } ], - range: [0, 9], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 9} @@ -14116,25 +12648,21 @@ test("[a, ...b] = c", { right: { type: "Identifier", name: "c", - range: [12, 13], loc: { start: {line: 1, column: 12}, end: {line: 1, column: 13} } }, - range: [0, 13], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 13} } }, - range: [0, 13], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 13} } }], - range: [0, 13], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 13} @@ -14163,7 +12691,6 @@ test("[{ a, b }, ...c] = d", { key: { type: "Identifier", name: "a", - range: [3, 4], loc: { start: {line: 1, column: 3}, end: {line: 1, column: 4} @@ -14172,7 +12699,6 @@ test("[{ a, b }, ...c] = d", { value: { type: "Identifier", name: "a", - range: [3, 4], loc: { start: {line: 1, column: 3}, end: {line: 1, column: 4} @@ -14182,7 +12708,6 @@ test("[{ a, b }, ...c] = d", { method: false, shorthand: true, computed: false, - range: [3, 4], loc: { start: {line: 1, column: 3}, end: {line: 1, column: 4} @@ -14193,7 +12718,6 @@ test("[{ a, b }, ...c] = d", { key: { type: "Identifier", name: "b", - range: [6, 7], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} @@ -14202,7 +12726,6 @@ test("[{ a, b }, ...c] = d", { value: { type: "Identifier", name: "b", - range: [6, 7], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} @@ -14212,14 +12735,12 @@ test("[{ a, b }, ...c] = d", { method: false, shorthand: true, computed: false, - range: [6, 7], loc: { start: {line: 1, column: 6}, end: {line: 1, column: 7} } } ], - range: [1, 9], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 9} @@ -14230,20 +12751,17 @@ test("[{ a, b }, ...c] = d", { argument: { type: "Identifier", name: "c", - range: [14, 15], loc: { start: {line: 1, column: 14}, end: {line: 1, column: 15} } }, - range: [11, 15], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 15} } } ], - range: [0, 16], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 16} @@ -14252,25 +12770,21 @@ test("[{ a, b }, ...c] = d", { right: { type: "Identifier", name: "d", - range: [19, 20], loc: { start: {line: 1, column: 19}, end: {line: 1, column: 20} } }, - range: [0, 20], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 20} } }, - range: [0, 20], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 20} } }], - range: [0, 20], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 20} @@ -14294,7 +12808,6 @@ test("[a, ...[b, c]] = d", { { type: "Identifier", name: "a", - range: [1, 2], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 2} @@ -14308,7 +12821,6 @@ test("[a, ...[b, c]] = d", { { type: "Identifier", name: "b", - range: [8, 9], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 9} @@ -14317,27 +12829,23 @@ test("[a, ...[b, c]] = d", { { type: "Identifier", name: "c", - range: [11, 12], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 12} } } ], - range: [7, 13], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 13} } }, - range: [4, 13], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 13} } } ], - range: [0, 14], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 14} @@ -14346,25 +12854,21 @@ test("[a, ...[b, c]] = d", { right: { type: "Identifier", name: "d", - range: [17, 18], loc: { start: {line: 1, column: 17}, end: {line: 1, column: 18} } }, - range: [0, 18], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 18} } }, - range: [0, 18], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 18} } }], - range: [0, 18], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 18} @@ -14388,19 +12892,16 @@ test("var [...a] = b", { argument: { type: "Identifier", name: "a", - range: [8, 9], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 9} } }, - range: [5, 9], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 9} } }], - range: [4, 10], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 10} @@ -14409,26 +12910,22 @@ test("var [...a] = b", { init: { type: "Identifier", name: "b", - range: [13, 14], loc: { start: {line: 1, column: 13}, end: {line: 1, column: 14} } }, - range: [4, 14], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 14} } }], kind: "var", - range: [0, 14], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 14} } }], - range: [0, 14], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 14} @@ -14451,7 +12948,6 @@ test("var [a, ...b] = c", { { type: "Identifier", name: "a", - range: [5, 6], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 6} @@ -14462,20 +12958,17 @@ test("var [a, ...b] = c", { argument: { type: "Identifier", name: "b", - range: [11, 12], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 12} } }, - range: [8, 12], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 12} } } ], - range: [4, 13], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 13} @@ -14484,26 +12977,22 @@ test("var [a, ...b] = c", { init: { type: "Identifier", name: "c", - range: [16, 17], loc: { start: {line: 1, column: 16}, end: {line: 1, column: 17} } }, - range: [4, 17], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 17} } }], kind: "var", - range: [0, 17], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 17} } }], - range: [0, 17], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 17} @@ -14531,7 +13020,6 @@ test("var [{ a, b }, ...c] = d", { key: { type: "Identifier", name: "a", - range: [7, 8], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 8} @@ -14540,7 +13028,6 @@ test("var [{ a, b }, ...c] = d", { value: { type: "Identifier", name: "a", - range: [7, 8], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 8} @@ -14550,7 +13037,6 @@ test("var [{ a, b }, ...c] = d", { method: false, shorthand: true, computed: false, - range: [7, 8], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 8} @@ -14561,7 +13047,6 @@ test("var [{ a, b }, ...c] = d", { key: { type: "Identifier", name: "b", - range: [10, 11], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 11} @@ -14570,7 +13055,6 @@ test("var [{ a, b }, ...c] = d", { value: { type: "Identifier", name: "b", - range: [10, 11], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 11} @@ -14580,14 +13064,12 @@ test("var [{ a, b }, ...c] = d", { method: false, shorthand: true, computed: false, - range: [10, 11], loc: { start: {line: 1, column: 10}, end: {line: 1, column: 11} } } ], - range: [5, 13], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 13} @@ -14598,20 +13080,17 @@ test("var [{ a, b }, ...c] = d", { argument: { type: "Identifier", name: "c", - range: [18, 19], loc: { start: {line: 1, column: 18}, end: {line: 1, column: 19} } }, - range: [15, 19], loc: { start: {line: 1, column: 15}, end: {line: 1, column: 19} } } ], - range: [4, 20], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 20} @@ -14620,26 +13099,22 @@ test("var [{ a, b }, ...c] = d", { init: { type: "Identifier", name: "d", - range: [23, 24], loc: { start: {line: 1, column: 23}, end: {line: 1, column: 24} } }, - range: [4, 24], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 24} } }], kind: "var", - range: [0, 24], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 24} } }], - range: [0, 24], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 24} @@ -14662,7 +13137,6 @@ test("var [a, ...[b, c]] = d", { { type: "Identifier", name: "a", - range: [5, 6], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 6} @@ -14676,7 +13150,6 @@ test("var [a, ...[b, c]] = d", { { type: "Identifier", name: "b", - range: [12, 13], loc: { start: {line: 1, column: 12}, end: {line: 1, column: 13} @@ -14685,27 +13158,23 @@ test("var [a, ...[b, c]] = d", { { type: "Identifier", name: "c", - range: [15, 16], loc: { start: {line: 1, column: 15}, end: {line: 1, column: 16} } } ], - range: [11, 17], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 17} } }, - range: [8, 17], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 17} } } ], - range: [4, 18], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 18} @@ -14714,26 +13183,22 @@ test("var [a, ...[b, c]] = d", { init: { type: "Identifier", name: "d", - range: [21, 22], loc: { start: {line: 1, column: 21}, end: {line: 1, column: 22} } }, - range: [4, 22], loc: { start: {line: 1, column: 4}, end: {line: 1, column: 22} } }], kind: "var", - range: [0, 22], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 22} } }], - range: [0, 22], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 22} @@ -14753,7 +13218,6 @@ test("func(...a)", { callee: { type: "Identifier", name: "func", - range: [0, 4], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 4} @@ -14764,31 +13228,26 @@ test("func(...a)", { argument: { type: "Identifier", name: "a", - range: [8, 9], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 9} } }, - range: [5, 9], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 9} } }], - range: [0, 10], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 10} } }, - range: [0, 10], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 10} } }], - range: [0, 10], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 10} @@ -14808,7 +13267,6 @@ test("func(a, ...b)", { callee: { type: "Identifier", name: "func", - range: [0, 4], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 4} @@ -14818,7 +13276,6 @@ test("func(a, ...b)", { { type: "Identifier", name: "a", - range: [5, 6], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 6} @@ -14829,32 +13286,27 @@ test("func(a, ...b)", { argument: { type: "Identifier", name: "b", - range: [11, 12], loc: { start: {line: 1, column: 11}, end: {line: 1, column: 12} } }, - range: [8, 12], loc: { start: {line: 1, column: 8}, end: {line: 1, column: 12} } } ], - range: [0, 13], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 13} } }, - range: [0, 13], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 13} } }], - range: [0, 13], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 13} @@ -14871,28 +13323,24 @@ test("func(...a, b)", { start: {line: 1, column: 0}, end: {line: 1, column: 13} }, - range: [0, 13], body: [{ type: "ExpressionStatement", loc: { start: {line: 1, column: 0}, end: {line: 1, column: 13} }, - range: [0, 13], expression: { type: "CallExpression", loc: { start: {line: 1, column: 0}, end: {line: 1, column: 13} }, - range: [0, 13], callee: { type: "Identifier", loc: { start: {line: 1, column: 0}, end: {line: 1, column: 4} }, - range: [0, 4], name: "func" }, arguments: [ @@ -14902,14 +13350,12 @@ test("func(...a, b)", { start: {line: 1, column: 5}, end: {line: 1, column: 9} }, - range: [5, 9], argument: { type: "Identifier", loc: { start: {line: 1, column: 8}, end: {line: 1, column: 9} }, - range: [8, 9], name: "a" } }, @@ -14919,7 +13365,6 @@ test("func(...a, b)", { start: {line: 1, column: 11}, end: {line: 1, column: 12} }, - range: [11, 12], name: "b" } ] @@ -15086,7 +13531,6 @@ test("yield* 10", { left: { type: "Identifier", name: "yield", - range: [0, 5], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 5} @@ -15096,25 +13540,21 @@ test("yield* 10", { type: "Literal", value: 10, raw: "10", - range: [7, 9], loc: { start: {line: 1, column: 7}, end: {line: 1, column: 9} } }, - range: [0, 9], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 9} } }, - range: [0, 9], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 9} } }], - range: [0, 9], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 9} @@ -15135,7 +13575,6 @@ test("e => yield* 10", { params: [{ type: "Identifier", name: "e", - range: [0, 1], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 1} @@ -15148,7 +13587,6 @@ test("e => yield* 10", { left: { type: "Identifier", name: "yield", - range: [5, 10], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 10} @@ -15158,13 +13596,11 @@ test("e => yield* 10", { type: "Literal", value: 10, raw: "10", - range: [12, 14], loc: { start: {line: 1, column: 12}, end: {line: 1, column: 14} } }, - range: [5, 14], loc: { start: {line: 1, column: 5}, end: {line: 1, column: 14} @@ -15173,19 +13609,16 @@ test("e => yield* 10", { rest: null, generator: false, expression: true, - range: [0, 14], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 14} } }, - range: [0, 14], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 14} } }], - range: [0, 14], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 14} @@ -15217,7 +13650,6 @@ test("(function () { yield* 10 })", { left: { type: "Identifier", name: "yield", - range: [15, 20], loc: { start: {line: 1, column: 15}, end: {line: 1, column: 20} @@ -15227,25 +13659,21 @@ test("(function () { yield* 10 })", { type: "Literal", value: 10, raw: "10", - range: [22, 24], loc: { start: {line: 1, column: 22}, end: {line: 1, column: 24} } }, - range: [15, 24], loc: { start: {line: 1, column: 15}, end: {line: 1, column: 24} } }, - range: [15, 24], loc: { start: {line: 1, column: 15}, end: {line: 1, column: 24} } }], - range: [13, 26], loc: { start: {line: 1, column: 13}, end: {line: 1, column: 26} @@ -15254,19 +13682,16 @@ test("(function () { yield* 10 })", { rest: null, generator: false, expression: false, - range: [1, 26], loc: { start: {line: 1, column: 1}, end: {line: 1, column: 26} } }, - range: [0, 27], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 27} } }], - range: [0, 27], loc: { start: {line: 1, column: 0}, end: {line: 1, column: 27} @@ -15345,21 +13770,18 @@ test("[...a, ] = b", { start: {line: 1, column: 0}, end: {line: 1, column: 12} }, - range: [0, 12], body: [{ type: "ExpressionStatement", loc: { start: {line: 1, column: 0}, end: {line: 1, column: 12} }, - range: [0, 12], expression: { type: "AssignmentExpression", loc: { start: {line: 1, column: 0}, end: {line: 1, column: 12} }, - range: [0, 12], operator: "=", left: { type: "ArrayPattern", @@ -15367,21 +13789,18 @@ test("[...a, ] = b", { start: {line: 1, column: 0}, end: {line: 1, column: 8} }, - range: [0, 8], elements: [{ type: "SpreadElement", loc: { start: {line: 1, column: 1}, end: {line: 1, column: 5} }, - range: [1, 5], argument: { type: "Identifier", loc: { start: {line: 1, column: 4}, end: {line: 1, column: 5} }, - range: [4, 5], name: "a" } }] @@ -15392,7 +13811,6 @@ test("[...a, ] = b", { start: {line: 1, column: 11}, end: {line: 1, column: 12} }, - range: [11, 12], name: "b" } } @@ -15420,54 +13838,34 @@ testFail("({ get test() { } }) => 42", "Unexpected token (1:7)", {ecmaVersion: 6 // # https://github.com/marijnh/acorn/issues/127 test('doSmth(`${x} + ${y} = ${x + y}`)', { type: "Program", - start: 0, - end: 32, body: [{ type: "ExpressionStatement", - start: 0, - end: 32, expression: { type: "CallExpression", - start: 0, - end: 32, callee: { type: "Identifier", - start: 0, - end: 6, name: "doSmth" }, arguments: [{ type: "TemplateLiteral", - start: 7, - end: 31, expressions: [ { type: "Identifier", - start: 10, - end: 11, name: "x" }, { type: "Identifier", - start: 17, - end: 18, name: "y" }, { type: "BinaryExpression", - start: 24, - end: 29, left: { type: "Identifier", - start: 24, - end: 25, name: "x" }, operator: "+", right: { type: "Identifier", - start: 28, - end: 29, name: "y" } } @@ -15475,29 +13873,21 @@ test('doSmth(`${x} + ${y} = ${x + y}`)', { quasis: [ { type: "TemplateElement", - start: 8, - end: 8, value: {cooked: "", raw: ""}, tail: false }, { type: "TemplateElement", - start: 12, - end: 15, value: {cooked: " + ", raw: " + "}, tail: false }, { type: "TemplateElement", - start: 19, - end: 22, value: {cooked: " = ", raw: " = "}, tail: false }, { type: "TemplateElement", - start: 30, - end: 30, value: {cooked: "", raw: ""}, tail: true } @@ -15510,29 +13900,19 @@ test('doSmth(`${x} + ${y} = ${x + y}`)', { // # https://github.com/marijnh/acorn/issues/129 test('function normal(x, y = 10) {}', { type: "Program", - start: 0, - end: 29, body: [{ type: "FunctionDeclaration", - start: 0, - end: 29, id: { type: "Identifier", - start: 9, - end: 15, name: "normal" }, params: [ { type: "Identifier", - start: 16, - end: 17, name: "x" }, { type: "Identifier", - start: 19, - end: 20, name: "y" } ], @@ -15540,8 +13920,6 @@ test('function normal(x, y = 10) {}', { null, { type: "Literal", - start: 23, - end: 25, value: 10, raw: "10" } @@ -15550,8 +13928,6 @@ test('function normal(x, y = 10) {}', { generator: false, body: { type: "BlockStatement", - start: 27, - end: 29, body: [] }, expression: false From 9d3580b23ac6e5a55013339c3b13cde5c6a6072b Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Wed, 29 Oct 2014 20:35:37 +1100 Subject: [PATCH 06/47] make ImportDeclaration and ExportDeclaration semicolons more spec-compliant --- acorn.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/acorn.js b/acorn.js index 8013c92685..401b9421c8 100644 --- a/acorn.js +++ b/acorn.js @@ -2482,8 +2482,8 @@ node.source = null; semicolon(); } else { - // export * from '...' - // export { x, y as z } [from '...'] + // export * from '...'; + // export { x, y as z } [from '...']; var isBatch = tokType === _star; node.declaration = null; node['default'] = false; @@ -2495,6 +2495,7 @@ if (isBatch) unexpected(); node.source = null; } + semicolon(); } return finishNode(node, "ExportDeclaration"); } @@ -2549,6 +2550,7 @@ // (it doesn't support mixed default + named yet) node.kind = node.specifiers[0]['default'] ? "default" : "named"; } + semicolon(); return finishNode(node, "ImportDeclaration"); } From a18f3d10037c4adba0f0de8b16472ee5feeb9524 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Tue, 4 Nov 2014 11:40:49 +1100 Subject: [PATCH 07/47] Add support for computed static mutator class methods --- acorn.js | 2 +- test/tests-harmony.js | 153 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 154 insertions(+), 1 deletion(-) diff --git a/acorn.js b/acorn.js index 401b9421c8..d94aee2fc3 100644 --- a/acorn.js +++ b/acorn.js @@ -2402,7 +2402,7 @@ } var isGenerator = eat(_star); parsePropertyName(method); - if (tokType === _name && !method.computed && method.key.type === "Identifier" && + if (tokType !== _parenL && !method.computed && method.key.type === "Identifier" && (method.key.name === "get" || method.key.name === "set")) { if (isGenerator) unexpected(); method.kind = method.key.name; diff --git a/test/tests-harmony.js b/test/tests-harmony.js index 539418f870..2302f58f60 100644 --- a/test/tests-harmony.js +++ b/test/tests-harmony.js @@ -8304,6 +8304,159 @@ test("class A { static get foo() {} static set foo(v) {} get foo() {} set foo(v) locations: true }); + +test("class A { static [foo]() {} }", { + type: "Program", + loc: { + start: {line: 1, column: 0}, + end: {line: 1, column: 29} + }, + body: [{ + type: "ClassDeclaration", + loc: { + start: {line: 1, column: 0}, + end: {line: 1, column: 29} + }, + id: { + type: "Identifier", + loc: { + start: {line: 1, column: 6}, + end: {line: 1, column: 7} + }, + name: "A" + }, + superClass: null, + body: { + type: "ClassBody", + loc: { + start: {line: 1, column: 8}, + end: {line: 1, column: 29} + }, + body: [{ + type: "MethodDefinition", + loc: { + start: {line: 1, column: 10}, + end: {line: 1, column: 27} + }, + static: true, + computed: true, + key: { + type: "Identifier", + loc: { + start: {line: 1, column: 18}, + end: {line: 1, column: 21} + }, + name: "foo" + }, + kind: "", + value: { + type: "FunctionExpression", + loc: { + start: {line: 1, column: 22}, + end: {line: 1, column: 27} + }, + id: null, + params: [], + defaults: [], + rest: null, + generator: false, + body: { + type: "BlockStatement", + loc: { + start: {line: 1, column: 25}, + end: {line: 1, column: 27} + }, + body: [] + }, + expression: false + } + }] + } + }] +}, { + ecmaVersion: 6, + ranges: true, + locations: true +}); + +test("class A { static get [foo]() {} }", { + type: "Program", + loc: { + start: {line: 1, column: 0}, + end: {line: 1, column: 33} + }, + body: [{ + type: "ClassDeclaration", + loc: { + start: {line: 1, column: 0}, + end: {line: 1, column: 33} + }, + id: { + type: "Identifier", + loc: { + start: {line: 1, column: 6}, + end: {line: 1, column: 7} + }, + range: [ + 6, + 7 + ], + name: "A" + }, + superClass: null, + body: { + type: "ClassBody", + loc: { + start: {line: 1, column: 8}, + end: {line: 1, column: 33} + }, + body: [{ + type: "MethodDefinition", + loc: { + start: {line: 1, column: 10}, + end: {line: 1, column: 31} + }, + static: true, + computed: true, + key: { + type: "Identifier", + loc: { + start: {line: 1, column: 22}, + end: {line: 1, column: 25} + }, + name: "foo" + }, + kind: "get", + value: { + type: "FunctionExpression", + loc: { + start: {line: 1, column: 26}, + end: {line: 1, column: 31} + }, + id: null, + params: [], + defaults: [], + rest: null, + generator: false, + body: { + type: "BlockStatement", + loc: { + start: {line: 1, column: 29}, + end: {line: 1, column: 31} + }, + body: [] + }, + expression: false + } + }] + } + }] +}, { + ecmaVersion: 6, + ranges: true, + locations: true +}); + test("class A { set foo(v) {} get foo() {} }", { type: "Program", body: [{ From d745bd7e32a60734939c01e17aa40a6b89121af6 Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Sun, 26 Oct 2014 17:29:51 +0200 Subject: [PATCH 08/47] Make test runner more generic. --- test/driver.js | 5 ++--- test/run.js | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/driver.js b/test/driver.js index a08bf6e837..f948fe656a 100644 --- a/test/driver.js +++ b/test/driver.js @@ -1,6 +1,5 @@ (function(exports) { var tests = []; - var acorn = typeof require == "undefined" ? window.acorn : require("../acorn.js"); exports.test = function(code, ast, options, comments) { tests.push({code: code, ast: ast, options: options, comments: comments}); @@ -12,7 +11,7 @@ tests.push({code: code, assert: assert, options: options}); }; - exports.runTests = function(callback) { + exports.runTests = function(parse, callback) { var comments; function onComment(block, text, start, end, startLoc, endLoc) { @@ -33,7 +32,7 @@ try { comments = []; if (test.options && !test.options.onComment) test.options.onComment = onComment; - var ast = acorn.parse(test.code, test.options || opts); + var ast = parse(test.code, test.options || opts); if (test.error) callback("fail", test.code, "Expected error message: " + test.error + "\nBut parsing succeeded."); else if (test.assert) { diff --git a/test/run.js b/test/run.js index 2d44344745..7e84a79464 100644 --- a/test/run.js +++ b/test/run.js @@ -9,7 +9,8 @@ function report(state, code, message) { } var t0 = +new Date; -driver.runTests(report); +var acorn = typeof require == "undefined" ? window.acorn : require("../acorn.js"); +driver.runTests(acorn.parse, report); console.log(testsRun + " tests run in " + (+new Date - t0) + "ms"); if (failed) { From 074db16fb7ae737b5dc2757d9e7f26ef296d9e32 Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Sun, 26 Oct 2014 17:35:49 +0200 Subject: [PATCH 09/47] Indentation fix. --- test/driver.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/driver.js b/test/driver.js index f948fe656a..539fc00308 100644 --- a/test/driver.js +++ b/test/driver.js @@ -15,14 +15,14 @@ var comments; function onComment(block, text, start, end, startLoc, endLoc) { - comments.push({ - block: block, - text: text, - start: start, - end: end, - startLoc: { line: startLoc.line, column: startLoc.column }, - endLoc: { line: endLoc.line, column: endLoc.column } - }); + comments.push({ + block: block, + text: text, + start: start, + end: end, + startLoc: { line: startLoc.line, column: startLoc.column }, + endLoc: { line: endLoc.line, column: endLoc.column } + }); } var opts = {locations: true, onComment: onComment}; @@ -32,7 +32,7 @@ try { comments = []; if (test.options && !test.options.onComment) test.options.onComment = onComment; - var ast = parse(test.code, test.options || opts); + var ast = acorn.parse(test.code, test.options || opts); if (test.error) callback("fail", test.code, "Expected error message: " + test.error + "\nBut parsing succeeded."); else if (test.assert) { From 86f8c56d2be35fc9753d6328a6c56294099a0c42 Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Sun, 26 Oct 2014 17:39:58 +0200 Subject: [PATCH 10/47] Added .editorconfig. --- .editorconfig | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..0020fc03ac --- /dev/null +++ b/.editorconfig @@ -0,0 +1,5 @@ +root = true + +[*] +indent_style = space +indent_size = 2 From d424874cf89a71db3b8efcd5bbb9ebb96b027ed9 Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Sun, 26 Oct 2014 17:44:39 +0200 Subject: [PATCH 11/47] Editorconfig: enforce Unix line endings and extra new line in the end of file. --- .editorconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.editorconfig b/.editorconfig index 0020fc03ac..c14d5c67b4 100644 --- a/.editorconfig +++ b/.editorconfig @@ -3,3 +3,5 @@ root = true [*] indent_style = space indent_size = 2 +end_of_line = lf +insert_final_newline = true From 7db211d56a6f2957941e94976a18bd6c19f8e36d Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Sun, 26 Oct 2014 17:59:10 +0200 Subject: [PATCH 12/47] Added loose parser support to test runner (currently failing for 208/1680). --- test/driver.js | 14 ++++++++++---- test/run.js | 10 +++++++--- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/test/driver.js b/test/driver.js index 539fc00308..8b812bfdca 100644 --- a/test/driver.js +++ b/test/driver.js @@ -11,7 +11,8 @@ tests.push({code: code, assert: assert, options: options}); }; - exports.runTests = function(parse, callback) { + exports.runTests = function(config) { + var parse = config.parse, callback = config.callback; var comments; function onComment(block, text, start, end, startLoc, endLoc) { @@ -32,9 +33,14 @@ try { comments = []; if (test.options && !test.options.onComment) test.options.onComment = onComment; - var ast = acorn.parse(test.code, test.options || opts); - if (test.error) callback("fail", test.code, - "Expected error message: " + test.error + "\nBut parsing succeeded."); + var ast = parse(test.code, test.options || opts); + if (test.error) { + if (config.loose) { + callback("ok", test.code); + } else { + callback("fail", test.code, "Expected error message: " + test.error + "\nBut parsing succeeded."); + } + } else if (test.assert) { var error = test.assert(ast); if (error) callback("fail", test.code, diff --git a/test/run.js b/test/run.js index 7e84a79464..2fa2c8dbff 100644 --- a/test/run.js +++ b/test/run.js @@ -9,8 +9,12 @@ function report(state, code, message) { } var t0 = +new Date; -var acorn = typeof require == "undefined" ? window.acorn : require("../acorn.js"); -driver.runTests(acorn.parse, report); + +var parse = (typeof require === "undefined" ? window.acorn : require("../acorn.js")).parse; +var parse_dammit = (typeof require === "undefined") ? window.acorn_loose : require("../acorn_loose").parse_dammit; + +driver.runTests({parse: parse, callback: report}); +driver.runTests({parse: parse_dammit, loose: true, callback: report}); console.log(testsRun + " tests run in " + (+new Date - t0) + "ms"); if (failed) { @@ -20,4 +24,4 @@ if (failed) { }); } else { console.log("All passed."); -} \ No newline at end of file +} From 61d2067b2bf64862b09c7634057a2017fa352614 Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Sun, 26 Oct 2014 18:08:43 +0200 Subject: [PATCH 13/47] Loose: Added ParenthesizedExpression. --- acorn_loose.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/acorn_loose.js b/acorn_loose.js index 09fbf210fe..6829f2f606 100644 --- a/acorn_loose.js +++ b/acorn_loose.js @@ -664,9 +664,15 @@ return finishNode(node, "Literal"); case tt.parenL: + var start = storeCurrentPos(); next(); var val = parseExpression(); expect(tt.parenR); + if (options.preserveParens) { + var par = startNodeAt(start); + par.expression = val; + val = finishNode(par, "ParenthesizedExpression"); + } return val; case tt.bracketL: From c26fd33826de858c1edfbea66db31984002664e0 Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Sun, 26 Oct 2014 19:20:00 +0200 Subject: [PATCH 14/47] Clone test options object since calling `parse` is destructive for it. --- test/driver.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/driver.js b/test/driver.js index 8b812bfdca..5c71b1eeff 100644 --- a/test/driver.js +++ b/test/driver.js @@ -32,8 +32,9 @@ var test = tests[i]; try { comments = []; - if (test.options && !test.options.onComment) test.options.onComment = onComment; - var ast = parse(test.code, test.options || opts); + var testOpts = JSON.parse(JSON.stringify(test.options || opts)); + if (!testOpts.onComment) testOpts.onComment = onComment; + var ast = parse(test.code, testOpts); if (test.error) { if (config.loose) { callback("ok", test.code); From 11ecb20e9e9e5862b688bbc61f50974328aefb1d Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Sun, 26 Oct 2014 19:27:00 +0200 Subject: [PATCH 15/47] Loose: ES6 function params support. --- acorn.js | 2 +- acorn_loose.js | 82 ++++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 73 insertions(+), 11 deletions(-) diff --git a/acorn.js b/acorn.js index d94aee2fc3..14648d36a1 100644 --- a/acorn.js +++ b/acorn.js @@ -444,7 +444,7 @@ parenL: _parenL, parenR: _parenR, comma: _comma, semi: _semi, colon: _colon, dot: _dot, ellipsis: _ellipsis, question: _question, slash: _slash, eq: _eq, name: _name, eof: _eof, num: _num, regexp: _regexp, string: _string, - arrow: _arrow, bquote: _bquote, dollarBraceL: _dollarBraceL}; + arrow: _arrow, bquote: _bquote, dollarBraceL: _dollarBraceL, star: _star}; for (var kw in keywordTypes) exports.tokTypes["_" + kw] = keywordTypes[kw]; // This is a trick taken from Esprima. It turns out that, on diff --git a/acorn_loose.js b/acorn_loose.js index 6829f2f606..39615aac63 100644 --- a/acorn_loose.js +++ b/acorn_loose.js @@ -256,6 +256,8 @@ if (token.type === type) { next(); return true; + } else { + return false; } } @@ -759,19 +761,79 @@ return finishNode(node, "Identifier"); } + function initFunction(node) { + node.id = null; + node.params = []; + if (options.ecmaVersion >= 6) { + node.defaults = []; + node.rest = null; + node.generator = false; + node.expression = false; + } + } + + // Convert existing expression atom to assignable pattern + // if possible. + + function toAssignable(node) { + if (options.ecmaVersion >= 6 && node) { + switch (node.type) { + case "ObjectExpression": + node.type = "ObjectPattern"; + var props = node.properties; + for (var i = 0; i < props.length; i++) { + toAssignable(props[i].value); + } + break; + + case "ArrayExpression": + node.type = "ArrayPattern"; + var elms = node.elements; + for (var i = 0; i < elms.length; i++) { + toAssignable(elms[i]); + } + break; + + case "SpreadElement": + toAssignable(node.argument); + break; + } + } + return node; + } + + function parseFunctionParams(node) { + var defaults = [], hasDefaults = false; + + pushCx(); + var params = parseExprList(tt.parenR); + for (var i = 0; i < params.length; i++) { + var param = toAssignable(params[i]), defValue = null; + if (param.type === "SpreadElement") { + if (i === params.length - 1) { + params.length--; + node.rest = param.argument; + } + } else if (param.type === "AssignmentExpression") { + defValue = param.right; + param = param.left; + } + node.params.push(param); + defaults.push(defValue); + if (defValue) hasDefaults = true; + } + + if (hasDefaults) node.defaults = defaults; + } + function parseFunction(node, isStatement) { + initFunction(node); + if (options.ecmaVersion >= 6) { + node.generator = eat(tt.star); + } if (token.type === tt.name) node.id = parseIdent(); else if (isStatement) node.id = dummyIdent(); - else node.id = null; - node.params = []; - pushCx(); - expect(tt.parenL); - while (token.type == tt.name) { - node.params.push(parseIdent()); - eat(tt.comma); - } - popCx(); - eat(tt.parenR); + parseFunctionParams(node); node.body = parseBlock(); return finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression"); } From b7367a2a8c12a3122adb42cac98960140247772e Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Sun, 26 Oct 2014 20:21:39 +0200 Subject: [PATCH 16/47] Make setOptions non-destructive for original object. --- acorn.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/acorn.js b/acorn.js index 14648d36a1..e6658d8c64 100644 --- a/acorn.js +++ b/acorn.js @@ -135,9 +135,9 @@ }; function setOptions(opts) { - options = opts || {}; - for (var opt in defaultOptions) if (!has(options, opt)) - options[opt] = defaultOptions[opt]; + options = {}; + for (var opt in defaultOptions) + options[opt] = has(opts, opt) ? opts[opt] : defaultOptions[opt]; sourceFile = options.sourceFile || null; if (isArray(options.onToken)) { var tokens = options.onToken; From 0abe4b64a804ca3fd78f80c9567948e83c37d04d Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Sun, 26 Oct 2014 20:23:45 +0200 Subject: [PATCH 17/47] Collect test stats separately for each mode. --- test/driver.js | 11 ++++++----- test/run.js | 50 +++++++++++++++++++++++++++++++++++++------------- 2 files changed, 43 insertions(+), 18 deletions(-) diff --git a/test/driver.js b/test/driver.js index 5c71b1eeff..f6d35a1d6c 100644 --- a/test/driver.js +++ b/test/driver.js @@ -11,9 +11,8 @@ tests.push({code: code, assert: assert, options: options}); }; - exports.runTests = function(config) { - var parse = config.parse, callback = config.callback; - var comments; + exports.runTests = function(config, callback) { + var parse = config.parse, comments; function onComment(block, text, start, end, startLoc, endLoc) { comments.push({ @@ -32,9 +31,11 @@ var test = tests[i]; try { comments = []; - var testOpts = JSON.parse(JSON.stringify(test.options || opts)); - if (!testOpts.onComment) testOpts.onComment = onComment; + var testOpts = test.options || opts; + var oldOnComment = testOpts.onComment; + if (!oldOnComment) testOpts.onComment = onComment; var ast = parse(test.code, testOpts); + testOpts.onComment = oldOnComment; if (test.error) { if (config.loose) { callback("ok", test.code); diff --git a/test/run.js b/test/run.js index 2fa2c8dbff..fcd40680da 100644 --- a/test/run.js +++ b/test/run.js @@ -2,26 +2,50 @@ var driver = require("./driver.js"); require("./tests.js"); require("./tests-harmony.js"); -var testsRun = 0, failed = 0; +var stats, modes = { + Normal: { + config: { + parse: (typeof require === "undefined" ? window.acorn : require("../acorn.js")).parse + } + }, + Loose: { + config: { + parse: (typeof require === "undefined") ? window.acorn_loose : require("../acorn_loose").parse_dammit, + loose: true + } + } +}; + function report(state, code, message) { - if (state != "ok") {++failed; console.log(code, message);} - ++testsRun; + if (state != "ok") {++stats.failed; console.log(code, message);} + ++stats.testsRun; } -var t0 = +new Date; +for (var name in modes) { + var mode = modes[name]; + stats = mode.stats = {testsRun: 0, failed: 0}; + var t0 = +new Date; + driver.runTests(mode.config, report); + mode.stats.duration = +new Date - t0; +} -var parse = (typeof require === "undefined" ? window.acorn : require("../acorn.js")).parse; -var parse_dammit = (typeof require === "undefined") ? window.acorn_loose : require("../acorn_loose").parse_dammit; +function outputStats(name, stats) { + console.log(name + ": " + stats.testsRun + " tests run in " + stats.duration + "ms; " + + (stats.failed ? stats.failed + " failures." : "all passed.")); +} -driver.runTests({parse: parse, callback: report}); -driver.runTests({parse: parse_dammit, loose: true, callback: report}); -console.log(testsRun + " tests run in " + (+new Date - t0) + "ms"); +var total = {testsRun: 0, failed: 0, duration: 0}; -if (failed) { - console.log(failed + " failures."); +for (var name in modes) { + var stats = modes[name].stats; + outputStats(name + " parser", stats); + for (var key in stats) total[key] += stats[key]; +} + +outputStats("Total", total); + +if (total.failed) { process.stdout.write("", function() { process.exit(1); }); -} else { - console.log("All passed."); } From 6d6483435235e3c73cf507d7f66f1a454b6c71d8 Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Sun, 26 Oct 2014 20:32:49 +0200 Subject: [PATCH 18/47] Removed manual `onComment` test in favor of new argument. --- test/driver.js | 4 +-- test/tests.js | 76 +++++++++++++++++++------------------------------- 2 files changed, 29 insertions(+), 51 deletions(-) diff --git a/test/driver.js b/test/driver.js index f6d35a1d6c..d56f3b551b 100644 --- a/test/driver.js +++ b/test/driver.js @@ -32,10 +32,8 @@ try { comments = []; var testOpts = test.options || opts; - var oldOnComment = testOpts.onComment; - if (!oldOnComment) testOpts.onComment = onComment; + testOpts.onComment = onComment; var ast = parse(test.code, testOpts); - testOpts.onComment = oldOnComment; if (test.error) { if (config.loose) { callback("ok", test.code); diff --git a/test/tests.js b/test/tests.js index 287d98f84d..8d17a891a4 100644 --- a/test/tests.js +++ b/test/tests.js @@ -28666,55 +28666,35 @@ testFail("for(x of a);", "Unexpected token (1:6)"); testFail("for(var x of a);", "Unexpected token (1:10)"); // Assertion Tests -(function() { - var actualComments = [], - expectedComments = [ - " Bear class", - " Whatever", - [" 1", - " 2", - " 3" - ].join('\n'), - "stuff" - ]; - testAssert( - function TestComments() { - // Bear class - function Bear(x,y,z) { - this.position = [x||0,y||0,z||0] - } - - Bear.prototype.roar = function(message) { - return 'RAWWW: ' + message; // Whatever - }; - - function Cat() { - /* 1 - 2 - 3*/ - } - - Cat.prototype.roar = function(message) { - return 'MEOOWW: ' + /*stuff*/ message; - }; - }.toString().replace(/\r\n/g, '\n'), - function assert(ast) { - if (actualComments.length !== expectedComments.length) { - return JSON.stringify(actualComments) + " !== " + JSON.stringify(expectedComments); - } else { - for (var i=0, n=actualComments.length; i < n; i++) { - if (actualComments[i] !== expectedComments[i]) - return JSON.stringify(actualComments[i]) + ' !== ' + JSON.stringify(expectedComments[i]); - } - } - }, - { - onComment: function(isMultiline, text) { - actualComments.push(text); - } +test(function TestComments() { + // Bear class + function Bear(x,y,z) { + this.position = [x||0,y||0,z||0] } - ); -})(); + + Bear.prototype.roar = function(message) { + return 'RAWWW: ' + message; // Whatever + }; + + function Cat() { + /* 1 + 2 + 3*/ + } + + Cat.prototype.roar = function(message) { + return 'MEOOWW: ' + /*stuff*/ message; + }; +}.toString().replace(/\r\n/g, '\n'), {}, {}, [ + {block: false, text: " Bear class"}, + {block: false, text: " Whatever"}, + {block: true, text: [ + " 1", + " 2", + " 3" + ].join('\n')}, + {block: true, text: "stuff"} +]); test(" HTML comment", {}, { + locations: true, + onComment: [{ + type: "Line", + value: " HTML comment", + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 16 } + } + }] +}); - test(";\n--> HTML comment", {}, {locations: true}, - [{ - block: false, - text: " HTML comment", - startLoc: { line: 2, column: 0 }, - endLoc: { line: 2, column: 16 } - }]); -})(); +var tokTypes = acorn.tokTypes; -(function() { - var tokTypes = acorn.tokTypes; - - var actualTokens = [], - expectedTokens = [ - { - type: tokTypes._var, - value: "var", - loc: { - start: {line: 1, column: 0}, - end: {line: 1, column: 3} - } - }, - { - type: tokTypes.name, - value: "x", - loc: { - start: {line: 1, column: 4}, - end: {line: 1, column: 5} - } - }, - { - type: tokTypes.eq, - value: "=", - loc: { - start: {line: 1, column: 6}, - end: {line: 1, column: 7} - } - }, - { - type: tokTypes.parenL, - value: undefined, - loc: { - start: {line: 1, column: 8}, - end: {line: 1, column: 9} - } - }, - { - type: tokTypes.num, - value: 1, - loc: { - start: {line: 1, column: 9}, - end: {line: 1, column: 10} - } - }, - { - type: {binop: 9, prefix: true, beforeExpr: true}, - value: "+", - loc: { - start: {line: 1, column: 11}, - end: {line: 1, column: 12} - } - }, - { - type: tokTypes.num, - value: 2, - loc: { - start: {line: 1, column: 13}, - end: {line: 1, column: 14} - } - }, - { - type: tokTypes.parenR, - value: undefined, - loc: { - start: {line: 1, column: 14}, - end: {line: 1, column: 15} - } - }, - { - type: tokTypes.eof, - value: undefined, - loc: { - start: {line: 1, column: 15}, - end: {line: 1, column: 15} - } - } - ]; - testAssert('var x = (1 + 2)', function assert(ast) { - if (actualTokens.length !== expectedTokens.length) { - return "Bad token stream length: expected " + expectedTokens.length + ", got " + actualTokens.length; - } else { - for (var i=0, n=actualTokens.length; i < n; i++) { - var mis = misMatch(expectedTokens[i], actualTokens[i]); - if (mis) return mis; +test('var x = (1 + 2)', {}, { + locations: true, + onToken: [ + { + type: tokTypes._var, + value: "var", + loc: { + start: {line: 1, column: 0}, + end: {line: 1, column: 3} + } + }, + { + type: tokTypes.name, + value: "x", + loc: { + start: {line: 1, column: 4}, + end: {line: 1, column: 5} + } + }, + { + type: tokTypes.eq, + value: "=", + loc: { + start: {line: 1, column: 6}, + end: {line: 1, column: 7} + } + }, + { + type: tokTypes.parenL, + value: undefined, + loc: { + start: {line: 1, column: 8}, + end: {line: 1, column: 9} + } + }, + { + type: tokTypes.num, + value: 1, + loc: { + start: {line: 1, column: 9}, + end: {line: 1, column: 10} + } + }, + { + type: {binop: 9, prefix: true, beforeExpr: true}, + value: "+", + loc: { + start: {line: 1, column: 11}, + end: {line: 1, column: 12} + } + }, + { + type: tokTypes.num, + value: 2, + loc: { + start: {line: 1, column: 13}, + end: {line: 1, column: 14} + } + }, + { + type: tokTypes.parenR, + value: undefined, + loc: { + start: {line: 1, column: 14}, + end: {line: 1, column: 15} + } + }, + { + type: tokTypes.eof, + value: undefined, + loc: { + start: {line: 1, column: 15}, + end: {line: 1, column: 15} } } - }, { - locations: true, - onToken: actualTokens - }); -})(); + ] +}); test("function f(f) { 'use strict'; }", {}); From 72df78cc883a565cfca5118cefa89b7ab576d86d Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Sun, 26 Oct 2014 20:58:05 +0200 Subject: [PATCH 20/47] Avoid separate handling of SpreadElement in favor of UnaryExpression parser. --- acorn.js | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/acorn.js b/acorn.js index e6658d8c64..e6a6e64c0e 100644 --- a/acorn.js +++ b/acorn.js @@ -401,8 +401,9 @@ var _bracketL = {type: "[", beforeExpr: true}, _bracketR = {type: "]"}, _braceL = {type: "{", beforeExpr: true}; var _braceR = {type: "}"}, _parenL = {type: "(", beforeExpr: true}, _parenR = {type: ")"}; var _comma = {type: ",", beforeExpr: true}, _semi = {type: ";", beforeExpr: true}; - var _colon = {type: ":", beforeExpr: true}, _dot = {type: "."}, _ellipsis = {type: "..."}, _question = {type: "?", beforeExpr: true}; + var _colon = {type: ":", beforeExpr: true}, _dot = {type: "."}, _question = {type: "?", beforeExpr: true}; var _arrow = {type: "=>", beforeExpr: true}, _bquote = {type: "`"}, _dollarBraceL = {type: "${", beforeExpr: true}; + var _ellipsis = {type: "...", prefix: true, beforeExpr: true}; // Operators. These carry several kinds of properties to help the // parser use them properly (the presence of these properties is @@ -1949,6 +1950,8 @@ function parseMaybeUnary() { if (tokType.prefix) { var node = startNode(), update = tokType.isUpdate; + var nodeType = tokType === _ellipsis ? "SpreadElement" : + (update ? "UpdateExpression" : "UnaryExpression"); node.operator = tokVal; node.prefix = true; tokRegexpAllowed = true; @@ -1958,7 +1961,7 @@ else if (strict && node.operator === "delete" && node.argument.type === "Identifier") raise(node.start, "Deleting local variable in strict mode"); - return finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); + return finishNode(node, nodeType); } var start = storeCurrentPos(); var expr = parseExprSubscripts(); @@ -2115,9 +2118,6 @@ case _new: return parseNew(); - case _ellipsis: - return parseSpread(); - case _bquote: return parseTemplate(); @@ -2140,15 +2140,6 @@ return finishNode(node, "NewExpression"); } - // Parse spread element '...expr' - - function parseSpread() { - var node = startNode(); - next(); - node.argument = parseExpression(true); - return finishNode(node, "SpreadElement"); - } - // Parse template expression. function parseTemplate() { From b47696eecfa455d0c22b3161c1866106329236a3 Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Sun, 26 Oct 2014 21:03:35 +0200 Subject: [PATCH 21/47] Avoid UnaryExpression-specific properties in SpreadElement (just in case). --- acorn.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/acorn.js b/acorn.js index e6a6e64c0e..adf467542e 100644 --- a/acorn.js +++ b/acorn.js @@ -1949,11 +1949,14 @@ function parseMaybeUnary() { if (tokType.prefix) { - var node = startNode(), update = tokType.isUpdate; - var nodeType = tokType === _ellipsis ? "SpreadElement" : - (update ? "UpdateExpression" : "UnaryExpression"); - node.operator = tokVal; - node.prefix = true; + var node = startNode(), update = tokType.isUpdate, nodeType; + if (tokType === _ellipsis) { + nodeType = "SpreadElement"; + } else { + nodeType = update ? "UpdateExpression" : "UnaryExpression"; + node.operator = tokVal; + node.prefix = true; + } tokRegexpAllowed = true; next(); node.argument = parseMaybeUnary(); From a14a5c81926a2e0fd7ed8c1a754157bda1679a7a Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Sun, 26 Oct 2014 21:29:30 +0200 Subject: [PATCH 22/47] Loose: Added support for rest parameters. Includes correction of mistype ".." vs "...". --- acorn_loose.js | 39 +++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/acorn_loose.js b/acorn_loose.js index 39615aac63..b0b73b00df 100644 --- a/acorn_loose.js +++ b/acorn_loose.js @@ -81,7 +81,13 @@ function readToken() { for (;;) { try { - return fetchToken(); + var tok = fetchToken(); + if (tok.type === tt.dot && input.substr(tok.end, 1) === '.') { + tok = fetchToken(); + tok.start--; + tok.type = tt.ellipsis; + } + return tok; } catch(e) { if (!(e instanceof SyntaxError)) throw e; @@ -281,8 +287,17 @@ } function checkLVal(expr) { - if (expr.type === "Identifier" || expr.type === "MemberExpression") return expr; - return dummyIdent(); + switch (expr.type) { + case "Identifier": + case "MemberExpression": + case "ObjectPattern": + case "ArrayPattern": + case "SpreadElement": + return expr; + + default: + return dummyIdent(); + } } function parseTopLevel() { @@ -577,13 +592,20 @@ function parseMaybeUnary(noIn) { if (token.type.prefix) { - var node = startNode(), update = token.type.isUpdate; + var node = startNode(), update = token.type.isUpdate, nodeType; + if (token.type === tt.ellipsis) { + nodeType = "SpreadElement"; + } else { + nodeType = update ? "UpdateExpression" : "UnaryExpression"; + node.operator = token.value; + node.prefix = true; + } node.operator = token.value; node.prefix = true; next(); node.argument = parseMaybeUnary(noIn); if (update) node.argument = checkLVal(node.argument); - return finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); + return finishNode(node, nodeType); } var start = storeCurrentPos(); var expr = parseExprSubscripts(); @@ -810,15 +832,16 @@ for (var i = 0; i < params.length; i++) { var param = toAssignable(params[i]), defValue = null; if (param.type === "SpreadElement") { + param = param.argument; if (i === params.length - 1) { - params.length--; - node.rest = param.argument; + node.rest = param; + continue; } } else if (param.type === "AssignmentExpression") { defValue = param.right; param = param.left; } - node.params.push(param); + node.params.push(checkLVal(param)); defaults.push(defValue); if (defValue) hasDefaults = true; } From eba8a5646cde0bdd3f2d7a44c946f977cbe834f7 Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Sun, 26 Oct 2014 23:14:06 +0200 Subject: [PATCH 23/47] Loose: added support for holes in arrays (but disallows trailing comma). --- acorn_loose.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/acorn_loose.js b/acorn_loose.js index b0b73b00df..87cdbd552c 100644 --- a/acorn_loose.js +++ b/acorn_loose.js @@ -702,7 +702,7 @@ case tt.bracketL: var node = startNode(); pushCx(); - node.elements = parseExprList(tt.bracketR); + node.elements = parseExprList(tt.bracketR, true); return finishNode(node, "ArrayExpression"); case tt.braceL: @@ -861,11 +861,15 @@ return finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression"); } - function parseExprList(close) { + function parseExprList(close, allowEmpty) { var indent = curIndent, line = curLineStart, elts = [], continuedLine = nextLineStart; next(); // Opening bracket if (curLineStart > continuedLine) continuedLine = curLineStart; while (!closes(close, indent + (curLineStart <= continuedLine ? 1 : 0), line)) { + if (allowEmpty && eat(tt.comma)) { + elts.push(null); + continue; + } var elt = parseExpression(true); if (isDummy(elt)) { if (closes(close, indent, line)) break; @@ -873,7 +877,7 @@ } else { elts.push(elt); } - while (eat(tt.comma)) {} + eat(tt.comma); } popCx(); eat(close); From c5145cedb2c46fa17592305e4b5b14de9774a887 Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Sun, 26 Oct 2014 23:14:26 +0200 Subject: [PATCH 24/47] Fix no-options case for acorn. --- acorn.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acorn.js b/acorn.js index adf467542e..ea4121ec88 100644 --- a/acorn.js +++ b/acorn.js @@ -137,7 +137,7 @@ function setOptions(opts) { options = {}; for (var opt in defaultOptions) - options[opt] = has(opts, opt) ? opts[opt] : defaultOptions[opt]; + options[opt] = opts && has(opts, opt) ? opts[opt] : defaultOptions[opt]; sourceFile = options.sourceFile || null; if (isArray(options.onToken)) { var tokens = options.onToken; From 4879af22d1e88f6b1b0ffd17bbff23a17038ff92 Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Sun, 26 Oct 2014 23:32:35 +0200 Subject: [PATCH 25/47] Loose: Added support for assignment patterns to expression and variables. --- acorn_loose.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/acorn_loose.js b/acorn_loose.js index 87cdbd552c..f3523b8829 100644 --- a/acorn_loose.js +++ b/acorn_loose.js @@ -498,13 +498,12 @@ function parseVar(node, noIn) { node.declarations = []; node.kind = "var"; - while (token.type === tt.name) { + do { var decl = startNode(); - decl.id = parseIdent(); + decl.id = options.ecmaVersion >= 6 ? toAssignable(parseExprAtom()) : parseIdent(); decl.init = eat(tt.eq) ? parseExpression(true, noIn) : null; node.declarations.push(finishNode(decl, "VariableDeclarator")); - if (!eat(tt.comma)) break; - } + } while (eat(tt.comma)); if (!node.declarations.length) { var decl = startNode(); decl.id = dummyIdent(); @@ -541,7 +540,7 @@ if (token.type.isAssign) { var node = startNodeAt(start); node.operator = token.value; - node.left = checkLVal(left); + node.left = token.type === tt.eq ? toAssignable(left) : checkLVal(left); next(); node.right = parseMaybeAssign(noIn); return finishNode(node, "AssignmentExpression"); @@ -821,7 +820,7 @@ break; } } - return node; + return checkLVal(node); } function parseFunctionParams(node) { From 963a26e46f158b83de3c551743ebdff574a10281 Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Sun, 26 Oct 2014 23:44:19 +0200 Subject: [PATCH 26/47] Loose: Added support for let and const. Fixes #146. --- acorn_loose.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/acorn_loose.js b/acorn_loose.js index f3523b8829..4159309211 100644 --- a/acorn_loose.js +++ b/acorn_loose.js @@ -335,10 +335,8 @@ pushCx(); expect(tt.parenL); if (token.type === tt.semi) return parseFor(node, null); - if (token.type === tt._var) { - var init = startNode(); - next(); - parseVar(init, true); + if (token.type === tt._var || token.type === tt._let) { + var init = parseVar(true); if (init.declarations.length === 1 && eat(tt._in)) return parseForIn(node, init); return parseFor(node, init); @@ -421,9 +419,9 @@ return finishNode(node, "TryStatement"); case tt._var: - next(); - node = parseVar(node); - return node; + case tt._let: + case tt._const: + return parseVar(); case tt._while: next(); @@ -495,9 +493,11 @@ return finishNode(node, "ForInStatement"); } - function parseVar(node, noIn) { + function parseVar(noIn) { + var node = startNode(); + node.kind = token.type.keyword; + next(); node.declarations = []; - node.kind = "var"; do { var decl = startNode(); decl.id = options.ecmaVersion >= 6 ? toAssignable(parseExprAtom()) : parseIdent(); @@ -803,7 +803,7 @@ node.type = "ObjectPattern"; var props = node.properties; for (var i = 0; i < props.length; i++) { - toAssignable(props[i].value); + props[i].value = toAssignable(props[i].value); } break; @@ -811,12 +811,12 @@ node.type = "ArrayPattern"; var elms = node.elements; for (var i = 0; i < elms.length; i++) { - toAssignable(elms[i]); + elms[i] = toAssignable(elms[i]); } break; case "SpreadElement": - toAssignable(node.argument); + node.argument = toAssignable(node.argument); break; } } From dda90580df211f3d8275d0c28d37d26253ef5e88 Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Mon, 27 Oct 2014 00:07:40 +0200 Subject: [PATCH 27/47] Loose: Added support for shorthand properties. --- acorn_loose.js | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/acorn_loose.js b/acorn_loose.js index 4159309211..9bc5320465 100644 --- a/acorn_loose.js +++ b/acorn_loose.js @@ -287,6 +287,7 @@ } function checkLVal(expr) { + if (!expr) return expr; switch (expr.type) { case "Identifier": case "MemberExpression": @@ -742,10 +743,14 @@ next(); if (curIndent + 1 < indent) { indent = curIndent; line = curLineStart; } while (!closes(tt.braceR, indent, line)) { - var name = parsePropertyName(); - if (!name) { if (isDummy(parseExpression(true))) next(); eat(tt.comma); continue; } - var prop = startNode(); - prop.key = name; + var prop = startNode(), isGenerator; + if (options.ecmaVersion >= 6) { + prop.method = false; + prop.shorthand = false; + isGenerator = eat(tt.star); + } + parsePropertyName(prop); + if (!prop.key) { if (isDummy(parseExpression(true))) next(); eat(tt.comma); continue; } if (eat(tt.colon)) { prop.value = parseExpression(true); prop.kind = "init"; @@ -755,7 +760,9 @@ prop.key = parsePropertyName() || dummyIdent(); prop.value = parseFunction(startNode(), false); } else { - prop.value = dummyIdent(); + prop.value = options.ecmaVersion >= 6 ? prop.key : dummyIdent(); + prop.kind = "init"; + prop.shorthand = true; } node.properties.push(finishNode(prop, "Property")); @@ -766,9 +773,18 @@ return finishNode(node, "ObjectExpression"); } - function parsePropertyName() { - if (token.type === tt.num || token.type === tt.string) return parseExprAtom(); - if (token.type === tt.name || token.type.keyword) return parseIdent(); + function parsePropertyName(prop) { + if (options.ecmaVersion >= 6) { + if (eat(tt.bracketL)) { + prop.computed = true; + prop.key = parseExpression(); + expect(tt.bracketR); + return; + } else { + prop.computed = false; + } + } + prop.key = (token.type === tt.num || token.type === tt.string) ? parseExprAtom() : parseIdent(); } function parsePropertyAccessor() { From 143066184cd2781b2f6769ccf6b56da46ae6d487 Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Mon, 27 Oct 2014 00:39:45 +0200 Subject: [PATCH 28/47] Emit full stack trace for unknown exceptions. --- test/driver.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/driver.js b/test/driver.js index 5444cc5331..ea5dc421c3 100644 --- a/test/driver.js +++ b/test/driver.js @@ -56,7 +56,7 @@ else callback("fail", test.code, "Expected error message: " + test.error + "\nGot error message: " + e.message); } else { - callback("error", test.code, e.message || e.toString()); + callback("error", test.code, !(e instanceof SyntaxError) && e.stack || e.message || e.toString()); } } } From b46b53e1494611856bf4ca35cc9a6cf22ac23453 Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Mon, 27 Oct 2014 00:55:49 +0200 Subject: [PATCH 29/47] Loose: implement object methods; expose processed options from acorn. --- acorn.js | 1 + acorn_loose.js | 31 ++++++++++++++++++++++++------- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/acorn.js b/acorn.js index ea4121ec88..ab23dcd278 100644 --- a/acorn.js +++ b/acorn.js @@ -234,6 +234,7 @@ tokRegexpAllowed = reAllowed; skipSpace(); }; + getToken.options = options; return getToken; }; diff --git a/acorn_loose.js b/acorn_loose.js index 9bc5320465..0546d19882 100644 --- a/acorn_loose.js +++ b/acorn_loose.js @@ -40,14 +40,16 @@ var options, input, fetchToken, context; + acorn.defaultOptions.tabSize = 4; + exports.parse_dammit = function(inpt, opts) { if (!opts) opts = {}; input = String(inpt); if (/^#!.*/.test(input)) input = "//" + input.slice(2); - options = opts; if (!opts.tabSize) opts.tabSize = 4; fetchToken = acorn.tokenize(input, opts); + options = fetchToken.options; sourceFile = options.sourceFile || null; context = []; nextLineStart = 0; @@ -750,18 +752,22 @@ isGenerator = eat(tt.star); } parsePropertyName(prop); - if (!prop.key) { if (isDummy(parseExpression(true))) next(); eat(tt.comma); continue; } + if (isDummy(prop.key)) { if (isDummy(parseExpression(true))) next(); eat(tt.comma); continue; } if (eat(tt.colon)) { - prop.value = parseExpression(true); prop.kind = "init"; + prop.value = parseExpression(true); + } else if (options.ecmaVersion >= 6 && (token.type === tt.parenL || token.type === tt.braceL)) { + prop.kind = "init"; + prop.method = true; + prop.value = parseMethod(isGenerator); } else if (options.ecmaVersion >= 5 && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set")) { prop.kind = prop.key.name; - prop.key = parsePropertyName() || dummyIdent(); - prop.value = parseFunction(startNode(), false); + parsePropertyName(prop); + prop.value = parseMethod(false); } else { - prop.value = options.ecmaVersion >= 6 ? prop.key : dummyIdent(); prop.kind = "init"; + prop.value = options.ecmaVersion >= 6 ? prop.key : dummyIdent(); prop.shorthand = true; } @@ -784,7 +790,8 @@ prop.computed = false; } } - prop.key = (token.type === tt.num || token.type === tt.string) ? parseExprAtom() : parseIdent(); + var key = (token.type === tt.num || token.type === tt.string) ? parseExprAtom() : parseIdent(); + prop.key = key || dummyIdent(); } function parsePropertyAccessor() { @@ -876,6 +883,16 @@ return finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression"); } + function parseMethod(isGenerator) { + var node = startNode(); + initFunction(node); + parseFunctionParams(node); + node.generator = isGenerator; + node.expression = options.ecmaVersion >= 6 && token.type !== tt.braceL; + node.body = node.expression ? parseExpression(true) : parseBlock(); + return finishNode(node, "FunctionExpression"); + } + function parseExprList(close, allowEmpty) { var indent = curIndent, line = curLineStart, elts = [], continuedLine = nextLineStart; next(); // Opening bracket From 9cdc6809cede95e0447363abb60e06853dae248d Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Mon, 27 Oct 2014 00:57:19 +0200 Subject: [PATCH 30/47] Loose: fix pattern+defaults case in function params. --- acorn_loose.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/acorn_loose.js b/acorn_loose.js index 0546d19882..c7243986f7 100644 --- a/acorn_loose.js +++ b/acorn_loose.js @@ -852,18 +852,20 @@ pushCx(); var params = parseExprList(tt.parenR); for (var i = 0; i < params.length; i++) { - var param = toAssignable(params[i]), defValue = null; + var param = params[i], defValue = null; + if (param.type === "AssignmentExpression") { + defValue = param.right; + param = param.left; + } + param = toAssignable(param); if (param.type === "SpreadElement") { param = param.argument; if (i === params.length - 1) { node.rest = param; continue; } - } else if (param.type === "AssignmentExpression") { - defValue = param.right; - param = param.left; } - node.params.push(checkLVal(param)); + node.params.push(param); defaults.push(defValue); if (defValue) hasDefaults = true; } From c6b6ef389ea42dfaabe082d22f32fab49346fdca Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Mon, 27 Oct 2014 01:00:48 +0200 Subject: [PATCH 31/47] Loose: Remove own tabSize initialization in favor of defaultOptions. --- acorn_loose.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/acorn_loose.js b/acorn_loose.js index c7243986f7..0934683b4f 100644 --- a/acorn_loose.js +++ b/acorn_loose.js @@ -46,8 +46,6 @@ if (!opts) opts = {}; input = String(inpt); if (/^#!.*/.test(input)) input = "//" + input.slice(2); - - if (!opts.tabSize) opts.tabSize = 4; fetchToken = acorn.tokenize(input, opts); options = fetchToken.options; sourceFile = options.sourceFile || null; From ede10a079c5f4ece9585d3e34f3950c581bc3d41 Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Mon, 27 Oct 2014 01:36:16 +0200 Subject: [PATCH 32/47] Loose: class support. --- acorn_loose.js | 58 ++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 47 insertions(+), 11 deletions(-) diff --git a/acorn_loose.js b/acorn_loose.js index 0934683b4f..25f723544c 100644 --- a/acorn_loose.js +++ b/acorn_loose.js @@ -443,6 +443,9 @@ next(); return finishNode(node, "EmptyStatement"); + case tt._class: + return parseObj(true, true); + default: var expr = parseExpression(); if (isDummy(expr)) { @@ -708,6 +711,9 @@ case tt.braceL: return parseObj(); + case tt._class: + return parseObj(true); + case tt._function: var node = startNode(); next(); @@ -735,46 +741,76 @@ return finishNode(node, "NewExpression"); } - function parseObj() { + function parseObj(isClass, isStatement) { var node = startNode(); - node.properties = []; + if (isClass) { + next(); + if (token.type === tt.name) node.id = parseIdent(); + else if (isStatement) node.id = dummyIdent(); + node.superClass = eat(tt._extends) ? parseExpression() : null; + node.body = startNode(); + node.body.body = []; + } else { + node.properties = []; + } pushCx(); var indent = curIndent + 1, line = curLineStart; - next(); + eat(tt.braceL); if (curIndent + 1 < indent) { indent = curIndent; line = curLineStart; } while (!closes(tt.braceR, indent, line)) { var prop = startNode(), isGenerator; if (options.ecmaVersion >= 6) { - prop.method = false; - prop.shorthand = false; + if (isClass) { + if (prop['static'] = (token.type === tt.name && token.value === "static")) next(); + } else { + prop.method = false; + prop.shorthand = false; + } isGenerator = eat(tt.star); } parsePropertyName(prop); if (isDummy(prop.key)) { if (isDummy(parseExpression(true))) next(); eat(tt.comma); continue; } - if (eat(tt.colon)) { + if (!isClass && eat(tt.colon)) { prop.kind = "init"; prop.value = parseExpression(true); } else if (options.ecmaVersion >= 6 && (token.type === tt.parenL || token.type === tt.braceL)) { - prop.kind = "init"; - prop.method = true; + if (isClass) { + prop.kind = ""; + } else { + prop.kind = "init"; + prop.method = true; + } prop.value = parseMethod(isGenerator); } else if (options.ecmaVersion >= 5 && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set")) { prop.kind = prop.key.name; parsePropertyName(prop); prop.value = parseMethod(false); + } else if (isClass) { + prop.kind = ""; + prop.value = parseMethod(isGenerator); } else { prop.kind = "init"; prop.value = options.ecmaVersion >= 6 ? prop.key : dummyIdent(); prop.shorthand = true; } - node.properties.push(finishNode(prop, "Property")); - eat(tt.comma); + if (isClass) { + node.body.body.push(finishNode(prop, "MethodDefinition")); + semicolon(); + } else { + node.properties.push(finishNode(prop, "Property")); + eat(tt.comma); + } } popCx(); eat(tt.braceR); - return finishNode(node, "ObjectExpression"); + if (isClass) { + finishNode(node.body, "ClassBody"); + return finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); + } else { + return finishNode(node, "ObjectExpression"); + } } function parsePropertyName(prop) { From 992fc0503d022b803ed2a69bc6a1f5268af03a00 Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Mon, 27 Oct 2014 02:01:31 +0200 Subject: [PATCH 33/47] Loose: arrow functions. --- acorn_loose.js | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/acorn_loose.js b/acorn_loose.js index 25f723544c..4f2dc7ae31 100644 --- a/acorn_loose.js +++ b/acorn_loose.js @@ -674,8 +674,12 @@ var node = startNode(); next(); return finishNode(node, "ThisExpression"); + case tt.name: - return parseIdent(); + var start = storeCurrentPos(); + var id = parseIdent(); + return eat(tt.arrow) ? parseArrowExpression(startNodeAt(start), [id]) : id; + case tt.num: case tt.string: case tt.regexp: var node = startNode(); node.value = token.value; @@ -695,6 +699,9 @@ next(); var val = parseExpression(); expect(tt.parenR); + if (eat(tt.arrow)) { + return parseArrowExpression(startNodeAt(start), val.expressions || (isDummy(val) ? [] : [val])); + } if (options.preserveParens) { var par = startNodeAt(start); par.expression = val; @@ -880,11 +887,13 @@ return checkLVal(node); } - function parseFunctionParams(node) { + function parseFunctionParams(node, params) { var defaults = [], hasDefaults = false; - pushCx(); - var params = parseExprList(tt.parenR); + if (!params) { + pushCx(); + params = parseExprList(tt.parenR); + } for (var i = 0; i < params.length; i++) { var param = params[i], defValue = null; if (param.type === "AssignmentExpression") { @@ -923,12 +932,20 @@ var node = startNode(); initFunction(node); parseFunctionParams(node); - node.generator = isGenerator; + node.generator = isGenerator || false; node.expression = options.ecmaVersion >= 6 && token.type !== tt.braceL; node.body = node.expression ? parseExpression(true) : parseBlock(); return finishNode(node, "FunctionExpression"); } + function parseArrowExpression(node, params) { + initFunction(node); + parseFunctionParams(node, params); + node.expression = token.type !== tt.braceL; + node.body = node.expression ? parseExpression(true) : parseBlock(); + return finishNode(node, "ArrowFunctionExpression"); + } + function parseExprList(close, allowEmpty) { var indent = curIndent, line = curLineStart, elts = [], continuedLine = nextLineStart; next(); // Opening bracket From bdce88c1842186ad0287cce397af981a895fb907 Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Mon, 27 Oct 2014 02:05:38 +0200 Subject: [PATCH 34/47] Loose: for-of statement. --- acorn_loose.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/acorn_loose.js b/acorn_loose.js index 4f2dc7ae31..ec2c44bd94 100644 --- a/acorn_loose.js +++ b/acorn_loose.js @@ -338,12 +338,17 @@ if (token.type === tt.semi) return parseFor(node, null); if (token.type === tt._var || token.type === tt._let) { var init = parseVar(true); - if (init.declarations.length === 1 && eat(tt._in)) - return parseForIn(node, init); + if (init.declarations.length === 1) { + if (eat(tt._in)) return parseForIn(node, init); + if (token.type === tt.name && token.value === "of") { + next(); + return parseForIn(node, init, true); + } + } return parseFor(node, init); } var init = parseExpression(false, true); - if (eat(tt._in)) {return parseForIn(node, checkLVal(init));} + if (eat(tt._in)) return parseForIn(node, checkLVal(init)); return parseFor(node, init); case tt._function: @@ -488,13 +493,13 @@ return finishNode(node, "ForStatement"); } - function parseForIn(node, init) { + function parseForIn(node, init, isOf) { node.left = init; node.right = parseExpression(); popCx(); expect(tt.parenR); node.body = parseStatement(); - return finishNode(node, "ForInStatement"); + return finishNode(node, isOf ? "ForOfStatement" : "ForInStatement"); } function parseVar(noIn) { @@ -680,7 +685,7 @@ var id = parseIdent(); return eat(tt.arrow) ? parseArrowExpression(startNodeAt(start), [id]) : id; - case tt.num: case tt.string: case tt.regexp: + case tt.num: case tt.string: case tt.regexp: var node = startNode(); node.value = token.value; node.raw = input.slice(token.start, token.end); From 80f8d527ff108406a54eb592076f2db2654529f6 Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Mon, 27 Oct 2014 02:25:23 +0200 Subject: [PATCH 35/47] Loose: Skip ES7 tests as we are targeting ES6 now. --- test/driver.js | 1 + test/run.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/test/driver.js b/test/driver.js index ea5dc421c3..cbd6cc3a04 100644 --- a/test/driver.js +++ b/test/driver.js @@ -16,6 +16,7 @@ for (var i = 0; i < tests.length; ++i) { var test = tests[i]; + if (config.filter && !config.filter(test)) continue; try { var testOpts = test.options || {locations: true}; var expected = {}; diff --git a/test/run.js b/test/run.js index fcd40680da..adc5eb9f13 100644 --- a/test/run.js +++ b/test/run.js @@ -11,7 +11,11 @@ var stats, modes = { Loose: { config: { parse: (typeof require === "undefined") ? window.acorn_loose : require("../acorn_loose").parse_dammit, - loose: true + loose: true, + filter: function (test) { + var ecmaVersion = (test.options || {}).ecmaVersion || 5; + return ecmaVersion <= 6; + } } } }; From 1589a959fad68bf9719ea4309a6c46d1192cb8e6 Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Mon, 27 Oct 2014 02:37:27 +0200 Subject: [PATCH 36/47] Loose: yield support. --- acorn_loose.js | 14 +++++++++++++- test/run.js | 5 +++-- test/tests-harmony.js | 3 +++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/acorn_loose.js b/acorn_loose.js index ec2c44bd94..8a75e3dd07 100644 --- a/acorn_loose.js +++ b/acorn_loose.js @@ -271,7 +271,7 @@ return (token.type === tt.eof || token.type === tt.braceR || newline.test(input.slice(lastEnd, token.start))); } function semicolon() { - eat(tt.semi); + return eat(tt.semi); } function expect(type) { @@ -734,6 +734,18 @@ case tt._new: return parseNew(); + case tt._yield: + var node = startNode(); + next(); + if (semicolon() || canInsertSemicolon()) { + node.delegate = false; + node.argument = null; + } else { + node.delegate = eat(tt.star); + node.argument = parseExpression(true); + } + return finishNode(node, "YieldExpression"); + default: return dummyIdent(); } diff --git a/test/run.js b/test/run.js index adc5eb9f13..04001c3d56 100644 --- a/test/run.js +++ b/test/run.js @@ -13,8 +13,9 @@ var stats, modes = { parse: (typeof require === "undefined") ? window.acorn_loose : require("../acorn_loose").parse_dammit, loose: true, filter: function (test) { - var ecmaVersion = (test.options || {}).ecmaVersion || 5; - return ecmaVersion <= 6; + var opts = test.options || {}; + if (opts.loose === false) return false; + return (opts.ecmaVersion || 5) <= 6; } } } diff --git a/test/tests-harmony.js b/test/tests-harmony.js index 2302f58f60..84cf2be487 100644 --- a/test/tests-harmony.js +++ b/test/tests-harmony.js @@ -13714,6 +13714,7 @@ test("yield* 10", { } }, { ecmaVersion: 6, + loose: false, ranges: true, locations: true }); @@ -13778,6 +13779,7 @@ test("e => yield* 10", { } }, { ecmaVersion: 6, + loose: false, ranges: true, locations: true }); @@ -13851,6 +13853,7 @@ test("(function () { yield* 10 })", { } }, { ecmaVersion: 6, + loose: false, ranges: true, locations: true }); From aa96edf76932d7ed86a69246888b86728e042ee5 Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Mon, 27 Oct 2014 02:43:33 +0200 Subject: [PATCH 37/47] Loose: support for-of without var. --- acorn_loose.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/acorn_loose.js b/acorn_loose.js index 8a75e3dd07..197e184369 100644 --- a/acorn_loose.js +++ b/acorn_loose.js @@ -338,17 +338,15 @@ if (token.type === tt.semi) return parseFor(node, null); if (token.type === tt._var || token.type === tt._let) { var init = parseVar(true); - if (init.declarations.length === 1) { - if (eat(tt._in)) return parseForIn(node, init); - if (token.type === tt.name && token.value === "of") { - next(); - return parseForIn(node, init, true); - } + if (init.declarations.length === 1 && (token.type === tt._in || token.type === tt.name && token.value === "of")) { + return parseForIn(node, init); } return parseFor(node, init); } var init = parseExpression(false, true); - if (eat(tt._in)) return parseForIn(node, checkLVal(init)); + if (token.type === tt._in || token.type === tt.name && token.value === "of") { + return parseForIn(node, checkLVal(init)); + } return parseFor(node, init); case tt._function: @@ -493,13 +491,15 @@ return finishNode(node, "ForStatement"); } - function parseForIn(node, init, isOf) { + function parseForIn(node, init) { + var type = token.type === tt._in ? "ForInStatement" : "ForOfStatement"; + next(); node.left = init; node.right = parseExpression(); popCx(); expect(tt.parenR); node.body = parseStatement(); - return finishNode(node, isOf ? "ForOfStatement" : "ForInStatement"); + return finishNode(node, type); } function parseVar(noIn) { From 4647f966eb291777af4da448af08def26730a24a Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Tue, 28 Oct 2014 13:12:18 +0200 Subject: [PATCH 38/47] Loose: don't silently skip missed elements in expr list. --- acorn_loose.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/acorn_loose.js b/acorn_loose.js index 197e184369..7585b83b28 100644 --- a/acorn_loose.js +++ b/acorn_loose.js @@ -968,8 +968,8 @@ next(); // Opening bracket if (curLineStart > continuedLine) continuedLine = curLineStart; while (!closes(close, indent + (curLineStart <= continuedLine ? 1 : 0), line)) { - if (allowEmpty && eat(tt.comma)) { - elts.push(null); + if (eat(tt.comma)) { + elts.push(allowEmpty ? null : dummyIdent()); continue; } var elt = parseExpression(true); From d4565fed53c387854f51dc18ce3fec7b7150e8ee Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Tue, 28 Oct 2014 16:55:30 +0200 Subject: [PATCH 39/47] Loose: ES6 import, export. Removed "kind" from tests for ES6 import/export as it's left only for backward compatibility. --- acorn_loose.js | 96 +++++++++++++++++++++++++++++++++++++++++++ test/tests-harmony.js | 10 +---- 2 files changed, 98 insertions(+), 8 deletions(-) diff --git a/acorn_loose.js b/acorn_loose.js index 7585b83b28..dd1ea902c0 100644 --- a/acorn_loose.js +++ b/acorn_loose.js @@ -449,6 +449,12 @@ case tt._class: return parseObj(true, true); + case tt._import: + return parseImport(); + + case tt._export: + return parseExport(); + default: var expr = parseExpression(); if (isDummy(expr)) { @@ -963,6 +969,96 @@ return finishNode(node, "ArrowFunctionExpression"); } + function parseExport() { + var node = startNode(); + next(); + node['default'] = eat(tt._default); + node.specifiers = node.source = null; + if (node['default']) { + node.declaration = parseExpression(); + semicolon(); + } else if (token.type.keyword) { + node.declaration = parseStatement(); + } else { + node.declaration = null; + parseSpecifierList(node, "Export"); + } + return finishNode(node, "ExportDeclaration"); + } + + function parseImport() { + var node = startNode(); + next(); + if (token.type === tt.string) { + node.specifiers = []; + node.source = parseExprAtom(); + node.kind = ''; + } else { + if (token.type === tt.name && token.value !== "from") { + var elt = startNode(); + elt.id = parseIdent(); + elt.name = null; + elt['default'] = true; + finishNode(elt, "ImportSpecifier"); + eat(tt.comma); + } + parseSpecifierList(node, "Import"); + var specs = node.specifiers; + for (var i = 0; i < specs.length; i++) specs[i]['default'] = false; + if (elt) node.specifiers.unshift(elt); + } + return finishNode(node, "ImportDeclaration"); + } + + function parseSpecifierList(node, prefix) { + var elts = node.specifiers = []; + if (token.type === tt.star) { + var elt = startNode(); + next(); + if (token.type === tt.name && token.value === "as") { + next(); + elt.name = parseIdent(); + } + elts.push(finishNode(elt, prefix + "BatchSpecifier")); + } else { + var indent = curIndent, line = curLineStart, continuedLine = nextLineStart; + pushCx(); + eat(tt.braceL); + if (curLineStart > continuedLine) continuedLine = curLineStart; + while (!closes(tt.braceR, indent + (curLineStart <= continuedLine ? 1 : 0), line)) { + var elt = startNode(); + if (token.type === tt.star) { + next(); + if (token.type === tt.name && token.value === "as") { + next(); + elt.name = parseIdent(); + } + finishNode(elt, prefix + "BatchSpecifier"); + } else { + if (token.type === tt.name && token.value === "from") break; + elt.id = parseIdent(); + if (token.type === tt.name && token.value === "as") { + next(); + elt.name = parseIdent(); + } else { + elt.name = null; + } + finishNode(elt, prefix + "Specifier"); + } + elts.push(elt); + eat(tt.comma); + } + eat(tt.braceR); + popCx(); + } + if (token.type === tt.name && token.value === "from") { + next(); + node.source = parseExprAtom(); + } else { + node.source = null; + } + } + function parseExprList(close, allowEmpty) { var indent = curIndent, line = curLineStart, elts = [], continuedLine = nextLineStart; next(); // Opening bracket diff --git a/test/tests-harmony.js b/test/tests-harmony.js index 84cf2be487..00149c1ee7 100644 --- a/test/tests-harmony.js +++ b/test/tests-harmony.js @@ -5113,7 +5113,6 @@ test("import $ from \"jquery\"", { end: {line: 1, column: 8} } }], - kind: "default", source: { type: "Literal", value: "jquery", @@ -5176,7 +5175,6 @@ test("import { encrypt, decrypt } from \"crypto\"", { } } ], - kind: "named", source: { type: "Literal", value: "crypto", @@ -5228,7 +5226,6 @@ test("import { encrypt as enc } from \"crypto\"", { end: {line: 1, column: 23} } }], - kind: "named", source: { type: "Literal", value: "crypto", @@ -5333,8 +5330,7 @@ test("import crypto, { decrypt, encrypt as enc } from \"crypto\"", { }, value: "crypto", raw: "\"crypto\"" - }, - kind: "default" + } }] }, { ecmaVersion: 6, @@ -5371,7 +5367,6 @@ test("import { null as nil } from \"bar\"", { end: {line: 1, column: 20} } }], - kind: "named", source: { type: "Literal", value: "bar", @@ -5431,8 +5426,7 @@ test("import * as crypto from \"crypto\"", { }, value: "crypto", raw: "\"crypto\"" - }, - kind: "named" + } }] }, { ecmaVersion: 6, From fc2e96fa01ba6b24fea6e366e2946e4c41d13ccc Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Tue, 28 Oct 2014 18:43:37 +0200 Subject: [PATCH 40/47] Loose: respect optional semicolons in break/continue/class/import/export. --- acorn_loose.js | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/acorn_loose.js b/acorn_loose.js index dd1ea902c0..f551679a58 100644 --- a/acorn_loose.js +++ b/acorn_loose.js @@ -315,8 +315,12 @@ case tt._break: case tt._continue: next(); var isBreak = starttype === tt._break; - node.label = token.type === tt.name ? parseIdent() : null; - semicolon(); + if (semicolon() || canInsertSemicolon()) { + node.label = null; + } else { + node.label = token.type === tt.name ? parseIdent() : null; + semicolon(); + } return finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement"); case tt._debugger: @@ -771,6 +775,35 @@ return finishNode(node, "NewExpression"); } + function parseTemplate() { + var node = startNode(); + node.expressions = []; + node.quasis = []; + inTemplate = true; + next(); + for (;;) { + var elem = startNode(); + elem.value = {cooked: tokVal, raw: input.slice(tokStart, tokEnd)}; + elem.tail = false; + next(); + node.quasis.push(finishNode(elem, "TemplateElement")); + if (tokType === _bquote) { // '`', end of template + elem.tail = true; + break; + } + inTemplate = false; + expect(_dollarBraceL); + node.expressions.push(parseExpression()); + inTemplate = true; + // hack to include previously skipped space + tokPos = tokEnd; + expect(_braceR); + } + inTemplate = false; + next(); + return finishNode(node, "TemplateLiteral"); + } + function parseObj(isClass, isStatement) { var node = startNode(); if (isClass) { @@ -836,6 +869,7 @@ popCx(); eat(tt.braceR); if (isClass) { + semicolon(); finishNode(node.body, "ClassBody"); return finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); } else { @@ -983,6 +1017,7 @@ node.declaration = null; parseSpecifierList(node, "Export"); } + semicolon(); return finishNode(node, "ExportDeclaration"); } @@ -1007,6 +1042,7 @@ for (var i = 0; i < specs.length; i++) specs[i]['default'] = false; if (elt) node.specifiers.unshift(elt); } + semicolon(); return finishNode(node, "ImportDeclaration"); } From 2419de74dcf88d3a7a0b34a8845ea1d444f1538a Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Fri, 31 Oct 2014 00:47:33 +0200 Subject: [PATCH 41/47] Loose: Fix regex after tokenizer changes in #144. --- acorn_loose.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/acorn_loose.js b/acorn_loose.js index f551679a58..261d9e76b5 100644 --- a/acorn_loose.js +++ b/acorn_loose.js @@ -695,7 +695,16 @@ var id = parseIdent(); return eat(tt.arrow) ? parseArrowExpression(startNodeAt(start), [id]) : id; - case tt.num: case tt.string: case tt.regexp: + case tt.regexp: + var node = startNode(); + var val = token.value; + node.regex = {pattern: val.pattern, flags: val.flags}; + node.value = val.value; + node.raw = input.slice(token.start, token.end); + next(); + return finishNode(node, "Literal"); + + case tt.num: case tt.string: var node = startNode(); node.value = token.value; node.raw = input.slice(token.start, token.end); From 6bf8311061807e719bfa4c6efe156e8db7214bca Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Fri, 31 Oct 2014 01:09:21 +0200 Subject: [PATCH 42/47] Loose: fix #33. --- acorn_loose.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/acorn_loose.js b/acorn_loose.js index 261d9e76b5..4c5806a179 100644 --- a/acorn_loose.js +++ b/acorn_loose.js @@ -59,15 +59,14 @@ var lastEnd, token = {start: 0, end: 0}, ahead = []; var curLineStart, nextLineStart, curIndent, lastEndLoc, sourceFile; - function next() { + function next(forceRegexp) { lastEnd = token.end; if (options.locations) lastEndLoc = token.endLoc; + if (forceRegexp) + ahead.length = 0; - if (ahead.length) - token = ahead.shift(); - else - token = readToken(); + token = ahead.shift() || readToken(forceRegexp); if (token.start >= nextLineStart) { while (token.start >= nextLineStart) { @@ -78,10 +77,10 @@ } } - function readToken() { + function readToken(forceRegexp) { for (;;) { try { - var tok = fetchToken(); + var tok = fetchToken(forceRegexp); if (tok.type === tt.dot && input.substr(tok.end, 1) === '.') { tok = fetchToken(); tok.start--; @@ -309,6 +308,9 @@ } function parseStatement() { + if (token.type === tt.slash || token.type === tt.assign && token.value === "/=") + next(true); + var starttype = token.type, node = startNode(); switch (starttype) { From 96ccdb05faf175de545ea01085302bac5a590eeb Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Mon, 3 Nov 2014 20:07:19 +0200 Subject: [PATCH 43/47] Web-driver support for loose parser + small fixes. * Added support for acorn_loose and grouped log to web-driver. * Removed unused copy-pasted `parseTemplate` from loose parser. * Throw non-SyntaxError errors immediately (as those are generic). --- acorn_loose.js | 29 ---------- test/driver.js | 7 ++- test/index.html | 21 ++------ test/run.js | 138 ++++++++++++++++++++++++++++++++---------------- 4 files changed, 103 insertions(+), 92 deletions(-) diff --git a/acorn_loose.js b/acorn_loose.js index 4c5806a179..9b739da101 100644 --- a/acorn_loose.js +++ b/acorn_loose.js @@ -786,35 +786,6 @@ return finishNode(node, "NewExpression"); } - function parseTemplate() { - var node = startNode(); - node.expressions = []; - node.quasis = []; - inTemplate = true; - next(); - for (;;) { - var elem = startNode(); - elem.value = {cooked: tokVal, raw: input.slice(tokStart, tokEnd)}; - elem.tail = false; - next(); - node.quasis.push(finishNode(elem, "TemplateElement")); - if (tokType === _bquote) { // '`', end of template - elem.tail = true; - break; - } - inTemplate = false; - expect(_dollarBraceL); - node.expressions.push(parseExpression()); - inTemplate = true; - // hack to include previously skipped space - tokPos = tokEnd; - expect(_braceR); - } - inTemplate = false; - next(); - return finishNode(node, "TemplateLiteral"); - } - function parseObj(isClass, isStatement) { var node = startNode(); if (isClass) { diff --git a/test/driver.js b/test/driver.js index cbd6cc3a04..c76b8f91a4 100644 --- a/test/driver.js +++ b/test/driver.js @@ -52,12 +52,15 @@ else callback("ok", test.code); } } catch(e) { - if (test.error && e instanceof SyntaxError) { + if (!(e instanceof SyntaxError)) { + throw e; + } + if (test.error) { if (e.message == test.error) callback("ok", test.code); else callback("fail", test.code, "Expected error message: " + test.error + "\nGot error message: " + e.message); } else { - callback("error", test.code, !(e instanceof SyntaxError) && e.stack || e.message || e.toString()); + callback("error", test.code, e.message || e.toString()); } } } diff --git a/test/index.html b/test/index.html index 96a9d952c5..ef80eb7b15 100644 --- a/test/index.html +++ b/test/index.html @@ -3,23 +3,12 @@ Acorn test suite + - - + +
    + + diff --git a/test/run.js b/test/run.js index 04001c3d56..fefcaed6a7 100644 --- a/test/run.js +++ b/test/run.js @@ -1,56 +1,104 @@ -var driver = require("./driver.js"); -require("./tests.js"); -require("./tests-harmony.js"); +(function() { + var driver; -var stats, modes = { - Normal: { - config: { - parse: (typeof require === "undefined" ? window.acorn : require("../acorn.js")).parse + if (typeof require !== "undefined") { + driver = require("./driver.js"); + require("./tests.js"); + require("./tests-harmony.js"); + } else { + driver = window; + } + + var htmlLog = typeof document === "object" && document.getElementById('log'); + var htmlGroup; + + function group(name) { + if (htmlLog) { + htmlGroup = document.createElement("ul"); + var item = document.createElement("li"); + item.textContent = name; + item.appendChild(htmlGroup); + htmlLog.appendChild(item); } - }, - Loose: { - config: { - parse: (typeof require === "undefined") ? window.acorn_loose : require("../acorn_loose").parse_dammit, - loose: true, - filter: function (test) { - var opts = test.options || {}; - if (opts.loose === false) return false; - return (opts.ecmaVersion || 5) <= 6; - } + if (typeof console === "object" && console.group) { + console.group(name); } } -}; -function report(state, code, message) { - if (state != "ok") {++stats.failed; console.log(code, message);} - ++stats.testsRun; -} + function groupEnd() { + htmlGroup = null; + if (typeof console === "object" && console.groupEnd) { + console.groupEnd(name); + } + } -for (var name in modes) { - var mode = modes[name]; - stats = mode.stats = {testsRun: 0, failed: 0}; - var t0 = +new Date; - driver.runTests(mode.config, report); - mode.stats.duration = +new Date - t0; -} + function log(title, message) { + if (htmlGroup) { + var elem = document.createElement("li"); + elem.innerHTML = "" + title + " " + message; + htmlGroup.appendChild(elem); + } + if (typeof console === "object") console.log(title, message); + } -function outputStats(name, stats) { - console.log(name + ": " + stats.testsRun + " tests run in " + stats.duration + "ms; " + - (stats.failed ? stats.failed + " failures." : "all passed.")); -} + var stats, modes = { + Normal: { + config: { + parse: (typeof require === "undefined" ? window.acorn : require("../acorn.js")).parse + } + }, + Loose: { + config: { + parse: (typeof require === "undefined" ? window.acorn : require("../acorn_loose")).parse_dammit, + loose: true, + filter: function (test) { + var opts = test.options || {}; + if (opts.loose === false) return false; + return (opts.ecmaVersion || 5) <= 6; + } + } + } + }; -var total = {testsRun: 0, failed: 0, duration: 0}; + function report(state, code, message) { + if (state != "ok") {++stats.failed; log(code, message);} + ++stats.testsRun; + } -for (var name in modes) { - var stats = modes[name].stats; - outputStats(name + " parser", stats); - for (var key in stats) total[key] += stats[key]; -} + group("Errors"); -outputStats("Total", total); + for (var name in modes) { + var mode = modes[name]; + stats = mode.stats = {testsRun: 0, failed: 0}; + var t0 = +new Date; + driver.runTests(mode.config, report); + mode.stats.duration = +new Date - t0; + } -if (total.failed) { - process.stdout.write("", function() { - process.exit(1); - }); -} + groupEnd(); + + function outputStats(name, stats) { + log(name + ":", stats.testsRun + " tests run in " + stats.duration + "ms; " + + (stats.failed ? stats.failed + " failures." : "all passed.")); + } + + var total = {testsRun: 0, failed: 0, duration: 0}; + + group("Stats"); + + for (var name in modes) { + var stats = modes[name].stats; + outputStats(name + " parser", stats); + for (var key in stats) total[key] += stats[key]; + } + + outputStats("Total", total); + + groupEnd(); + + if (total.failed && typeof process === "object") { + process.stdout.write("", function() { + process.exit(1); + }); + } +})(); From bc64d3c5f4a96c7540697a7624addd7d563c0ed1 Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Tue, 4 Nov 2014 02:01:02 +0200 Subject: [PATCH 44/47] Add support for nested groups in log (Chrome console + browser). --- test/run.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/test/run.js b/test/run.js index fefcaed6a7..04f752dc3b 100644 --- a/test/run.js +++ b/test/run.js @@ -10,15 +10,16 @@ } var htmlLog = typeof document === "object" && document.getElementById('log'); - var htmlGroup; + var htmlGroup = htmlLog; function group(name) { - if (htmlLog) { + if (htmlGroup) { + var parentGroup = htmlGroup; htmlGroup = document.createElement("ul"); var item = document.createElement("li"); item.textContent = name; item.appendChild(htmlGroup); - htmlLog.appendChild(item); + parentGroup.appendChild(item); } if (typeof console === "object" && console.group) { console.group(name); @@ -26,7 +27,9 @@ } function groupEnd() { - htmlGroup = null; + if (htmlGroup) { + htmlGroup = htmlGroup.parentElement.parentElement; + } if (typeof console === "object" && console.groupEnd) { console.groupEnd(name); } @@ -68,11 +71,13 @@ group("Errors"); for (var name in modes) { + group(name); var mode = modes[name]; stats = mode.stats = {testsRun: 0, failed: 0}; var t0 = +new Date; driver.runTests(mode.config, report); mode.stats.duration = +new Date - t0; + groupEnd(); } groupEnd(); From 249e6961f884e4660ec8fe2e4af8fb53b929ac13 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Wed, 12 Nov 2014 17:04:41 +0100 Subject: [PATCH 45/47] Make tests pass for loose parser Define Program node extent to be the whole program, make both parser and the tests conform to this. Fix a bunch of bugs in the loose parser's handling of corner cases. Issue #151 --- acorn.js | 24 +++++++++++++------ acorn_loose.js | 5 +++- test/run.js | 1 + test/tests.js | 62 +++++++++++++++++++++++++------------------------- 4 files changed, 53 insertions(+), 39 deletions(-) diff --git a/acorn.js b/acorn.js index ab23dcd278..97ccf2c993 100644 --- a/acorn.js +++ b/acorn.js @@ -43,8 +43,9 @@ input = String(inpt); inputLen = input.length; setOptions(opts); initTokenState(); + var startPos = options.locations ? [tokStart, new Position] : tokStart; initParserState(); - return parseTopLevel(options.program); + return parseTopLevel(options.program || startNodeAt(startPos)); }; // A second optional argument can be given to further configure @@ -214,6 +215,7 @@ input = String(inpt); inputLen = input.length; setOptions(opts); initTokenState(); + skipSpace(); function getToken(forceRegexp) { lastEnd = tokEnd; @@ -234,6 +236,9 @@ tokRegexpAllowed = reAllowed; skipSpace(); }; + getToken.noRegexp = function() { + tokRegexpAllowed = false; + }; getToken.options = options; return getToken; }; @@ -308,6 +313,7 @@ if (options.locations) lastEndLoc = new Position; inFunction = inGenerator = strict = false; labels = []; + skipSpace(); readToken(); } @@ -446,7 +452,8 @@ parenL: _parenL, parenR: _parenR, comma: _comma, semi: _semi, colon: _colon, dot: _dot, ellipsis: _ellipsis, question: _question, slash: _slash, eq: _eq, name: _name, eof: _eof, num: _num, regexp: _regexp, string: _string, - arrow: _arrow, bquote: _bquote, dollarBraceL: _dollarBraceL, star: _star}; + arrow: _arrow, bquote: _bquote, dollarBraceL: _dollarBraceL, star: _star, + assign: _assign}; for (var kw in keywordTypes) exports.tokTypes["_" + kw] = keywordTypes[kw]; // This is a trick taken from Esprima. It turns out that, on @@ -592,7 +599,6 @@ tokRegexpAllowed = true; metParenL = 0; inTemplate = false; - skipSpace(); } // Called at the end of every token. Sets `tokEnd`, `tokVal`, and @@ -1505,15 +1511,19 @@ // `program` argument. If present, the statements will be appended // to its body instead of creating a new node. - function parseTopLevel(program) { - var node = program || startNode(), first = true; - if (!program) node.body = []; + function parseTopLevel(node) { + var first = true; + if (!node.body) node.body = []; while (tokType !== _eof) { var stmt = parseStatement(); node.body.push(stmt); if (first && isUseStrict(stmt)) setStrict(true); first = false; } + + lastStart = tokStart; + lastEnd = tokEnd; + lastEndLoc = tokEndLoc; return finishNode(node, "Program"); } @@ -2062,7 +2072,7 @@ case _parenL: var start = storeCurrentPos(); - var tokStartLoc1 = tokStartLoc, tokStart1 = tokStart, val, exprList; + var val, exprList; next(); // check whether this is generator comprehension or regular expression if (options.ecmaVersion >= 7 && tokType === _for) { diff --git a/acorn_loose.js b/acorn_loose.js index 9b739da101..649aec6241 100644 --- a/acorn_loose.js +++ b/acorn_loose.js @@ -301,9 +301,11 @@ } function parseTopLevel() { - var node = startNode(); + var node = startNodeAt(options.locations ? [0, acorn.getLineInfo(input, 0)] : 0); node.body = []; while (token.type !== tt.eof) node.body.push(parseStatement()); + lastEnd = token.end; + lastEndLoc = token.endLoc; return finishNode(node, "Program"); } @@ -881,6 +883,7 @@ function parseIdent() { var node = startNode(); node.name = token.type === tt.name ? token.value : token.type.keyword; + fetchToken.noRegexp(); next(); return finishNode(node, "Identifier"); } diff --git a/test/run.js b/test/run.js index 04f752dc3b..e896397100 100644 --- a/test/run.js +++ b/test/run.js @@ -55,6 +55,7 @@ parse: (typeof require === "undefined" ? window.acorn : require("../acorn_loose")).parse_dammit, loose: true, filter: function (test) { + if (/`/.test(test.code)) return false; // FIXME remove this when the loose parse supports template strings var opts = test.options || {}; if (opts.loose === false) return false; return (opts.ecmaVersion || 5) <= 6; diff --git a/test/tests.js b/test/tests.js index f1d9467745..e50952826c 100644 --- a/test/tests.js +++ b/test/tests.js @@ -43,8 +43,8 @@ test("this\n", { column: 0 }, end: { - line: 1, - column: 4 + line: 2, + column: 0 } } }); @@ -86,8 +86,8 @@ test("null\n", { column: 0 }, end: { - line: 1, - column: 4 + line: 2, + column: 0 } } }); @@ -125,12 +125,12 @@ test("\n 42\n\n", { ], loc: { start: { - line: 2, - column: 4 + line: 1, + column: 0 }, end: { - line: 2, - column: 6 + line: 4, + column: 0 } } }); @@ -4916,7 +4916,7 @@ test("/* block comment */ 42", { loc: { start: { line: 1, - column: 20 + column: 0 }, end: { line: 1, @@ -4963,7 +4963,7 @@ test("42 /*The*/ /*Answer*/", { }, end: { line: 1, - column: 2 + column: 21 } } }); @@ -5006,7 +5006,7 @@ test("42 /*the*/ /*answer*/", { }, end: { line: 1, - column: 2 + column: 21 } } }); @@ -5044,8 +5044,8 @@ test("/* multiline\ncomment\nshould\nbe\nignored */ 42", { ], loc: { start: { - line: 5, - column: 11 + line: 1, + column: 0 }, end: { line: 5, @@ -5087,8 +5087,8 @@ test("/*a\r\nb*/ 42", { ], loc: { start: { - line: 2, - column: 4 + line: 1, + column: 0 }, end: { line: 2, @@ -5130,8 +5130,8 @@ test("/*a\rb*/ 42", { ], loc: { start: { - line: 2, - column: 4 + line: 1, + column: 0 }, end: { line: 2, @@ -5173,8 +5173,8 @@ test("/*a\nb*/ 42", { ], loc: { start: { - line: 2, - column: 4 + line: 1, + column: 0 }, end: { line: 2, @@ -5216,8 +5216,8 @@ test("/*a\nc*/ 42", { ], loc: { start: { - line: 2, - column: 4 + line: 1, + column: 0 }, end: { line: 2, @@ -5259,7 +5259,7 @@ test("// line comment\n42", { ], loc: { start: { - line: 2, + line: 1, column: 0 }, end: { @@ -5307,7 +5307,7 @@ test("42 // line comment", { }, end: { line: 1, - column: 2 + column: 18 } } }); @@ -5345,7 +5345,7 @@ test("// Hello, world!\n42", { ], loc: { start: { - line: 2, + line: 1, column: 0 }, end: { @@ -5360,7 +5360,7 @@ test("// Hello, world!\n", { body: [], loc: { start: { - line: 2, + line: 1, column: 0 }, end: { @@ -5375,7 +5375,7 @@ test("// Hallo, world!\n", { body: [], loc: { start: { - line: 2, + line: 1, column: 0 }, end: { @@ -5418,7 +5418,7 @@ test("//\n42", { ], loc: { start: { - line: 2, + line: 1, column: 0 }, end: { @@ -5434,7 +5434,7 @@ test("//", { loc: { start: { line: 1, - column: 2 + column: 0 }, end: { line: 1, @@ -5449,7 +5449,7 @@ test("// ", { loc: { start: { line: 1, - column: 3 + column: 0 }, end: { line: 1, @@ -5492,7 +5492,7 @@ test("/**/42", { loc: { start: { line: 1, - column: 4 + column: 0 }, end: { line: 1, @@ -5534,7 +5534,7 @@ test("// Hello, world!\n\n// Another hello\n42", { ], loc: { start: { - line: 4, + line: 1, column: 0 }, end: { From 98691e5b808fc332aedabb47ad2c3ab66487bfb8 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Wed, 12 Nov 2014 17:31:45 +0100 Subject: [PATCH 46/47] Properly initialize top node start position --- acorn.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acorn.js b/acorn.js index 97ccf2c993..ca5e8eb731 100644 --- a/acorn.js +++ b/acorn.js @@ -43,7 +43,7 @@ input = String(inpt); inputLen = input.length; setOptions(opts); initTokenState(); - var startPos = options.locations ? [tokStart, new Position] : tokStart; + var startPos = options.locations ? [tokPos, new Position] : tokPos; initParserState(); return parseTopLevel(options.program || startNodeAt(startPos)); }; From f48a921e249392226387b3e6323b01e6b3f5c3c5 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Wed, 5 Nov 2014 12:02:47 -0500 Subject: [PATCH 47/47] allow `export { default } from "foo"` --- acorn.js | 2 +- test/tests-harmony.js | 53 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/acorn.js b/acorn.js index ca5e8eb731..526c3a4f35 100644 --- a/acorn.js +++ b/acorn.js @@ -2524,7 +2524,7 @@ } else first = false; var node = startNode(); - node.id = parseIdent(); + node.id = parseIdent(tokType === _default); if (tokType === _name && tokVal === "as") { next(); node.name = parseIdent(true); diff --git a/test/tests-harmony.js b/test/tests-harmony.js index 00149c1ee7..f5064c8a94 100644 --- a/test/tests-harmony.js +++ b/test/tests-harmony.js @@ -5064,6 +5064,59 @@ test("export { encrypt, decrypt as dec }", { locations: true }); +test("export { default } from \"other\"", { + type: "Program", + body: [{ + type: "ExportDeclaration", + declaration: null, + specifiers: [ + { + type: "ExportSpecifier", + id: { + type: "Identifier", + name: "default", + loc: { + start: {line: 1, column: 9}, + end: {line: 1, column: 16} + } + }, + name: null, + loc: { + start: {line: 1, column: 9}, + end: {line: 1, column: 16} + } + } + ], + source: { + type: "Literal", + loc: { + start: { + line: 1, + column: 24 + }, + end: { + line: 1, + column: 31 + } + }, + value: "other", + raw: "\"other\"" + }, + loc: { + start: {line: 1, column: 0}, + end: {line: 1, column: 31} + } + }], + loc: { + start: {line: 1, column: 0}, + end: {line: 1, column: 31} + } +}, { + ecmaVersion: 6, + ranges: true, + locations: true +}); + test("import \"jquery\"", { type: "Program", body: [{