diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-arrow-function-static-init-await-binding.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-arrow-function-static-init-await-binding.result.js new file mode 100644 index 00000000..f405c1f3 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-arrow-function-static-init-await-binding.result.js @@ -0,0 +1,6 @@ +export default { + "index": 27, + "lineNumber": 4, + "column": 6, + "message": "Cannot use await in class static initialization block" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-arrow-function-static-init-await-binding.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-arrow-function-static-init-await-binding.src.js new file mode 100644 index 00000000..172fca50 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-arrow-function-static-init-await-binding.src.js @@ -0,0 +1,6 @@ + +class C { + static { + (await => 0); + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-arrow-function-static-init-await-reference.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-arrow-function-static-init-await-reference.result.js new file mode 100644 index 00000000..fe48265b --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-arrow-function-static-init-await-reference.result.js @@ -0,0 +1,6 @@ +export default { + "index": 32, + "lineNumber": 4, + "column": 11, + "message": "Cannot use await in class static initialization block" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-arrow-function-static-init-await-reference.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-arrow-function-static-init-await-reference.src.js new file mode 100644 index 00000000..0716a796 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-arrow-function-static-init-await-reference.src.js @@ -0,0 +1,6 @@ + +class C { + static { + ((x = await) => 0); + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-class-static-init-await-binding.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-class-static-init-await-binding.result.js new file mode 100644 index 00000000..eeeb5fc4 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-class-static-init-await-binding.result.js @@ -0,0 +1,6 @@ +export default { + "index": 33, + "lineNumber": 4, + "column": 12, + "message": "Cannot use await in class static initialization block" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-class-static-init-await-binding.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-class-static-init-await-binding.src.js new file mode 100644 index 00000000..0d37d49e --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-class-static-init-await-binding.src.js @@ -0,0 +1,6 @@ + +class C { + static { + (class await {}); + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-class-static-init-await-reference.module-result.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-class-static-init-await-reference.module-result.js new file mode 100644 index 00000000..8db53b99 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-class-static-init-await-reference.module-result.js @@ -0,0 +1,6 @@ +export default { + "index": 5, + "lineNumber": 2, + "column": 5, + "message": "Cannot use keyword 'await' outside an async function" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-class-static-init-await-reference.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-class-static-init-await-reference.result.js new file mode 100644 index 00000000..41fcac4d --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-class-static-init-await-reference.result.js @@ -0,0 +1,1951 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 14, + "column": 43 + } + }, + "range": [ + 1, + 263 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "range": [ + 1, + 15 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "range": [ + 5, + 14 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 5, + 10 + ], + "name": "await" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "range": [ + 13, + 14 + ], + "value": 0, + "raw": "0" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 24 + } + }, + "range": [ + 16, + 40 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 20, + 29 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 20, + 29 + ], + "name": "fromParam" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 23 + } + }, + "range": [ + 31, + 39 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 23 + } + }, + "range": [ + 31, + 39 + ], + "name": "fromBody" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 12, + "column": 1 + } + }, + "range": [ + 41, + 169 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 47, + 48 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 12, + "column": 1 + } + }, + "range": [ + 49, + 169 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 11, + "column": 3 + } + }, + "range": [ + 53, + 167 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 10, + "column": 7 + } + }, + "range": [ + 66, + 163 + ], + "expression": { + "type": "NewExpression", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 10, + "column": 6 + } + }, + "range": [ + 66, + 162 + ], + "callee": { + "type": "ClassExpression", + "loc": { + "start": { + "line": 6, + "column": 9 + }, + "end": { + "line": 10, + "column": 5 + } + }, + "range": [ + 71, + 161 + ], + "id": null, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 10, + "column": 5 + } + }, + "range": [ + 77, + 161 + ], + "body": [ + { + "type": "MethodDefinition", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 9, + "column": 7 + } + }, + "range": [ + 85, + 155 + ], + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 17 + } + }, + "range": [ + 85, + 96 + ], + "name": "constructor" + }, + "kind": "constructor", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 7, + "column": 17 + }, + "end": { + "line": 9, + "column": 7 + } + }, + "range": [ + 96, + 155 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 7, + "column": 18 + }, + "end": { + "line": 7, + "column": 39 + } + }, + "range": [ + 97, + 118 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 18 + }, + "end": { + "line": 7, + "column": 19 + } + }, + "range": [ + 97, + 98 + ], + "name": "x" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 7, + "column": 22 + }, + "end": { + "line": 7, + "column": 39 + } + }, + "range": [ + 101, + 118 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 22 + }, + "end": { + "line": 7, + "column": 31 + } + }, + "range": [ + 101, + 110 + ], + "name": "fromParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 34 + }, + "end": { + "line": 7, + "column": 39 + } + }, + "range": [ + 113, + 118 + ], + "name": "await" + } + } + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 7, + "column": 41 + }, + "end": { + "line": 9, + "column": 7 + } + }, + "range": [ + 120, + 155 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 25 + } + }, + "range": [ + 130, + 147 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 24 + } + }, + "range": [ + 130, + 146 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 16 + } + }, + "range": [ + 130, + 138 + ], + "name": "fromBody" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 19 + }, + "end": { + "line": 8, + "column": 24 + } + }, + "range": [ + 141, + 146 + ], + "name": "await" + } + } + } + ] + } + } + } + ] + } + }, + "arguments": [] + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 49 + } + }, + "range": [ + 170, + 219 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 48 + } + }, + "range": [ + 170, + 218 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 16 + } + }, + "range": [ + 170, + 186 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 6 + } + }, + "range": [ + 170, + 176 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 7 + }, + "end": { + "line": 13, + "column": 16 + } + }, + "range": [ + 177, + 186 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 17 + }, + "end": { + "line": 13, + "column": 26 + } + }, + "range": [ + 187, + 196 + ], + "name": "fromParam" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 13, + "column": 28 + }, + "end": { + "line": 13, + "column": 29 + } + }, + "range": [ + 198, + 199 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 13, + "column": 31 + }, + "end": { + "line": 13, + "column": 47 + } + }, + "range": [ + 201, + 217 + ], + "value": "from parameter", + "raw": "'from parameter'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 43 + } + }, + "range": [ + 220, + 263 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 42 + } + }, + "range": [ + 220, + 262 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 16 + } + }, + "range": [ + 220, + 236 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 6 + } + }, + "range": [ + 220, + 226 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 7 + }, + "end": { + "line": 14, + "column": 16 + } + }, + "range": [ + 227, + 236 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 17 + }, + "end": { + "line": 14, + "column": 25 + } + }, + "range": [ + 237, + 245 + ], + "name": "fromBody" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 14, + "column": 27 + }, + "end": { + "line": 14, + "column": 28 + } + }, + "range": [ + 247, + 248 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 14, + "column": 30 + }, + "end": { + "line": 14, + "column": 41 + } + }, + "range": [ + 250, + 261 + ], + "value": "from body", + "raw": "'from body'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "range": [ + 1, + 4 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 5, + 10 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "range": [ + 11, + 12 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "range": [ + 13, + 14 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "range": [ + 14, + 15 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "range": [ + 16, + 19 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 20, + 29 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "range": [ + 29, + 30 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 23 + } + }, + "range": [ + 31, + 39 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 23 + }, + "end": { + "line": 3, + "column": 24 + } + }, + "range": [ + 39, + 40 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 41, + 46 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 47, + 48 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 8 + } + }, + "range": [ + 53, + 59 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 60, + 61 + ] + }, + { + "type": "Keyword", + "value": "new", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 66, + 69 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 9 + } + }, + "range": [ + 70, + 71 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 6, + "column": 9 + }, + "end": { + "line": 6, + "column": 14 + } + }, + "range": [ + 71, + 76 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 6, + "column": 16 + } + }, + "range": [ + 77, + 78 + ] + }, + { + "type": "Identifier", + "value": "constructor", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 17 + } + }, + "range": [ + 85, + 96 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 7, + "column": 17 + }, + "end": { + "line": 7, + "column": 18 + } + }, + "range": [ + 96, + 97 + ] + }, + { + "type": "Identifier", + "value": "x", + "loc": { + "start": { + "line": 7, + "column": 18 + }, + "end": { + "line": 7, + "column": 19 + } + }, + "range": [ + 97, + 98 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 7, + "column": 20 + }, + "end": { + "line": 7, + "column": 21 + } + }, + "range": [ + 99, + 100 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 7, + "column": 22 + }, + "end": { + "line": 7, + "column": 31 + } + }, + "range": [ + 101, + 110 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 7, + "column": 32 + }, + "end": { + "line": 7, + "column": 33 + } + }, + "range": [ + 111, + 112 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 7, + "column": 34 + }, + "end": { + "line": 7, + "column": 39 + } + }, + "range": [ + 113, + 118 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 7, + "column": 39 + }, + "end": { + "line": 7, + "column": 40 + } + }, + "range": [ + 118, + 119 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 41 + }, + "end": { + "line": 7, + "column": 42 + } + }, + "range": [ + 120, + 121 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 16 + } + }, + "range": [ + 130, + 138 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 8, + "column": 17 + }, + "end": { + "line": 8, + "column": 18 + } + }, + "range": [ + 139, + 140 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 8, + "column": 19 + }, + "end": { + "line": 8, + "column": 24 + } + }, + "range": [ + 141, + 146 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 8, + "column": 24 + }, + "end": { + "line": 8, + "column": 25 + } + }, + "range": [ + 146, + 147 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 9, + "column": 6 + }, + "end": { + "line": 9, + "column": 7 + } + }, + "range": [ + 154, + 155 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 5 + } + }, + "range": [ + 160, + 161 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 10, + "column": 5 + }, + "end": { + "line": 10, + "column": 6 + } + }, + "range": [ + 161, + 162 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 7 + } + }, + "range": [ + 162, + 163 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 3 + } + }, + "range": [ + 166, + 167 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 1 + } + }, + "range": [ + 168, + 169 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 6 + } + }, + "range": [ + 170, + 176 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 13, + "column": 6 + }, + "end": { + "line": 13, + "column": 7 + } + }, + "range": [ + 176, + 177 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 13, + "column": 7 + }, + "end": { + "line": 13, + "column": 16 + } + }, + "range": [ + 177, + 186 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 13, + "column": 16 + }, + "end": { + "line": 13, + "column": 17 + } + }, + "range": [ + 186, + 187 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 13, + "column": 17 + }, + "end": { + "line": 13, + "column": 26 + } + }, + "range": [ + 187, + 196 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 13, + "column": 26 + }, + "end": { + "line": 13, + "column": 27 + } + }, + "range": [ + 196, + 197 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 13, + "column": 28 + }, + "end": { + "line": 13, + "column": 29 + } + }, + "range": [ + 198, + 199 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 13, + "column": 29 + }, + "end": { + "line": 13, + "column": 30 + } + }, + "range": [ + 199, + 200 + ] + }, + { + "type": "String", + "value": "'from parameter'", + "loc": { + "start": { + "line": 13, + "column": 31 + }, + "end": { + "line": 13, + "column": 47 + } + }, + "range": [ + 201, + 217 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 13, + "column": 47 + }, + "end": { + "line": 13, + "column": 48 + } + }, + "range": [ + 217, + 218 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 13, + "column": 48 + }, + "end": { + "line": 13, + "column": 49 + } + }, + "range": [ + 218, + 219 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 6 + } + }, + "range": [ + 220, + 226 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 7 + } + }, + "range": [ + 226, + 227 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 14, + "column": 7 + }, + "end": { + "line": 14, + "column": 16 + } + }, + "range": [ + 227, + 236 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 14, + "column": 16 + }, + "end": { + "line": 14, + "column": 17 + } + }, + "range": [ + 236, + 237 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 14, + "column": 17 + }, + "end": { + "line": 14, + "column": 25 + } + }, + "range": [ + 237, + 245 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 14, + "column": 25 + }, + "end": { + "line": 14, + "column": 26 + } + }, + "range": [ + 245, + 246 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 14, + "column": 27 + }, + "end": { + "line": 14, + "column": 28 + } + }, + "range": [ + 247, + 248 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 14, + "column": 28 + }, + "end": { + "line": 14, + "column": 29 + } + }, + "range": [ + 248, + 249 + ] + }, + { + "type": "String", + "value": "'from body'", + "loc": { + "start": { + "line": 14, + "column": 30 + }, + "end": { + "line": 14, + "column": 41 + } + }, + "range": [ + 250, + 261 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 14, + "column": 41 + }, + "end": { + "line": 14, + "column": 42 + } + }, + "range": [ + 261, + 262 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 14, + "column": 42 + }, + "end": { + "line": 14, + "column": 43 + } + }, + "range": [ + 262, + 263 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-class-static-init-await-reference.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-class-static-init-await-reference.src.js new file mode 100644 index 00000000..2119d07c --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-class-static-init-await-reference.src.js @@ -0,0 +1,14 @@ + +var await = 0; +var fromParam, fromBody; +class C { + static { + new (class { + constructor(x = fromParam = await) { + fromBody = await; + } + }); + } +} +assert.sameValue(fromParam, 0, 'from parameter'); +assert.sameValue(fromBody, 0, 'from body'); diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-function-static-init-await-binding.module-result.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-function-static-init-await-binding.module-result.js new file mode 100644 index 00000000..6ad2695d --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-function-static-init-await-binding.module-result.js @@ -0,0 +1,6 @@ +export default { + "index": 36, + "lineNumber": 4, + "column": 15, + "message": "Cannot use keyword 'await' outside an async function" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-function-static-init-await-binding.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-function-static-init-await-binding.result.js new file mode 100644 index 00000000..0a40da99 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-function-static-init-await-binding.result.js @@ -0,0 +1,495 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 1, + 59 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 1, + 59 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 7, + 8 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 9, + 59 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 13, + 57 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 31 + } + }, + "range": [ + 26, + 53 + ], + "expression": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 29 + } + }, + "range": [ + 27, + 51 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 14 + }, + "end": { + "line": 4, + "column": 19 + } + }, + "range": [ + 36, + 41 + ], + "name": "await" + }, + "expression": false, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 20 + }, + "end": { + "line": 4, + "column": 25 + } + }, + "range": [ + 42, + 47 + ], + "name": "await" + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 4, + "column": 27 + }, + "end": { + "line": 4, + "column": 29 + } + }, + "range": [ + 49, + 51 + ], + "body": [] + } + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "range": [ + 1, + 6 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 7, + 8 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 9, + 10 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "range": [ + 13, + 19 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 20, + 21 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 26, + 27 + ] + }, + { + "type": "Keyword", + "value": "function", + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 27, + 35 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 4, + "column": 14 + }, + "end": { + "line": 4, + "column": 19 + } + }, + "range": [ + 36, + 41 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 19 + }, + "end": { + "line": 4, + "column": 20 + } + }, + "range": [ + 41, + 42 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 4, + "column": 20 + }, + "end": { + "line": 4, + "column": 25 + } + }, + "range": [ + 42, + 47 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 25 + }, + "end": { + "line": 4, + "column": 26 + } + }, + "range": [ + 47, + 48 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 27 + }, + "end": { + "line": 4, + "column": 28 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 4, + "column": 28 + }, + "end": { + "line": 4, + "column": 29 + } + }, + "range": [ + 50, + 51 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 29 + }, + "end": { + "line": 4, + "column": 30 + } + }, + "range": [ + 51, + 52 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 30 + }, + "end": { + "line": 4, + "column": 31 + } + }, + "range": [ + 52, + 53 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 56, + 57 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 58, + 59 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-function-static-init-await-binding.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-function-static-init-await-binding.src.js new file mode 100644 index 00000000..eccafab9 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-function-static-init-await-binding.src.js @@ -0,0 +1,6 @@ + +class C { + static { + (function await(await) {}); + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-function-static-init-await-reference.module-result.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-function-static-init-await-reference.module-result.js new file mode 100644 index 00000000..8db53b99 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-function-static-init-await-reference.module-result.js @@ -0,0 +1,6 @@ +export default { + "index": 5, + "lineNumber": 2, + "column": 5, + "message": "Cannot use keyword 'await' outside an async function" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-function-static-init-await-reference.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-function-static-init-await-reference.result.js new file mode 100644 index 00000000..1c47cb42 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-function-static-init-await-reference.result.js @@ -0,0 +1,1840 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 12, + "column": 43 + } + }, + "range": [ + 1, + 235 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "range": [ + 1, + 15 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "range": [ + 5, + 14 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 5, + 10 + ], + "name": "await" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "range": [ + 13, + 14 + ], + "value": 0, + "raw": "0" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 24 + } + }, + "range": [ + 16, + 40 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 20, + 29 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 20, + 29 + ], + "name": "fromParam" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 23 + } + }, + "range": [ + 31, + 39 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 23 + } + }, + "range": [ + 31, + 39 + ], + "name": "fromBody" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 10, + "column": 1 + } + }, + "range": [ + 41, + 141 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 47, + 48 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 10, + "column": 1 + } + }, + "range": [ + 49, + 141 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 9, + "column": 3 + } + }, + "range": [ + 53, + 139 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 8, + "column": 9 + } + }, + "range": [ + 66, + 135 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 8, + "column": 8 + } + }, + "range": [ + 66, + 134 + ], + "callee": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 8, + "column": 5 + } + }, + "range": [ + 67, + 131 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 6, + "column": 36 + } + }, + "range": [ + 77, + 98 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 6, + "column": 16 + } + }, + "range": [ + 77, + 78 + ], + "name": "x" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 6, + "column": 19 + }, + "end": { + "line": 6, + "column": 36 + } + }, + "range": [ + 81, + 98 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 19 + }, + "end": { + "line": 6, + "column": 28 + } + }, + "range": [ + 81, + 90 + ], + "name": "fromParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 31 + }, + "end": { + "line": 6, + "column": 36 + } + }, + "range": [ + 93, + 98 + ], + "name": "await" + } + } + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 6, + "column": 38 + }, + "end": { + "line": 8, + "column": 5 + } + }, + "range": [ + 100, + 131 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 23 + } + }, + "range": [ + 108, + 125 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 22 + } + }, + "range": [ + 108, + 124 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 14 + } + }, + "range": [ + 108, + 116 + ], + "name": "fromBody" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 17 + }, + "end": { + "line": 7, + "column": 22 + } + }, + "range": [ + 119, + 124 + ], + "name": "await" + } + } + } + ] + } + }, + "arguments": [], + "optional": false + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 49 + } + }, + "range": [ + 142, + 191 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 48 + } + }, + "range": [ + 142, + 190 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 16 + } + }, + "range": [ + 142, + 158 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 6 + } + }, + "range": [ + 142, + 148 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 7 + }, + "end": { + "line": 11, + "column": 16 + } + }, + "range": [ + 149, + 158 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 17 + }, + "end": { + "line": 11, + "column": 26 + } + }, + "range": [ + 159, + 168 + ], + "name": "fromParam" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 11, + "column": 28 + }, + "end": { + "line": 11, + "column": 29 + } + }, + "range": [ + 170, + 171 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 11, + "column": 31 + }, + "end": { + "line": 11, + "column": 47 + } + }, + "range": [ + 173, + 189 + ], + "value": "from parameter", + "raw": "'from parameter'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 43 + } + }, + "range": [ + 192, + 235 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 42 + } + }, + "range": [ + 192, + 234 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 16 + } + }, + "range": [ + 192, + 208 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 6 + } + }, + "range": [ + 192, + 198 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 16 + } + }, + "range": [ + 199, + 208 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 17 + }, + "end": { + "line": 12, + "column": 25 + } + }, + "range": [ + 209, + 217 + ], + "name": "fromBody" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 12, + "column": 27 + }, + "end": { + "line": 12, + "column": 28 + } + }, + "range": [ + 219, + 220 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 12, + "column": 30 + }, + "end": { + "line": 12, + "column": 41 + } + }, + "range": [ + 222, + 233 + ], + "value": "from body", + "raw": "'from body'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "range": [ + 1, + 4 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 5, + 10 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "range": [ + 11, + 12 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "range": [ + 13, + 14 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "range": [ + 14, + 15 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "range": [ + 16, + 19 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 20, + 29 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "range": [ + 29, + 30 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 23 + } + }, + "range": [ + 31, + 39 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 23 + }, + "end": { + "line": 3, + "column": 24 + } + }, + "range": [ + 39, + 40 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 41, + 46 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 47, + 48 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 8 + } + }, + "range": [ + 53, + 59 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 60, + 61 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 66, + 67 + ] + }, + { + "type": "Keyword", + "value": "function", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 13 + } + }, + "range": [ + 67, + 75 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 14 + }, + "end": { + "line": 6, + "column": 15 + } + }, + "range": [ + 76, + 77 + ] + }, + { + "type": "Identifier", + "value": "x", + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 6, + "column": 16 + } + }, + "range": [ + 77, + 78 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 6, + "column": 17 + }, + "end": { + "line": 6, + "column": 18 + } + }, + "range": [ + 79, + 80 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 6, + "column": 19 + }, + "end": { + "line": 6, + "column": 28 + } + }, + "range": [ + 81, + 90 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 6, + "column": 29 + }, + "end": { + "line": 6, + "column": 30 + } + }, + "range": [ + 91, + 92 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 6, + "column": 31 + }, + "end": { + "line": 6, + "column": 36 + } + }, + "range": [ + 93, + 98 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 36 + }, + "end": { + "line": 6, + "column": 37 + } + }, + "range": [ + 98, + 99 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 38 + }, + "end": { + "line": 6, + "column": 39 + } + }, + "range": [ + 100, + 101 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 14 + } + }, + "range": [ + 108, + 116 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 7, + "column": 15 + }, + "end": { + "line": 7, + "column": 16 + } + }, + "range": [ + 117, + 118 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 7, + "column": 17 + }, + "end": { + "line": 7, + "column": 22 + } + }, + "range": [ + 119, + 124 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 7, + "column": 22 + }, + "end": { + "line": 7, + "column": 23 + } + }, + "range": [ + 124, + 125 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 5 + } + }, + "range": [ + 130, + 131 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 8, + "column": 5 + }, + "end": { + "line": 8, + "column": 6 + } + }, + "range": [ + 131, + 132 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 8, + "column": 6 + }, + "end": { + "line": 8, + "column": 7 + } + }, + "range": [ + 132, + 133 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 8, + "column": 7 + }, + "end": { + "line": 8, + "column": 8 + } + }, + "range": [ + 133, + 134 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 9 + } + }, + "range": [ + 134, + 135 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 9, + "column": 3 + } + }, + "range": [ + 138, + 139 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 10, + "column": 0 + }, + "end": { + "line": 10, + "column": 1 + } + }, + "range": [ + 140, + 141 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 6 + } + }, + "range": [ + 142, + 148 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 7 + } + }, + "range": [ + 148, + 149 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 11, + "column": 7 + }, + "end": { + "line": 11, + "column": 16 + } + }, + "range": [ + 149, + 158 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 11, + "column": 16 + }, + "end": { + "line": 11, + "column": 17 + } + }, + "range": [ + 158, + 159 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 11, + "column": 17 + }, + "end": { + "line": 11, + "column": 26 + } + }, + "range": [ + 159, + 168 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 11, + "column": 26 + }, + "end": { + "line": 11, + "column": 27 + } + }, + "range": [ + 168, + 169 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 11, + "column": 28 + }, + "end": { + "line": 11, + "column": 29 + } + }, + "range": [ + 170, + 171 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 11, + "column": 29 + }, + "end": { + "line": 11, + "column": 30 + } + }, + "range": [ + 171, + 172 + ] + }, + { + "type": "String", + "value": "'from parameter'", + "loc": { + "start": { + "line": 11, + "column": 31 + }, + "end": { + "line": 11, + "column": 47 + } + }, + "range": [ + 173, + 189 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 11, + "column": 47 + }, + "end": { + "line": 11, + "column": 48 + } + }, + "range": [ + 189, + 190 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 11, + "column": 48 + }, + "end": { + "line": 11, + "column": 49 + } + }, + "range": [ + 190, + 191 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 6 + } + }, + "range": [ + 192, + 198 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 12, + "column": 6 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "range": [ + 198, + 199 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 16 + } + }, + "range": [ + 199, + 208 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 12, + "column": 16 + }, + "end": { + "line": 12, + "column": 17 + } + }, + "range": [ + 208, + 209 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 12, + "column": 17 + }, + "end": { + "line": 12, + "column": 25 + } + }, + "range": [ + 209, + 217 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 12, + "column": 25 + }, + "end": { + "line": 12, + "column": 26 + } + }, + "range": [ + 217, + 218 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 12, + "column": 27 + }, + "end": { + "line": 12, + "column": 28 + } + }, + "range": [ + 219, + 220 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 12, + "column": 28 + }, + "end": { + "line": 12, + "column": 29 + } + }, + "range": [ + 220, + 221 + ] + }, + { + "type": "String", + "value": "'from body'", + "loc": { + "start": { + "line": 12, + "column": 30 + }, + "end": { + "line": 12, + "column": 41 + } + }, + "range": [ + 222, + 233 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 12, + "column": 41 + }, + "end": { + "line": 12, + "column": 42 + } + }, + "range": [ + 233, + 234 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 12, + "column": 42 + }, + "end": { + "line": 12, + "column": 43 + } + }, + "range": [ + 234, + 235 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-function-static-init-await-reference.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-function-static-init-await-reference.src.js new file mode 100644 index 00000000..bce7a44e --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-function-static-init-await-reference.src.js @@ -0,0 +1,12 @@ + +var await = 0; +var fromParam, fromBody; +class C { + static { + (function (x = fromParam = await) { + fromBody = await; + })(); + } +} +assert.sameValue(fromParam, 0, 'from parameter'); +assert.sameValue(fromBody, 0, 'from body'); diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-generators-static-init-await-binding.module-result.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-generators-static-init-await-binding.module-result.js new file mode 100644 index 00000000..63cea4d4 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-generators-static-init-await-binding.module-result.js @@ -0,0 +1,6 @@ +export default { + "index": 38, + "lineNumber": 4, + "column": 17, + "message": "Cannot use keyword 'await' outside an async function" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-generators-static-init-await-binding.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-generators-static-init-await-binding.result.js new file mode 100644 index 00000000..c45dbfaa --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-generators-static-init-await-binding.result.js @@ -0,0 +1,513 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 1, + 62 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 1, + 62 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 7, + 8 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 9, + 62 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 13, + 60 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 34 + } + }, + "range": [ + 26, + 56 + ], + "expression": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 32 + } + }, + "range": [ + 27, + 54 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 16 + }, + "end": { + "line": 4, + "column": 21 + } + }, + "range": [ + 38, + 43 + ], + "name": "await" + }, + "expression": false, + "generator": true, + "async": false, + "params": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 23 + }, + "end": { + "line": 4, + "column": 28 + } + }, + "range": [ + 45, + 50 + ], + "name": "await" + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 4, + "column": 30 + }, + "end": { + "line": 4, + "column": 32 + } + }, + "range": [ + 52, + 54 + ], + "body": [] + } + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "range": [ + 1, + 6 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 7, + 8 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 9, + 10 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "range": [ + 13, + 19 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 20, + 21 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 26, + 27 + ] + }, + { + "type": "Keyword", + "value": "function", + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 27, + 35 + ] + }, + { + "type": "Punctuator", + "value": "*", + "loc": { + "start": { + "line": 4, + "column": 14 + }, + "end": { + "line": 4, + "column": 15 + } + }, + "range": [ + 36, + 37 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 4, + "column": 16 + }, + "end": { + "line": 4, + "column": 21 + } + }, + "range": [ + 38, + 43 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 22 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 44, + 45 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 4, + "column": 23 + }, + "end": { + "line": 4, + "column": 28 + } + }, + "range": [ + 45, + 50 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 28 + }, + "end": { + "line": 4, + "column": 29 + } + }, + "range": [ + 50, + 51 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 30 + }, + "end": { + "line": 4, + "column": 31 + } + }, + "range": [ + 52, + 53 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 4, + "column": 31 + }, + "end": { + "line": 4, + "column": 32 + } + }, + "range": [ + 53, + 54 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 32 + }, + "end": { + "line": 4, + "column": 33 + } + }, + "range": [ + 54, + 55 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 33 + }, + "end": { + "line": 4, + "column": 34 + } + }, + "range": [ + 55, + 56 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 59, + 60 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 61, + 62 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-generators-static-init-await-binding.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-generators-static-init-await-binding.src.js new file mode 100644 index 00000000..4308c5e9 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-generators-static-init-await-binding.src.js @@ -0,0 +1,6 @@ + +class C { + static { + (function * await (await) {}); + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-generators-static-init-await-reference.module-result.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-generators-static-init-await-reference.module-result.js new file mode 100644 index 00000000..8db53b99 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-generators-static-init-await-reference.module-result.js @@ -0,0 +1,6 @@ +export default { + "index": 5, + "lineNumber": 2, + "column": 5, + "message": "Cannot use keyword 'await' outside an async function" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-generators-static-init-await-reference.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-generators-static-init-await-reference.result.js new file mode 100644 index 00000000..d220bc32 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-generators-static-init-await-reference.result.js @@ -0,0 +1,1986 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 12, + "column": 43 + } + }, + "range": [ + 1, + 244 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "range": [ + 1, + 15 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "range": [ + 5, + 14 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 5, + 10 + ], + "name": "await" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "range": [ + 13, + 14 + ], + "value": 0, + "raw": "0" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 24 + } + }, + "range": [ + 16, + 40 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 20, + 29 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 20, + 29 + ], + "name": "fromParam" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 23 + } + }, + "range": [ + 31, + 39 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 23 + } + }, + "range": [ + 31, + 39 + ], + "name": "fromBody" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 10, + "column": 1 + } + }, + "range": [ + 41, + 150 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 47, + 48 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 10, + "column": 1 + } + }, + "range": [ + 49, + 150 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 9, + "column": 3 + } + }, + "range": [ + 53, + 148 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 8, + "column": 16 + } + }, + "range": [ + 66, + 144 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 8, + "column": 15 + } + }, + "range": [ + 66, + 143 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 8, + "column": 13 + } + }, + "range": [ + 66, + 141 + ], + "object": { + "type": "CallExpression", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 8, + "column": 8 + } + }, + "range": [ + 66, + 136 + ], + "callee": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 8, + "column": 5 + } + }, + "range": [ + 67, + 133 + ], + "id": null, + "expression": false, + "generator": true, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 6, + "column": 17 + }, + "end": { + "line": 6, + "column": 38 + } + }, + "range": [ + 79, + 100 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 17 + }, + "end": { + "line": 6, + "column": 18 + } + }, + "range": [ + 79, + 80 + ], + "name": "x" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 6, + "column": 21 + }, + "end": { + "line": 6, + "column": 38 + } + }, + "range": [ + 83, + 100 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 21 + }, + "end": { + "line": 6, + "column": 30 + } + }, + "range": [ + 83, + 92 + ], + "name": "fromParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 33 + }, + "end": { + "line": 6, + "column": 38 + } + }, + "range": [ + 95, + 100 + ], + "name": "await" + } + } + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 6, + "column": 40 + }, + "end": { + "line": 8, + "column": 5 + } + }, + "range": [ + 102, + 133 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 23 + } + }, + "range": [ + 110, + 127 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 22 + } + }, + "range": [ + 110, + 126 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 14 + } + }, + "range": [ + 110, + 118 + ], + "name": "fromBody" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 17 + }, + "end": { + "line": 7, + "column": 22 + } + }, + "range": [ + 121, + 126 + ], + "name": "await" + } + } + } + ] + } + }, + "arguments": [], + "optional": false + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 8, + "column": 13 + } + }, + "range": [ + 137, + 141 + ], + "name": "next" + }, + "computed": false, + "optional": false + }, + "arguments": [], + "optional": false + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 49 + } + }, + "range": [ + 151, + 200 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 48 + } + }, + "range": [ + 151, + 199 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 16 + } + }, + "range": [ + 151, + 167 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 6 + } + }, + "range": [ + 151, + 157 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 7 + }, + "end": { + "line": 11, + "column": 16 + } + }, + "range": [ + 158, + 167 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 17 + }, + "end": { + "line": 11, + "column": 26 + } + }, + "range": [ + 168, + 177 + ], + "name": "fromParam" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 11, + "column": 28 + }, + "end": { + "line": 11, + "column": 29 + } + }, + "range": [ + 179, + 180 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 11, + "column": 31 + }, + "end": { + "line": 11, + "column": 47 + } + }, + "range": [ + 182, + 198 + ], + "value": "from parameter", + "raw": "'from parameter'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 43 + } + }, + "range": [ + 201, + 244 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 42 + } + }, + "range": [ + 201, + 243 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 16 + } + }, + "range": [ + 201, + 217 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 6 + } + }, + "range": [ + 201, + 207 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 16 + } + }, + "range": [ + 208, + 217 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 17 + }, + "end": { + "line": 12, + "column": 25 + } + }, + "range": [ + 218, + 226 + ], + "name": "fromBody" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 12, + "column": 27 + }, + "end": { + "line": 12, + "column": 28 + } + }, + "range": [ + 228, + 229 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 12, + "column": 30 + }, + "end": { + "line": 12, + "column": 41 + } + }, + "range": [ + 231, + 242 + ], + "value": "from body", + "raw": "'from body'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "range": [ + 1, + 4 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 5, + 10 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "range": [ + 11, + 12 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "range": [ + 13, + 14 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "range": [ + 14, + 15 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "range": [ + 16, + 19 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 20, + 29 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "range": [ + 29, + 30 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 23 + } + }, + "range": [ + 31, + 39 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 23 + }, + "end": { + "line": 3, + "column": 24 + } + }, + "range": [ + 39, + 40 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 41, + 46 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 47, + 48 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 8 + } + }, + "range": [ + 53, + 59 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 60, + 61 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 66, + 67 + ] + }, + { + "type": "Keyword", + "value": "function", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 13 + } + }, + "range": [ + 67, + 75 + ] + }, + { + "type": "Punctuator", + "value": "*", + "loc": { + "start": { + "line": 6, + "column": 14 + }, + "end": { + "line": 6, + "column": 15 + } + }, + "range": [ + 76, + 77 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 16 + }, + "end": { + "line": 6, + "column": 17 + } + }, + "range": [ + 78, + 79 + ] + }, + { + "type": "Identifier", + "value": "x", + "loc": { + "start": { + "line": 6, + "column": 17 + }, + "end": { + "line": 6, + "column": 18 + } + }, + "range": [ + 79, + 80 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 6, + "column": 19 + }, + "end": { + "line": 6, + "column": 20 + } + }, + "range": [ + 81, + 82 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 6, + "column": 21 + }, + "end": { + "line": 6, + "column": 30 + } + }, + "range": [ + 83, + 92 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 6, + "column": 31 + }, + "end": { + "line": 6, + "column": 32 + } + }, + "range": [ + 93, + 94 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 6, + "column": 33 + }, + "end": { + "line": 6, + "column": 38 + } + }, + "range": [ + 95, + 100 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 38 + }, + "end": { + "line": 6, + "column": 39 + } + }, + "range": [ + 100, + 101 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 40 + }, + "end": { + "line": 6, + "column": 41 + } + }, + "range": [ + 102, + 103 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 14 + } + }, + "range": [ + 110, + 118 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 7, + "column": 15 + }, + "end": { + "line": 7, + "column": 16 + } + }, + "range": [ + 119, + 120 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 7, + "column": 17 + }, + "end": { + "line": 7, + "column": 22 + } + }, + "range": [ + 121, + 126 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 7, + "column": 22 + }, + "end": { + "line": 7, + "column": 23 + } + }, + "range": [ + 126, + 127 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 5 + } + }, + "range": [ + 132, + 133 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 8, + "column": 5 + }, + "end": { + "line": 8, + "column": 6 + } + }, + "range": [ + 133, + 134 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 8, + "column": 6 + }, + "end": { + "line": 8, + "column": 7 + } + }, + "range": [ + 134, + 135 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 8, + "column": 7 + }, + "end": { + "line": 8, + "column": 8 + } + }, + "range": [ + 135, + 136 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 9 + } + }, + "range": [ + 136, + 137 + ] + }, + { + "type": "Identifier", + "value": "next", + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 8, + "column": 13 + } + }, + "range": [ + 137, + 141 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 8, + "column": 13 + }, + "end": { + "line": 8, + "column": 14 + } + }, + "range": [ + 141, + 142 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 8, + "column": 14 + }, + "end": { + "line": 8, + "column": 15 + } + }, + "range": [ + 142, + 143 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 8, + "column": 15 + }, + "end": { + "line": 8, + "column": 16 + } + }, + "range": [ + 143, + 144 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 9, + "column": 3 + } + }, + "range": [ + 147, + 148 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 10, + "column": 0 + }, + "end": { + "line": 10, + "column": 1 + } + }, + "range": [ + 149, + 150 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 6 + } + }, + "range": [ + 151, + 157 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 7 + } + }, + "range": [ + 157, + 158 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 11, + "column": 7 + }, + "end": { + "line": 11, + "column": 16 + } + }, + "range": [ + 158, + 167 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 11, + "column": 16 + }, + "end": { + "line": 11, + "column": 17 + } + }, + "range": [ + 167, + 168 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 11, + "column": 17 + }, + "end": { + "line": 11, + "column": 26 + } + }, + "range": [ + 168, + 177 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 11, + "column": 26 + }, + "end": { + "line": 11, + "column": 27 + } + }, + "range": [ + 177, + 178 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 11, + "column": 28 + }, + "end": { + "line": 11, + "column": 29 + } + }, + "range": [ + 179, + 180 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 11, + "column": 29 + }, + "end": { + "line": 11, + "column": 30 + } + }, + "range": [ + 180, + 181 + ] + }, + { + "type": "String", + "value": "'from parameter'", + "loc": { + "start": { + "line": 11, + "column": 31 + }, + "end": { + "line": 11, + "column": 47 + } + }, + "range": [ + 182, + 198 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 11, + "column": 47 + }, + "end": { + "line": 11, + "column": 48 + } + }, + "range": [ + 198, + 199 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 11, + "column": 48 + }, + "end": { + "line": 11, + "column": 49 + } + }, + "range": [ + 199, + 200 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 6 + } + }, + "range": [ + 201, + 207 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 12, + "column": 6 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "range": [ + 207, + 208 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 16 + } + }, + "range": [ + 208, + 217 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 12, + "column": 16 + }, + "end": { + "line": 12, + "column": 17 + } + }, + "range": [ + 217, + 218 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 12, + "column": 17 + }, + "end": { + "line": 12, + "column": 25 + } + }, + "range": [ + 218, + 226 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 12, + "column": 25 + }, + "end": { + "line": 12, + "column": 26 + } + }, + "range": [ + 226, + 227 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 12, + "column": 27 + }, + "end": { + "line": 12, + "column": 28 + } + }, + "range": [ + 228, + 229 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 12, + "column": 28 + }, + "end": { + "line": 12, + "column": 29 + } + }, + "range": [ + 229, + 230 + ] + }, + { + "type": "String", + "value": "'from body'", + "loc": { + "start": { + "line": 12, + "column": 30 + }, + "end": { + "line": 12, + "column": 41 + } + }, + "range": [ + 231, + 242 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 12, + "column": 41 + }, + "end": { + "line": 12, + "column": 42 + } + }, + "range": [ + 242, + 243 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 12, + "column": 42 + }, + "end": { + "line": 12, + "column": 43 + } + }, + "range": [ + 243, + 244 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-generators-static-init-await-reference.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-generators-static-init-await-reference.src.js new file mode 100644 index 00000000..74fd2ac2 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-generators-static-init-await-reference.src.js @@ -0,0 +1,12 @@ + +var await = 0; +var fromParam, fromBody; +class C { + static { + (function * (x = fromParam = await) { + fromBody = await; + })().next(); + } +} +assert.sameValue(fromParam, 0, 'from parameter'); +assert.sameValue(fromBody, 0, 'from body'); diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-ident-name-prop-name-literal-await-static-init.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-ident-name-prop-name-literal-await-static-init.result.js new file mode 100644 index 00000000..6100325e --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-ident-name-prop-name-literal-await-static-init.result.js @@ -0,0 +1,460 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 1, + 47 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 1, + 47 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 7, + 8 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 9, + 47 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 13, + 45 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 19 + } + }, + "range": [ + 26, + 41 + ], + "expression": { + "type": "ObjectExpression", + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 17 + } + }, + "range": [ + 27, + 39 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 4, + "column": 7 + }, + "end": { + "line": 4, + "column": 15 + } + }, + "range": [ + 29, + 37 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 7 + }, + "end": { + "line": 4, + "column": 12 + } + }, + "range": [ + 29, + 34 + ], + "name": "await" + }, + "value": { + "type": "Literal", + "loc": { + "start": { + "line": 4, + "column": 14 + }, + "end": { + "line": 4, + "column": 15 + } + }, + "range": [ + 36, + 37 + ], + "value": 0, + "raw": "0" + }, + "kind": "init" + } + ] + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "range": [ + 1, + 6 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 7, + 8 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 9, + 10 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "range": [ + 13, + 19 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 20, + 21 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 26, + 27 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 6 + } + }, + "range": [ + 27, + 28 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 4, + "column": 7 + }, + "end": { + "line": 4, + "column": 12 + } + }, + "range": [ + 29, + 34 + ] + }, + { + "type": "Punctuator", + "value": ":", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 34, + 35 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 4, + "column": 14 + }, + "end": { + "line": 4, + "column": 15 + } + }, + "range": [ + 36, + 37 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 4, + "column": 16 + }, + "end": { + "line": 4, + "column": 17 + } + }, + "range": [ + 38, + 39 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 17 + }, + "end": { + "line": 4, + "column": 18 + } + }, + "range": [ + 39, + 40 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 18 + }, + "end": { + "line": 4, + "column": 19 + } + }, + "range": [ + 40, + 41 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 44, + 45 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 46, + 47 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-ident-name-prop-name-literal-await-static-init.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-ident-name-prop-name-literal-await-static-init.src.js new file mode 100644 index 00000000..c348b0a9 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-ident-name-prop-name-literal-await-static-init.src.js @@ -0,0 +1,6 @@ + +class C { + static { + ({ await: 0 }); + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-identifier-shorthand-static-init-await-invalid.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-identifier-shorthand-static-init-await-invalid.result.js new file mode 100644 index 00000000..0b415c9e --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-identifier-shorthand-static-init-await-invalid.result.js @@ -0,0 +1,6 @@ +export default { + "index": 29, + "lineNumber": 4, + "column": 8, + "message": "Cannot use await in class static initialization block" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-identifier-shorthand-static-init-await-invalid.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-identifier-shorthand-static-init-await-invalid.src.js new file mode 100644 index 00000000..9cdf6bab --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-identifier-shorthand-static-init-await-invalid.src.js @@ -0,0 +1,6 @@ + +class C { + static { + ({ await }); + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-identifier-shorthand-static-init-await-valid.module-result.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-identifier-shorthand-static-init-await-valid.module-result.js new file mode 100644 index 00000000..6ad2695d --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-identifier-shorthand-static-init-await-valid.module-result.js @@ -0,0 +1,6 @@ +export default { + "index": 36, + "lineNumber": 4, + "column": 15, + "message": "Cannot use keyword 'await' outside an async function" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-identifier-shorthand-static-init-await-valid.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-identifier-shorthand-static-init-await-valid.result.js new file mode 100644 index 00000000..8b6d63a6 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-identifier-shorthand-static-init-await-valid.result.js @@ -0,0 +1,535 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 1, + 52 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 1, + 52 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 7, + 8 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 9, + 52 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 13, + 50 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 24 + } + }, + "range": [ + 26, + 46 + ], + "expression": { + "type": "ArrowFunctionExpression", + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 22 + } + }, + "range": [ + 27, + 44 + ], + "id": null, + "expression": true, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "ObjectExpression", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 21 + } + }, + "range": [ + 34, + 43 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 4, + "column": 14 + }, + "end": { + "line": 4, + "column": 19 + } + }, + "range": [ + 36, + 41 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 14 + }, + "end": { + "line": 4, + "column": 19 + } + }, + "range": [ + 36, + 41 + ], + "name": "await" + }, + "kind": "init", + "value": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 14 + }, + "end": { + "line": 4, + "column": 19 + } + }, + "range": [ + 36, + 41 + ], + "name": "await" + } + } + ] + } + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "range": [ + 1, + 6 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 7, + 8 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 9, + 10 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "range": [ + 13, + 19 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 20, + 21 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 26, + 27 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 6 + } + }, + "range": [ + 27, + 28 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 28, + 29 + ] + }, + { + "type": "Punctuator", + "value": "=>", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 30, + 32 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 11 + }, + "end": { + "line": 4, + "column": 12 + } + }, + "range": [ + 33, + 34 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 34, + 35 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 4, + "column": 14 + }, + "end": { + "line": 4, + "column": 19 + } + }, + "range": [ + 36, + 41 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 4, + "column": 20 + }, + "end": { + "line": 4, + "column": 21 + } + }, + "range": [ + 42, + 43 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 21 + }, + "end": { + "line": 4, + "column": 22 + } + }, + "range": [ + 43, + 44 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 22 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 44, + 45 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 23 + }, + "end": { + "line": 4, + "column": 24 + } + }, + "range": [ + 45, + 46 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 51, + 52 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-identifier-shorthand-static-init-await-valid.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-identifier-shorthand-static-init-await-valid.src.js new file mode 100644 index 00000000..9df062cc --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-identifier-shorthand-static-init-await-valid.src.js @@ -0,0 +1,6 @@ + +class C { + static { + (() => ({ await })); + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-binding-accessor.module-result.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-binding-accessor.module-result.js new file mode 100644 index 00000000..416c950a --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-binding-accessor.module-result.js @@ -0,0 +1,6 @@ +export default { + "index": 41, + "lineNumber": 4, + "column": 20, + "message": "Cannot use keyword 'await' outside an async function" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-binding-accessor.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-binding-accessor.result.js new file mode 100644 index 00000000..501f23ec --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-binding-accessor.result.js @@ -0,0 +1,572 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 1, + 59 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 1, + 59 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 7, + 8 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 9, + 59 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 13, + 57 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 31 + } + }, + "range": [ + 26, + 53 + ], + "expression": { + "type": "ObjectExpression", + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 29 + } + }, + "range": [ + 27, + 51 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 28 + } + }, + "range": [ + 28, + 50 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 10 + }, + "end": { + "line": 4, + "column": 18 + } + }, + "range": [ + 32, + 40 + ], + "name": "accessor" + }, + "kind": "set", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 4, + "column": 18 + }, + "end": { + "line": 4, + "column": 28 + } + }, + "range": [ + 40, + 50 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 19 + }, + "end": { + "line": 4, + "column": 24 + } + }, + "range": [ + 41, + 46 + ], + "name": "await" + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 4, + "column": 26 + }, + "end": { + "line": 4, + "column": 28 + } + }, + "range": [ + 48, + 50 + ], + "body": [] + } + } + } + ] + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "range": [ + 1, + 6 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 7, + 8 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 9, + 10 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "range": [ + 13, + 19 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 20, + 21 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 26, + 27 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 6 + } + }, + "range": [ + 27, + 28 + ] + }, + { + "type": "Identifier", + "value": "set", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 28, + 31 + ] + }, + { + "type": "Identifier", + "value": "accessor", + "loc": { + "start": { + "line": 4, + "column": 10 + }, + "end": { + "line": 4, + "column": 18 + } + }, + "range": [ + 32, + 40 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 18 + }, + "end": { + "line": 4, + "column": 19 + } + }, + "range": [ + 40, + 41 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 4, + "column": 19 + }, + "end": { + "line": 4, + "column": 24 + } + }, + "range": [ + 41, + 46 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 24 + }, + "end": { + "line": 4, + "column": 25 + } + }, + "range": [ + 46, + 47 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 26 + }, + "end": { + "line": 4, + "column": 27 + } + }, + "range": [ + 48, + 49 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 4, + "column": 27 + }, + "end": { + "line": 4, + "column": 28 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 4, + "column": 28 + }, + "end": { + "line": 4, + "column": 29 + } + }, + "range": [ + 50, + 51 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 29 + }, + "end": { + "line": 4, + "column": 30 + } + }, + "range": [ + 51, + 52 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 30 + }, + "end": { + "line": 4, + "column": 31 + } + }, + "range": [ + 52, + 53 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 56, + 57 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 58, + 59 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-binding-accessor.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-binding-accessor.src.js new file mode 100644 index 00000000..ecc53e5a --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-binding-accessor.src.js @@ -0,0 +1,6 @@ + +class C { + static { + ({set accessor(await) {}}); + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-binding-generator.module-result.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-binding-generator.module-result.js new file mode 100644 index 00000000..6ad2695d --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-binding-generator.module-result.js @@ -0,0 +1,6 @@ +export default { + "index": 36, + "lineNumber": 4, + "column": 15, + "message": "Cannot use keyword 'await' outside an async function" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-binding-generator.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-binding-generator.result.js new file mode 100644 index 00000000..baa5cb90 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-binding-generator.result.js @@ -0,0 +1,572 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 1, + 54 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 1, + 54 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 7, + 8 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 9, + 54 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 13, + 52 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 26 + } + }, + "range": [ + 26, + 48 + ], + "expression": { + "type": "ObjectExpression", + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 24 + } + }, + "range": [ + 27, + 46 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 28, + 45 + ], + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 7 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 29, + 35 + ], + "name": "method" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 35, + 45 + ], + "id": null, + "expression": false, + "generator": true, + "async": false, + "params": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 14 + }, + "end": { + "line": 4, + "column": 19 + } + }, + "range": [ + 36, + 41 + ], + "name": "await" + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 4, + "column": 21 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 43, + 45 + ], + "body": [] + } + } + } + ] + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "range": [ + 1, + 6 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 7, + 8 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 9, + 10 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "range": [ + 13, + 19 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 20, + 21 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 26, + 27 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 6 + } + }, + "range": [ + 27, + 28 + ] + }, + { + "type": "Punctuator", + "value": "*", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 28, + 29 + ] + }, + { + "type": "Identifier", + "value": "method", + "loc": { + "start": { + "line": 4, + "column": 7 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 29, + 35 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 14 + } + }, + "range": [ + 35, + 36 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 4, + "column": 14 + }, + "end": { + "line": 4, + "column": 19 + } + }, + "range": [ + 36, + 41 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 19 + }, + "end": { + "line": 4, + "column": 20 + } + }, + "range": [ + 41, + 42 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 21 + }, + "end": { + "line": 4, + "column": 22 + } + }, + "range": [ + 43, + 44 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 4, + "column": 22 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 44, + 45 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 4, + "column": 23 + }, + "end": { + "line": 4, + "column": 24 + } + }, + "range": [ + 45, + 46 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 24 + }, + "end": { + "line": 4, + "column": 25 + } + }, + "range": [ + 46, + 47 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 25 + }, + "end": { + "line": 4, + "column": 26 + } + }, + "range": [ + 47, + 48 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 51, + 52 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 53, + 54 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-binding-generator.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-binding-generator.src.js new file mode 100644 index 00000000..179c2bb9 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-binding-generator.src.js @@ -0,0 +1,6 @@ + +class C { + static { + ({*method(await) {}}); + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-binding-normal.module-result.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-binding-normal.module-result.js new file mode 100644 index 00000000..b18f12a8 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-binding-normal.module-result.js @@ -0,0 +1,6 @@ +export default { + "index": 35, + "lineNumber": 4, + "column": 14, + "message": "Cannot use keyword 'await' outside an async function" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-binding-normal.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-binding-normal.result.js new file mode 100644 index 00000000..88c2b453 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-binding-normal.result.js @@ -0,0 +1,554 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 1, + 53 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 1, + 53 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 7, + 8 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 9, + 53 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 13, + 51 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 25 + } + }, + "range": [ + 26, + 47 + ], + "expression": { + "type": "ObjectExpression", + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 27, + 45 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 22 + } + }, + "range": [ + 28, + 44 + ], + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 12 + } + }, + "range": [ + 28, + 34 + ], + "name": "method" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 22 + } + }, + "range": [ + 34, + 44 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 18 + } + }, + "range": [ + 35, + 40 + ], + "name": "await" + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 4, + "column": 20 + }, + "end": { + "line": 4, + "column": 22 + } + }, + "range": [ + 42, + 44 + ], + "body": [] + } + } + } + ] + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "range": [ + 1, + 6 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 7, + 8 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 9, + 10 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "range": [ + 13, + 19 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 20, + 21 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 26, + 27 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 6 + } + }, + "range": [ + 27, + 28 + ] + }, + { + "type": "Identifier", + "value": "method", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 12 + } + }, + "range": [ + 28, + 34 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 34, + 35 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 18 + } + }, + "range": [ + 35, + 40 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 18 + }, + "end": { + "line": 4, + "column": 19 + } + }, + "range": [ + 40, + 41 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 20 + }, + "end": { + "line": 4, + "column": 21 + } + }, + "range": [ + 42, + 43 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 4, + "column": 21 + }, + "end": { + "line": 4, + "column": 22 + } + }, + "range": [ + 43, + 44 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 4, + "column": 22 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 44, + 45 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 23 + }, + "end": { + "line": 4, + "column": 24 + } + }, + "range": [ + 45, + 46 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 24 + }, + "end": { + "line": 4, + "column": 25 + } + }, + "range": [ + 46, + 47 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 50, + 51 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 52, + 53 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-binding-normal.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-binding-normal.src.js new file mode 100644 index 00000000..6c155af1 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-binding-normal.src.js @@ -0,0 +1,6 @@ + +class C { + static { + ({method(await) {}}); + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-reference-accessor.module-result.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-reference-accessor.module-result.js new file mode 100644 index 00000000..8db53b99 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-reference-accessor.module-result.js @@ -0,0 +1,6 @@ +export default { + "index": 5, + "lineNumber": 2, + "column": 5, + "message": "Cannot use keyword 'await' outside an async function" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-reference-accessor.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-reference-accessor.result.js new file mode 100644 index 00000000..d00796a4 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-reference-accessor.result.js @@ -0,0 +1,2042 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 14, + "column": 43 + } + }, + "range": [ + 1, + 275 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "range": [ + 1, + 15 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "range": [ + 5, + 14 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 5, + 10 + ], + "name": "await" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "range": [ + 13, + 14 + ], + "value": 0, + "raw": "0" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 24 + } + }, + "range": [ + 16, + 40 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 20, + 29 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 20, + 29 + ], + "name": "fromParam" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 23 + } + }, + "range": [ + 31, + 39 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 23 + } + }, + "range": [ + 31, + 39 + ], + "name": "fromBody" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 12, + "column": 1 + } + }, + "range": [ + 41, + 181 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 47, + 48 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 12, + "column": 1 + } + }, + "range": [ + 49, + 181 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 11, + "column": 3 + } + }, + "range": [ + 53, + 179 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 10, + "column": 28 + } + }, + "range": [ + 66, + 175 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 10, + "column": 27 + } + }, + "range": [ + 66, + 174 + ], + "operator": "=", + "left": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 10, + "column": 15 + } + }, + "range": [ + 66, + 162 + ], + "object": { + "type": "ObjectExpression", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 10, + "column": 5 + } + }, + "range": [ + 67, + 152 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 9, + "column": 7 + } + }, + "range": [ + 75, + 146 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 10 + }, + "end": { + "line": 7, + "column": 18 + } + }, + "range": [ + 79, + 87 + ], + "name": "accessor" + }, + "kind": "set", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 7, + "column": 18 + }, + "end": { + "line": 9, + "column": 7 + } + }, + "range": [ + 87, + 146 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 7, + "column": 19 + }, + "end": { + "line": 7, + "column": 40 + } + }, + "range": [ + 88, + 109 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 19 + }, + "end": { + "line": 7, + "column": 20 + } + }, + "range": [ + 88, + 89 + ], + "name": "x" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 7, + "column": 23 + }, + "end": { + "line": 7, + "column": 40 + } + }, + "range": [ + 92, + 109 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 23 + }, + "end": { + "line": 7, + "column": 32 + } + }, + "range": [ + 92, + 101 + ], + "name": "fromParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 35 + }, + "end": { + "line": 7, + "column": 40 + } + }, + "range": [ + 104, + 109 + ], + "name": "await" + } + } + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 7, + "column": 42 + }, + "end": { + "line": 9, + "column": 7 + } + }, + "range": [ + 111, + 146 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 25 + } + }, + "range": [ + 121, + 138 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 24 + } + }, + "range": [ + 121, + 137 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 16 + } + }, + "range": [ + 121, + 129 + ], + "name": "fromBody" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 19 + }, + "end": { + "line": 8, + "column": 24 + } + }, + "range": [ + 132, + 137 + ], + "name": "await" + } + } + } + ] + } + } + } + ] + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 7 + }, + "end": { + "line": 10, + "column": 15 + } + }, + "range": [ + 154, + 162 + ], + "name": "accessor" + }, + "computed": false, + "optional": false + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 27 + } + }, + "range": [ + 165, + 174 + ], + "name": "undefined" + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 49 + } + }, + "range": [ + 182, + 231 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 48 + } + }, + "range": [ + 182, + 230 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 16 + } + }, + "range": [ + 182, + 198 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 6 + } + }, + "range": [ + 182, + 188 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 7 + }, + "end": { + "line": 13, + "column": 16 + } + }, + "range": [ + 189, + 198 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 17 + }, + "end": { + "line": 13, + "column": 26 + } + }, + "range": [ + 199, + 208 + ], + "name": "fromParam" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 13, + "column": 28 + }, + "end": { + "line": 13, + "column": 29 + } + }, + "range": [ + 210, + 211 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 13, + "column": 31 + }, + "end": { + "line": 13, + "column": 47 + } + }, + "range": [ + 213, + 229 + ], + "value": "from parameter", + "raw": "'from parameter'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 43 + } + }, + "range": [ + 232, + 275 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 42 + } + }, + "range": [ + 232, + 274 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 16 + } + }, + "range": [ + 232, + 248 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 6 + } + }, + "range": [ + 232, + 238 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 7 + }, + "end": { + "line": 14, + "column": 16 + } + }, + "range": [ + 239, + 248 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 17 + }, + "end": { + "line": 14, + "column": 25 + } + }, + "range": [ + 249, + 257 + ], + "name": "fromBody" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 14, + "column": 27 + }, + "end": { + "line": 14, + "column": 28 + } + }, + "range": [ + 259, + 260 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 14, + "column": 30 + }, + "end": { + "line": 14, + "column": 41 + } + }, + "range": [ + 262, + 273 + ], + "value": "from body", + "raw": "'from body'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "range": [ + 1, + 4 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 5, + 10 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "range": [ + 11, + 12 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "range": [ + 13, + 14 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "range": [ + 14, + 15 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "range": [ + 16, + 19 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 20, + 29 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "range": [ + 29, + 30 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 23 + } + }, + "range": [ + 31, + 39 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 23 + }, + "end": { + "line": 3, + "column": 24 + } + }, + "range": [ + 39, + 40 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 41, + 46 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 47, + 48 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 8 + } + }, + "range": [ + 53, + 59 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 60, + 61 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 66, + 67 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 6 + } + }, + "range": [ + 67, + 68 + ] + }, + { + "type": "Identifier", + "value": "set", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 9 + } + }, + "range": [ + 75, + 78 + ] + }, + { + "type": "Identifier", + "value": "accessor", + "loc": { + "start": { + "line": 7, + "column": 10 + }, + "end": { + "line": 7, + "column": 18 + } + }, + "range": [ + 79, + 87 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 7, + "column": 18 + }, + "end": { + "line": 7, + "column": 19 + } + }, + "range": [ + 87, + 88 + ] + }, + { + "type": "Identifier", + "value": "x", + "loc": { + "start": { + "line": 7, + "column": 19 + }, + "end": { + "line": 7, + "column": 20 + } + }, + "range": [ + 88, + 89 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 7, + "column": 21 + }, + "end": { + "line": 7, + "column": 22 + } + }, + "range": [ + 90, + 91 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 7, + "column": 23 + }, + "end": { + "line": 7, + "column": 32 + } + }, + "range": [ + 92, + 101 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 7, + "column": 33 + }, + "end": { + "line": 7, + "column": 34 + } + }, + "range": [ + 102, + 103 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 7, + "column": 35 + }, + "end": { + "line": 7, + "column": 40 + } + }, + "range": [ + 104, + 109 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 7, + "column": 40 + }, + "end": { + "line": 7, + "column": 41 + } + }, + "range": [ + 109, + 110 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 42 + }, + "end": { + "line": 7, + "column": 43 + } + }, + "range": [ + 111, + 112 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 16 + } + }, + "range": [ + 121, + 129 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 8, + "column": 17 + }, + "end": { + "line": 8, + "column": 18 + } + }, + "range": [ + 130, + 131 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 8, + "column": 19 + }, + "end": { + "line": 8, + "column": 24 + } + }, + "range": [ + 132, + 137 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 8, + "column": 24 + }, + "end": { + "line": 8, + "column": 25 + } + }, + "range": [ + 137, + 138 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 9, + "column": 6 + }, + "end": { + "line": 9, + "column": 7 + } + }, + "range": [ + 145, + 146 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 5 + } + }, + "range": [ + 151, + 152 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 10, + "column": 5 + }, + "end": { + "line": 10, + "column": 6 + } + }, + "range": [ + 152, + 153 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 7 + } + }, + "range": [ + 153, + 154 + ] + }, + { + "type": "Identifier", + "value": "accessor", + "loc": { + "start": { + "line": 10, + "column": 7 + }, + "end": { + "line": 10, + "column": 15 + } + }, + "range": [ + 154, + 162 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 10, + "column": 16 + }, + "end": { + "line": 10, + "column": 17 + } + }, + "range": [ + 163, + 164 + ] + }, + { + "type": "Identifier", + "value": "undefined", + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 27 + } + }, + "range": [ + 165, + 174 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 10, + "column": 27 + }, + "end": { + "line": 10, + "column": 28 + } + }, + "range": [ + 174, + 175 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 3 + } + }, + "range": [ + 178, + 179 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 1 + } + }, + "range": [ + 180, + 181 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 6 + } + }, + "range": [ + 182, + 188 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 13, + "column": 6 + }, + "end": { + "line": 13, + "column": 7 + } + }, + "range": [ + 188, + 189 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 13, + "column": 7 + }, + "end": { + "line": 13, + "column": 16 + } + }, + "range": [ + 189, + 198 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 13, + "column": 16 + }, + "end": { + "line": 13, + "column": 17 + } + }, + "range": [ + 198, + 199 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 13, + "column": 17 + }, + "end": { + "line": 13, + "column": 26 + } + }, + "range": [ + 199, + 208 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 13, + "column": 26 + }, + "end": { + "line": 13, + "column": 27 + } + }, + "range": [ + 208, + 209 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 13, + "column": 28 + }, + "end": { + "line": 13, + "column": 29 + } + }, + "range": [ + 210, + 211 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 13, + "column": 29 + }, + "end": { + "line": 13, + "column": 30 + } + }, + "range": [ + 211, + 212 + ] + }, + { + "type": "String", + "value": "'from parameter'", + "loc": { + "start": { + "line": 13, + "column": 31 + }, + "end": { + "line": 13, + "column": 47 + } + }, + "range": [ + 213, + 229 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 13, + "column": 47 + }, + "end": { + "line": 13, + "column": 48 + } + }, + "range": [ + 229, + 230 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 13, + "column": 48 + }, + "end": { + "line": 13, + "column": 49 + } + }, + "range": [ + 230, + 231 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 6 + } + }, + "range": [ + 232, + 238 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 7 + } + }, + "range": [ + 238, + 239 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 14, + "column": 7 + }, + "end": { + "line": 14, + "column": 16 + } + }, + "range": [ + 239, + 248 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 14, + "column": 16 + }, + "end": { + "line": 14, + "column": 17 + } + }, + "range": [ + 248, + 249 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 14, + "column": 17 + }, + "end": { + "line": 14, + "column": 25 + } + }, + "range": [ + 249, + 257 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 14, + "column": 25 + }, + "end": { + "line": 14, + "column": 26 + } + }, + "range": [ + 257, + 258 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 14, + "column": 27 + }, + "end": { + "line": 14, + "column": 28 + } + }, + "range": [ + 259, + 260 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 14, + "column": 28 + }, + "end": { + "line": 14, + "column": 29 + } + }, + "range": [ + 260, + 261 + ] + }, + { + "type": "String", + "value": "'from body'", + "loc": { + "start": { + "line": 14, + "column": 30 + }, + "end": { + "line": 14, + "column": 41 + } + }, + "range": [ + 262, + 273 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 14, + "column": 41 + }, + "end": { + "line": 14, + "column": 42 + } + }, + "range": [ + 273, + 274 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 14, + "column": 42 + }, + "end": { + "line": 14, + "column": 43 + } + }, + "range": [ + 274, + 275 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-reference-accessor.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-reference-accessor.src.js new file mode 100644 index 00000000..357186a5 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-reference-accessor.src.js @@ -0,0 +1,14 @@ + +var await = 0; +var fromParam, fromBody; +class C { + static { + ({ + set accessor(x = fromParam = await) { + fromBody = await; + } + }).accessor = undefined; + } +} +assert.sameValue(fromParam, 0, 'from parameter'); +assert.sameValue(fromBody, 0, 'from body'); diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-reference-generator.module-result.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-reference-generator.module-result.js new file mode 100644 index 00000000..8db53b99 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-reference-generator.module-result.js @@ -0,0 +1,6 @@ +export default { + "index": 5, + "lineNumber": 2, + "column": 5, + "message": "Cannot use keyword 'await' outside an async function" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-reference-generator.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-reference-generator.result.js new file mode 100644 index 00000000..f7c49e37 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-reference-generator.result.js @@ -0,0 +1,2153 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 14, + "column": 43 + } + }, + "range": [ + 1, + 265 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "range": [ + 1, + 15 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "range": [ + 5, + 14 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 5, + 10 + ], + "name": "await" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "range": [ + 13, + 14 + ], + "value": 0, + "raw": "0" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 24 + } + }, + "range": [ + 16, + 40 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 20, + 29 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 20, + 29 + ], + "name": "fromParam" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 23 + } + }, + "range": [ + 31, + 39 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 23 + } + }, + "range": [ + 31, + 39 + ], + "name": "fromBody" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 12, + "column": 1 + } + }, + "range": [ + 41, + 171 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 47, + 48 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 12, + "column": 1 + } + }, + "range": [ + 49, + 171 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 11, + "column": 3 + } + }, + "range": [ + 53, + 169 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 10, + "column": 23 + } + }, + "range": [ + 66, + 165 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 10, + "column": 22 + } + }, + "range": [ + 66, + 164 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 10, + "column": 20 + } + }, + "range": [ + 66, + 162 + ], + "object": { + "type": "CallExpression", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 10, + "column": 15 + } + }, + "range": [ + 66, + 157 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 10, + "column": 13 + } + }, + "range": [ + 66, + 155 + ], + "object": { + "type": "ObjectExpression", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 10, + "column": 5 + } + }, + "range": [ + 67, + 147 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 9, + "column": 7 + } + }, + "range": [ + 75, + 141 + ], + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 7 + }, + "end": { + "line": 7, + "column": 13 + } + }, + "range": [ + 76, + 82 + ], + "name": "method" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 7, + "column": 13 + }, + "end": { + "line": 9, + "column": 7 + } + }, + "range": [ + 82, + 141 + ], + "id": null, + "expression": false, + "generator": true, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 7, + "column": 14 + }, + "end": { + "line": 7, + "column": 35 + } + }, + "range": [ + 83, + 104 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 14 + }, + "end": { + "line": 7, + "column": 15 + } + }, + "range": [ + 83, + 84 + ], + "name": "x" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 7, + "column": 18 + }, + "end": { + "line": 7, + "column": 35 + } + }, + "range": [ + 87, + 104 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 18 + }, + "end": { + "line": 7, + "column": 27 + } + }, + "range": [ + 87, + 96 + ], + "name": "fromParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 30 + }, + "end": { + "line": 7, + "column": 35 + } + }, + "range": [ + 99, + 104 + ], + "name": "await" + } + } + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 7, + "column": 37 + }, + "end": { + "line": 9, + "column": 7 + } + }, + "range": [ + 106, + 141 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 25 + } + }, + "range": [ + 116, + 133 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 24 + } + }, + "range": [ + 116, + 132 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 16 + } + }, + "range": [ + 116, + 124 + ], + "name": "fromBody" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 19 + }, + "end": { + "line": 8, + "column": 24 + } + }, + "range": [ + 127, + 132 + ], + "name": "await" + } + } + } + ] + } + } + } + ] + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 7 + }, + "end": { + "line": 10, + "column": 13 + } + }, + "range": [ + 149, + 155 + ], + "name": "method" + }, + "computed": false, + "optional": false + }, + "arguments": [], + "optional": false + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 16 + }, + "end": { + "line": 10, + "column": 20 + } + }, + "range": [ + 158, + 162 + ], + "name": "next" + }, + "computed": false, + "optional": false + }, + "arguments": [], + "optional": false + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 49 + } + }, + "range": [ + 172, + 221 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 48 + } + }, + "range": [ + 172, + 220 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 16 + } + }, + "range": [ + 172, + 188 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 6 + } + }, + "range": [ + 172, + 178 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 7 + }, + "end": { + "line": 13, + "column": 16 + } + }, + "range": [ + 179, + 188 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 17 + }, + "end": { + "line": 13, + "column": 26 + } + }, + "range": [ + 189, + 198 + ], + "name": "fromParam" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 13, + "column": 28 + }, + "end": { + "line": 13, + "column": 29 + } + }, + "range": [ + 200, + 201 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 13, + "column": 31 + }, + "end": { + "line": 13, + "column": 47 + } + }, + "range": [ + 203, + 219 + ], + "value": "from parameter", + "raw": "'from parameter'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 43 + } + }, + "range": [ + 222, + 265 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 42 + } + }, + "range": [ + 222, + 264 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 16 + } + }, + "range": [ + 222, + 238 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 6 + } + }, + "range": [ + 222, + 228 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 7 + }, + "end": { + "line": 14, + "column": 16 + } + }, + "range": [ + 229, + 238 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 17 + }, + "end": { + "line": 14, + "column": 25 + } + }, + "range": [ + 239, + 247 + ], + "name": "fromBody" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 14, + "column": 27 + }, + "end": { + "line": 14, + "column": 28 + } + }, + "range": [ + 249, + 250 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 14, + "column": 30 + }, + "end": { + "line": 14, + "column": 41 + } + }, + "range": [ + 252, + 263 + ], + "value": "from body", + "raw": "'from body'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "range": [ + 1, + 4 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 5, + 10 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "range": [ + 11, + 12 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "range": [ + 13, + 14 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "range": [ + 14, + 15 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "range": [ + 16, + 19 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 20, + 29 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "range": [ + 29, + 30 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 23 + } + }, + "range": [ + 31, + 39 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 23 + }, + "end": { + "line": 3, + "column": 24 + } + }, + "range": [ + 39, + 40 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 41, + 46 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 47, + 48 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 8 + } + }, + "range": [ + 53, + 59 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 60, + 61 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 66, + 67 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 6 + } + }, + "range": [ + 67, + 68 + ] + }, + { + "type": "Punctuator", + "value": "*", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 7 + } + }, + "range": [ + 75, + 76 + ] + }, + { + "type": "Identifier", + "value": "method", + "loc": { + "start": { + "line": 7, + "column": 7 + }, + "end": { + "line": 7, + "column": 13 + } + }, + "range": [ + 76, + 82 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 7, + "column": 13 + }, + "end": { + "line": 7, + "column": 14 + } + }, + "range": [ + 82, + 83 + ] + }, + { + "type": "Identifier", + "value": "x", + "loc": { + "start": { + "line": 7, + "column": 14 + }, + "end": { + "line": 7, + "column": 15 + } + }, + "range": [ + 83, + 84 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 7, + "column": 16 + }, + "end": { + "line": 7, + "column": 17 + } + }, + "range": [ + 85, + 86 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 7, + "column": 18 + }, + "end": { + "line": 7, + "column": 27 + } + }, + "range": [ + 87, + 96 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 7, + "column": 28 + }, + "end": { + "line": 7, + "column": 29 + } + }, + "range": [ + 97, + 98 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 7, + "column": 30 + }, + "end": { + "line": 7, + "column": 35 + } + }, + "range": [ + 99, + 104 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 7, + "column": 35 + }, + "end": { + "line": 7, + "column": 36 + } + }, + "range": [ + 104, + 105 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 37 + }, + "end": { + "line": 7, + "column": 38 + } + }, + "range": [ + 106, + 107 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 16 + } + }, + "range": [ + 116, + 124 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 8, + "column": 17 + }, + "end": { + "line": 8, + "column": 18 + } + }, + "range": [ + 125, + 126 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 8, + "column": 19 + }, + "end": { + "line": 8, + "column": 24 + } + }, + "range": [ + 127, + 132 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 8, + "column": 24 + }, + "end": { + "line": 8, + "column": 25 + } + }, + "range": [ + 132, + 133 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 9, + "column": 6 + }, + "end": { + "line": 9, + "column": 7 + } + }, + "range": [ + 140, + 141 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 5 + } + }, + "range": [ + 146, + 147 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 10, + "column": 5 + }, + "end": { + "line": 10, + "column": 6 + } + }, + "range": [ + 147, + 148 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 7 + } + }, + "range": [ + 148, + 149 + ] + }, + { + "type": "Identifier", + "value": "method", + "loc": { + "start": { + "line": 10, + "column": 7 + }, + "end": { + "line": 10, + "column": 13 + } + }, + "range": [ + 149, + 155 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 10, + "column": 13 + }, + "end": { + "line": 10, + "column": 14 + } + }, + "range": [ + 155, + 156 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 10, + "column": 14 + }, + "end": { + "line": 10, + "column": 15 + } + }, + "range": [ + 156, + 157 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 10, + "column": 15 + }, + "end": { + "line": 10, + "column": 16 + } + }, + "range": [ + 157, + 158 + ] + }, + { + "type": "Identifier", + "value": "next", + "loc": { + "start": { + "line": 10, + "column": 16 + }, + "end": { + "line": 10, + "column": 20 + } + }, + "range": [ + 158, + 162 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 10, + "column": 20 + }, + "end": { + "line": 10, + "column": 21 + } + }, + "range": [ + 162, + 163 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 10, + "column": 21 + }, + "end": { + "line": 10, + "column": 22 + } + }, + "range": [ + 163, + 164 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 10, + "column": 22 + }, + "end": { + "line": 10, + "column": 23 + } + }, + "range": [ + 164, + 165 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 3 + } + }, + "range": [ + 168, + 169 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 1 + } + }, + "range": [ + 170, + 171 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 6 + } + }, + "range": [ + 172, + 178 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 13, + "column": 6 + }, + "end": { + "line": 13, + "column": 7 + } + }, + "range": [ + 178, + 179 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 13, + "column": 7 + }, + "end": { + "line": 13, + "column": 16 + } + }, + "range": [ + 179, + 188 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 13, + "column": 16 + }, + "end": { + "line": 13, + "column": 17 + } + }, + "range": [ + 188, + 189 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 13, + "column": 17 + }, + "end": { + "line": 13, + "column": 26 + } + }, + "range": [ + 189, + 198 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 13, + "column": 26 + }, + "end": { + "line": 13, + "column": 27 + } + }, + "range": [ + 198, + 199 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 13, + "column": 28 + }, + "end": { + "line": 13, + "column": 29 + } + }, + "range": [ + 200, + 201 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 13, + "column": 29 + }, + "end": { + "line": 13, + "column": 30 + } + }, + "range": [ + 201, + 202 + ] + }, + { + "type": "String", + "value": "'from parameter'", + "loc": { + "start": { + "line": 13, + "column": 31 + }, + "end": { + "line": 13, + "column": 47 + } + }, + "range": [ + 203, + 219 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 13, + "column": 47 + }, + "end": { + "line": 13, + "column": 48 + } + }, + "range": [ + 219, + 220 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 13, + "column": 48 + }, + "end": { + "line": 13, + "column": 49 + } + }, + "range": [ + 220, + 221 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 6 + } + }, + "range": [ + 222, + 228 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 7 + } + }, + "range": [ + 228, + 229 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 14, + "column": 7 + }, + "end": { + "line": 14, + "column": 16 + } + }, + "range": [ + 229, + 238 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 14, + "column": 16 + }, + "end": { + "line": 14, + "column": 17 + } + }, + "range": [ + 238, + 239 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 14, + "column": 17 + }, + "end": { + "line": 14, + "column": 25 + } + }, + "range": [ + 239, + 247 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 14, + "column": 25 + }, + "end": { + "line": 14, + "column": 26 + } + }, + "range": [ + 247, + 248 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 14, + "column": 27 + }, + "end": { + "line": 14, + "column": 28 + } + }, + "range": [ + 249, + 250 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 14, + "column": 28 + }, + "end": { + "line": 14, + "column": 29 + } + }, + "range": [ + 250, + 251 + ] + }, + { + "type": "String", + "value": "'from body'", + "loc": { + "start": { + "line": 14, + "column": 30 + }, + "end": { + "line": 14, + "column": 41 + } + }, + "range": [ + 252, + 263 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 14, + "column": 41 + }, + "end": { + "line": 14, + "column": 42 + } + }, + "range": [ + 263, + 264 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 14, + "column": 42 + }, + "end": { + "line": 14, + "column": 43 + } + }, + "range": [ + 264, + 265 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-reference-generator.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-reference-generator.src.js new file mode 100644 index 00000000..c59c0b96 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-reference-generator.src.js @@ -0,0 +1,14 @@ + +var await = 0; +var fromParam, fromBody; +class C { + static { + ({ + *method(x = fromParam = await) { + fromBody = await; + } + }).method().next(); + } +} +assert.sameValue(fromParam, 0, 'from parameter'); +assert.sameValue(fromBody, 0, 'from body'); diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-reference-normal.module-result.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-reference-normal.module-result.js new file mode 100644 index 00000000..8db53b99 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-reference-normal.module-result.js @@ -0,0 +1,6 @@ +export default { + "index": 5, + "lineNumber": 2, + "column": 5, + "message": "Cannot use keyword 'await' outside an async function" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-reference-normal.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-reference-normal.result.js new file mode 100644 index 00000000..62d1c59e --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-reference-normal.result.js @@ -0,0 +1,2007 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 14, + "column": 43 + } + }, + "range": [ + 1, + 257 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "range": [ + 1, + 15 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "range": [ + 5, + 14 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 5, + 10 + ], + "name": "await" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "range": [ + 13, + 14 + ], + "value": 0, + "raw": "0" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 24 + } + }, + "range": [ + 16, + 40 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 20, + 29 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 20, + 29 + ], + "name": "fromParam" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 23 + } + }, + "range": [ + 31, + 39 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 23 + } + }, + "range": [ + 31, + 39 + ], + "name": "fromBody" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 12, + "column": 1 + } + }, + "range": [ + 41, + 163 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 47, + 48 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 12, + "column": 1 + } + }, + "range": [ + 49, + 163 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 11, + "column": 3 + } + }, + "range": [ + 53, + 161 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 10, + "column": 16 + } + }, + "range": [ + 66, + 157 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 10, + "column": 15 + } + }, + "range": [ + 66, + 156 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 10, + "column": 13 + } + }, + "range": [ + 66, + 154 + ], + "object": { + "type": "ObjectExpression", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 10, + "column": 5 + } + }, + "range": [ + 67, + 146 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 9, + "column": 7 + } + }, + "range": [ + 75, + 140 + ], + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 12 + } + }, + "range": [ + 75, + 81 + ], + "name": "method" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 7, + "column": 12 + }, + "end": { + "line": 9, + "column": 7 + } + }, + "range": [ + 81, + 140 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 7, + "column": 13 + }, + "end": { + "line": 7, + "column": 34 + } + }, + "range": [ + 82, + 103 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 13 + }, + "end": { + "line": 7, + "column": 14 + } + }, + "range": [ + 82, + 83 + ], + "name": "x" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 7, + "column": 17 + }, + "end": { + "line": 7, + "column": 34 + } + }, + "range": [ + 86, + 103 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 17 + }, + "end": { + "line": 7, + "column": 26 + } + }, + "range": [ + 86, + 95 + ], + "name": "fromParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 29 + }, + "end": { + "line": 7, + "column": 34 + } + }, + "range": [ + 98, + 103 + ], + "name": "await" + } + } + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 7, + "column": 36 + }, + "end": { + "line": 9, + "column": 7 + } + }, + "range": [ + 105, + 140 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 25 + } + }, + "range": [ + 115, + 132 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 24 + } + }, + "range": [ + 115, + 131 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 16 + } + }, + "range": [ + 115, + 123 + ], + "name": "fromBody" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 19 + }, + "end": { + "line": 8, + "column": 24 + } + }, + "range": [ + 126, + 131 + ], + "name": "await" + } + } + } + ] + } + } + } + ] + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 7 + }, + "end": { + "line": 10, + "column": 13 + } + }, + "range": [ + 148, + 154 + ], + "name": "method" + }, + "computed": false, + "optional": false + }, + "arguments": [], + "optional": false + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 49 + } + }, + "range": [ + 164, + 213 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 48 + } + }, + "range": [ + 164, + 212 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 16 + } + }, + "range": [ + 164, + 180 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 6 + } + }, + "range": [ + 164, + 170 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 7 + }, + "end": { + "line": 13, + "column": 16 + } + }, + "range": [ + 171, + 180 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 17 + }, + "end": { + "line": 13, + "column": 26 + } + }, + "range": [ + 181, + 190 + ], + "name": "fromParam" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 13, + "column": 28 + }, + "end": { + "line": 13, + "column": 29 + } + }, + "range": [ + 192, + 193 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 13, + "column": 31 + }, + "end": { + "line": 13, + "column": 47 + } + }, + "range": [ + 195, + 211 + ], + "value": "from parameter", + "raw": "'from parameter'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 43 + } + }, + "range": [ + 214, + 257 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 42 + } + }, + "range": [ + 214, + 256 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 16 + } + }, + "range": [ + 214, + 230 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 6 + } + }, + "range": [ + 214, + 220 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 7 + }, + "end": { + "line": 14, + "column": 16 + } + }, + "range": [ + 221, + 230 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 17 + }, + "end": { + "line": 14, + "column": 25 + } + }, + "range": [ + 231, + 239 + ], + "name": "fromBody" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 14, + "column": 27 + }, + "end": { + "line": 14, + "column": 28 + } + }, + "range": [ + 241, + 242 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 14, + "column": 30 + }, + "end": { + "line": 14, + "column": 41 + } + }, + "range": [ + 244, + 255 + ], + "value": "from body", + "raw": "'from body'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "range": [ + 1, + 4 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 5, + 10 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "range": [ + 11, + 12 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "range": [ + 13, + 14 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "range": [ + 14, + 15 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "range": [ + 16, + 19 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 20, + 29 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "range": [ + 29, + 30 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 23 + } + }, + "range": [ + 31, + 39 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 23 + }, + "end": { + "line": 3, + "column": 24 + } + }, + "range": [ + 39, + 40 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 41, + 46 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 47, + 48 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 8 + } + }, + "range": [ + 53, + 59 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 60, + 61 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 66, + 67 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 6 + } + }, + "range": [ + 67, + 68 + ] + }, + { + "type": "Identifier", + "value": "method", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 12 + } + }, + "range": [ + 75, + 81 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 7, + "column": 12 + }, + "end": { + "line": 7, + "column": 13 + } + }, + "range": [ + 81, + 82 + ] + }, + { + "type": "Identifier", + "value": "x", + "loc": { + "start": { + "line": 7, + "column": 13 + }, + "end": { + "line": 7, + "column": 14 + } + }, + "range": [ + 82, + 83 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 7, + "column": 15 + }, + "end": { + "line": 7, + "column": 16 + } + }, + "range": [ + 84, + 85 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 7, + "column": 17 + }, + "end": { + "line": 7, + "column": 26 + } + }, + "range": [ + 86, + 95 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 7, + "column": 27 + }, + "end": { + "line": 7, + "column": 28 + } + }, + "range": [ + 96, + 97 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 7, + "column": 29 + }, + "end": { + "line": 7, + "column": 34 + } + }, + "range": [ + 98, + 103 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 7, + "column": 34 + }, + "end": { + "line": 7, + "column": 35 + } + }, + "range": [ + 103, + 104 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 36 + }, + "end": { + "line": 7, + "column": 37 + } + }, + "range": [ + 105, + 106 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 16 + } + }, + "range": [ + 115, + 123 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 8, + "column": 17 + }, + "end": { + "line": 8, + "column": 18 + } + }, + "range": [ + 124, + 125 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 8, + "column": 19 + }, + "end": { + "line": 8, + "column": 24 + } + }, + "range": [ + 126, + 131 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 8, + "column": 24 + }, + "end": { + "line": 8, + "column": 25 + } + }, + "range": [ + 131, + 132 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 9, + "column": 6 + }, + "end": { + "line": 9, + "column": 7 + } + }, + "range": [ + 139, + 140 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 5 + } + }, + "range": [ + 145, + 146 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 10, + "column": 5 + }, + "end": { + "line": 10, + "column": 6 + } + }, + "range": [ + 146, + 147 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 7 + } + }, + "range": [ + 147, + 148 + ] + }, + { + "type": "Identifier", + "value": "method", + "loc": { + "start": { + "line": 10, + "column": 7 + }, + "end": { + "line": 10, + "column": 13 + } + }, + "range": [ + 148, + 154 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 10, + "column": 13 + }, + "end": { + "line": 10, + "column": 14 + } + }, + "range": [ + 154, + 155 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 10, + "column": 14 + }, + "end": { + "line": 10, + "column": 15 + } + }, + "range": [ + 155, + 156 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 10, + "column": 15 + }, + "end": { + "line": 10, + "column": 16 + } + }, + "range": [ + 156, + 157 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 3 + } + }, + "range": [ + 160, + 161 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 1 + } + }, + "range": [ + 162, + 163 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 6 + } + }, + "range": [ + 164, + 170 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 13, + "column": 6 + }, + "end": { + "line": 13, + "column": 7 + } + }, + "range": [ + 170, + 171 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 13, + "column": 7 + }, + "end": { + "line": 13, + "column": 16 + } + }, + "range": [ + 171, + 180 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 13, + "column": 16 + }, + "end": { + "line": 13, + "column": 17 + } + }, + "range": [ + 180, + 181 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 13, + "column": 17 + }, + "end": { + "line": 13, + "column": 26 + } + }, + "range": [ + 181, + 190 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 13, + "column": 26 + }, + "end": { + "line": 13, + "column": 27 + } + }, + "range": [ + 190, + 191 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 13, + "column": 28 + }, + "end": { + "line": 13, + "column": 29 + } + }, + "range": [ + 192, + 193 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 13, + "column": 29 + }, + "end": { + "line": 13, + "column": 30 + } + }, + "range": [ + 193, + 194 + ] + }, + { + "type": "String", + "value": "'from parameter'", + "loc": { + "start": { + "line": 13, + "column": 31 + }, + "end": { + "line": 13, + "column": 47 + } + }, + "range": [ + 195, + 211 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 13, + "column": 47 + }, + "end": { + "line": 13, + "column": 48 + } + }, + "range": [ + 211, + 212 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 13, + "column": 48 + }, + "end": { + "line": 13, + "column": 49 + } + }, + "range": [ + 212, + 213 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 6 + } + }, + "range": [ + 214, + 220 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 7 + } + }, + "range": [ + 220, + 221 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 14, + "column": 7 + }, + "end": { + "line": 14, + "column": 16 + } + }, + "range": [ + 221, + 230 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 14, + "column": 16 + }, + "end": { + "line": 14, + "column": 17 + } + }, + "range": [ + 230, + 231 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 14, + "column": 17 + }, + "end": { + "line": 14, + "column": 25 + } + }, + "range": [ + 231, + 239 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 14, + "column": 25 + }, + "end": { + "line": 14, + "column": 26 + } + }, + "range": [ + 239, + 240 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 14, + "column": 27 + }, + "end": { + "line": 14, + "column": 28 + } + }, + "range": [ + 241, + 242 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 14, + "column": 28 + }, + "end": { + "line": 14, + "column": 29 + } + }, + "range": [ + 242, + 243 + ] + }, + { + "type": "String", + "value": "'from body'", + "loc": { + "start": { + "line": 14, + "column": 30 + }, + "end": { + "line": 14, + "column": 41 + } + }, + "range": [ + 244, + 255 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 14, + "column": 41 + }, + "end": { + "line": 14, + "column": 42 + } + }, + "range": [ + 255, + 256 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 14, + "column": 42 + }, + "end": { + "line": 14, + "column": 43 + } + }, + "range": [ + 256, + 257 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-reference-normal.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-reference-normal.src.js new file mode 100644 index 00000000..6e58da3e --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-method-definition-static-init-await-reference-normal.src.js @@ -0,0 +1,14 @@ + +var await = 0; +var fromParam, fromBody; +class C { + static { + ({ + method(x = fromParam = await) { + fromBody = await; + } + }).method(); + } +} +assert.sameValue(fromParam, 0, 'from parameter'); +assert.sameValue(fromBody, 0, 'from body'); diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/identifier-resolution-static-init-invalid-await.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/identifier-resolution-static-init-invalid-await.result.js new file mode 100644 index 00000000..99a56749 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/identifier-resolution-static-init-invalid-await.result.js @@ -0,0 +1,6 @@ +export default { + "index": 26, + "lineNumber": 4, + "column": 5, + "message": "Cannot use await in class static initialization block" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/identifier-resolution-static-init-invalid-await.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/identifier-resolution-static-init-invalid-await.src.js new file mode 100644 index 00000000..d5052789 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/identifier-resolution-static-init-invalid-await.src.js @@ -0,0 +1,6 @@ + +class C { + static { + await; + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-break-static-init-without-label.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-break-static-init-without-label.result.js new file mode 100644 index 00000000..26855a09 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-break-static-init-without-label.result.js @@ -0,0 +1,6 @@ +export default { + "index": 54, + "lineNumber": 5, + "column": 7, + "message": "Unsyntactic break" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-break-static-init-without-label.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-break-static-init-without-label.src.js new file mode 100644 index 00000000..06c6d01a --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-break-static-init-without-label.src.js @@ -0,0 +1,8 @@ + +label: while(false) { + class C { + static { + break; + } + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-abrupt.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-abrupt.result.js new file mode 100644 index 00000000..307547ee --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-abrupt.result.js @@ -0,0 +1,3451 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 24, + "column": 61 + } + }, + "range": [ + 1, + 545 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 32 + } + }, + "range": [ + 1, + 33 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 31 + } + }, + "range": [ + 5, + 32 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "range": [ + 5, + 11 + ], + "name": "thrown" + }, + "init": { + "type": "NewExpression", + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 31 + } + }, + "range": [ + 14, + 32 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "range": [ + 18, + 30 + ], + "name": "Test262Error" + }, + "arguments": [] + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "range": [ + 34, + 45 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 38, + 44 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 38, + 44 + ], + "name": "caught" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 22 + } + }, + "range": [ + 46, + 68 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 21 + } + }, + "range": [ + 50, + 67 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 50, + 59 + ], + "name": "sameBlock" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 4, + "column": 16 + }, + "end": { + "line": 4, + "column": 21 + } + }, + "range": [ + 62, + 67 + ], + "value": false, + "raw": "false" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 28 + } + }, + "range": [ + 69, + 97 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 27 + } + }, + "range": [ + 73, + 96 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 19 + } + }, + "range": [ + 73, + 88 + ], + "name": "subsequentField" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 5, + "column": 22 + }, + "end": { + "line": 5, + "column": 27 + } + }, + "range": [ + 91, + 96 + ], + "value": false, + "raw": "false" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 28 + } + }, + "range": [ + 98, + 126 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 27 + } + }, + "range": [ + 102, + 125 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 19 + } + }, + "range": [ + 102, + 117 + ], + "name": "subsequentBlock" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 6, + "column": 22 + }, + "end": { + "line": 6, + "column": 27 + } + }, + "range": [ + 120, + 125 + ], + "value": false, + "raw": "false" + } + } + ], + "kind": "var" + }, + { + "type": "TryStatement", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 20, + "column": 1 + } + }, + "range": [ + 127, + 337 + ], + "block": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 18, + "column": 1 + } + }, + "range": [ + 131, + 301 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 17, + "column": 3 + } + }, + "range": [ + 135, + 299 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 9 + } + }, + "range": [ + 141, + 142 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 17, + "column": 3 + } + }, + "range": [ + 143, + 299 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 12, + "column": 5 + } + }, + "range": [ + 149, + 207 + ], + "body": [ + { + "type": "ThrowStatement", + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 19 + } + }, + "range": [ + 164, + 177 + ], + "argument": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 12 + }, + "end": { + "line": 10, + "column": 18 + } + }, + "range": [ + 170, + 176 + ], + "name": "thrown" + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 23 + } + }, + "range": [ + 184, + 201 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 22 + } + }, + "range": [ + 184, + 200 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 15 + } + }, + "range": [ + 184, + 193 + ], + "name": "sameBlock" + }, + "right": { + "type": "Literal", + "loc": { + "start": { + "line": 11, + "column": 18 + }, + "end": { + "line": 11, + "column": 22 + } + }, + "range": [ + 196, + 200 + ], + "value": true, + "raw": "true" + } + } + } + ] + }, + { + "type": "PropertyDefinition", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 38 + } + }, + "range": [ + 212, + 246 + ], + "static": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 11 + }, + "end": { + "line": 13, + "column": 12 + } + }, + "range": [ + 219, + 220 + ], + "name": "x" + }, + "value": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 13, + "column": 15 + }, + "end": { + "line": 13, + "column": 37 + } + }, + "range": [ + 223, + 245 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 15 + }, + "end": { + "line": 13, + "column": 30 + } + }, + "range": [ + 223, + 238 + ], + "name": "subsequentField" + }, + "right": { + "type": "Literal", + "loc": { + "start": { + "line": 13, + "column": 33 + }, + "end": { + "line": 13, + "column": 37 + } + }, + "range": [ + 241, + 245 + ], + "value": true, + "raw": "true" + } + } + }, + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 16, + "column": 5 + } + }, + "range": [ + 251, + 295 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 15, + "column": 29 + } + }, + "range": [ + 266, + 289 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 15, + "column": 28 + } + }, + "range": [ + 266, + 288 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 15, + "column": 21 + } + }, + "range": [ + 266, + 281 + ], + "name": "subsequentBlock" + }, + "right": { + "type": "Literal", + "loc": { + "start": { + "line": 15, + "column": 24 + }, + "end": { + "line": 15, + "column": 28 + } + }, + "range": [ + 284, + 288 + ], + "value": true, + "raw": "true" + } + } + } + ] + } + ] + } + } + ] + }, + "handler": { + "type": "CatchClause", + "loc": { + "start": { + "line": 18, + "column": 2 + }, + "end": { + "line": 20, + "column": 1 + } + }, + "range": [ + 302, + 337 + ], + "param": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 9 + }, + "end": { + "line": 18, + "column": 14 + } + }, + "range": [ + 309, + 314 + ], + "name": "error" + }, + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 18, + "column": 16 + }, + "end": { + "line": 20, + "column": 1 + } + }, + "range": [ + 316, + 337 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 19, + "column": 2 + }, + "end": { + "line": 19, + "column": 17 + } + }, + "range": [ + 320, + 335 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 19, + "column": 2 + }, + "end": { + "line": 19, + "column": 16 + } + }, + "range": [ + 320, + 334 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 19, + "column": 2 + }, + "end": { + "line": 19, + "column": 8 + } + }, + "range": [ + 320, + 326 + ], + "name": "caught" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 19, + "column": 11 + }, + "end": { + "line": 19, + "column": 16 + } + }, + "range": [ + 329, + 334 + ], + "name": "error" + } + } + } + ] + } + }, + "finalizer": null + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 21, + "column": 0 + }, + "end": { + "line": 21, + "column": 33 + } + }, + "range": [ + 338, + 371 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 21, + "column": 0 + }, + "end": { + "line": 21, + "column": 32 + } + }, + "range": [ + 338, + 370 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 21, + "column": 0 + }, + "end": { + "line": 21, + "column": 16 + } + }, + "range": [ + 338, + 354 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 21, + "column": 0 + }, + "end": { + "line": 21, + "column": 6 + } + }, + "range": [ + 338, + 344 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 21, + "column": 7 + }, + "end": { + "line": 21, + "column": 16 + } + }, + "range": [ + 345, + 354 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 21, + "column": 17 + }, + "end": { + "line": 21, + "column": 23 + } + }, + "range": [ + 355, + 361 + ], + "name": "caught" + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 21, + "column": 25 + }, + "end": { + "line": 21, + "column": 31 + } + }, + "range": [ + 363, + 369 + ], + "name": "thrown" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 22, + "column": 0 + }, + "end": { + "line": 22, + "column": 49 + } + }, + "range": [ + 372, + 421 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 22, + "column": 0 + }, + "end": { + "line": 22, + "column": 48 + } + }, + "range": [ + 372, + 420 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 22, + "column": 0 + }, + "end": { + "line": 22, + "column": 16 + } + }, + "range": [ + 372, + 388 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 22, + "column": 0 + }, + "end": { + "line": 22, + "column": 6 + } + }, + "range": [ + 372, + 378 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 22, + "column": 7 + }, + "end": { + "line": 22, + "column": 16 + } + }, + "range": [ + 379, + 388 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 22, + "column": 17 + }, + "end": { + "line": 22, + "column": 26 + } + }, + "range": [ + 389, + 398 + ], + "name": "sameBlock" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 22, + "column": 28 + }, + "end": { + "line": 22, + "column": 33 + } + }, + "range": [ + 400, + 405 + ], + "value": false, + "raw": "false" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 22, + "column": 35 + }, + "end": { + "line": 22, + "column": 47 + } + }, + "range": [ + 407, + 419 + ], + "value": "same block", + "raw": "'same block'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 23, + "column": 0 + }, + "end": { + "line": 23, + "column": 61 + } + }, + "range": [ + 422, + 483 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 23, + "column": 0 + }, + "end": { + "line": 23, + "column": 60 + } + }, + "range": [ + 422, + 482 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 23, + "column": 0 + }, + "end": { + "line": 23, + "column": 16 + } + }, + "range": [ + 422, + 438 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 23, + "column": 0 + }, + "end": { + "line": 23, + "column": 6 + } + }, + "range": [ + 422, + 428 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 23, + "column": 7 + }, + "end": { + "line": 23, + "column": 16 + } + }, + "range": [ + 429, + 438 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 23, + "column": 17 + }, + "end": { + "line": 23, + "column": 32 + } + }, + "range": [ + 439, + 454 + ], + "name": "subsequentField" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 23, + "column": 34 + }, + "end": { + "line": 23, + "column": 39 + } + }, + "range": [ + 456, + 461 + ], + "value": false, + "raw": "false" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 23, + "column": 41 + }, + "end": { + "line": 23, + "column": 59 + } + }, + "range": [ + 463, + 481 + ], + "value": "subsequent field", + "raw": "'subsequent field'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 24, + "column": 0 + }, + "end": { + "line": 24, + "column": 61 + } + }, + "range": [ + 484, + 545 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 24, + "column": 0 + }, + "end": { + "line": 24, + "column": 60 + } + }, + "range": [ + 484, + 544 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 24, + "column": 0 + }, + "end": { + "line": 24, + "column": 16 + } + }, + "range": [ + 484, + 500 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 24, + "column": 0 + }, + "end": { + "line": 24, + "column": 6 + } + }, + "range": [ + 484, + 490 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 24, + "column": 7 + }, + "end": { + "line": 24, + "column": 16 + } + }, + "range": [ + 491, + 500 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 24, + "column": 17 + }, + "end": { + "line": 24, + "column": 32 + } + }, + "range": [ + 501, + 516 + ], + "name": "subsequentBlock" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 24, + "column": 34 + }, + "end": { + "line": 24, + "column": 39 + } + }, + "range": [ + 518, + 523 + ], + "value": false, + "raw": "false" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 24, + "column": 41 + }, + "end": { + "line": 24, + "column": 59 + } + }, + "range": [ + 525, + 543 + ], + "value": "subsequent block", + "raw": "'subsequent block'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "range": [ + 1, + 4 + ] + }, + { + "type": "Identifier", + "value": "thrown", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "range": [ + 5, + 11 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "range": [ + 12, + 13 + ] + }, + { + "type": "Keyword", + "value": "new", + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "range": [ + 14, + 17 + ] + }, + { + "type": "Identifier", + "value": "Test262Error", + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "range": [ + 18, + 30 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 2, + "column": 29 + }, + "end": { + "line": 2, + "column": 30 + } + }, + "range": [ + 30, + 31 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 2, + "column": 30 + }, + "end": { + "line": 2, + "column": 31 + } + }, + "range": [ + 31, + 32 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 2, + "column": 31 + }, + "end": { + "line": 2, + "column": 32 + } + }, + "range": [ + 32, + 33 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "range": [ + 34, + 37 + ] + }, + { + "type": "Identifier", + "value": "caught", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 38, + 44 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "range": [ + 44, + 45 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 46, + 49 + ] + }, + { + "type": "Identifier", + "value": "sameBlock", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 50, + 59 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 4, + "column": 14 + }, + "end": { + "line": 4, + "column": 15 + } + }, + "range": [ + 60, + 61 + ] + }, + { + "type": "Boolean", + "value": "false", + "loc": { + "start": { + "line": 4, + "column": 16 + }, + "end": { + "line": 4, + "column": 21 + } + }, + "range": [ + 62, + 67 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 21 + }, + "end": { + "line": 4, + "column": 22 + } + }, + "range": [ + 67, + 68 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 69, + 72 + ] + }, + { + "type": "Identifier", + "value": "subsequentField", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 19 + } + }, + "range": [ + 73, + 88 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 5, + "column": 20 + }, + "end": { + "line": 5, + "column": 21 + } + }, + "range": [ + 89, + 90 + ] + }, + { + "type": "Boolean", + "value": "false", + "loc": { + "start": { + "line": 5, + "column": 22 + }, + "end": { + "line": 5, + "column": 27 + } + }, + "range": [ + 91, + 96 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 27 + }, + "end": { + "line": 5, + "column": 28 + } + }, + "range": [ + 96, + 97 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 98, + 101 + ] + }, + { + "type": "Identifier", + "value": "subsequentBlock", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 19 + } + }, + "range": [ + 102, + 117 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 6, + "column": 20 + }, + "end": { + "line": 6, + "column": 21 + } + }, + "range": [ + 118, + 119 + ] + }, + { + "type": "Boolean", + "value": "false", + "loc": { + "start": { + "line": 6, + "column": 22 + }, + "end": { + "line": 6, + "column": 27 + } + }, + "range": [ + 120, + 125 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 27 + }, + "end": { + "line": 6, + "column": 28 + } + }, + "range": [ + 125, + 126 + ] + }, + { + "type": "Keyword", + "value": "try", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 127, + 130 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "range": [ + 131, + 132 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 7 + } + }, + "range": [ + 135, + 140 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 9 + } + }, + "range": [ + 141, + 142 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 11 + } + }, + "range": [ + 143, + 144 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 10 + } + }, + "range": [ + 149, + 155 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 9, + "column": 11 + }, + "end": { + "line": 9, + "column": 12 + } + }, + "range": [ + 156, + 157 + ] + }, + { + "type": "Keyword", + "value": "throw", + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 11 + } + }, + "range": [ + 164, + 169 + ] + }, + { + "type": "Identifier", + "value": "thrown", + "loc": { + "start": { + "line": 10, + "column": 12 + }, + "end": { + "line": 10, + "column": 18 + } + }, + "range": [ + 170, + 176 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 19 + } + }, + "range": [ + 176, + 177 + ] + }, + { + "type": "Identifier", + "value": "sameBlock", + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 15 + } + }, + "range": [ + 184, + 193 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 11, + "column": 16 + }, + "end": { + "line": 11, + "column": 17 + } + }, + "range": [ + 194, + 195 + ] + }, + { + "type": "Boolean", + "value": "true", + "loc": { + "start": { + "line": 11, + "column": 18 + }, + "end": { + "line": 11, + "column": 22 + } + }, + "range": [ + 196, + 200 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 11, + "column": 22 + }, + "end": { + "line": 11, + "column": 23 + } + }, + "range": [ + 200, + 201 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 12, + "column": 4 + }, + "end": { + "line": 12, + "column": 5 + } + }, + "range": [ + 206, + 207 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 10 + } + }, + "range": [ + 212, + 218 + ] + }, + { + "type": "Identifier", + "value": "x", + "loc": { + "start": { + "line": 13, + "column": 11 + }, + "end": { + "line": 13, + "column": 12 + } + }, + "range": [ + 219, + 220 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 13, + "column": 13 + }, + "end": { + "line": 13, + "column": 14 + } + }, + "range": [ + 221, + 222 + ] + }, + { + "type": "Identifier", + "value": "subsequentField", + "loc": { + "start": { + "line": 13, + "column": 15 + }, + "end": { + "line": 13, + "column": 30 + } + }, + "range": [ + 223, + 238 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 13, + "column": 31 + }, + "end": { + "line": 13, + "column": 32 + } + }, + "range": [ + 239, + 240 + ] + }, + { + "type": "Boolean", + "value": "true", + "loc": { + "start": { + "line": 13, + "column": 33 + }, + "end": { + "line": 13, + "column": 37 + } + }, + "range": [ + 241, + 245 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 13, + "column": 37 + }, + "end": { + "line": 13, + "column": 38 + } + }, + "range": [ + 245, + 246 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 10 + } + }, + "range": [ + 251, + 257 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 14, + "column": 11 + }, + "end": { + "line": 14, + "column": 12 + } + }, + "range": [ + 258, + 259 + ] + }, + { + "type": "Identifier", + "value": "subsequentBlock", + "loc": { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 15, + "column": 21 + } + }, + "range": [ + 266, + 281 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 15, + "column": 22 + }, + "end": { + "line": 15, + "column": 23 + } + }, + "range": [ + 282, + 283 + ] + }, + { + "type": "Boolean", + "value": "true", + "loc": { + "start": { + "line": 15, + "column": 24 + }, + "end": { + "line": 15, + "column": 28 + } + }, + "range": [ + 284, + 288 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 15, + "column": 28 + }, + "end": { + "line": 15, + "column": 29 + } + }, + "range": [ + 288, + 289 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 16, + "column": 4 + }, + "end": { + "line": 16, + "column": 5 + } + }, + "range": [ + 294, + 295 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 17, + "column": 2 + }, + "end": { + "line": 17, + "column": 3 + } + }, + "range": [ + 298, + 299 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 1 + } + }, + "range": [ + 300, + 301 + ] + }, + { + "type": "Keyword", + "value": "catch", + "loc": { + "start": { + "line": 18, + "column": 2 + }, + "end": { + "line": 18, + "column": 7 + } + }, + "range": [ + 302, + 307 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 18, + "column": 8 + }, + "end": { + "line": 18, + "column": 9 + } + }, + "range": [ + 308, + 309 + ] + }, + { + "type": "Identifier", + "value": "error", + "loc": { + "start": { + "line": 18, + "column": 9 + }, + "end": { + "line": 18, + "column": 14 + } + }, + "range": [ + 309, + 314 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 18, + "column": 14 + }, + "end": { + "line": 18, + "column": 15 + } + }, + "range": [ + 314, + 315 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 18, + "column": 16 + }, + "end": { + "line": 18, + "column": 17 + } + }, + "range": [ + 316, + 317 + ] + }, + { + "type": "Identifier", + "value": "caught", + "loc": { + "start": { + "line": 19, + "column": 2 + }, + "end": { + "line": 19, + "column": 8 + } + }, + "range": [ + 320, + 326 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 19, + "column": 9 + }, + "end": { + "line": 19, + "column": 10 + } + }, + "range": [ + 327, + 328 + ] + }, + { + "type": "Identifier", + "value": "error", + "loc": { + "start": { + "line": 19, + "column": 11 + }, + "end": { + "line": 19, + "column": 16 + } + }, + "range": [ + 329, + 334 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 19, + "column": 16 + }, + "end": { + "line": 19, + "column": 17 + } + }, + "range": [ + 334, + 335 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 20, + "column": 0 + }, + "end": { + "line": 20, + "column": 1 + } + }, + "range": [ + 336, + 337 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 21, + "column": 0 + }, + "end": { + "line": 21, + "column": 6 + } + }, + "range": [ + 338, + 344 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 21, + "column": 6 + }, + "end": { + "line": 21, + "column": 7 + } + }, + "range": [ + 344, + 345 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 21, + "column": 7 + }, + "end": { + "line": 21, + "column": 16 + } + }, + "range": [ + 345, + 354 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 21, + "column": 16 + }, + "end": { + "line": 21, + "column": 17 + } + }, + "range": [ + 354, + 355 + ] + }, + { + "type": "Identifier", + "value": "caught", + "loc": { + "start": { + "line": 21, + "column": 17 + }, + "end": { + "line": 21, + "column": 23 + } + }, + "range": [ + 355, + 361 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 21, + "column": 23 + }, + "end": { + "line": 21, + "column": 24 + } + }, + "range": [ + 361, + 362 + ] + }, + { + "type": "Identifier", + "value": "thrown", + "loc": { + "start": { + "line": 21, + "column": 25 + }, + "end": { + "line": 21, + "column": 31 + } + }, + "range": [ + 363, + 369 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 21, + "column": 31 + }, + "end": { + "line": 21, + "column": 32 + } + }, + "range": [ + 369, + 370 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 21, + "column": 32 + }, + "end": { + "line": 21, + "column": 33 + } + }, + "range": [ + 370, + 371 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 22, + "column": 0 + }, + "end": { + "line": 22, + "column": 6 + } + }, + "range": [ + 372, + 378 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 22, + "column": 6 + }, + "end": { + "line": 22, + "column": 7 + } + }, + "range": [ + 378, + 379 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 22, + "column": 7 + }, + "end": { + "line": 22, + "column": 16 + } + }, + "range": [ + 379, + 388 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 22, + "column": 16 + }, + "end": { + "line": 22, + "column": 17 + } + }, + "range": [ + 388, + 389 + ] + }, + { + "type": "Identifier", + "value": "sameBlock", + "loc": { + "start": { + "line": 22, + "column": 17 + }, + "end": { + "line": 22, + "column": 26 + } + }, + "range": [ + 389, + 398 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 22, + "column": 26 + }, + "end": { + "line": 22, + "column": 27 + } + }, + "range": [ + 398, + 399 + ] + }, + { + "type": "Boolean", + "value": "false", + "loc": { + "start": { + "line": 22, + "column": 28 + }, + "end": { + "line": 22, + "column": 33 + } + }, + "range": [ + 400, + 405 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 22, + "column": 33 + }, + "end": { + "line": 22, + "column": 34 + } + }, + "range": [ + 405, + 406 + ] + }, + { + "type": "String", + "value": "'same block'", + "loc": { + "start": { + "line": 22, + "column": 35 + }, + "end": { + "line": 22, + "column": 47 + } + }, + "range": [ + 407, + 419 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 22, + "column": 47 + }, + "end": { + "line": 22, + "column": 48 + } + }, + "range": [ + 419, + 420 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 22, + "column": 48 + }, + "end": { + "line": 22, + "column": 49 + } + }, + "range": [ + 420, + 421 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 23, + "column": 0 + }, + "end": { + "line": 23, + "column": 6 + } + }, + "range": [ + 422, + 428 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 23, + "column": 6 + }, + "end": { + "line": 23, + "column": 7 + } + }, + "range": [ + 428, + 429 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 23, + "column": 7 + }, + "end": { + "line": 23, + "column": 16 + } + }, + "range": [ + 429, + 438 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 23, + "column": 16 + }, + "end": { + "line": 23, + "column": 17 + } + }, + "range": [ + 438, + 439 + ] + }, + { + "type": "Identifier", + "value": "subsequentField", + "loc": { + "start": { + "line": 23, + "column": 17 + }, + "end": { + "line": 23, + "column": 32 + } + }, + "range": [ + 439, + 454 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 23, + "column": 32 + }, + "end": { + "line": 23, + "column": 33 + } + }, + "range": [ + 454, + 455 + ] + }, + { + "type": "Boolean", + "value": "false", + "loc": { + "start": { + "line": 23, + "column": 34 + }, + "end": { + "line": 23, + "column": 39 + } + }, + "range": [ + 456, + 461 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 23, + "column": 39 + }, + "end": { + "line": 23, + "column": 40 + } + }, + "range": [ + 461, + 462 + ] + }, + { + "type": "String", + "value": "'subsequent field'", + "loc": { + "start": { + "line": 23, + "column": 41 + }, + "end": { + "line": 23, + "column": 59 + } + }, + "range": [ + 463, + 481 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 23, + "column": 59 + }, + "end": { + "line": 23, + "column": 60 + } + }, + "range": [ + 481, + 482 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 23, + "column": 60 + }, + "end": { + "line": 23, + "column": 61 + } + }, + "range": [ + 482, + 483 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 24, + "column": 0 + }, + "end": { + "line": 24, + "column": 6 + } + }, + "range": [ + 484, + 490 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 24, + "column": 6 + }, + "end": { + "line": 24, + "column": 7 + } + }, + "range": [ + 490, + 491 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 24, + "column": 7 + }, + "end": { + "line": 24, + "column": 16 + } + }, + "range": [ + 491, + 500 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 24, + "column": 16 + }, + "end": { + "line": 24, + "column": 17 + } + }, + "range": [ + 500, + 501 + ] + }, + { + "type": "Identifier", + "value": "subsequentBlock", + "loc": { + "start": { + "line": 24, + "column": 17 + }, + "end": { + "line": 24, + "column": 32 + } + }, + "range": [ + 501, + 516 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 24, + "column": 32 + }, + "end": { + "line": 24, + "column": 33 + } + }, + "range": [ + 516, + 517 + ] + }, + { + "type": "Boolean", + "value": "false", + "loc": { + "start": { + "line": 24, + "column": 34 + }, + "end": { + "line": 24, + "column": 39 + } + }, + "range": [ + 518, + 523 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 24, + "column": 39 + }, + "end": { + "line": 24, + "column": 40 + } + }, + "range": [ + 523, + 524 + ] + }, + { + "type": "String", + "value": "'subsequent block'", + "loc": { + "start": { + "line": 24, + "column": 41 + }, + "end": { + "line": 24, + "column": 59 + } + }, + "range": [ + 525, + 543 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 24, + "column": 59 + }, + "end": { + "line": 24, + "column": 60 + } + }, + "range": [ + 543, + 544 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 24, + "column": 60 + }, + "end": { + "line": 24, + "column": 61 + } + }, + "range": [ + 544, + 545 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-abrupt.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-abrupt.src.js new file mode 100644 index 00000000..fcecf066 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-abrupt.src.js @@ -0,0 +1,24 @@ + +var thrown = new Test262Error(); +var caught; +var sameBlock = false; +var subsequentField = false; +var subsequentBlock = false; +try { + class C { + static { + throw thrown; + sameBlock = true; + } + static x = subsequentField = true; + static { + subsequentBlock = true; + } + } +} catch (error) { + caught = error; +} +assert.sameValue(caught, thrown); +assert.sameValue(sameBlock, false, 'same block'); +assert.sameValue(subsequentField, false, 'subsequent field'); +assert.sameValue(subsequentBlock, false, 'subsequent block'); diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-arguments-functions.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-arguments-functions.result.js new file mode 100644 index 00000000..6235f45e --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-arguments-functions.result.js @@ -0,0 +1,5588 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 23, + "column": 68 + } + }, + "range": [ + 1, + 770 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "range": [ + 1, + 17 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "range": [ + 5, + 7 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "range": [ + 5, + 7 + ], + "name": "fn" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "range": [ + 9, + 16 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "range": [ + 9, + 16 + ], + "name": "fnParam" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 18 + } + }, + "range": [ + 18, + 36 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 22, + 25 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 22, + 25 + ], + "name": "gen" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 17 + } + }, + "range": [ + 27, + 35 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 17 + } + }, + "range": [ + 27, + 35 + ], + "name": "genParam" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 26 + } + }, + "range": [ + 37, + 63 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 11 + } + }, + "range": [ + 41, + 48 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 11 + } + }, + "range": [ + 41, + 48 + ], + "name": "asyncFn" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 25 + } + }, + "range": [ + 50, + 62 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 25 + } + }, + "range": [ + 50, + 62 + ], + "name": "asyncFnParam" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 17, + "column": 1 + } + }, + "range": [ + 64, + 408 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "range": [ + 70, + 71 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 5, + "column": 8 + }, + "end": { + "line": 17, + "column": 1 + } + }, + "range": [ + 72, + 408 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 16, + "column": 3 + } + }, + "range": [ + 76, + 406 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 9, + "column": 19 + } + }, + "range": [ + 89, + 175 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 9, + "column": 18 + } + }, + "range": [ + 89, + 174 + ], + "callee": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 7, + "column": 5 + }, + "end": { + "line": 9, + "column": 5 + } + }, + "range": [ + 90, + 161 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [ + { + "type": "ObjectPattern", + "loc": { + "start": { + "line": 7, + "column": 14 + }, + "end": { + "line": 7, + "column": 45 + } + }, + "range": [ + 99, + 130 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 7, + "column": 15 + }, + "end": { + "line": 7, + "column": 44 + } + }, + "range": [ + 100, + 129 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 15 + }, + "end": { + "line": 7, + "column": 22 + } + }, + "range": [ + 100, + 107 + ], + "name": "test262" + }, + "kind": "init", + "value": { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 7, + "column": 15 + }, + "end": { + "line": 7, + "column": 44 + } + }, + "range": [ + 100, + 129 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 15 + }, + "end": { + "line": 7, + "column": 22 + } + }, + "range": [ + 100, + 107 + ], + "name": "test262" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 7, + "column": 25 + }, + "end": { + "line": 7, + "column": 44 + } + }, + "range": [ + 110, + 129 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 25 + }, + "end": { + "line": 7, + "column": 32 + } + }, + "range": [ + 110, + 117 + ], + "name": "fnParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 35 + }, + "end": { + "line": 7, + "column": 44 + } + }, + "range": [ + 120, + 129 + ], + "name": "arguments" + } + } + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 7, + "column": 47 + }, + "end": { + "line": 9, + "column": 5 + } + }, + "range": [ + 132, + 161 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 8, + "column": 6 + }, + "end": { + "line": 8, + "column": 21 + } + }, + "range": [ + 140, + 155 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 8, + "column": 6 + }, + "end": { + "line": 8, + "column": 20 + } + }, + "range": [ + 140, + 154 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 6 + }, + "end": { + "line": 8, + "column": 8 + } + }, + "range": [ + 140, + 142 + ], + "name": "fn" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 11 + }, + "end": { + "line": 8, + "column": 20 + } + }, + "range": [ + 145, + 154 + ], + "name": "arguments" + } + } + } + ] + } + }, + "arguments": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 9, + "column": 7 + }, + "end": { + "line": 9, + "column": 17 + } + }, + "range": [ + 163, + 173 + ], + "value": "function", + "raw": "'function'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 12, + "column": 36 + } + }, + "range": [ + 180, + 288 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 12, + "column": 35 + } + }, + "range": [ + 180, + 287 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 12, + "column": 33 + } + }, + "range": [ + 180, + 285 + ], + "object": { + "type": "CallExpression", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 12, + "column": 28 + } + }, + "range": [ + 180, + 280 + ], + "callee": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 10, + "column": 5 + }, + "end": { + "line": 12, + "column": 5 + } + }, + "range": [ + 181, + 257 + ], + "id": null, + "expression": false, + "generator": true, + "async": false, + "params": [ + { + "type": "ObjectPattern", + "loc": { + "start": { + "line": 10, + "column": 17 + }, + "end": { + "line": 10, + "column": 49 + } + }, + "range": [ + 193, + 225 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 48 + } + }, + "range": [ + 194, + 224 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 25 + } + }, + "range": [ + 194, + 201 + ], + "name": "test262" + }, + "kind": "init", + "value": { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 48 + } + }, + "range": [ + 194, + 224 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 25 + } + }, + "range": [ + 194, + 201 + ], + "name": "test262" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 10, + "column": 28 + }, + "end": { + "line": 10, + "column": 48 + } + }, + "range": [ + 204, + 224 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 28 + }, + "end": { + "line": 10, + "column": 36 + } + }, + "range": [ + 204, + 212 + ], + "name": "genParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 39 + }, + "end": { + "line": 10, + "column": 48 + } + }, + "range": [ + 215, + 224 + ], + "name": "arguments" + } + } + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 10, + "column": 51 + }, + "end": { + "line": 12, + "column": 5 + } + }, + "range": [ + 227, + 257 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 22 + } + }, + "range": [ + 235, + 251 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 21 + } + }, + "range": [ + 235, + 250 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 9 + } + }, + "range": [ + 235, + 238 + ], + "name": "gen" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 12 + }, + "end": { + "line": 11, + "column": 21 + } + }, + "range": [ + 241, + 250 + ], + "name": "arguments" + } + } + } + ] + } + }, + "arguments": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 27 + } + }, + "range": [ + 259, + 279 + ], + "value": "generator function", + "raw": "'generator function'" + } + ], + "optional": false + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 29 + }, + "end": { + "line": 12, + "column": 33 + } + }, + "range": [ + 281, + 285 + ], + "name": "next" + }, + "computed": false, + "optional": false + }, + "arguments": [], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 15, + "column": 25 + } + }, + "range": [ + 293, + 402 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 15, + "column": 24 + } + }, + "range": [ + 293, + 401 + ], + "callee": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 13, + "column": 5 + }, + "end": { + "line": 15, + "column": 5 + } + }, + "range": [ + 294, + 382 + ], + "id": null, + "expression": false, + "generator": false, + "async": true, + "params": [ + { + "type": "ObjectPattern", + "loc": { + "start": { + "line": 13, + "column": 21 + }, + "end": { + "line": 13, + "column": 57 + } + }, + "range": [ + 310, + 346 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 13, + "column": 22 + }, + "end": { + "line": 13, + "column": 56 + } + }, + "range": [ + 311, + 345 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 22 + }, + "end": { + "line": 13, + "column": 29 + } + }, + "range": [ + 311, + 318 + ], + "name": "test262" + }, + "kind": "init", + "value": { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 13, + "column": 22 + }, + "end": { + "line": 13, + "column": 56 + } + }, + "range": [ + 311, + 345 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 22 + }, + "end": { + "line": 13, + "column": 29 + } + }, + "range": [ + 311, + 318 + ], + "name": "test262" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 13, + "column": 32 + }, + "end": { + "line": 13, + "column": 56 + } + }, + "range": [ + 321, + 345 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 32 + }, + "end": { + "line": 13, + "column": 44 + } + }, + "range": [ + 321, + 333 + ], + "name": "asyncFnParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 47 + }, + "end": { + "line": 13, + "column": 56 + } + }, + "range": [ + 336, + 345 + ], + "name": "arguments" + } + } + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 13, + "column": 59 + }, + "end": { + "line": 15, + "column": 5 + } + }, + "range": [ + 348, + 382 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 26 + } + }, + "range": [ + 356, + 376 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 25 + } + }, + "range": [ + 356, + 375 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 13 + } + }, + "range": [ + 356, + 363 + ], + "name": "asyncFn" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 16 + }, + "end": { + "line": 14, + "column": 25 + } + }, + "range": [ + 366, + 375 + ], + "name": "arguments" + } + } + } + ] + } + }, + "arguments": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 15, + "column": 7 + }, + "end": { + "line": 15, + "column": 23 + } + }, + "range": [ + 384, + 400 + ], + "value": "async function", + "raw": "'async function'" + } + ], + "optional": false + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 47 + } + }, + "range": [ + 409, + 456 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 46 + } + }, + "range": [ + 409, + 455 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 6 + } + }, + "range": [ + 409, + 415 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 18, + "column": 7 + }, + "end": { + "line": 18, + "column": 37 + } + }, + "range": [ + 416, + 446 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 7 + }, + "end": { + "line": 18, + "column": 19 + } + }, + "range": [ + 416, + 428 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 18, + "column": 20 + }, + "end": { + "line": 18, + "column": 32 + } + }, + "range": [ + 429, + 441 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 18, + "column": 21 + }, + "end": { + "line": 18, + "column": 31 + } + }, + "range": [ + 430, + 440 + ], + "value": "function", + "raw": "'function'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 34 + }, + "end": { + "line": 18, + "column": 36 + } + }, + "range": [ + 443, + 445 + ], + "name": "fn" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 18, + "column": 39 + }, + "end": { + "line": 18, + "column": 45 + } + }, + "range": [ + 448, + 454 + ], + "value": "body", + "raw": "'body'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 57 + } + }, + "range": [ + 457, + 514 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 56 + } + }, + "range": [ + 457, + 513 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 6 + } + }, + "range": [ + 457, + 463 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 19, + "column": 7 + }, + "end": { + "line": 19, + "column": 42 + } + }, + "range": [ + 464, + 499 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 19, + "column": 7 + }, + "end": { + "line": 19, + "column": 19 + } + }, + "range": [ + 464, + 476 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 19, + "column": 20 + }, + "end": { + "line": 19, + "column": 32 + } + }, + "range": [ + 477, + 489 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 19, + "column": 21 + }, + "end": { + "line": 19, + "column": 31 + } + }, + "range": [ + 478, + 488 + ], + "value": "function", + "raw": "'function'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 19, + "column": 34 + }, + "end": { + "line": 19, + "column": 41 + } + }, + "range": [ + 491, + 498 + ], + "name": "fnParam" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 19, + "column": 44 + }, + "end": { + "line": 19, + "column": 55 + } + }, + "range": [ + 501, + 512 + ], + "value": "parameter", + "raw": "'parameter'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 20, + "column": 0 + }, + "end": { + "line": 20, + "column": 58 + } + }, + "range": [ + 515, + 573 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 20, + "column": 0 + }, + "end": { + "line": 20, + "column": 57 + } + }, + "range": [ + 515, + 572 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 20, + "column": 0 + }, + "end": { + "line": 20, + "column": 6 + } + }, + "range": [ + 515, + 521 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 20, + "column": 7 + }, + "end": { + "line": 20, + "column": 48 + } + }, + "range": [ + 522, + 563 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 20, + "column": 7 + }, + "end": { + "line": 20, + "column": 19 + } + }, + "range": [ + 522, + 534 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 20, + "column": 20 + }, + "end": { + "line": 20, + "column": 42 + } + }, + "range": [ + 535, + 557 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 20, + "column": 21 + }, + "end": { + "line": 20, + "column": 41 + } + }, + "range": [ + 536, + 556 + ], + "value": "generator function", + "raw": "'generator function'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 20, + "column": 44 + }, + "end": { + "line": 20, + "column": 47 + } + }, + "range": [ + 559, + 562 + ], + "name": "gen" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 20, + "column": 50 + }, + "end": { + "line": 20, + "column": 56 + } + }, + "range": [ + 565, + 571 + ], + "value": "body", + "raw": "'body'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 21, + "column": 0 + }, + "end": { + "line": 21, + "column": 68 + } + }, + "range": [ + 574, + 642 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 21, + "column": 0 + }, + "end": { + "line": 21, + "column": 67 + } + }, + "range": [ + 574, + 641 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 21, + "column": 0 + }, + "end": { + "line": 21, + "column": 6 + } + }, + "range": [ + 574, + 580 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 21, + "column": 7 + }, + "end": { + "line": 21, + "column": 53 + } + }, + "range": [ + 581, + 627 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 21, + "column": 7 + }, + "end": { + "line": 21, + "column": 19 + } + }, + "range": [ + 581, + 593 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 21, + "column": 20 + }, + "end": { + "line": 21, + "column": 42 + } + }, + "range": [ + 594, + 616 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 21, + "column": 21 + }, + "end": { + "line": 21, + "column": 41 + } + }, + "range": [ + 595, + 615 + ], + "value": "generator function", + "raw": "'generator function'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 21, + "column": 44 + }, + "end": { + "line": 21, + "column": 52 + } + }, + "range": [ + 618, + 626 + ], + "name": "genParam" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 21, + "column": 55 + }, + "end": { + "line": 21, + "column": 66 + } + }, + "range": [ + 629, + 640 + ], + "value": "parameter", + "raw": "'parameter'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 22, + "column": 0 + }, + "end": { + "line": 22, + "column": 58 + } + }, + "range": [ + 643, + 701 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 22, + "column": 0 + }, + "end": { + "line": 22, + "column": 57 + } + }, + "range": [ + 643, + 700 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 22, + "column": 0 + }, + "end": { + "line": 22, + "column": 6 + } + }, + "range": [ + 643, + 649 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 22, + "column": 7 + }, + "end": { + "line": 22, + "column": 48 + } + }, + "range": [ + 650, + 691 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 22, + "column": 7 + }, + "end": { + "line": 22, + "column": 19 + } + }, + "range": [ + 650, + 662 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 22, + "column": 20 + }, + "end": { + "line": 22, + "column": 38 + } + }, + "range": [ + 663, + 681 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 22, + "column": 21 + }, + "end": { + "line": 22, + "column": 37 + } + }, + "range": [ + 664, + 680 + ], + "value": "async function", + "raw": "'async function'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 22, + "column": 40 + }, + "end": { + "line": 22, + "column": 47 + } + }, + "range": [ + 683, + 690 + ], + "name": "asyncFn" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 22, + "column": 50 + }, + "end": { + "line": 22, + "column": 56 + } + }, + "range": [ + 693, + 699 + ], + "value": "body", + "raw": "'body'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 23, + "column": 0 + }, + "end": { + "line": 23, + "column": 68 + } + }, + "range": [ + 702, + 770 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 23, + "column": 0 + }, + "end": { + "line": 23, + "column": 67 + } + }, + "range": [ + 702, + 769 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 23, + "column": 0 + }, + "end": { + "line": 23, + "column": 6 + } + }, + "range": [ + 702, + 708 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 23, + "column": 7 + }, + "end": { + "line": 23, + "column": 53 + } + }, + "range": [ + 709, + 755 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 23, + "column": 7 + }, + "end": { + "line": 23, + "column": 19 + } + }, + "range": [ + 709, + 721 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 23, + "column": 20 + }, + "end": { + "line": 23, + "column": 38 + } + }, + "range": [ + 722, + 740 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 23, + "column": 21 + }, + "end": { + "line": 23, + "column": 37 + } + }, + "range": [ + 723, + 739 + ], + "value": "async function", + "raw": "'async function'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 23, + "column": 40 + }, + "end": { + "line": 23, + "column": 52 + } + }, + "range": [ + 742, + 754 + ], + "name": "asyncFnParam" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 23, + "column": 55 + }, + "end": { + "line": 23, + "column": 66 + } + }, + "range": [ + 757, + 768 + ], + "value": "parameter", + "raw": "'parameter'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "range": [ + 1, + 4 + ] + }, + { + "type": "Identifier", + "value": "fn", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "range": [ + 5, + 7 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 7, + 8 + ] + }, + { + "type": "Identifier", + "value": "fnParam", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "range": [ + 9, + 16 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "range": [ + 16, + 17 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "range": [ + 18, + 21 + ] + }, + { + "type": "Identifier", + "value": "gen", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 22, + 25 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "range": [ + 25, + 26 + ] + }, + { + "type": "Identifier", + "value": "genParam", + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 17 + } + }, + "range": [ + 27, + 35 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 17 + }, + "end": { + "line": 3, + "column": 18 + } + }, + "range": [ + 35, + 36 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 37, + 40 + ] + }, + { + "type": "Identifier", + "value": "asyncFn", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 11 + } + }, + "range": [ + 41, + 48 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 4, + "column": 11 + }, + "end": { + "line": 4, + "column": 12 + } + }, + "range": [ + 48, + 49 + ] + }, + { + "type": "Identifier", + "value": "asyncFnParam", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 25 + } + }, + "range": [ + 50, + 62 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 25 + }, + "end": { + "line": 4, + "column": 26 + } + }, + "range": [ + 62, + 63 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "range": [ + 64, + 69 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "range": [ + 70, + 71 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 8 + }, + "end": { + "line": 5, + "column": 9 + } + }, + "range": [ + 72, + 73 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 8 + } + }, + "range": [ + 76, + 82 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 9 + }, + "end": { + "line": 6, + "column": 10 + } + }, + "range": [ + 83, + 84 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "range": [ + 89, + 90 + ] + }, + { + "type": "Keyword", + "value": "function", + "loc": { + "start": { + "line": 7, + "column": 5 + }, + "end": { + "line": 7, + "column": 13 + } + }, + "range": [ + 90, + 98 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 7, + "column": 13 + }, + "end": { + "line": 7, + "column": 14 + } + }, + "range": [ + 98, + 99 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 14 + }, + "end": { + "line": 7, + "column": 15 + } + }, + "range": [ + 99, + 100 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 7, + "column": 15 + }, + "end": { + "line": 7, + "column": 22 + } + }, + "range": [ + 100, + 107 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 7, + "column": 23 + }, + "end": { + "line": 7, + "column": 24 + } + }, + "range": [ + 108, + 109 + ] + }, + { + "type": "Identifier", + "value": "fnParam", + "loc": { + "start": { + "line": 7, + "column": 25 + }, + "end": { + "line": 7, + "column": 32 + } + }, + "range": [ + 110, + 117 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 7, + "column": 33 + }, + "end": { + "line": 7, + "column": 34 + } + }, + "range": [ + 118, + 119 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 7, + "column": 35 + }, + "end": { + "line": 7, + "column": 44 + } + }, + "range": [ + 120, + 129 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 44 + }, + "end": { + "line": 7, + "column": 45 + } + }, + "range": [ + 129, + 130 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 7, + "column": 45 + }, + "end": { + "line": 7, + "column": 46 + } + }, + "range": [ + 130, + 131 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 47 + }, + "end": { + "line": 7, + "column": 48 + } + }, + "range": [ + 132, + 133 + ] + }, + { + "type": "Identifier", + "value": "fn", + "loc": { + "start": { + "line": 8, + "column": 6 + }, + "end": { + "line": 8, + "column": 8 + } + }, + "range": [ + 140, + 142 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 8, + "column": 10 + } + }, + "range": [ + 143, + 144 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 8, + "column": 11 + }, + "end": { + "line": 8, + "column": 20 + } + }, + "range": [ + 145, + 154 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 8, + "column": 20 + }, + "end": { + "line": 8, + "column": 21 + } + }, + "range": [ + 154, + 155 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 5 + } + }, + "range": [ + 160, + 161 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 9, + "column": 5 + }, + "end": { + "line": 9, + "column": 6 + } + }, + "range": [ + 161, + 162 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 9, + "column": 6 + }, + "end": { + "line": 9, + "column": 7 + } + }, + "range": [ + 162, + 163 + ] + }, + { + "type": "String", + "value": "'function'", + "loc": { + "start": { + "line": 9, + "column": 7 + }, + "end": { + "line": 9, + "column": 17 + } + }, + "range": [ + 163, + 173 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 9, + "column": 17 + }, + "end": { + "line": 9, + "column": 18 + } + }, + "range": [ + 173, + 174 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 19 + } + }, + "range": [ + 174, + 175 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 5 + } + }, + "range": [ + 180, + 181 + ] + }, + { + "type": "Keyword", + "value": "function", + "loc": { + "start": { + "line": 10, + "column": 5 + }, + "end": { + "line": 10, + "column": 13 + } + }, + "range": [ + 181, + 189 + ] + }, + { + "type": "Punctuator", + "value": "*", + "loc": { + "start": { + "line": 10, + "column": 14 + }, + "end": { + "line": 10, + "column": 15 + } + }, + "range": [ + 190, + 191 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 10, + "column": 16 + }, + "end": { + "line": 10, + "column": 17 + } + }, + "range": [ + 192, + 193 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 10, + "column": 17 + }, + "end": { + "line": 10, + "column": 18 + } + }, + "range": [ + 193, + 194 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 25 + } + }, + "range": [ + 194, + 201 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 10, + "column": 26 + }, + "end": { + "line": 10, + "column": 27 + } + }, + "range": [ + 202, + 203 + ] + }, + { + "type": "Identifier", + "value": "genParam", + "loc": { + "start": { + "line": 10, + "column": 28 + }, + "end": { + "line": 10, + "column": 36 + } + }, + "range": [ + 204, + 212 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 10, + "column": 37 + }, + "end": { + "line": 10, + "column": 38 + } + }, + "range": [ + 213, + 214 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 10, + "column": 39 + }, + "end": { + "line": 10, + "column": 48 + } + }, + "range": [ + 215, + 224 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 10, + "column": 48 + }, + "end": { + "line": 10, + "column": 49 + } + }, + "range": [ + 224, + 225 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 10, + "column": 49 + }, + "end": { + "line": 10, + "column": 50 + } + }, + "range": [ + 225, + 226 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 10, + "column": 51 + }, + "end": { + "line": 10, + "column": 52 + } + }, + "range": [ + 227, + 228 + ] + }, + { + "type": "Identifier", + "value": "gen", + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 9 + } + }, + "range": [ + 235, + 238 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 11 + } + }, + "range": [ + 239, + 240 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 11, + "column": 12 + }, + "end": { + "line": 11, + "column": 21 + } + }, + "range": [ + 241, + 250 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 11, + "column": 21 + }, + "end": { + "line": 11, + "column": 22 + } + }, + "range": [ + 250, + 251 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 12, + "column": 4 + }, + "end": { + "line": 12, + "column": 5 + } + }, + "range": [ + 256, + 257 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 12, + "column": 5 + }, + "end": { + "line": 12, + "column": 6 + } + }, + "range": [ + 257, + 258 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 12, + "column": 6 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "range": [ + 258, + 259 + ] + }, + { + "type": "String", + "value": "'generator function'", + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 27 + } + }, + "range": [ + 259, + 279 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 12, + "column": 27 + }, + "end": { + "line": 12, + "column": 28 + } + }, + "range": [ + 279, + 280 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 12, + "column": 28 + }, + "end": { + "line": 12, + "column": 29 + } + }, + "range": [ + 280, + 281 + ] + }, + { + "type": "Identifier", + "value": "next", + "loc": { + "start": { + "line": 12, + "column": 29 + }, + "end": { + "line": 12, + "column": 33 + } + }, + "range": [ + 281, + 285 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 12, + "column": 33 + }, + "end": { + "line": 12, + "column": 34 + } + }, + "range": [ + 285, + 286 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 12, + "column": 34 + }, + "end": { + "line": 12, + "column": 35 + } + }, + "range": [ + 286, + 287 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 12, + "column": 35 + }, + "end": { + "line": 12, + "column": 36 + } + }, + "range": [ + 287, + 288 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 5 + } + }, + "range": [ + 293, + 294 + ] + }, + { + "type": "Identifier", + "value": "async", + "loc": { + "start": { + "line": 13, + "column": 5 + }, + "end": { + "line": 13, + "column": 10 + } + }, + "range": [ + 294, + 299 + ] + }, + { + "type": "Keyword", + "value": "function", + "loc": { + "start": { + "line": 13, + "column": 11 + }, + "end": { + "line": 13, + "column": 19 + } + }, + "range": [ + 300, + 308 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 13, + "column": 20 + }, + "end": { + "line": 13, + "column": 21 + } + }, + "range": [ + 309, + 310 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 13, + "column": 21 + }, + "end": { + "line": 13, + "column": 22 + } + }, + "range": [ + 310, + 311 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 13, + "column": 22 + }, + "end": { + "line": 13, + "column": 29 + } + }, + "range": [ + 311, + 318 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 13, + "column": 30 + }, + "end": { + "line": 13, + "column": 31 + } + }, + "range": [ + 319, + 320 + ] + }, + { + "type": "Identifier", + "value": "asyncFnParam", + "loc": { + "start": { + "line": 13, + "column": 32 + }, + "end": { + "line": 13, + "column": 44 + } + }, + "range": [ + 321, + 333 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 13, + "column": 45 + }, + "end": { + "line": 13, + "column": 46 + } + }, + "range": [ + 334, + 335 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 13, + "column": 47 + }, + "end": { + "line": 13, + "column": 56 + } + }, + "range": [ + 336, + 345 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 13, + "column": 56 + }, + "end": { + "line": 13, + "column": 57 + } + }, + "range": [ + 345, + 346 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 13, + "column": 57 + }, + "end": { + "line": 13, + "column": 58 + } + }, + "range": [ + 346, + 347 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 13, + "column": 59 + }, + "end": { + "line": 13, + "column": 60 + } + }, + "range": [ + 348, + 349 + ] + }, + { + "type": "Identifier", + "value": "asyncFn", + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 13 + } + }, + "range": [ + 356, + 363 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 14, + "column": 14 + }, + "end": { + "line": 14, + "column": 15 + } + }, + "range": [ + 364, + 365 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 14, + "column": 16 + }, + "end": { + "line": 14, + "column": 25 + } + }, + "range": [ + 366, + 375 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 14, + "column": 25 + }, + "end": { + "line": 14, + "column": 26 + } + }, + "range": [ + 375, + 376 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 15, + "column": 4 + }, + "end": { + "line": 15, + "column": 5 + } + }, + "range": [ + 381, + 382 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 15, + "column": 5 + }, + "end": { + "line": 15, + "column": 6 + } + }, + "range": [ + 382, + 383 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 15, + "column": 7 + } + }, + "range": [ + 383, + 384 + ] + }, + { + "type": "String", + "value": "'async function'", + "loc": { + "start": { + "line": 15, + "column": 7 + }, + "end": { + "line": 15, + "column": 23 + } + }, + "range": [ + 384, + 400 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 15, + "column": 23 + }, + "end": { + "line": 15, + "column": 24 + } + }, + "range": [ + 400, + 401 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 15, + "column": 24 + }, + "end": { + "line": 15, + "column": 25 + } + }, + "range": [ + 401, + 402 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 16, + "column": 2 + }, + "end": { + "line": 16, + "column": 3 + } + }, + "range": [ + 405, + 406 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 1 + } + }, + "range": [ + 407, + 408 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 6 + } + }, + "range": [ + 409, + 415 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 18, + "column": 6 + }, + "end": { + "line": 18, + "column": 7 + } + }, + "range": [ + 415, + 416 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 18, + "column": 7 + }, + "end": { + "line": 18, + "column": 19 + } + }, + "range": [ + 416, + 428 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 18, + "column": 19 + }, + "end": { + "line": 18, + "column": 20 + } + }, + "range": [ + 428, + 429 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 18, + "column": 20 + }, + "end": { + "line": 18, + "column": 21 + } + }, + "range": [ + 429, + 430 + ] + }, + { + "type": "String", + "value": "'function'", + "loc": { + "start": { + "line": 18, + "column": 21 + }, + "end": { + "line": 18, + "column": 31 + } + }, + "range": [ + 430, + 440 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 18, + "column": 31 + }, + "end": { + "line": 18, + "column": 32 + } + }, + "range": [ + 440, + 441 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 18, + "column": 32 + }, + "end": { + "line": 18, + "column": 33 + } + }, + "range": [ + 441, + 442 + ] + }, + { + "type": "Identifier", + "value": "fn", + "loc": { + "start": { + "line": 18, + "column": 34 + }, + "end": { + "line": 18, + "column": 36 + } + }, + "range": [ + 443, + 445 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 18, + "column": 36 + }, + "end": { + "line": 18, + "column": 37 + } + }, + "range": [ + 445, + 446 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 18, + "column": 37 + }, + "end": { + "line": 18, + "column": 38 + } + }, + "range": [ + 446, + 447 + ] + }, + { + "type": "String", + "value": "'body'", + "loc": { + "start": { + "line": 18, + "column": 39 + }, + "end": { + "line": 18, + "column": 45 + } + }, + "range": [ + 448, + 454 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 18, + "column": 45 + }, + "end": { + "line": 18, + "column": 46 + } + }, + "range": [ + 454, + 455 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 18, + "column": 46 + }, + "end": { + "line": 18, + "column": 47 + } + }, + "range": [ + 455, + 456 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 6 + } + }, + "range": [ + 457, + 463 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 19, + "column": 6 + }, + "end": { + "line": 19, + "column": 7 + } + }, + "range": [ + 463, + 464 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 19, + "column": 7 + }, + "end": { + "line": 19, + "column": 19 + } + }, + "range": [ + 464, + 476 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 19, + "column": 19 + }, + "end": { + "line": 19, + "column": 20 + } + }, + "range": [ + 476, + 477 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 19, + "column": 20 + }, + "end": { + "line": 19, + "column": 21 + } + }, + "range": [ + 477, + 478 + ] + }, + { + "type": "String", + "value": "'function'", + "loc": { + "start": { + "line": 19, + "column": 21 + }, + "end": { + "line": 19, + "column": 31 + } + }, + "range": [ + 478, + 488 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 19, + "column": 31 + }, + "end": { + "line": 19, + "column": 32 + } + }, + "range": [ + 488, + 489 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 19, + "column": 32 + }, + "end": { + "line": 19, + "column": 33 + } + }, + "range": [ + 489, + 490 + ] + }, + { + "type": "Identifier", + "value": "fnParam", + "loc": { + "start": { + "line": 19, + "column": 34 + }, + "end": { + "line": 19, + "column": 41 + } + }, + "range": [ + 491, + 498 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 19, + "column": 41 + }, + "end": { + "line": 19, + "column": 42 + } + }, + "range": [ + 498, + 499 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 19, + "column": 42 + }, + "end": { + "line": 19, + "column": 43 + } + }, + "range": [ + 499, + 500 + ] + }, + { + "type": "String", + "value": "'parameter'", + "loc": { + "start": { + "line": 19, + "column": 44 + }, + "end": { + "line": 19, + "column": 55 + } + }, + "range": [ + 501, + 512 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 19, + "column": 55 + }, + "end": { + "line": 19, + "column": 56 + } + }, + "range": [ + 512, + 513 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 19, + "column": 56 + }, + "end": { + "line": 19, + "column": 57 + } + }, + "range": [ + 513, + 514 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 20, + "column": 0 + }, + "end": { + "line": 20, + "column": 6 + } + }, + "range": [ + 515, + 521 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 20, + "column": 6 + }, + "end": { + "line": 20, + "column": 7 + } + }, + "range": [ + 521, + 522 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 20, + "column": 7 + }, + "end": { + "line": 20, + "column": 19 + } + }, + "range": [ + 522, + 534 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 20, + "column": 19 + }, + "end": { + "line": 20, + "column": 20 + } + }, + "range": [ + 534, + 535 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 20, + "column": 20 + }, + "end": { + "line": 20, + "column": 21 + } + }, + "range": [ + 535, + 536 + ] + }, + { + "type": "String", + "value": "'generator function'", + "loc": { + "start": { + "line": 20, + "column": 21 + }, + "end": { + "line": 20, + "column": 41 + } + }, + "range": [ + 536, + 556 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 20, + "column": 41 + }, + "end": { + "line": 20, + "column": 42 + } + }, + "range": [ + 556, + 557 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 20, + "column": 42 + }, + "end": { + "line": 20, + "column": 43 + } + }, + "range": [ + 557, + 558 + ] + }, + { + "type": "Identifier", + "value": "gen", + "loc": { + "start": { + "line": 20, + "column": 44 + }, + "end": { + "line": 20, + "column": 47 + } + }, + "range": [ + 559, + 562 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 20, + "column": 47 + }, + "end": { + "line": 20, + "column": 48 + } + }, + "range": [ + 562, + 563 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 20, + "column": 48 + }, + "end": { + "line": 20, + "column": 49 + } + }, + "range": [ + 563, + 564 + ] + }, + { + "type": "String", + "value": "'body'", + "loc": { + "start": { + "line": 20, + "column": 50 + }, + "end": { + "line": 20, + "column": 56 + } + }, + "range": [ + 565, + 571 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 20, + "column": 56 + }, + "end": { + "line": 20, + "column": 57 + } + }, + "range": [ + 571, + 572 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 20, + "column": 57 + }, + "end": { + "line": 20, + "column": 58 + } + }, + "range": [ + 572, + 573 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 21, + "column": 0 + }, + "end": { + "line": 21, + "column": 6 + } + }, + "range": [ + 574, + 580 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 21, + "column": 6 + }, + "end": { + "line": 21, + "column": 7 + } + }, + "range": [ + 580, + 581 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 21, + "column": 7 + }, + "end": { + "line": 21, + "column": 19 + } + }, + "range": [ + 581, + 593 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 21, + "column": 19 + }, + "end": { + "line": 21, + "column": 20 + } + }, + "range": [ + 593, + 594 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 21, + "column": 20 + }, + "end": { + "line": 21, + "column": 21 + } + }, + "range": [ + 594, + 595 + ] + }, + { + "type": "String", + "value": "'generator function'", + "loc": { + "start": { + "line": 21, + "column": 21 + }, + "end": { + "line": 21, + "column": 41 + } + }, + "range": [ + 595, + 615 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 21, + "column": 41 + }, + "end": { + "line": 21, + "column": 42 + } + }, + "range": [ + 615, + 616 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 21, + "column": 42 + }, + "end": { + "line": 21, + "column": 43 + } + }, + "range": [ + 616, + 617 + ] + }, + { + "type": "Identifier", + "value": "genParam", + "loc": { + "start": { + "line": 21, + "column": 44 + }, + "end": { + "line": 21, + "column": 52 + } + }, + "range": [ + 618, + 626 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 21, + "column": 52 + }, + "end": { + "line": 21, + "column": 53 + } + }, + "range": [ + 626, + 627 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 21, + "column": 53 + }, + "end": { + "line": 21, + "column": 54 + } + }, + "range": [ + 627, + 628 + ] + }, + { + "type": "String", + "value": "'parameter'", + "loc": { + "start": { + "line": 21, + "column": 55 + }, + "end": { + "line": 21, + "column": 66 + } + }, + "range": [ + 629, + 640 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 21, + "column": 66 + }, + "end": { + "line": 21, + "column": 67 + } + }, + "range": [ + 640, + 641 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 21, + "column": 67 + }, + "end": { + "line": 21, + "column": 68 + } + }, + "range": [ + 641, + 642 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 22, + "column": 0 + }, + "end": { + "line": 22, + "column": 6 + } + }, + "range": [ + 643, + 649 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 22, + "column": 6 + }, + "end": { + "line": 22, + "column": 7 + } + }, + "range": [ + 649, + 650 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 22, + "column": 7 + }, + "end": { + "line": 22, + "column": 19 + } + }, + "range": [ + 650, + 662 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 22, + "column": 19 + }, + "end": { + "line": 22, + "column": 20 + } + }, + "range": [ + 662, + 663 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 22, + "column": 20 + }, + "end": { + "line": 22, + "column": 21 + } + }, + "range": [ + 663, + 664 + ] + }, + { + "type": "String", + "value": "'async function'", + "loc": { + "start": { + "line": 22, + "column": 21 + }, + "end": { + "line": 22, + "column": 37 + } + }, + "range": [ + 664, + 680 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 22, + "column": 37 + }, + "end": { + "line": 22, + "column": 38 + } + }, + "range": [ + 680, + 681 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 22, + "column": 38 + }, + "end": { + "line": 22, + "column": 39 + } + }, + "range": [ + 681, + 682 + ] + }, + { + "type": "Identifier", + "value": "asyncFn", + "loc": { + "start": { + "line": 22, + "column": 40 + }, + "end": { + "line": 22, + "column": 47 + } + }, + "range": [ + 683, + 690 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 22, + "column": 47 + }, + "end": { + "line": 22, + "column": 48 + } + }, + "range": [ + 690, + 691 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 22, + "column": 48 + }, + "end": { + "line": 22, + "column": 49 + } + }, + "range": [ + 691, + 692 + ] + }, + { + "type": "String", + "value": "'body'", + "loc": { + "start": { + "line": 22, + "column": 50 + }, + "end": { + "line": 22, + "column": 56 + } + }, + "range": [ + 693, + 699 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 22, + "column": 56 + }, + "end": { + "line": 22, + "column": 57 + } + }, + "range": [ + 699, + 700 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 22, + "column": 57 + }, + "end": { + "line": 22, + "column": 58 + } + }, + "range": [ + 700, + 701 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 23, + "column": 0 + }, + "end": { + "line": 23, + "column": 6 + } + }, + "range": [ + 702, + 708 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 23, + "column": 6 + }, + "end": { + "line": 23, + "column": 7 + } + }, + "range": [ + 708, + 709 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 23, + "column": 7 + }, + "end": { + "line": 23, + "column": 19 + } + }, + "range": [ + 709, + 721 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 23, + "column": 19 + }, + "end": { + "line": 23, + "column": 20 + } + }, + "range": [ + 721, + 722 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 23, + "column": 20 + }, + "end": { + "line": 23, + "column": 21 + } + }, + "range": [ + 722, + 723 + ] + }, + { + "type": "String", + "value": "'async function'", + "loc": { + "start": { + "line": 23, + "column": 21 + }, + "end": { + "line": 23, + "column": 37 + } + }, + "range": [ + 723, + 739 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 23, + "column": 37 + }, + "end": { + "line": 23, + "column": 38 + } + }, + "range": [ + 739, + 740 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 23, + "column": 38 + }, + "end": { + "line": 23, + "column": 39 + } + }, + "range": [ + 740, + 741 + ] + }, + { + "type": "Identifier", + "value": "asyncFnParam", + "loc": { + "start": { + "line": 23, + "column": 40 + }, + "end": { + "line": 23, + "column": 52 + } + }, + "range": [ + 742, + 754 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 23, + "column": 52 + }, + "end": { + "line": 23, + "column": 53 + } + }, + "range": [ + 754, + 755 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 23, + "column": 53 + }, + "end": { + "line": 23, + "column": 54 + } + }, + "range": [ + 755, + 756 + ] + }, + { + "type": "String", + "value": "'parameter'", + "loc": { + "start": { + "line": 23, + "column": 55 + }, + "end": { + "line": 23, + "column": 66 + } + }, + "range": [ + 757, + 768 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 23, + "column": 66 + }, + "end": { + "line": 23, + "column": 67 + } + }, + "range": [ + 768, + 769 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 23, + "column": 67 + }, + "end": { + "line": 23, + "column": 68 + } + }, + "range": [ + 769, + 770 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-arguments-functions.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-arguments-functions.src.js new file mode 100644 index 00000000..b844c3c3 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-arguments-functions.src.js @@ -0,0 +1,23 @@ + +var fn, fnParam; +var gen, genParam; +var asyncFn, asyncFnParam; +class C { + static { + (function({test262 = fnParam = arguments}) { + fn = arguments; + })('function'); + (function * ({test262 = genParam = arguments}) { + gen = arguments; + })('generator function').next(); + (async function ({test262 = asyncFnParam = arguments}) { + asyncFn = arguments; + })('async function'); + } +} +assert(compareArray(['function'], fn), 'body'); +assert(compareArray(['function'], fnParam), 'parameter'); +assert(compareArray(['generator function'], gen), 'body'); +assert(compareArray(['generator function'], genParam), 'parameter'); +assert(compareArray(['async function'], asyncFn), 'body'); +assert(compareArray(['async function'], asyncFnParam), 'parameter'); diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-arguments-methods.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-arguments-methods.result.js new file mode 100644 index 00000000..5a5a2960 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-arguments-methods.result.js @@ -0,0 +1,9111 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 42, + "column": 70 + } + }, + "range": [ + 1, + 1320 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "range": [ + 1, + 14 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "range": [ + 5, + 13 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "range": [ + 5, + 13 + ], + "name": "instance" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 24 + } + }, + "range": [ + 15, + 39 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 19, + 25 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 19, + 25 + ], + "name": "method" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 23 + } + }, + "range": [ + 27, + 38 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 23 + } + }, + "range": [ + 27, + 38 + ], + "name": "methodParam" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 11 + } + }, + "range": [ + 40, + 51 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 44, + 50 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 44, + 50 + ], + "name": "getter" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "range": [ + 52, + 76 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 56, + 62 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 56, + 62 + ], + "name": "setter" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 12 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 64, + 75 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 12 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 64, + 75 + ], + "name": "setterParam" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 30 + } + }, + "range": [ + 77, + 107 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 13 + } + }, + "range": [ + 81, + 90 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 13 + } + }, + "range": [ + 81, + 90 + ], + "name": "genMethod" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 6, + "column": 29 + } + }, + "range": [ + 92, + 106 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 6, + "column": 29 + } + }, + "range": [ + 92, + 106 + ], + "name": "genMethodParam" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 34 + } + }, + "range": [ + 108, + 142 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 15 + } + }, + "range": [ + 112, + 123 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 15 + } + }, + "range": [ + 112, + 123 + ], + "name": "asyncMethod" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 7, + "column": 17 + }, + "end": { + "line": 7, + "column": 33 + } + }, + "range": [ + 125, + 141 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 17 + }, + "end": { + "line": 7, + "column": 33 + } + }, + "range": [ + 125, + 141 + ], + "name": "asyncMethodParam" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 28, + "column": 1 + } + }, + "range": [ + 143, + 641 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 6 + }, + "end": { + "line": 8, + "column": 7 + } + }, + "range": [ + 149, + 150 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 28, + "column": 1 + } + }, + "range": [ + 151, + 641 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 27, + "column": 3 + } + }, + "range": [ + 155, + 639 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 26, + "column": 8 + } + }, + "range": [ + 168, + 635 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 26, + "column": 7 + } + }, + "range": [ + 168, + 634 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 12 + } + }, + "range": [ + 168, + 176 + ], + "name": "instance" + }, + "right": { + "type": "NewExpression", + "loc": { + "start": { + "line": 10, + "column": 15 + }, + "end": { + "line": 26, + "column": 7 + } + }, + "range": [ + 179, + 634 + ], + "callee": { + "type": "ClassExpression", + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 26, + "column": 5 + } + }, + "range": [ + 183, + 632 + ], + "id": null, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 10, + "column": 25 + }, + "end": { + "line": 26, + "column": 5 + } + }, + "range": [ + 189, + 632 + ], + "body": [ + { + "type": "MethodDefinition", + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 13, + "column": 7 + } + }, + "range": [ + 197, + 278 + ], + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 12 + } + }, + "range": [ + 197, + 203 + ], + "name": "method" + }, + "kind": "method", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 11, + "column": 12 + }, + "end": { + "line": 13, + "column": 7 + } + }, + "range": [ + 203, + 278 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [ + { + "type": "ObjectPattern", + "loc": { + "start": { + "line": 11, + "column": 13 + }, + "end": { + "line": 11, + "column": 48 + } + }, + "range": [ + 204, + 239 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 11, + "column": 14 + }, + "end": { + "line": 11, + "column": 47 + } + }, + "range": [ + 205, + 238 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 14 + }, + "end": { + "line": 11, + "column": 21 + } + }, + "range": [ + 205, + 212 + ], + "name": "test262" + }, + "kind": "init", + "value": { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 11, + "column": 14 + }, + "end": { + "line": 11, + "column": 47 + } + }, + "range": [ + 205, + 238 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 14 + }, + "end": { + "line": 11, + "column": 21 + } + }, + "range": [ + 205, + 212 + ], + "name": "test262" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 11, + "column": 24 + }, + "end": { + "line": 11, + "column": 47 + } + }, + "range": [ + 215, + 238 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 24 + }, + "end": { + "line": 11, + "column": 35 + } + }, + "range": [ + 215, + 226 + ], + "name": "methodParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 38 + }, + "end": { + "line": 11, + "column": 47 + } + }, + "range": [ + 229, + 238 + ], + "name": "arguments" + } + } + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 11, + "column": 50 + }, + "end": { + "line": 13, + "column": 7 + } + }, + "range": [ + 241, + 278 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 12, + "column": 8 + }, + "end": { + "line": 12, + "column": 27 + } + }, + "range": [ + 251, + 270 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 12, + "column": 8 + }, + "end": { + "line": 12, + "column": 26 + } + }, + "range": [ + 251, + 269 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 8 + }, + "end": { + "line": 12, + "column": 14 + } + }, + "range": [ + 251, + 257 + ], + "name": "method" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 17 + }, + "end": { + "line": 12, + "column": 26 + } + }, + "range": [ + 260, + 269 + ], + "name": "arguments" + } + } + } + ] + } + } + }, + { + "type": "MethodDefinition", + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 16, + "column": 7 + } + }, + "range": [ + 285, + 337 + ], + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 18 + } + }, + "range": [ + 289, + 297 + ], + "name": "accessor" + }, + "kind": "get", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 14, + "column": 18 + }, + "end": { + "line": 16, + "column": 7 + } + }, + "range": [ + 297, + 337 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 14, + "column": 21 + }, + "end": { + "line": 16, + "column": 7 + } + }, + "range": [ + 300, + 337 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 15, + "column": 8 + }, + "end": { + "line": 15, + "column": 27 + } + }, + "range": [ + 310, + 329 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 15, + "column": 8 + }, + "end": { + "line": 15, + "column": 26 + } + }, + "range": [ + 310, + 328 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 8 + }, + "end": { + "line": 15, + "column": 14 + } + }, + "range": [ + 310, + 316 + ], + "name": "getter" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 17 + }, + "end": { + "line": 15, + "column": 26 + } + }, + "range": [ + 319, + 328 + ], + "name": "arguments" + } + } + } + ] + } + } + }, + { + "type": "MethodDefinition", + "loc": { + "start": { + "line": 17, + "column": 6 + }, + "end": { + "line": 19, + "column": 7 + } + }, + "range": [ + 344, + 431 + ], + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 10 + }, + "end": { + "line": 17, + "column": 18 + } + }, + "range": [ + 348, + 356 + ], + "name": "accessor" + }, + "kind": "set", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 17, + "column": 18 + }, + "end": { + "line": 19, + "column": 7 + } + }, + "range": [ + 356, + 431 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [ + { + "type": "ObjectPattern", + "loc": { + "start": { + "line": 17, + "column": 19 + }, + "end": { + "line": 17, + "column": 54 + } + }, + "range": [ + 357, + 392 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 17, + "column": 20 + }, + "end": { + "line": 17, + "column": 53 + } + }, + "range": [ + 358, + 391 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 20 + }, + "end": { + "line": 17, + "column": 27 + } + }, + "range": [ + 358, + 365 + ], + "name": "test262" + }, + "kind": "init", + "value": { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 17, + "column": 20 + }, + "end": { + "line": 17, + "column": 53 + } + }, + "range": [ + 358, + 391 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 20 + }, + "end": { + "line": 17, + "column": 27 + } + }, + "range": [ + 358, + 365 + ], + "name": "test262" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 17, + "column": 30 + }, + "end": { + "line": 17, + "column": 53 + } + }, + "range": [ + 368, + 391 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 30 + }, + "end": { + "line": 17, + "column": 41 + } + }, + "range": [ + 368, + 379 + ], + "name": "setterParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 44 + }, + "end": { + "line": 17, + "column": 53 + } + }, + "range": [ + 382, + 391 + ], + "name": "arguments" + } + } + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 17, + "column": 56 + }, + "end": { + "line": 19, + "column": 7 + } + }, + "range": [ + 394, + 431 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 18, + "column": 8 + }, + "end": { + "line": 18, + "column": 27 + } + }, + "range": [ + 404, + 423 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 18, + "column": 8 + }, + "end": { + "line": 18, + "column": 26 + } + }, + "range": [ + 404, + 422 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 8 + }, + "end": { + "line": 18, + "column": 14 + } + }, + "range": [ + 404, + 410 + ], + "name": "setter" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 26 + } + }, + "range": [ + 413, + 422 + ], + "name": "arguments" + } + } + } + ] + } + } + }, + { + "type": "MethodDefinition", + "loc": { + "start": { + "line": 20, + "column": 6 + }, + "end": { + "line": 22, + "column": 7 + } + }, + "range": [ + 438, + 523 + ], + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 20, + "column": 7 + }, + "end": { + "line": 20, + "column": 10 + } + }, + "range": [ + 439, + 442 + ], + "name": "gen" + }, + "kind": "method", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 20, + "column": 10 + }, + "end": { + "line": 22, + "column": 7 + } + }, + "range": [ + 442, + 523 + ], + "id": null, + "expression": false, + "generator": true, + "async": false, + "params": [ + { + "type": "ObjectPattern", + "loc": { + "start": { + "line": 20, + "column": 11 + }, + "end": { + "line": 20, + "column": 49 + } + }, + "range": [ + 443, + 481 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 20, + "column": 12 + }, + "end": { + "line": 20, + "column": 48 + } + }, + "range": [ + 444, + 480 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 20, + "column": 12 + }, + "end": { + "line": 20, + "column": 19 + } + }, + "range": [ + 444, + 451 + ], + "name": "test262" + }, + "kind": "init", + "value": { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 20, + "column": 12 + }, + "end": { + "line": 20, + "column": 48 + } + }, + "range": [ + 444, + 480 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 20, + "column": 12 + }, + "end": { + "line": 20, + "column": 19 + } + }, + "range": [ + 444, + 451 + ], + "name": "test262" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 20, + "column": 22 + }, + "end": { + "line": 20, + "column": 48 + } + }, + "range": [ + 454, + 480 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 20, + "column": 22 + }, + "end": { + "line": 20, + "column": 36 + } + }, + "range": [ + 454, + 468 + ], + "name": "genMethodParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 20, + "column": 39 + }, + "end": { + "line": 20, + "column": 48 + } + }, + "range": [ + 471, + 480 + ], + "name": "arguments" + } + } + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 20, + "column": 51 + }, + "end": { + "line": 22, + "column": 7 + } + }, + "range": [ + 483, + 523 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 21, + "column": 8 + }, + "end": { + "line": 21, + "column": 30 + } + }, + "range": [ + 493, + 515 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 21, + "column": 8 + }, + "end": { + "line": 21, + "column": 29 + } + }, + "range": [ + 493, + 514 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 21, + "column": 8 + }, + "end": { + "line": 21, + "column": 17 + } + }, + "range": [ + 493, + 502 + ], + "name": "genMethod" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 21, + "column": 20 + }, + "end": { + "line": 21, + "column": 29 + } + }, + "range": [ + 505, + 514 + ], + "name": "arguments" + } + } + } + ] + } + } + }, + { + "type": "MethodDefinition", + "loc": { + "start": { + "line": 23, + "column": 6 + }, + "end": { + "line": 25, + "column": 7 + } + }, + "range": [ + 530, + 626 + ], + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 23, + "column": 12 + }, + "end": { + "line": 23, + "column": 17 + } + }, + "range": [ + 536, + 541 + ], + "name": "async" + }, + "kind": "method", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 23, + "column": 17 + }, + "end": { + "line": 25, + "column": 7 + } + }, + "range": [ + 541, + 626 + ], + "id": null, + "expression": false, + "generator": false, + "async": true, + "params": [ + { + "type": "ObjectPattern", + "loc": { + "start": { + "line": 23, + "column": 18 + }, + "end": { + "line": 23, + "column": 58 + } + }, + "range": [ + 542, + 582 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 23, + "column": 19 + }, + "end": { + "line": 23, + "column": 57 + } + }, + "range": [ + 543, + 581 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 23, + "column": 19 + }, + "end": { + "line": 23, + "column": 26 + } + }, + "range": [ + 543, + 550 + ], + "name": "test262" + }, + "kind": "init", + "value": { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 23, + "column": 19 + }, + "end": { + "line": 23, + "column": 57 + } + }, + "range": [ + 543, + 581 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 23, + "column": 19 + }, + "end": { + "line": 23, + "column": 26 + } + }, + "range": [ + 543, + 550 + ], + "name": "test262" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 23, + "column": 29 + }, + "end": { + "line": 23, + "column": 57 + } + }, + "range": [ + 553, + 581 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 23, + "column": 29 + }, + "end": { + "line": 23, + "column": 45 + } + }, + "range": [ + 553, + 569 + ], + "name": "asyncMethodParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 23, + "column": 48 + }, + "end": { + "line": 23, + "column": 57 + } + }, + "range": [ + 572, + 581 + ], + "name": "arguments" + } + } + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 23, + "column": 60 + }, + "end": { + "line": 25, + "column": 7 + } + }, + "range": [ + 584, + 626 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 24, + "column": 8 + }, + "end": { + "line": 24, + "column": 32 + } + }, + "range": [ + 594, + 618 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 24, + "column": 8 + }, + "end": { + "line": 24, + "column": 31 + } + }, + "range": [ + 594, + 617 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 24, + "column": 8 + }, + "end": { + "line": 24, + "column": 19 + } + }, + "range": [ + 594, + 605 + ], + "name": "asyncMethod" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 24, + "column": 22 + }, + "end": { + "line": 24, + "column": 31 + } + }, + "range": [ + 608, + 617 + ], + "name": "arguments" + } + } + } + ] + } + } + } + ] + } + }, + "arguments": [] + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 29, + "column": 0 + }, + "end": { + "line": 29, + "column": 26 + } + }, + "range": [ + 642, + 668 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 29, + "column": 0 + }, + "end": { + "line": 29, + "column": 25 + } + }, + "range": [ + 642, + 667 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 29, + "column": 0 + }, + "end": { + "line": 29, + "column": 15 + } + }, + "range": [ + 642, + 657 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 29, + "column": 0 + }, + "end": { + "line": 29, + "column": 8 + } + }, + "range": [ + 642, + 650 + ], + "name": "instance" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 29, + "column": 9 + }, + "end": { + "line": 29, + "column": 15 + } + }, + "range": [ + 651, + 657 + ], + "name": "method" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 29, + "column": 16 + }, + "end": { + "line": 29, + "column": 24 + } + }, + "range": [ + 658, + 666 + ], + "value": "method", + "raw": "'method'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 30, + "column": 0 + }, + "end": { + "line": 30, + "column": 18 + } + }, + "range": [ + 669, + 687 + ], + "expression": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 30, + "column": 0 + }, + "end": { + "line": 30, + "column": 17 + } + }, + "range": [ + 669, + 686 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 30, + "column": 0 + }, + "end": { + "line": 30, + "column": 8 + } + }, + "range": [ + 669, + 677 + ], + "name": "instance" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 30, + "column": 9 + }, + "end": { + "line": 30, + "column": 17 + } + }, + "range": [ + 678, + 686 + ], + "name": "accessor" + }, + "computed": false, + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 31, + "column": 0 + }, + "end": { + "line": 31, + "column": 29 + } + }, + "range": [ + 688, + 717 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 31, + "column": 0 + }, + "end": { + "line": 31, + "column": 28 + } + }, + "range": [ + 688, + 716 + ], + "operator": "=", + "left": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 31, + "column": 0 + }, + "end": { + "line": 31, + "column": 17 + } + }, + "range": [ + 688, + 705 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 31, + "column": 0 + }, + "end": { + "line": 31, + "column": 8 + } + }, + "range": [ + 688, + 696 + ], + "name": "instance" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 31, + "column": 9 + }, + "end": { + "line": 31, + "column": 17 + } + }, + "range": [ + 697, + 705 + ], + "name": "accessor" + }, + "computed": false, + "optional": false + }, + "right": { + "type": "Literal", + "loc": { + "start": { + "line": 31, + "column": 20 + }, + "end": { + "line": 31, + "column": 28 + } + }, + "range": [ + 708, + 716 + ], + "value": "setter", + "raw": "'setter'" + } + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 32, + "column": 0 + }, + "end": { + "line": 32, + "column": 40 + } + }, + "range": [ + 718, + 758 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 32, + "column": 0 + }, + "end": { + "line": 32, + "column": 39 + } + }, + "range": [ + 718, + 757 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 32, + "column": 0 + }, + "end": { + "line": 32, + "column": 37 + } + }, + "range": [ + 718, + 755 + ], + "object": { + "type": "CallExpression", + "loc": { + "start": { + "line": 32, + "column": 0 + }, + "end": { + "line": 32, + "column": 32 + } + }, + "range": [ + 718, + 750 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 32, + "column": 0 + }, + "end": { + "line": 32, + "column": 12 + } + }, + "range": [ + 718, + 730 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 32, + "column": 0 + }, + "end": { + "line": 32, + "column": 8 + } + }, + "range": [ + 718, + 726 + ], + "name": "instance" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 32, + "column": 9 + }, + "end": { + "line": 32, + "column": 12 + } + }, + "range": [ + 727, + 730 + ], + "name": "gen" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 32, + "column": 13 + }, + "end": { + "line": 32, + "column": 31 + } + }, + "range": [ + 731, + 749 + ], + "value": "generator method", + "raw": "'generator method'" + } + ], + "optional": false + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 32, + "column": 33 + }, + "end": { + "line": 32, + "column": 37 + } + }, + "range": [ + 751, + 755 + ], + "name": "next" + }, + "computed": false, + "optional": false + }, + "arguments": [], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 33, + "column": 0 + }, + "end": { + "line": 33, + "column": 31 + } + }, + "range": [ + 759, + 790 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 33, + "column": 0 + }, + "end": { + "line": 33, + "column": 30 + } + }, + "range": [ + 759, + 789 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 33, + "column": 0 + }, + "end": { + "line": 33, + "column": 14 + } + }, + "range": [ + 759, + 773 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 33, + "column": 0 + }, + "end": { + "line": 33, + "column": 8 + } + }, + "range": [ + 759, + 767 + ], + "name": "instance" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 33, + "column": 9 + }, + "end": { + "line": 33, + "column": 14 + } + }, + "range": [ + 768, + 773 + ], + "name": "async" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 33, + "column": 15 + }, + "end": { + "line": 33, + "column": 29 + } + }, + "range": [ + 774, + 788 + ], + "value": "async method", + "raw": "'async method'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 34, + "column": 0 + }, + "end": { + "line": 34, + "column": 49 + } + }, + "range": [ + 791, + 840 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 34, + "column": 0 + }, + "end": { + "line": 34, + "column": 48 + } + }, + "range": [ + 791, + 839 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 34, + "column": 0 + }, + "end": { + "line": 34, + "column": 6 + } + }, + "range": [ + 791, + 797 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 34, + "column": 7 + }, + "end": { + "line": 34, + "column": 39 + } + }, + "range": [ + 798, + 830 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 34, + "column": 7 + }, + "end": { + "line": 34, + "column": 19 + } + }, + "range": [ + 798, + 810 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 34, + "column": 20 + }, + "end": { + "line": 34, + "column": 30 + } + }, + "range": [ + 811, + 821 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 34, + "column": 21 + }, + "end": { + "line": 34, + "column": 29 + } + }, + "range": [ + 812, + 820 + ], + "value": "method", + "raw": "'method'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 34, + "column": 32 + }, + "end": { + "line": 34, + "column": 38 + } + }, + "range": [ + 823, + 829 + ], + "name": "method" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 34, + "column": 41 + }, + "end": { + "line": 34, + "column": 47 + } + }, + "range": [ + 832, + 838 + ], + "value": "body", + "raw": "'body'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 35, + "column": 0 + }, + "end": { + "line": 35, + "column": 59 + } + }, + "range": [ + 841, + 900 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 35, + "column": 0 + }, + "end": { + "line": 35, + "column": 58 + } + }, + "range": [ + 841, + 899 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 35, + "column": 0 + }, + "end": { + "line": 35, + "column": 6 + } + }, + "range": [ + 841, + 847 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 35, + "column": 7 + }, + "end": { + "line": 35, + "column": 44 + } + }, + "range": [ + 848, + 885 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 35, + "column": 7 + }, + "end": { + "line": 35, + "column": 19 + } + }, + "range": [ + 848, + 860 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 35, + "column": 20 + }, + "end": { + "line": 35, + "column": 30 + } + }, + "range": [ + 861, + 871 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 35, + "column": 21 + }, + "end": { + "line": 35, + "column": 29 + } + }, + "range": [ + 862, + 870 + ], + "value": "method", + "raw": "'method'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 35, + "column": 32 + }, + "end": { + "line": 35, + "column": 43 + } + }, + "range": [ + 873, + 884 + ], + "name": "methodParam" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 35, + "column": 46 + }, + "end": { + "line": 35, + "column": 57 + } + }, + "range": [ + 887, + 898 + ], + "value": "parameter", + "raw": "'parameter'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 36, + "column": 0 + }, + "end": { + "line": 36, + "column": 41 + } + }, + "range": [ + 901, + 942 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 36, + "column": 0 + }, + "end": { + "line": 36, + "column": 40 + } + }, + "range": [ + 901, + 941 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 36, + "column": 0 + }, + "end": { + "line": 36, + "column": 6 + } + }, + "range": [ + 901, + 907 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 36, + "column": 7 + }, + "end": { + "line": 36, + "column": 31 + } + }, + "range": [ + 908, + 932 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 36, + "column": 7 + }, + "end": { + "line": 36, + "column": 19 + } + }, + "range": [ + 908, + 920 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 36, + "column": 20 + }, + "end": { + "line": 36, + "column": 22 + } + }, + "range": [ + 921, + 923 + ], + "elements": [] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 36, + "column": 24 + }, + "end": { + "line": 36, + "column": 30 + } + }, + "range": [ + 925, + 931 + ], + "name": "getter" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 36, + "column": 33 + }, + "end": { + "line": 36, + "column": 39 + } + }, + "range": [ + 934, + 940 + ], + "value": "body", + "raw": "'body'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 37, + "column": 0 + }, + "end": { + "line": 37, + "column": 49 + } + }, + "range": [ + 943, + 992 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 37, + "column": 0 + }, + "end": { + "line": 37, + "column": 48 + } + }, + "range": [ + 943, + 991 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 37, + "column": 0 + }, + "end": { + "line": 37, + "column": 6 + } + }, + "range": [ + 943, + 949 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 37, + "column": 7 + }, + "end": { + "line": 37, + "column": 39 + } + }, + "range": [ + 950, + 982 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 37, + "column": 7 + }, + "end": { + "line": 37, + "column": 19 + } + }, + "range": [ + 950, + 962 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 37, + "column": 20 + }, + "end": { + "line": 37, + "column": 30 + } + }, + "range": [ + 963, + 973 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 37, + "column": 21 + }, + "end": { + "line": 37, + "column": 29 + } + }, + "range": [ + 964, + 972 + ], + "value": "setter", + "raw": "'setter'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 37, + "column": 32 + }, + "end": { + "line": 37, + "column": 38 + } + }, + "range": [ + 975, + 981 + ], + "name": "setter" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 37, + "column": 41 + }, + "end": { + "line": 37, + "column": 47 + } + }, + "range": [ + 984, + 990 + ], + "value": "body", + "raw": "'body'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 38, + "column": 0 + }, + "end": { + "line": 38, + "column": 59 + } + }, + "range": [ + 993, + 1052 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 38, + "column": 0 + }, + "end": { + "line": 38, + "column": 58 + } + }, + "range": [ + 993, + 1051 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 38, + "column": 0 + }, + "end": { + "line": 38, + "column": 6 + } + }, + "range": [ + 993, + 999 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 38, + "column": 7 + }, + "end": { + "line": 38, + "column": 44 + } + }, + "range": [ + 1000, + 1037 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 38, + "column": 7 + }, + "end": { + "line": 38, + "column": 19 + } + }, + "range": [ + 1000, + 1012 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 38, + "column": 20 + }, + "end": { + "line": 38, + "column": 30 + } + }, + "range": [ + 1013, + 1023 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 38, + "column": 21 + }, + "end": { + "line": 38, + "column": 29 + } + }, + "range": [ + 1014, + 1022 + ], + "value": "setter", + "raw": "'setter'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 38, + "column": 32 + }, + "end": { + "line": 38, + "column": 43 + } + }, + "range": [ + 1025, + 1036 + ], + "name": "setterParam" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 38, + "column": 46 + }, + "end": { + "line": 38, + "column": 57 + } + }, + "range": [ + 1039, + 1050 + ], + "value": "parameter", + "raw": "'parameter'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 39, + "column": 0 + }, + "end": { + "line": 39, + "column": 62 + } + }, + "range": [ + 1053, + 1115 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 39, + "column": 0 + }, + "end": { + "line": 39, + "column": 61 + } + }, + "range": [ + 1053, + 1114 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 39, + "column": 0 + }, + "end": { + "line": 39, + "column": 6 + } + }, + "range": [ + 1053, + 1059 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 39, + "column": 7 + }, + "end": { + "line": 39, + "column": 52 + } + }, + "range": [ + 1060, + 1105 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 39, + "column": 7 + }, + "end": { + "line": 39, + "column": 19 + } + }, + "range": [ + 1060, + 1072 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 39, + "column": 20 + }, + "end": { + "line": 39, + "column": 40 + } + }, + "range": [ + 1073, + 1093 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 39, + "column": 21 + }, + "end": { + "line": 39, + "column": 39 + } + }, + "range": [ + 1074, + 1092 + ], + "value": "generator method", + "raw": "'generator method'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 39, + "column": 42 + }, + "end": { + "line": 39, + "column": 51 + } + }, + "range": [ + 1095, + 1104 + ], + "name": "genMethod" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 39, + "column": 54 + }, + "end": { + "line": 39, + "column": 60 + } + }, + "range": [ + 1107, + 1113 + ], + "value": "body", + "raw": "'body'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 40, + "column": 0 + }, + "end": { + "line": 40, + "column": 72 + } + }, + "range": [ + 1116, + 1188 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 40, + "column": 0 + }, + "end": { + "line": 40, + "column": 71 + } + }, + "range": [ + 1116, + 1187 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 40, + "column": 0 + }, + "end": { + "line": 40, + "column": 6 + } + }, + "range": [ + 1116, + 1122 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 40, + "column": 7 + }, + "end": { + "line": 40, + "column": 57 + } + }, + "range": [ + 1123, + 1173 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 40, + "column": 7 + }, + "end": { + "line": 40, + "column": 19 + } + }, + "range": [ + 1123, + 1135 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 40, + "column": 20 + }, + "end": { + "line": 40, + "column": 40 + } + }, + "range": [ + 1136, + 1156 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 40, + "column": 21 + }, + "end": { + "line": 40, + "column": 39 + } + }, + "range": [ + 1137, + 1155 + ], + "value": "generator method", + "raw": "'generator method'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 40, + "column": 42 + }, + "end": { + "line": 40, + "column": 56 + } + }, + "range": [ + 1158, + 1172 + ], + "name": "genMethodParam" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 40, + "column": 59 + }, + "end": { + "line": 40, + "column": 70 + } + }, + "range": [ + 1175, + 1186 + ], + "value": "parameter", + "raw": "'parameter'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 41, + "column": 0 + }, + "end": { + "line": 41, + "column": 60 + } + }, + "range": [ + 1189, + 1249 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 41, + "column": 0 + }, + "end": { + "line": 41, + "column": 59 + } + }, + "range": [ + 1189, + 1248 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 41, + "column": 0 + }, + "end": { + "line": 41, + "column": 6 + } + }, + "range": [ + 1189, + 1195 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 41, + "column": 7 + }, + "end": { + "line": 41, + "column": 50 + } + }, + "range": [ + 1196, + 1239 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 41, + "column": 7 + }, + "end": { + "line": 41, + "column": 19 + } + }, + "range": [ + 1196, + 1208 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 41, + "column": 20 + }, + "end": { + "line": 41, + "column": 36 + } + }, + "range": [ + 1209, + 1225 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 41, + "column": 21 + }, + "end": { + "line": 41, + "column": 35 + } + }, + "range": [ + 1210, + 1224 + ], + "value": "async method", + "raw": "'async method'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 41, + "column": 38 + }, + "end": { + "line": 41, + "column": 49 + } + }, + "range": [ + 1227, + 1238 + ], + "name": "asyncMethod" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 41, + "column": 52 + }, + "end": { + "line": 41, + "column": 58 + } + }, + "range": [ + 1241, + 1247 + ], + "value": "body", + "raw": "'body'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 42, + "column": 0 + }, + "end": { + "line": 42, + "column": 70 + } + }, + "range": [ + 1250, + 1320 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 42, + "column": 0 + }, + "end": { + "line": 42, + "column": 69 + } + }, + "range": [ + 1250, + 1319 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 42, + "column": 0 + }, + "end": { + "line": 42, + "column": 6 + } + }, + "range": [ + 1250, + 1256 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 42, + "column": 7 + }, + "end": { + "line": 42, + "column": 55 + } + }, + "range": [ + 1257, + 1305 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 42, + "column": 7 + }, + "end": { + "line": 42, + "column": 19 + } + }, + "range": [ + 1257, + 1269 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 42, + "column": 20 + }, + "end": { + "line": 42, + "column": 36 + } + }, + "range": [ + 1270, + 1286 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 42, + "column": 21 + }, + "end": { + "line": 42, + "column": 35 + } + }, + "range": [ + 1271, + 1285 + ], + "value": "async method", + "raw": "'async method'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 42, + "column": 38 + }, + "end": { + "line": 42, + "column": 54 + } + }, + "range": [ + 1288, + 1304 + ], + "name": "asyncMethodParam" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 42, + "column": 57 + }, + "end": { + "line": 42, + "column": 68 + } + }, + "range": [ + 1307, + 1318 + ], + "value": "parameter", + "raw": "'parameter'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "range": [ + 1, + 4 + ] + }, + { + "type": "Identifier", + "value": "instance", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "range": [ + 5, + 13 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "range": [ + 13, + 14 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "range": [ + 15, + 18 + ] + }, + { + "type": "Identifier", + "value": "method", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 19, + 25 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "range": [ + 25, + 26 + ] + }, + { + "type": "Identifier", + "value": "methodParam", + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 23 + } + }, + "range": [ + 27, + 38 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 23 + }, + "end": { + "line": 3, + "column": 24 + } + }, + "range": [ + 38, + 39 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 40, + 43 + ] + }, + { + "type": "Identifier", + "value": "getter", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 44, + 50 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 10 + }, + "end": { + "line": 4, + "column": 11 + } + }, + "range": [ + 50, + 51 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 52, + 55 + ] + }, + { + "type": "Identifier", + "value": "setter", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 56, + 62 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 5, + "column": 10 + }, + "end": { + "line": 5, + "column": 11 + } + }, + "range": [ + 62, + 63 + ] + }, + { + "type": "Identifier", + "value": "setterParam", + "loc": { + "start": { + "line": 5, + "column": 12 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 64, + 75 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 23 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "range": [ + 75, + 76 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 77, + 80 + ] + }, + { + "type": "Identifier", + "value": "genMethod", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 13 + } + }, + "range": [ + 81, + 90 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 14 + } + }, + "range": [ + 90, + 91 + ] + }, + { + "type": "Identifier", + "value": "genMethodParam", + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 6, + "column": 29 + } + }, + "range": [ + 92, + 106 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 29 + }, + "end": { + "line": 6, + "column": 30 + } + }, + "range": [ + 106, + 107 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 108, + 111 + ] + }, + { + "type": "Identifier", + "value": "asyncMethod", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 15 + } + }, + "range": [ + 112, + 123 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 7, + "column": 15 + }, + "end": { + "line": 7, + "column": 16 + } + }, + "range": [ + 123, + 124 + ] + }, + { + "type": "Identifier", + "value": "asyncMethodParam", + "loc": { + "start": { + "line": 7, + "column": 17 + }, + "end": { + "line": 7, + "column": 33 + } + }, + "range": [ + 125, + 141 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 7, + "column": 33 + }, + "end": { + "line": 7, + "column": 34 + } + }, + "range": [ + 141, + 142 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 5 + } + }, + "range": [ + 143, + 148 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 8, + "column": 6 + }, + "end": { + "line": 8, + "column": 7 + } + }, + "range": [ + 149, + 150 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 9 + } + }, + "range": [ + 151, + 152 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 9, + "column": 8 + } + }, + "range": [ + 155, + 161 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 10 + } + }, + "range": [ + 162, + 163 + ] + }, + { + "type": "Identifier", + "value": "instance", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 12 + } + }, + "range": [ + 168, + 176 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 10, + "column": 13 + }, + "end": { + "line": 10, + "column": 14 + } + }, + "range": [ + 177, + 178 + ] + }, + { + "type": "Keyword", + "value": "new", + "loc": { + "start": { + "line": 10, + "column": 15 + }, + "end": { + "line": 10, + "column": 18 + } + }, + "range": [ + 179, + 182 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 24 + } + }, + "range": [ + 183, + 188 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 10, + "column": 25 + }, + "end": { + "line": 10, + "column": 26 + } + }, + "range": [ + 189, + 190 + ] + }, + { + "type": "Identifier", + "value": "method", + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 12 + } + }, + "range": [ + 197, + 203 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 11, + "column": 12 + }, + "end": { + "line": 11, + "column": 13 + } + }, + "range": [ + 203, + 204 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 11, + "column": 13 + }, + "end": { + "line": 11, + "column": 14 + } + }, + "range": [ + 204, + 205 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 11, + "column": 14 + }, + "end": { + "line": 11, + "column": 21 + } + }, + "range": [ + 205, + 212 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 11, + "column": 22 + }, + "end": { + "line": 11, + "column": 23 + } + }, + "range": [ + 213, + 214 + ] + }, + { + "type": "Identifier", + "value": "methodParam", + "loc": { + "start": { + "line": 11, + "column": 24 + }, + "end": { + "line": 11, + "column": 35 + } + }, + "range": [ + 215, + 226 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 11, + "column": 36 + }, + "end": { + "line": 11, + "column": 37 + } + }, + "range": [ + 227, + 228 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 11, + "column": 38 + }, + "end": { + "line": 11, + "column": 47 + } + }, + "range": [ + 229, + 238 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 11, + "column": 47 + }, + "end": { + "line": 11, + "column": 48 + } + }, + "range": [ + 238, + 239 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 11, + "column": 48 + }, + "end": { + "line": 11, + "column": 49 + } + }, + "range": [ + 239, + 240 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 11, + "column": 50 + }, + "end": { + "line": 11, + "column": 51 + } + }, + "range": [ + 241, + 242 + ] + }, + { + "type": "Identifier", + "value": "method", + "loc": { + "start": { + "line": 12, + "column": 8 + }, + "end": { + "line": 12, + "column": 14 + } + }, + "range": [ + 251, + 257 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 12, + "column": 15 + }, + "end": { + "line": 12, + "column": 16 + } + }, + "range": [ + 258, + 259 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 12, + "column": 17 + }, + "end": { + "line": 12, + "column": 26 + } + }, + "range": [ + 260, + 269 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 12, + "column": 26 + }, + "end": { + "line": 12, + "column": 27 + } + }, + "range": [ + 269, + 270 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 13, + "column": 6 + }, + "end": { + "line": 13, + "column": 7 + } + }, + "range": [ + 277, + 278 + ] + }, + { + "type": "Identifier", + "value": "get", + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 9 + } + }, + "range": [ + 285, + 288 + ] + }, + { + "type": "Identifier", + "value": "accessor", + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 18 + } + }, + "range": [ + 289, + 297 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 14, + "column": 18 + }, + "end": { + "line": 14, + "column": 19 + } + }, + "range": [ + 297, + 298 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 14, + "column": 19 + }, + "end": { + "line": 14, + "column": 20 + } + }, + "range": [ + 298, + 299 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 14, + "column": 21 + }, + "end": { + "line": 14, + "column": 22 + } + }, + "range": [ + 300, + 301 + ] + }, + { + "type": "Identifier", + "value": "getter", + "loc": { + "start": { + "line": 15, + "column": 8 + }, + "end": { + "line": 15, + "column": 14 + } + }, + "range": [ + 310, + 316 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 15, + "column": 15 + }, + "end": { + "line": 15, + "column": 16 + } + }, + "range": [ + 317, + 318 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 15, + "column": 17 + }, + "end": { + "line": 15, + "column": 26 + } + }, + "range": [ + 319, + 328 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 15, + "column": 26 + }, + "end": { + "line": 15, + "column": 27 + } + }, + "range": [ + 328, + 329 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 16, + "column": 6 + }, + "end": { + "line": 16, + "column": 7 + } + }, + "range": [ + 336, + 337 + ] + }, + { + "type": "Identifier", + "value": "set", + "loc": { + "start": { + "line": 17, + "column": 6 + }, + "end": { + "line": 17, + "column": 9 + } + }, + "range": [ + 344, + 347 + ] + }, + { + "type": "Identifier", + "value": "accessor", + "loc": { + "start": { + "line": 17, + "column": 10 + }, + "end": { + "line": 17, + "column": 18 + } + }, + "range": [ + 348, + 356 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 17, + "column": 18 + }, + "end": { + "line": 17, + "column": 19 + } + }, + "range": [ + 356, + 357 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 17, + "column": 19 + }, + "end": { + "line": 17, + "column": 20 + } + }, + "range": [ + 357, + 358 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 17, + "column": 20 + }, + "end": { + "line": 17, + "column": 27 + } + }, + "range": [ + 358, + 365 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 17, + "column": 28 + }, + "end": { + "line": 17, + "column": 29 + } + }, + "range": [ + 366, + 367 + ] + }, + { + "type": "Identifier", + "value": "setterParam", + "loc": { + "start": { + "line": 17, + "column": 30 + }, + "end": { + "line": 17, + "column": 41 + } + }, + "range": [ + 368, + 379 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 17, + "column": 42 + }, + "end": { + "line": 17, + "column": 43 + } + }, + "range": [ + 380, + 381 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 17, + "column": 44 + }, + "end": { + "line": 17, + "column": 53 + } + }, + "range": [ + 382, + 391 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 17, + "column": 53 + }, + "end": { + "line": 17, + "column": 54 + } + }, + "range": [ + 391, + 392 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 17, + "column": 54 + }, + "end": { + "line": 17, + "column": 55 + } + }, + "range": [ + 392, + 393 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 17, + "column": 56 + }, + "end": { + "line": 17, + "column": 57 + } + }, + "range": [ + 394, + 395 + ] + }, + { + "type": "Identifier", + "value": "setter", + "loc": { + "start": { + "line": 18, + "column": 8 + }, + "end": { + "line": 18, + "column": 14 + } + }, + "range": [ + 404, + 410 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 18, + "column": 15 + }, + "end": { + "line": 18, + "column": 16 + } + }, + "range": [ + 411, + 412 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 26 + } + }, + "range": [ + 413, + 422 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 18, + "column": 26 + }, + "end": { + "line": 18, + "column": 27 + } + }, + "range": [ + 422, + 423 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 19, + "column": 6 + }, + "end": { + "line": 19, + "column": 7 + } + }, + "range": [ + 430, + 431 + ] + }, + { + "type": "Punctuator", + "value": "*", + "loc": { + "start": { + "line": 20, + "column": 6 + }, + "end": { + "line": 20, + "column": 7 + } + }, + "range": [ + 438, + 439 + ] + }, + { + "type": "Identifier", + "value": "gen", + "loc": { + "start": { + "line": 20, + "column": 7 + }, + "end": { + "line": 20, + "column": 10 + } + }, + "range": [ + 439, + 442 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 20, + "column": 10 + }, + "end": { + "line": 20, + "column": 11 + } + }, + "range": [ + 442, + 443 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 20, + "column": 11 + }, + "end": { + "line": 20, + "column": 12 + } + }, + "range": [ + 443, + 444 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 20, + "column": 12 + }, + "end": { + "line": 20, + "column": 19 + } + }, + "range": [ + 444, + 451 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 20, + "column": 20 + }, + "end": { + "line": 20, + "column": 21 + } + }, + "range": [ + 452, + 453 + ] + }, + { + "type": "Identifier", + "value": "genMethodParam", + "loc": { + "start": { + "line": 20, + "column": 22 + }, + "end": { + "line": 20, + "column": 36 + } + }, + "range": [ + 454, + 468 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 20, + "column": 37 + }, + "end": { + "line": 20, + "column": 38 + } + }, + "range": [ + 469, + 470 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 20, + "column": 39 + }, + "end": { + "line": 20, + "column": 48 + } + }, + "range": [ + 471, + 480 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 20, + "column": 48 + }, + "end": { + "line": 20, + "column": 49 + } + }, + "range": [ + 480, + 481 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 20, + "column": 49 + }, + "end": { + "line": 20, + "column": 50 + } + }, + "range": [ + 481, + 482 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 20, + "column": 51 + }, + "end": { + "line": 20, + "column": 52 + } + }, + "range": [ + 483, + 484 + ] + }, + { + "type": "Identifier", + "value": "genMethod", + "loc": { + "start": { + "line": 21, + "column": 8 + }, + "end": { + "line": 21, + "column": 17 + } + }, + "range": [ + 493, + 502 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 21, + "column": 18 + }, + "end": { + "line": 21, + "column": 19 + } + }, + "range": [ + 503, + 504 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 21, + "column": 20 + }, + "end": { + "line": 21, + "column": 29 + } + }, + "range": [ + 505, + 514 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 21, + "column": 29 + }, + "end": { + "line": 21, + "column": 30 + } + }, + "range": [ + 514, + 515 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 22, + "column": 6 + }, + "end": { + "line": 22, + "column": 7 + } + }, + "range": [ + 522, + 523 + ] + }, + { + "type": "Identifier", + "value": "async", + "loc": { + "start": { + "line": 23, + "column": 6 + }, + "end": { + "line": 23, + "column": 11 + } + }, + "range": [ + 530, + 535 + ] + }, + { + "type": "Identifier", + "value": "async", + "loc": { + "start": { + "line": 23, + "column": 12 + }, + "end": { + "line": 23, + "column": 17 + } + }, + "range": [ + 536, + 541 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 23, + "column": 17 + }, + "end": { + "line": 23, + "column": 18 + } + }, + "range": [ + 541, + 542 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 23, + "column": 18 + }, + "end": { + "line": 23, + "column": 19 + } + }, + "range": [ + 542, + 543 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 23, + "column": 19 + }, + "end": { + "line": 23, + "column": 26 + } + }, + "range": [ + 543, + 550 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 23, + "column": 27 + }, + "end": { + "line": 23, + "column": 28 + } + }, + "range": [ + 551, + 552 + ] + }, + { + "type": "Identifier", + "value": "asyncMethodParam", + "loc": { + "start": { + "line": 23, + "column": 29 + }, + "end": { + "line": 23, + "column": 45 + } + }, + "range": [ + 553, + 569 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 23, + "column": 46 + }, + "end": { + "line": 23, + "column": 47 + } + }, + "range": [ + 570, + 571 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 23, + "column": 48 + }, + "end": { + "line": 23, + "column": 57 + } + }, + "range": [ + 572, + 581 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 23, + "column": 57 + }, + "end": { + "line": 23, + "column": 58 + } + }, + "range": [ + 581, + 582 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 23, + "column": 58 + }, + "end": { + "line": 23, + "column": 59 + } + }, + "range": [ + 582, + 583 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 23, + "column": 60 + }, + "end": { + "line": 23, + "column": 61 + } + }, + "range": [ + 584, + 585 + ] + }, + { + "type": "Identifier", + "value": "asyncMethod", + "loc": { + "start": { + "line": 24, + "column": 8 + }, + "end": { + "line": 24, + "column": 19 + } + }, + "range": [ + 594, + 605 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 24, + "column": 20 + }, + "end": { + "line": 24, + "column": 21 + } + }, + "range": [ + 606, + 607 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 24, + "column": 22 + }, + "end": { + "line": 24, + "column": 31 + } + }, + "range": [ + 608, + 617 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 24, + "column": 31 + }, + "end": { + "line": 24, + "column": 32 + } + }, + "range": [ + 617, + 618 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 25, + "column": 6 + }, + "end": { + "line": 25, + "column": 7 + } + }, + "range": [ + 625, + 626 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 26, + "column": 4 + }, + "end": { + "line": 26, + "column": 5 + } + }, + "range": [ + 631, + 632 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 26, + "column": 5 + }, + "end": { + "line": 26, + "column": 6 + } + }, + "range": [ + 632, + 633 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 26, + "column": 6 + }, + "end": { + "line": 26, + "column": 7 + } + }, + "range": [ + 633, + 634 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 26, + "column": 7 + }, + "end": { + "line": 26, + "column": 8 + } + }, + "range": [ + 634, + 635 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 27, + "column": 2 + }, + "end": { + "line": 27, + "column": 3 + } + }, + "range": [ + 638, + 639 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 28, + "column": 0 + }, + "end": { + "line": 28, + "column": 1 + } + }, + "range": [ + 640, + 641 + ] + }, + { + "type": "Identifier", + "value": "instance", + "loc": { + "start": { + "line": 29, + "column": 0 + }, + "end": { + "line": 29, + "column": 8 + } + }, + "range": [ + 642, + 650 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 29, + "column": 8 + }, + "end": { + "line": 29, + "column": 9 + } + }, + "range": [ + 650, + 651 + ] + }, + { + "type": "Identifier", + "value": "method", + "loc": { + "start": { + "line": 29, + "column": 9 + }, + "end": { + "line": 29, + "column": 15 + } + }, + "range": [ + 651, + 657 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 29, + "column": 15 + }, + "end": { + "line": 29, + "column": 16 + } + }, + "range": [ + 657, + 658 + ] + }, + { + "type": "String", + "value": "'method'", + "loc": { + "start": { + "line": 29, + "column": 16 + }, + "end": { + "line": 29, + "column": 24 + } + }, + "range": [ + 658, + 666 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 29, + "column": 24 + }, + "end": { + "line": 29, + "column": 25 + } + }, + "range": [ + 666, + 667 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 29, + "column": 25 + }, + "end": { + "line": 29, + "column": 26 + } + }, + "range": [ + 667, + 668 + ] + }, + { + "type": "Identifier", + "value": "instance", + "loc": { + "start": { + "line": 30, + "column": 0 + }, + "end": { + "line": 30, + "column": 8 + } + }, + "range": [ + 669, + 677 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 30, + "column": 8 + }, + "end": { + "line": 30, + "column": 9 + } + }, + "range": [ + 677, + 678 + ] + }, + { + "type": "Identifier", + "value": "accessor", + "loc": { + "start": { + "line": 30, + "column": 9 + }, + "end": { + "line": 30, + "column": 17 + } + }, + "range": [ + 678, + 686 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 30, + "column": 17 + }, + "end": { + "line": 30, + "column": 18 + } + }, + "range": [ + 686, + 687 + ] + }, + { + "type": "Identifier", + "value": "instance", + "loc": { + "start": { + "line": 31, + "column": 0 + }, + "end": { + "line": 31, + "column": 8 + } + }, + "range": [ + 688, + 696 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 31, + "column": 8 + }, + "end": { + "line": 31, + "column": 9 + } + }, + "range": [ + 696, + 697 + ] + }, + { + "type": "Identifier", + "value": "accessor", + "loc": { + "start": { + "line": 31, + "column": 9 + }, + "end": { + "line": 31, + "column": 17 + } + }, + "range": [ + 697, + 705 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 31, + "column": 18 + }, + "end": { + "line": 31, + "column": 19 + } + }, + "range": [ + 706, + 707 + ] + }, + { + "type": "String", + "value": "'setter'", + "loc": { + "start": { + "line": 31, + "column": 20 + }, + "end": { + "line": 31, + "column": 28 + } + }, + "range": [ + 708, + 716 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 31, + "column": 28 + }, + "end": { + "line": 31, + "column": 29 + } + }, + "range": [ + 716, + 717 + ] + }, + { + "type": "Identifier", + "value": "instance", + "loc": { + "start": { + "line": 32, + "column": 0 + }, + "end": { + "line": 32, + "column": 8 + } + }, + "range": [ + 718, + 726 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 32, + "column": 8 + }, + "end": { + "line": 32, + "column": 9 + } + }, + "range": [ + 726, + 727 + ] + }, + { + "type": "Identifier", + "value": "gen", + "loc": { + "start": { + "line": 32, + "column": 9 + }, + "end": { + "line": 32, + "column": 12 + } + }, + "range": [ + 727, + 730 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 32, + "column": 12 + }, + "end": { + "line": 32, + "column": 13 + } + }, + "range": [ + 730, + 731 + ] + }, + { + "type": "String", + "value": "'generator method'", + "loc": { + "start": { + "line": 32, + "column": 13 + }, + "end": { + "line": 32, + "column": 31 + } + }, + "range": [ + 731, + 749 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 32, + "column": 31 + }, + "end": { + "line": 32, + "column": 32 + } + }, + "range": [ + 749, + 750 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 32, + "column": 32 + }, + "end": { + "line": 32, + "column": 33 + } + }, + "range": [ + 750, + 751 + ] + }, + { + "type": "Identifier", + "value": "next", + "loc": { + "start": { + "line": 32, + "column": 33 + }, + "end": { + "line": 32, + "column": 37 + } + }, + "range": [ + 751, + 755 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 32, + "column": 37 + }, + "end": { + "line": 32, + "column": 38 + } + }, + "range": [ + 755, + 756 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 32, + "column": 38 + }, + "end": { + "line": 32, + "column": 39 + } + }, + "range": [ + 756, + 757 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 32, + "column": 39 + }, + "end": { + "line": 32, + "column": 40 + } + }, + "range": [ + 757, + 758 + ] + }, + { + "type": "Identifier", + "value": "instance", + "loc": { + "start": { + "line": 33, + "column": 0 + }, + "end": { + "line": 33, + "column": 8 + } + }, + "range": [ + 759, + 767 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 33, + "column": 8 + }, + "end": { + "line": 33, + "column": 9 + } + }, + "range": [ + 767, + 768 + ] + }, + { + "type": "Identifier", + "value": "async", + "loc": { + "start": { + "line": 33, + "column": 9 + }, + "end": { + "line": 33, + "column": 14 + } + }, + "range": [ + 768, + 773 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 33, + "column": 14 + }, + "end": { + "line": 33, + "column": 15 + } + }, + "range": [ + 773, + 774 + ] + }, + { + "type": "String", + "value": "'async method'", + "loc": { + "start": { + "line": 33, + "column": 15 + }, + "end": { + "line": 33, + "column": 29 + } + }, + "range": [ + 774, + 788 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 33, + "column": 29 + }, + "end": { + "line": 33, + "column": 30 + } + }, + "range": [ + 788, + 789 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 33, + "column": 30 + }, + "end": { + "line": 33, + "column": 31 + } + }, + "range": [ + 789, + 790 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 34, + "column": 0 + }, + "end": { + "line": 34, + "column": 6 + } + }, + "range": [ + 791, + 797 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 34, + "column": 6 + }, + "end": { + "line": 34, + "column": 7 + } + }, + "range": [ + 797, + 798 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 34, + "column": 7 + }, + "end": { + "line": 34, + "column": 19 + } + }, + "range": [ + 798, + 810 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 34, + "column": 19 + }, + "end": { + "line": 34, + "column": 20 + } + }, + "range": [ + 810, + 811 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 34, + "column": 20 + }, + "end": { + "line": 34, + "column": 21 + } + }, + "range": [ + 811, + 812 + ] + }, + { + "type": "String", + "value": "'method'", + "loc": { + "start": { + "line": 34, + "column": 21 + }, + "end": { + "line": 34, + "column": 29 + } + }, + "range": [ + 812, + 820 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 34, + "column": 29 + }, + "end": { + "line": 34, + "column": 30 + } + }, + "range": [ + 820, + 821 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 34, + "column": 30 + }, + "end": { + "line": 34, + "column": 31 + } + }, + "range": [ + 821, + 822 + ] + }, + { + "type": "Identifier", + "value": "method", + "loc": { + "start": { + "line": 34, + "column": 32 + }, + "end": { + "line": 34, + "column": 38 + } + }, + "range": [ + 823, + 829 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 34, + "column": 38 + }, + "end": { + "line": 34, + "column": 39 + } + }, + "range": [ + 829, + 830 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 34, + "column": 39 + }, + "end": { + "line": 34, + "column": 40 + } + }, + "range": [ + 830, + 831 + ] + }, + { + "type": "String", + "value": "'body'", + "loc": { + "start": { + "line": 34, + "column": 41 + }, + "end": { + "line": 34, + "column": 47 + } + }, + "range": [ + 832, + 838 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 34, + "column": 47 + }, + "end": { + "line": 34, + "column": 48 + } + }, + "range": [ + 838, + 839 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 34, + "column": 48 + }, + "end": { + "line": 34, + "column": 49 + } + }, + "range": [ + 839, + 840 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 35, + "column": 0 + }, + "end": { + "line": 35, + "column": 6 + } + }, + "range": [ + 841, + 847 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 35, + "column": 6 + }, + "end": { + "line": 35, + "column": 7 + } + }, + "range": [ + 847, + 848 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 35, + "column": 7 + }, + "end": { + "line": 35, + "column": 19 + } + }, + "range": [ + 848, + 860 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 35, + "column": 19 + }, + "end": { + "line": 35, + "column": 20 + } + }, + "range": [ + 860, + 861 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 35, + "column": 20 + }, + "end": { + "line": 35, + "column": 21 + } + }, + "range": [ + 861, + 862 + ] + }, + { + "type": "String", + "value": "'method'", + "loc": { + "start": { + "line": 35, + "column": 21 + }, + "end": { + "line": 35, + "column": 29 + } + }, + "range": [ + 862, + 870 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 35, + "column": 29 + }, + "end": { + "line": 35, + "column": 30 + } + }, + "range": [ + 870, + 871 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 35, + "column": 30 + }, + "end": { + "line": 35, + "column": 31 + } + }, + "range": [ + 871, + 872 + ] + }, + { + "type": "Identifier", + "value": "methodParam", + "loc": { + "start": { + "line": 35, + "column": 32 + }, + "end": { + "line": 35, + "column": 43 + } + }, + "range": [ + 873, + 884 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 35, + "column": 43 + }, + "end": { + "line": 35, + "column": 44 + } + }, + "range": [ + 884, + 885 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 35, + "column": 44 + }, + "end": { + "line": 35, + "column": 45 + } + }, + "range": [ + 885, + 886 + ] + }, + { + "type": "String", + "value": "'parameter'", + "loc": { + "start": { + "line": 35, + "column": 46 + }, + "end": { + "line": 35, + "column": 57 + } + }, + "range": [ + 887, + 898 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 35, + "column": 57 + }, + "end": { + "line": 35, + "column": 58 + } + }, + "range": [ + 898, + 899 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 35, + "column": 58 + }, + "end": { + "line": 35, + "column": 59 + } + }, + "range": [ + 899, + 900 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 36, + "column": 0 + }, + "end": { + "line": 36, + "column": 6 + } + }, + "range": [ + 901, + 907 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 36, + "column": 6 + }, + "end": { + "line": 36, + "column": 7 + } + }, + "range": [ + 907, + 908 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 36, + "column": 7 + }, + "end": { + "line": 36, + "column": 19 + } + }, + "range": [ + 908, + 920 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 36, + "column": 19 + }, + "end": { + "line": 36, + "column": 20 + } + }, + "range": [ + 920, + 921 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 36, + "column": 20 + }, + "end": { + "line": 36, + "column": 21 + } + }, + "range": [ + 921, + 922 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 36, + "column": 21 + }, + "end": { + "line": 36, + "column": 22 + } + }, + "range": [ + 922, + 923 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 36, + "column": 22 + }, + "end": { + "line": 36, + "column": 23 + } + }, + "range": [ + 923, + 924 + ] + }, + { + "type": "Identifier", + "value": "getter", + "loc": { + "start": { + "line": 36, + "column": 24 + }, + "end": { + "line": 36, + "column": 30 + } + }, + "range": [ + 925, + 931 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 36, + "column": 30 + }, + "end": { + "line": 36, + "column": 31 + } + }, + "range": [ + 931, + 932 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 36, + "column": 31 + }, + "end": { + "line": 36, + "column": 32 + } + }, + "range": [ + 932, + 933 + ] + }, + { + "type": "String", + "value": "'body'", + "loc": { + "start": { + "line": 36, + "column": 33 + }, + "end": { + "line": 36, + "column": 39 + } + }, + "range": [ + 934, + 940 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 36, + "column": 39 + }, + "end": { + "line": 36, + "column": 40 + } + }, + "range": [ + 940, + 941 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 36, + "column": 40 + }, + "end": { + "line": 36, + "column": 41 + } + }, + "range": [ + 941, + 942 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 37, + "column": 0 + }, + "end": { + "line": 37, + "column": 6 + } + }, + "range": [ + 943, + 949 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 37, + "column": 6 + }, + "end": { + "line": 37, + "column": 7 + } + }, + "range": [ + 949, + 950 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 37, + "column": 7 + }, + "end": { + "line": 37, + "column": 19 + } + }, + "range": [ + 950, + 962 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 37, + "column": 19 + }, + "end": { + "line": 37, + "column": 20 + } + }, + "range": [ + 962, + 963 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 37, + "column": 20 + }, + "end": { + "line": 37, + "column": 21 + } + }, + "range": [ + 963, + 964 + ] + }, + { + "type": "String", + "value": "'setter'", + "loc": { + "start": { + "line": 37, + "column": 21 + }, + "end": { + "line": 37, + "column": 29 + } + }, + "range": [ + 964, + 972 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 37, + "column": 29 + }, + "end": { + "line": 37, + "column": 30 + } + }, + "range": [ + 972, + 973 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 37, + "column": 30 + }, + "end": { + "line": 37, + "column": 31 + } + }, + "range": [ + 973, + 974 + ] + }, + { + "type": "Identifier", + "value": "setter", + "loc": { + "start": { + "line": 37, + "column": 32 + }, + "end": { + "line": 37, + "column": 38 + } + }, + "range": [ + 975, + 981 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 37, + "column": 38 + }, + "end": { + "line": 37, + "column": 39 + } + }, + "range": [ + 981, + 982 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 37, + "column": 39 + }, + "end": { + "line": 37, + "column": 40 + } + }, + "range": [ + 982, + 983 + ] + }, + { + "type": "String", + "value": "'body'", + "loc": { + "start": { + "line": 37, + "column": 41 + }, + "end": { + "line": 37, + "column": 47 + } + }, + "range": [ + 984, + 990 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 37, + "column": 47 + }, + "end": { + "line": 37, + "column": 48 + } + }, + "range": [ + 990, + 991 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 37, + "column": 48 + }, + "end": { + "line": 37, + "column": 49 + } + }, + "range": [ + 991, + 992 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 38, + "column": 0 + }, + "end": { + "line": 38, + "column": 6 + } + }, + "range": [ + 993, + 999 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 38, + "column": 6 + }, + "end": { + "line": 38, + "column": 7 + } + }, + "range": [ + 999, + 1000 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 38, + "column": 7 + }, + "end": { + "line": 38, + "column": 19 + } + }, + "range": [ + 1000, + 1012 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 38, + "column": 19 + }, + "end": { + "line": 38, + "column": 20 + } + }, + "range": [ + 1012, + 1013 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 38, + "column": 20 + }, + "end": { + "line": 38, + "column": 21 + } + }, + "range": [ + 1013, + 1014 + ] + }, + { + "type": "String", + "value": "'setter'", + "loc": { + "start": { + "line": 38, + "column": 21 + }, + "end": { + "line": 38, + "column": 29 + } + }, + "range": [ + 1014, + 1022 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 38, + "column": 29 + }, + "end": { + "line": 38, + "column": 30 + } + }, + "range": [ + 1022, + 1023 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 38, + "column": 30 + }, + "end": { + "line": 38, + "column": 31 + } + }, + "range": [ + 1023, + 1024 + ] + }, + { + "type": "Identifier", + "value": "setterParam", + "loc": { + "start": { + "line": 38, + "column": 32 + }, + "end": { + "line": 38, + "column": 43 + } + }, + "range": [ + 1025, + 1036 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 38, + "column": 43 + }, + "end": { + "line": 38, + "column": 44 + } + }, + "range": [ + 1036, + 1037 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 38, + "column": 44 + }, + "end": { + "line": 38, + "column": 45 + } + }, + "range": [ + 1037, + 1038 + ] + }, + { + "type": "String", + "value": "'parameter'", + "loc": { + "start": { + "line": 38, + "column": 46 + }, + "end": { + "line": 38, + "column": 57 + } + }, + "range": [ + 1039, + 1050 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 38, + "column": 57 + }, + "end": { + "line": 38, + "column": 58 + } + }, + "range": [ + 1050, + 1051 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 38, + "column": 58 + }, + "end": { + "line": 38, + "column": 59 + } + }, + "range": [ + 1051, + 1052 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 39, + "column": 0 + }, + "end": { + "line": 39, + "column": 6 + } + }, + "range": [ + 1053, + 1059 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 39, + "column": 6 + }, + "end": { + "line": 39, + "column": 7 + } + }, + "range": [ + 1059, + 1060 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 39, + "column": 7 + }, + "end": { + "line": 39, + "column": 19 + } + }, + "range": [ + 1060, + 1072 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 39, + "column": 19 + }, + "end": { + "line": 39, + "column": 20 + } + }, + "range": [ + 1072, + 1073 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 39, + "column": 20 + }, + "end": { + "line": 39, + "column": 21 + } + }, + "range": [ + 1073, + 1074 + ] + }, + { + "type": "String", + "value": "'generator method'", + "loc": { + "start": { + "line": 39, + "column": 21 + }, + "end": { + "line": 39, + "column": 39 + } + }, + "range": [ + 1074, + 1092 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 39, + "column": 39 + }, + "end": { + "line": 39, + "column": 40 + } + }, + "range": [ + 1092, + 1093 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 39, + "column": 40 + }, + "end": { + "line": 39, + "column": 41 + } + }, + "range": [ + 1093, + 1094 + ] + }, + { + "type": "Identifier", + "value": "genMethod", + "loc": { + "start": { + "line": 39, + "column": 42 + }, + "end": { + "line": 39, + "column": 51 + } + }, + "range": [ + 1095, + 1104 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 39, + "column": 51 + }, + "end": { + "line": 39, + "column": 52 + } + }, + "range": [ + 1104, + 1105 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 39, + "column": 52 + }, + "end": { + "line": 39, + "column": 53 + } + }, + "range": [ + 1105, + 1106 + ] + }, + { + "type": "String", + "value": "'body'", + "loc": { + "start": { + "line": 39, + "column": 54 + }, + "end": { + "line": 39, + "column": 60 + } + }, + "range": [ + 1107, + 1113 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 39, + "column": 60 + }, + "end": { + "line": 39, + "column": 61 + } + }, + "range": [ + 1113, + 1114 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 39, + "column": 61 + }, + "end": { + "line": 39, + "column": 62 + } + }, + "range": [ + 1114, + 1115 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 40, + "column": 0 + }, + "end": { + "line": 40, + "column": 6 + } + }, + "range": [ + 1116, + 1122 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 40, + "column": 6 + }, + "end": { + "line": 40, + "column": 7 + } + }, + "range": [ + 1122, + 1123 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 40, + "column": 7 + }, + "end": { + "line": 40, + "column": 19 + } + }, + "range": [ + 1123, + 1135 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 40, + "column": 19 + }, + "end": { + "line": 40, + "column": 20 + } + }, + "range": [ + 1135, + 1136 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 40, + "column": 20 + }, + "end": { + "line": 40, + "column": 21 + } + }, + "range": [ + 1136, + 1137 + ] + }, + { + "type": "String", + "value": "'generator method'", + "loc": { + "start": { + "line": 40, + "column": 21 + }, + "end": { + "line": 40, + "column": 39 + } + }, + "range": [ + 1137, + 1155 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 40, + "column": 39 + }, + "end": { + "line": 40, + "column": 40 + } + }, + "range": [ + 1155, + 1156 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 40, + "column": 40 + }, + "end": { + "line": 40, + "column": 41 + } + }, + "range": [ + 1156, + 1157 + ] + }, + { + "type": "Identifier", + "value": "genMethodParam", + "loc": { + "start": { + "line": 40, + "column": 42 + }, + "end": { + "line": 40, + "column": 56 + } + }, + "range": [ + 1158, + 1172 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 40, + "column": 56 + }, + "end": { + "line": 40, + "column": 57 + } + }, + "range": [ + 1172, + 1173 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 40, + "column": 57 + }, + "end": { + "line": 40, + "column": 58 + } + }, + "range": [ + 1173, + 1174 + ] + }, + { + "type": "String", + "value": "'parameter'", + "loc": { + "start": { + "line": 40, + "column": 59 + }, + "end": { + "line": 40, + "column": 70 + } + }, + "range": [ + 1175, + 1186 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 40, + "column": 70 + }, + "end": { + "line": 40, + "column": 71 + } + }, + "range": [ + 1186, + 1187 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 40, + "column": 71 + }, + "end": { + "line": 40, + "column": 72 + } + }, + "range": [ + 1187, + 1188 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 41, + "column": 0 + }, + "end": { + "line": 41, + "column": 6 + } + }, + "range": [ + 1189, + 1195 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 41, + "column": 6 + }, + "end": { + "line": 41, + "column": 7 + } + }, + "range": [ + 1195, + 1196 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 41, + "column": 7 + }, + "end": { + "line": 41, + "column": 19 + } + }, + "range": [ + 1196, + 1208 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 41, + "column": 19 + }, + "end": { + "line": 41, + "column": 20 + } + }, + "range": [ + 1208, + 1209 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 41, + "column": 20 + }, + "end": { + "line": 41, + "column": 21 + } + }, + "range": [ + 1209, + 1210 + ] + }, + { + "type": "String", + "value": "'async method'", + "loc": { + "start": { + "line": 41, + "column": 21 + }, + "end": { + "line": 41, + "column": 35 + } + }, + "range": [ + 1210, + 1224 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 41, + "column": 35 + }, + "end": { + "line": 41, + "column": 36 + } + }, + "range": [ + 1224, + 1225 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 41, + "column": 36 + }, + "end": { + "line": 41, + "column": 37 + } + }, + "range": [ + 1225, + 1226 + ] + }, + { + "type": "Identifier", + "value": "asyncMethod", + "loc": { + "start": { + "line": 41, + "column": 38 + }, + "end": { + "line": 41, + "column": 49 + } + }, + "range": [ + 1227, + 1238 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 41, + "column": 49 + }, + "end": { + "line": 41, + "column": 50 + } + }, + "range": [ + 1238, + 1239 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 41, + "column": 50 + }, + "end": { + "line": 41, + "column": 51 + } + }, + "range": [ + 1239, + 1240 + ] + }, + { + "type": "String", + "value": "'body'", + "loc": { + "start": { + "line": 41, + "column": 52 + }, + "end": { + "line": 41, + "column": 58 + } + }, + "range": [ + 1241, + 1247 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 41, + "column": 58 + }, + "end": { + "line": 41, + "column": 59 + } + }, + "range": [ + 1247, + 1248 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 41, + "column": 59 + }, + "end": { + "line": 41, + "column": 60 + } + }, + "range": [ + 1248, + 1249 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 42, + "column": 0 + }, + "end": { + "line": 42, + "column": 6 + } + }, + "range": [ + 1250, + 1256 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 42, + "column": 6 + }, + "end": { + "line": 42, + "column": 7 + } + }, + "range": [ + 1256, + 1257 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 42, + "column": 7 + }, + "end": { + "line": 42, + "column": 19 + } + }, + "range": [ + 1257, + 1269 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 42, + "column": 19 + }, + "end": { + "line": 42, + "column": 20 + } + }, + "range": [ + 1269, + 1270 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 42, + "column": 20 + }, + "end": { + "line": 42, + "column": 21 + } + }, + "range": [ + 1270, + 1271 + ] + }, + { + "type": "String", + "value": "'async method'", + "loc": { + "start": { + "line": 42, + "column": 21 + }, + "end": { + "line": 42, + "column": 35 + } + }, + "range": [ + 1271, + 1285 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 42, + "column": 35 + }, + "end": { + "line": 42, + "column": 36 + } + }, + "range": [ + 1285, + 1286 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 42, + "column": 36 + }, + "end": { + "line": 42, + "column": 37 + } + }, + "range": [ + 1286, + 1287 + ] + }, + { + "type": "Identifier", + "value": "asyncMethodParam", + "loc": { + "start": { + "line": 42, + "column": 38 + }, + "end": { + "line": 42, + "column": 54 + } + }, + "range": [ + 1288, + 1304 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 42, + "column": 54 + }, + "end": { + "line": 42, + "column": 55 + } + }, + "range": [ + 1304, + 1305 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 42, + "column": 55 + }, + "end": { + "line": 42, + "column": 56 + } + }, + "range": [ + 1305, + 1306 + ] + }, + { + "type": "String", + "value": "'parameter'", + "loc": { + "start": { + "line": 42, + "column": 57 + }, + "end": { + "line": 42, + "column": 68 + } + }, + "range": [ + 1307, + 1318 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 42, + "column": 68 + }, + "end": { + "line": 42, + "column": 69 + } + }, + "range": [ + 1318, + 1319 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 42, + "column": 69 + }, + "end": { + "line": 42, + "column": 70 + } + }, + "range": [ + 1319, + 1320 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-arguments-methods.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-arguments-methods.src.js new file mode 100644 index 00000000..6991b8a9 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-arguments-methods.src.js @@ -0,0 +1,42 @@ + +var instance; +var method, methodParam; +var getter; +var setter, setterParam; +var genMethod, genMethodParam; +var asyncMethod, asyncMethodParam; +class C { + static { + instance = new class { + method({test262 = methodParam = arguments}) { + method = arguments; + } + get accessor() { + getter = arguments; + } + set accessor({test262 = setterParam = arguments}) { + setter = arguments; + } + *gen({test262 = genMethodParam = arguments}) { + genMethod = arguments; + } + async async({test262 = asyncMethodParam = arguments}) { + asyncMethod = arguments; + } + }(); + } +} +instance.method('method'); +instance.accessor; +instance.accessor = 'setter'; +instance.gen('generator method').next(); +instance.async('async method'); +assert(compareArray(['method'], method), 'body'); +assert(compareArray(['method'], methodParam), 'parameter'); +assert(compareArray([], getter), 'body'); +assert(compareArray(['setter'], setter), 'body'); +assert(compareArray(['setter'], setterParam), 'parameter'); +assert(compareArray(['generator method'], genMethod), 'body'); +assert(compareArray(['generator method'], genMethodParam), 'parameter'); +assert(compareArray(['async method'], asyncMethod), 'body'); +assert(compareArray(['async method'], asyncMethodParam), 'parameter'); diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-await-binding-invalid.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-await-binding-invalid.result.js new file mode 100644 index 00000000..fe48265b --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-await-binding-invalid.result.js @@ -0,0 +1,6 @@ +export default { + "index": 32, + "lineNumber": 4, + "column": 11, + "message": "Cannot use await in class static initialization block" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-await-binding-invalid.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-await-binding-invalid.src.js new file mode 100644 index 00000000..346a15b1 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-await-binding-invalid.src.js @@ -0,0 +1,6 @@ + +class C { + static { + class await {} + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-await-binding-valid.module-result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-await-binding-valid.module-result.js new file mode 100644 index 00000000..416c950a --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-await-binding-valid.module-result.js @@ -0,0 +1,6 @@ +export default { + "index": 41, + "lineNumber": 4, + "column": 20, + "message": "Cannot use keyword 'await' outside an async function" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-await-binding-valid.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-await-binding-valid.result.js new file mode 100644 index 00000000..96e7fbb9 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-await-binding-valid.result.js @@ -0,0 +1,550 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 1, + 59 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 1, + 59 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 7, + 8 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 9, + 59 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 13, + 57 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 31 + } + }, + "range": [ + 26, + 53 + ], + "expression": { + "type": "ArrowFunctionExpression", + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 29 + } + }, + "range": [ + 27, + 51 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 4, + "column": 11 + }, + "end": { + "line": 4, + "column": 29 + } + }, + "range": [ + 33, + 51 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 27 + } + }, + "range": [ + 35, + 49 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 19 + }, + "end": { + "line": 4, + "column": 24 + } + }, + "range": [ + 41, + 46 + ], + "name": "await" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 4, + "column": 25 + }, + "end": { + "line": 4, + "column": 27 + } + }, + "range": [ + 47, + 49 + ], + "body": [] + } + } + ] + } + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "range": [ + 1, + 6 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 7, + 8 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 9, + 10 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "range": [ + 13, + 19 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 20, + 21 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 26, + 27 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 6 + } + }, + "range": [ + 27, + 28 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 28, + 29 + ] + }, + { + "type": "Punctuator", + "value": "=>", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 30, + 32 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 11 + }, + "end": { + "line": 4, + "column": 12 + } + }, + "range": [ + 33, + 34 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 18 + } + }, + "range": [ + 35, + 40 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 4, + "column": 19 + }, + "end": { + "line": 4, + "column": 24 + } + }, + "range": [ + 41, + 46 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 25 + }, + "end": { + "line": 4, + "column": 26 + } + }, + "range": [ + 47, + 48 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 4, + "column": 26 + }, + "end": { + "line": 4, + "column": 27 + } + }, + "range": [ + 48, + 49 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 4, + "column": 28 + }, + "end": { + "line": 4, + "column": 29 + } + }, + "range": [ + 50, + 51 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 29 + }, + "end": { + "line": 4, + "column": 30 + } + }, + "range": [ + 51, + 52 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 30 + }, + "end": { + "line": 4, + "column": 31 + } + }, + "range": [ + 52, + 53 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 56, + 57 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 58, + 59 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-await-binding-valid.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-await-binding-valid.src.js new file mode 100644 index 00000000..e8475cc6 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-await-binding-valid.src.js @@ -0,0 +1,6 @@ + +class C { + static { + (() => { class await {} }); + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-expr-new-target.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-expr-new-target.result.js new file mode 100644 index 00000000..53e9fe5a --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-expr-new-target.result.js @@ -0,0 +1,890 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 8, + "column": 35 + } + }, + "range": [ + 1, + 105 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "range": [ + 1, + 18 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "range": [ + 5, + 17 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 5, + 10 + ], + "name": "value" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "range": [ + 13, + 17 + ], + "value": null, + "raw": "null" + } + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 19, + 69 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 25, + 26 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 27, + 69 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 31, + 67 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 44, + 63 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 22 + } + }, + "range": [ + 44, + 62 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 9 + } + }, + "range": [ + 44, + 49 + ], + "name": "value" + }, + "right": { + "type": "MetaProperty", + "loc": { + "start": { + "line": 5, + "column": 12 + }, + "end": { + "line": 5, + "column": 22 + } + }, + "range": [ + 52, + 62 + ], + "meta": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 12 + }, + "end": { + "line": 5, + "column": 15 + } + }, + "range": [ + 52, + 55 + ], + "name": "new" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 16 + }, + "end": { + "line": 5, + "column": 22 + } + }, + "range": [ + 56, + 62 + ], + "name": "target" + } + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 35 + } + }, + "range": [ + 70, + 105 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 34 + } + }, + "range": [ + 70, + 104 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 16 + } + }, + "range": [ + 70, + 86 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 6 + } + }, + "range": [ + 70, + 76 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 7 + }, + "end": { + "line": 8, + "column": 16 + } + }, + "range": [ + 77, + 86 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 17 + }, + "end": { + "line": 8, + "column": 22 + } + }, + "range": [ + 87, + 92 + ], + "name": "value" + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 24 + }, + "end": { + "line": 8, + "column": 33 + } + }, + "range": [ + 94, + 103 + ], + "name": "undefined" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "range": [ + 1, + 4 + ] + }, + { + "type": "Identifier", + "value": "value", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 5, + 10 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "range": [ + 11, + 12 + ] + }, + { + "type": "Null", + "value": "null", + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "range": [ + 13, + 17 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "range": [ + 17, + 18 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "range": [ + 19, + 24 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 25, + 26 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 27, + 28 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 8 + } + }, + "range": [ + 31, + 37 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 38, + 39 + ] + }, + { + "type": "Identifier", + "value": "value", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 9 + } + }, + "range": [ + 44, + 49 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 5, + "column": 10 + }, + "end": { + "line": 5, + "column": 11 + } + }, + "range": [ + 50, + 51 + ] + }, + { + "type": "Keyword", + "value": "new", + "loc": { + "start": { + "line": 5, + "column": 12 + }, + "end": { + "line": 5, + "column": 15 + } + }, + "range": [ + 52, + 55 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 16 + } + }, + "range": [ + 55, + 56 + ] + }, + { + "type": "Identifier", + "value": "target", + "loc": { + "start": { + "line": 5, + "column": 16 + }, + "end": { + "line": 5, + "column": 22 + } + }, + "range": [ + 56, + 62 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 22 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 62, + 63 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 66, + 67 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 68, + 69 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 6 + } + }, + "range": [ + 70, + 76 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 8, + "column": 6 + }, + "end": { + "line": 8, + "column": 7 + } + }, + "range": [ + 76, + 77 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 8, + "column": 7 + }, + "end": { + "line": 8, + "column": 16 + } + }, + "range": [ + 77, + 86 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 8, + "column": 16 + }, + "end": { + "line": 8, + "column": 17 + } + }, + "range": [ + 86, + 87 + ] + }, + { + "type": "Identifier", + "value": "value", + "loc": { + "start": { + "line": 8, + "column": 17 + }, + "end": { + "line": 8, + "column": 22 + } + }, + "range": [ + 87, + 92 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 8, + "column": 22 + }, + "end": { + "line": 8, + "column": 23 + } + }, + "range": [ + 92, + 93 + ] + }, + { + "type": "Identifier", + "value": "undefined", + "loc": { + "start": { + "line": 8, + "column": 24 + }, + "end": { + "line": 8, + "column": 33 + } + }, + "range": [ + 94, + 103 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 8, + "column": 33 + }, + "end": { + "line": 8, + "column": 34 + } + }, + "range": [ + 103, + 104 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 8, + "column": 34 + }, + "end": { + "line": 8, + "column": 35 + } + }, + "range": [ + 104, + 105 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-expr-new-target.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-expr-new-target.src.js new file mode 100644 index 00000000..4d13082c --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-expr-new-target.src.js @@ -0,0 +1,8 @@ + +var value = null; +class C { + static { + value = new.target; + } +} +assert.sameValue(value, undefined); diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-expr-this.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-expr-this.result.js new file mode 100644 index 00000000..defd957f --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-expr-this.result.js @@ -0,0 +1,764 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 8, + "column": 27 + } + }, + "range": [ + 1, + 84 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "range": [ + 1, + 11 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 5, + 10 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 5, + 10 + ], + "name": "value" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 12, + 56 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 18, + 19 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 20, + 56 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 24, + 54 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 17 + } + }, + "range": [ + 37, + 50 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 16 + } + }, + "range": [ + 37, + 49 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 9 + } + }, + "range": [ + 37, + 42 + ], + "name": "value" + }, + "right": { + "type": "ThisExpression", + "loc": { + "start": { + "line": 5, + "column": 12 + }, + "end": { + "line": 5, + "column": 16 + } + }, + "range": [ + 45, + 49 + ] + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 27 + } + }, + "range": [ + 57, + 84 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 26 + } + }, + "range": [ + 57, + 83 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 16 + } + }, + "range": [ + 57, + 73 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 6 + } + }, + "range": [ + 57, + 63 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 7 + }, + "end": { + "line": 8, + "column": 16 + } + }, + "range": [ + 64, + 73 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 17 + }, + "end": { + "line": 8, + "column": 22 + } + }, + "range": [ + 74, + 79 + ], + "name": "value" + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 24 + }, + "end": { + "line": 8, + "column": 25 + } + }, + "range": [ + 81, + 82 + ], + "name": "C" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "range": [ + 1, + 4 + ] + }, + { + "type": "Identifier", + "value": "value", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 5, + 10 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "range": [ + 10, + 11 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "range": [ + 12, + 17 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 18, + 19 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 20, + 21 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 8 + } + }, + "range": [ + 24, + 30 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 31, + 32 + ] + }, + { + "type": "Identifier", + "value": "value", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 9 + } + }, + "range": [ + 37, + 42 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 5, + "column": 10 + }, + "end": { + "line": 5, + "column": 11 + } + }, + "range": [ + 43, + 44 + ] + }, + { + "type": "Keyword", + "value": "this", + "loc": { + "start": { + "line": 5, + "column": 12 + }, + "end": { + "line": 5, + "column": 16 + } + }, + "range": [ + 45, + 49 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 16 + }, + "end": { + "line": 5, + "column": 17 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 53, + 54 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 55, + 56 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 6 + } + }, + "range": [ + 57, + 63 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 8, + "column": 6 + }, + "end": { + "line": 8, + "column": 7 + } + }, + "range": [ + 63, + 64 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 8, + "column": 7 + }, + "end": { + "line": 8, + "column": 16 + } + }, + "range": [ + 64, + 73 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 8, + "column": 16 + }, + "end": { + "line": 8, + "column": 17 + } + }, + "range": [ + 73, + 74 + ] + }, + { + "type": "Identifier", + "value": "value", + "loc": { + "start": { + "line": 8, + "column": 17 + }, + "end": { + "line": 8, + "column": 22 + } + }, + "range": [ + 74, + 79 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 8, + "column": 22 + }, + "end": { + "line": 8, + "column": 23 + } + }, + "range": [ + 79, + 80 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 8, + "column": 24 + }, + "end": { + "line": 8, + "column": 25 + } + }, + "range": [ + 81, + 82 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 8, + "column": 25 + }, + "end": { + "line": 8, + "column": 26 + } + }, + "range": [ + 82, + 83 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 8, + "column": 26 + }, + "end": { + "line": 8, + "column": 27 + } + }, + "range": [ + 83, + 84 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-expr-this.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-expr-this.src.js new file mode 100644 index 00000000..b56fdf7c --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-expr-this.src.js @@ -0,0 +1,8 @@ + +var value; +class C { + static { + value = this; + } +} +assert.sameValue(value, C); diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-arguments.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-arguments.result.js new file mode 100644 index 00000000..b2cc101a --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-arguments.result.js @@ -0,0 +1,6 @@ +export default { + "index": 36, + "lineNumber": 4, + "column": 15, + "message": "Cannot use arguments in class static initialization block" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-arguments.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-arguments.src.js new file mode 100644 index 00000000..9b050dc8 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-arguments.src.js @@ -0,0 +1,6 @@ + +class C { + static { + (class { [argument\u0073]() {} }); + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-await.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-await.result.js new file mode 100644 index 00000000..49254fdb --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-await.result.js @@ -0,0 +1,6 @@ +export default { + "index": 53, + "lineNumber": 5, + "column": 7, + "message": "Cannot use await in class static initialization block" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-await.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-await.src.js new file mode 100644 index 00000000..0c80ab2e --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-await.src.js @@ -0,0 +1,8 @@ + +async function f() { + class C { + static { + await 0; + } + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-label-dup.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-label-dup.result.js new file mode 100644 index 00000000..1933671c --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-label-dup.result.js @@ -0,0 +1,6 @@ +export default { + "index": 29, + "lineNumber": 4, + "column": 8, + "message": "Label 'x' is already declared" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-label-dup.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-label-dup.src.js new file mode 100644 index 00000000..5c1c0e0f --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-label-dup.src.js @@ -0,0 +1,6 @@ + +class C { + static { + x: x: 0; + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-lex-dup.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-lex-dup.result.js new file mode 100644 index 00000000..682cd796 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-lex-dup.result.js @@ -0,0 +1,6 @@ +export default { + "index": 41, + "lineNumber": 5, + "column": 9, + "message": "Identifier 'x' has already been declared" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-lex-dup.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-lex-dup.src.js new file mode 100644 index 00000000..142885ff --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-lex-dup.src.js @@ -0,0 +1,7 @@ + +class C { + static { + let x; + let x; + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-lex-var.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-lex-var.result.js new file mode 100644 index 00000000..682cd796 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-lex-var.result.js @@ -0,0 +1,6 @@ +export default { + "index": 41, + "lineNumber": 5, + "column": 9, + "message": "Identifier 'x' has already been declared" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-lex-var.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-lex-var.src.js new file mode 100644 index 00000000..afd378a1 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-lex-var.src.js @@ -0,0 +1,7 @@ + +class C { + static { + let x; + var x; + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-return.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-return.result.js new file mode 100644 index 00000000..4b2922b1 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-return.result.js @@ -0,0 +1,6 @@ +export default { + "index": 47, + "lineNumber": 5, + "column": 7, + "message": "'return' outside of function" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-return.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-return.src.js new file mode 100644 index 00000000..5791757a --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-return.src.js @@ -0,0 +1,8 @@ + +function f() { + class C { + static { + return; + } + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-super-call.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-super-call.result.js new file mode 100644 index 00000000..e23b7121 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-super-call.result.js @@ -0,0 +1,6 @@ +export default { + "index": 26, + "lineNumber": 4, + "column": 5, + "message": "super() call outside constructor of a subclass" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-super-call.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-super-call.src.js new file mode 100644 index 00000000..53d0054c --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-super-call.src.js @@ -0,0 +1,6 @@ + +class C { + static { + super(); + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-undefined-break-target.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-undefined-break-target.result.js new file mode 100644 index 00000000..c3d82a76 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-undefined-break-target.result.js @@ -0,0 +1,6 @@ +export default { + "index": 51, + "lineNumber": 5, + "column": 7, + "message": "Unsyntactic break" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-undefined-break-target.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-undefined-break-target.src.js new file mode 100644 index 00000000..ad5c4469 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-undefined-break-target.src.js @@ -0,0 +1,8 @@ + +class C { + static { + x: while (false) { + break y; + } + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-undefined-continue-target.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-undefined-continue-target.result.js new file mode 100644 index 00000000..49d2024a --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-undefined-continue-target.result.js @@ -0,0 +1,6 @@ +export default { + "index": 51, + "lineNumber": 5, + "column": 7, + "message": "Unsyntactic continue" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-undefined-continue-target.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-undefined-continue-target.src.js new file mode 100644 index 00000000..6f6a03ad --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-undefined-continue-target.src.js @@ -0,0 +1,8 @@ + +class C { + static { + x: while (false) { + continue y; + } + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-yield.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-yield.result.js new file mode 100644 index 00000000..8b49f7ca --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-yield.result.js @@ -0,0 +1,6 @@ +export default { + "index": 49, + "lineNumber": 5, + "column": 7, + "message": "The keyword 'yield' is reserved" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-yield.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-yield.src.js new file mode 100644 index 00000000..f90a27f3 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-yield.src.js @@ -0,0 +1,8 @@ + +function * g() { + class C { + static { + yield; + } + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-lex-close.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-lex-close.result.js new file mode 100644 index 00000000..1443f7eb --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-lex-close.result.js @@ -0,0 +1,1167 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 12, + "column": 39 + } + }, + "range": [ + 1, + 176 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "range": [ + 1, + 29 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "range": [ + 5, + 28 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "range": [ + 5, + 12 + ], + "name": "test262" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "range": [ + 15, + 28 + ], + "value": "outer scope", + "raw": "'outer scope'" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 30, + 40 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 34, + 39 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 34, + 39 + ], + "name": "probe" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 11, + "column": 1 + } + }, + "range": [ + 41, + 136 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 47, + 48 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 11, + "column": 1 + } + }, + "range": [ + 49, + 136 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 53, + 98 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 32 + } + }, + "range": [ + 66, + 94 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 31 + } + }, + "range": [ + 70, + 93 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 15 + } + }, + "range": [ + 70, + 77 + ], + "name": "test262" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 6, + "column": 18 + }, + "end": { + "line": 6, + "column": 31 + } + }, + "range": [ + 80, + 93 + ], + "value": "first block", + "raw": "'first block'" + } + } + ], + "kind": "let" + } + ] + }, + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 10, + "column": 3 + } + }, + "range": [ + 101, + 134 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 20 + } + }, + "range": [ + 114, + 130 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 19 + } + }, + "range": [ + 114, + 129 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 9 + } + }, + "range": [ + 114, + 119 + ], + "name": "probe" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 12 + }, + "end": { + "line": 9, + "column": 19 + } + }, + "range": [ + 122, + 129 + ], + "name": "test262" + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 39 + } + }, + "range": [ + 137, + 176 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 38 + } + }, + "range": [ + 137, + 175 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 16 + } + }, + "range": [ + 137, + 153 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 6 + } + }, + "range": [ + 137, + 143 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 16 + } + }, + "range": [ + 144, + 153 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 17 + }, + "end": { + "line": 12, + "column": 22 + } + }, + "range": [ + 154, + 159 + ], + "name": "probe" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 12, + "column": 24 + }, + "end": { + "line": 12, + "column": 37 + } + }, + "range": [ + 161, + 174 + ], + "value": "outer scope", + "raw": "'outer scope'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "range": [ + 1, + 4 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "range": [ + 5, + 12 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "range": [ + 13, + 14 + ] + }, + { + "type": "String", + "value": "'outer scope'", + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "range": [ + 15, + 28 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 2, + "column": 27 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "range": [ + 28, + 29 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "range": [ + 30, + 33 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 34, + 39 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 39, + 40 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 41, + 46 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 47, + 48 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 8 + } + }, + "range": [ + 53, + 59 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 60, + 61 + ] + }, + { + "type": "Keyword", + "value": "let", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 66, + 69 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 15 + } + }, + "range": [ + 70, + 77 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 6, + "column": 16 + }, + "end": { + "line": 6, + "column": 17 + } + }, + "range": [ + 78, + 79 + ] + }, + { + "type": "String", + "value": "'first block'", + "loc": { + "start": { + "line": 6, + "column": 18 + }, + "end": { + "line": 6, + "column": 31 + } + }, + "range": [ + 80, + 93 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 31 + }, + "end": { + "line": 6, + "column": 32 + } + }, + "range": [ + 93, + 94 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 97, + 98 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 8 + } + }, + "range": [ + 101, + 107 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 8, + "column": 10 + } + }, + "range": [ + 108, + 109 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 9 + } + }, + "range": [ + 114, + 119 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 11 + } + }, + "range": [ + 120, + 121 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 9, + "column": 12 + }, + "end": { + "line": 9, + "column": 19 + } + }, + "range": [ + 122, + 129 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 9, + "column": 19 + }, + "end": { + "line": 9, + "column": 20 + } + }, + "range": [ + 129, + 130 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 10, + "column": 2 + }, + "end": { + "line": 10, + "column": 3 + } + }, + "range": [ + 133, + 134 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 1 + } + }, + "range": [ + 135, + 136 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 6 + } + }, + "range": [ + 137, + 143 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 12, + "column": 6 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "range": [ + 143, + 144 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 16 + } + }, + "range": [ + 144, + 153 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 12, + "column": 16 + }, + "end": { + "line": 12, + "column": 17 + } + }, + "range": [ + 153, + 154 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 12, + "column": 17 + }, + "end": { + "line": 12, + "column": 22 + } + }, + "range": [ + 154, + 159 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 12, + "column": 22 + }, + "end": { + "line": 12, + "column": 23 + } + }, + "range": [ + 159, + 160 + ] + }, + { + "type": "String", + "value": "'outer scope'", + "loc": { + "start": { + "line": 12, + "column": 24 + }, + "end": { + "line": 12, + "column": 37 + } + }, + "range": [ + 161, + 174 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 12, + "column": 37 + }, + "end": { + "line": 12, + "column": 38 + } + }, + "range": [ + 174, + 175 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 12, + "column": 38 + }, + "end": { + "line": 12, + "column": 39 + } + }, + "range": [ + 175, + 176 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-lex-close.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-lex-close.src.js new file mode 100644 index 00000000..8cae1b10 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-lex-close.src.js @@ -0,0 +1,12 @@ + +var test262 = 'outer scope'; +var probe; +class C { + static { + let test262 = 'first block'; + } + static { + probe = test262; + } +} +assert.sameValue(probe, 'outer scope'); diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-lex-derived.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-lex-derived.result.js new file mode 100644 index 00000000..bac9fc7a --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-lex-derived.result.js @@ -0,0 +1,765 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 8, + "column": 27 + } + }, + "range": [ + 1, + 81 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "range": [ + 1, + 11 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 5, + 10 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 5, + 10 + ], + "name": "probe" + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 12, + 53 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 18, + 19 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 20, + 53 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 24, + 51 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 14 + } + }, + "range": [ + 37, + 47 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "range": [ + 37, + 46 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 9 + } + }, + "range": [ + 37, + 42 + ], + "name": "probe" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 12 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "range": [ + 45, + 46 + ], + "name": "C" + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 27 + } + }, + "range": [ + 54, + 81 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 26 + } + }, + "range": [ + 54, + 80 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 16 + } + }, + "range": [ + 54, + 70 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 6 + } + }, + "range": [ + 54, + 60 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 7 + }, + "end": { + "line": 8, + "column": 16 + } + }, + "range": [ + 61, + 70 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 17 + }, + "end": { + "line": 8, + "column": 22 + } + }, + "range": [ + 71, + 76 + ], + "name": "probe" + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 24 + }, + "end": { + "line": 8, + "column": 25 + } + }, + "range": [ + 78, + 79 + ], + "name": "C" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "let", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "range": [ + 1, + 4 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 5, + 10 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "range": [ + 10, + 11 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "range": [ + 12, + 17 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 18, + 19 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 20, + 21 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 8 + } + }, + "range": [ + 24, + 30 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 31, + 32 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 9 + } + }, + "range": [ + 37, + 42 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 5, + "column": 10 + }, + "end": { + "line": 5, + "column": 11 + } + }, + "range": [ + 43, + 44 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 5, + "column": 12 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "range": [ + 45, + 46 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 14 + } + }, + "range": [ + 46, + 47 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 50, + 51 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 52, + 53 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 6 + } + }, + "range": [ + 54, + 60 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 8, + "column": 6 + }, + "end": { + "line": 8, + "column": 7 + } + }, + "range": [ + 60, + 61 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 8, + "column": 7 + }, + "end": { + "line": 8, + "column": 16 + } + }, + "range": [ + 61, + 70 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 8, + "column": 16 + }, + "end": { + "line": 8, + "column": 17 + } + }, + "range": [ + 70, + 71 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 8, + "column": 17 + }, + "end": { + "line": 8, + "column": 22 + } + }, + "range": [ + 71, + 76 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 8, + "column": 22 + }, + "end": { + "line": 8, + "column": 23 + } + }, + "range": [ + 76, + 77 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 8, + "column": 24 + }, + "end": { + "line": 8, + "column": 25 + } + }, + "range": [ + 78, + 79 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 8, + "column": 25 + }, + "end": { + "line": 8, + "column": 26 + } + }, + "range": [ + 79, + 80 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 8, + "column": 26 + }, + "end": { + "line": 8, + "column": 27 + } + }, + "range": [ + 80, + 81 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-lex-derived.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-lex-derived.src.js new file mode 100644 index 00000000..b6dc858e --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-lex-derived.src.js @@ -0,0 +1,8 @@ + +let probe; +class C { + static { + probe = C; + } +} +assert.sameValue(probe, C); diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-lex-open.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-lex-open.result.js new file mode 100644 index 00000000..84111ee0 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-lex-open.result.js @@ -0,0 +1,2128 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 16, + "column": 41 + } + }, + "range": [ + 1, + 327 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "range": [ + 1, + 29 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "range": [ + 5, + 28 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "range": [ + 5, + 12 + ], + "name": "test262" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "range": [ + 15, + 28 + ], + "value": "outer scope", + "raw": "'outer scope'" + } + } + ], + "kind": "let" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 19 + } + }, + "range": [ + 30, + 49 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 34, + 40 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 34, + 40 + ], + "name": "probe1" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 18 + } + }, + "range": [ + 42, + 48 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 18 + } + }, + "range": [ + 42, + 48 + ], + "name": "probe2" + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 13, + "column": 1 + } + }, + "range": [ + 50, + 202 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 56, + 57 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 13, + "column": 1 + } + }, + "range": [ + 58, + 202 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 8, + "column": 3 + } + }, + "range": [ + 62, + 129 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 32 + } + }, + "range": [ + 75, + 103 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 31 + } + }, + "range": [ + 79, + 102 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 15 + } + }, + "range": [ + 79, + 86 + ], + "name": "test262" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 6, + "column": 18 + }, + "end": { + "line": 6, + "column": 31 + } + }, + "range": [ + 89, + 102 + ], + "value": "first block", + "raw": "'first block'" + } + } + ], + "kind": "let" + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 21 + } + }, + "range": [ + 108, + 125 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 20 + } + }, + "range": [ + 108, + 124 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 10 + } + }, + "range": [ + 108, + 114 + ], + "name": "probe1" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 13 + }, + "end": { + "line": 7, + "column": 20 + } + }, + "range": [ + 117, + 124 + ], + "name": "test262" + } + } + } + ] + }, + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 12, + "column": 3 + } + }, + "range": [ + 132, + 200 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 33 + } + }, + "range": [ + 145, + 174 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 10, + "column": 8 + }, + "end": { + "line": 10, + "column": 32 + } + }, + "range": [ + 149, + 173 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 8 + }, + "end": { + "line": 10, + "column": 15 + } + }, + "range": [ + 149, + 156 + ], + "name": "test262" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 32 + } + }, + "range": [ + 159, + 173 + ], + "value": "second block", + "raw": "'second block'" + } + } + ], + "kind": "let" + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 11, + "column": 4 + }, + "end": { + "line": 11, + "column": 21 + } + }, + "range": [ + 179, + 196 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 11, + "column": 4 + }, + "end": { + "line": 11, + "column": 20 + } + }, + "range": [ + 179, + 195 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 4 + }, + "end": { + "line": 11, + "column": 10 + } + }, + "range": [ + 179, + 185 + ], + "name": "probe2" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 13 + }, + "end": { + "line": 11, + "column": 20 + } + }, + "range": [ + 188, + 195 + ], + "name": "test262" + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 41 + } + }, + "range": [ + 203, + 244 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 40 + } + }, + "range": [ + 203, + 243 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 16 + } + }, + "range": [ + 203, + 219 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 6 + } + }, + "range": [ + 203, + 209 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 7 + }, + "end": { + "line": 14, + "column": 16 + } + }, + "range": [ + 210, + 219 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 17 + }, + "end": { + "line": 14, + "column": 24 + } + }, + "range": [ + 220, + 227 + ], + "name": "test262" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 14, + "column": 26 + }, + "end": { + "line": 14, + "column": 39 + } + }, + "range": [ + 229, + 242 + ], + "value": "outer scope", + "raw": "'outer scope'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 40 + } + }, + "range": [ + 245, + 285 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 39 + } + }, + "range": [ + 245, + 284 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 16 + } + }, + "range": [ + 245, + 261 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 6 + } + }, + "range": [ + 245, + 251 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 7 + }, + "end": { + "line": 15, + "column": 16 + } + }, + "range": [ + 252, + 261 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 17 + }, + "end": { + "line": 15, + "column": 23 + } + }, + "range": [ + 262, + 268 + ], + "name": "probe1" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 15, + "column": 25 + }, + "end": { + "line": 15, + "column": 38 + } + }, + "range": [ + 270, + 283 + ], + "value": "first block", + "raw": "'first block'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 41 + } + }, + "range": [ + 286, + 327 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 40 + } + }, + "range": [ + 286, + 326 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 286, + 302 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 6 + } + }, + "range": [ + 286, + 292 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 7 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 293, + 302 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 17 + }, + "end": { + "line": 16, + "column": 23 + } + }, + "range": [ + 303, + 309 + ], + "name": "probe2" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 16, + "column": 25 + }, + "end": { + "line": 16, + "column": 39 + } + }, + "range": [ + 311, + 325 + ], + "value": "second block", + "raw": "'second block'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "let", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "range": [ + 1, + 4 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "range": [ + 5, + 12 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "range": [ + 13, + 14 + ] + }, + { + "type": "String", + "value": "'outer scope'", + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "range": [ + 15, + 28 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 2, + "column": 27 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "range": [ + 28, + 29 + ] + }, + { + "type": "Keyword", + "value": "let", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "range": [ + 30, + 33 + ] + }, + { + "type": "Identifier", + "value": "probe1", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 34, + 40 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "range": [ + 40, + 41 + ] + }, + { + "type": "Identifier", + "value": "probe2", + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 18 + } + }, + "range": [ + 42, + 48 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 18 + }, + "end": { + "line": 3, + "column": 19 + } + }, + "range": [ + 48, + 49 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 50, + 55 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 56, + 57 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 58, + 59 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 8 + } + }, + "range": [ + 62, + 68 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 69, + 70 + ] + }, + { + "type": "Keyword", + "value": "let", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 75, + 78 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 15 + } + }, + "range": [ + 79, + 86 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 6, + "column": 16 + }, + "end": { + "line": 6, + "column": 17 + } + }, + "range": [ + 87, + 88 + ] + }, + { + "type": "String", + "value": "'first block'", + "loc": { + "start": { + "line": 6, + "column": 18 + }, + "end": { + "line": 6, + "column": 31 + } + }, + "range": [ + 89, + 102 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 31 + }, + "end": { + "line": 6, + "column": 32 + } + }, + "range": [ + 102, + 103 + ] + }, + { + "type": "Identifier", + "value": "probe1", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 10 + } + }, + "range": [ + 108, + 114 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 7, + "column": 11 + }, + "end": { + "line": 7, + "column": 12 + } + }, + "range": [ + 115, + 116 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 7, + "column": 13 + }, + "end": { + "line": 7, + "column": 20 + } + }, + "range": [ + 117, + 124 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 7, + "column": 20 + }, + "end": { + "line": 7, + "column": 21 + } + }, + "range": [ + 124, + 125 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 3 + } + }, + "range": [ + 128, + 129 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 9, + "column": 8 + } + }, + "range": [ + 132, + 138 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 10 + } + }, + "range": [ + 139, + 140 + ] + }, + { + "type": "Keyword", + "value": "let", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 7 + } + }, + "range": [ + 145, + 148 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 10, + "column": 8 + }, + "end": { + "line": 10, + "column": 15 + } + }, + "range": [ + 149, + 156 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 10, + "column": 16 + }, + "end": { + "line": 10, + "column": 17 + } + }, + "range": [ + 157, + 158 + ] + }, + { + "type": "String", + "value": "'second block'", + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 32 + } + }, + "range": [ + 159, + 173 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 10, + "column": 32 + }, + "end": { + "line": 10, + "column": 33 + } + }, + "range": [ + 173, + 174 + ] + }, + { + "type": "Identifier", + "value": "probe2", + "loc": { + "start": { + "line": 11, + "column": 4 + }, + "end": { + "line": 11, + "column": 10 + } + }, + "range": [ + 179, + 185 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 11, + "column": 11 + }, + "end": { + "line": 11, + "column": 12 + } + }, + "range": [ + 186, + 187 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 11, + "column": 13 + }, + "end": { + "line": 11, + "column": 20 + } + }, + "range": [ + 188, + 195 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 11, + "column": 20 + }, + "end": { + "line": 11, + "column": 21 + } + }, + "range": [ + 195, + 196 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 12, + "column": 2 + }, + "end": { + "line": 12, + "column": 3 + } + }, + "range": [ + 199, + 200 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 1 + } + }, + "range": [ + 201, + 202 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 6 + } + }, + "range": [ + 203, + 209 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 7 + } + }, + "range": [ + 209, + 210 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 14, + "column": 7 + }, + "end": { + "line": 14, + "column": 16 + } + }, + "range": [ + 210, + 219 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 14, + "column": 16 + }, + "end": { + "line": 14, + "column": 17 + } + }, + "range": [ + 219, + 220 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 14, + "column": 17 + }, + "end": { + "line": 14, + "column": 24 + } + }, + "range": [ + 220, + 227 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 14, + "column": 24 + }, + "end": { + "line": 14, + "column": 25 + } + }, + "range": [ + 227, + 228 + ] + }, + { + "type": "String", + "value": "'outer scope'", + "loc": { + "start": { + "line": 14, + "column": 26 + }, + "end": { + "line": 14, + "column": 39 + } + }, + "range": [ + 229, + 242 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 14, + "column": 39 + }, + "end": { + "line": 14, + "column": 40 + } + }, + "range": [ + 242, + 243 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 14, + "column": 40 + }, + "end": { + "line": 14, + "column": 41 + } + }, + "range": [ + 243, + 244 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 6 + } + }, + "range": [ + 245, + 251 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 15, + "column": 7 + } + }, + "range": [ + 251, + 252 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 15, + "column": 7 + }, + "end": { + "line": 15, + "column": 16 + } + }, + "range": [ + 252, + 261 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 15, + "column": 16 + }, + "end": { + "line": 15, + "column": 17 + } + }, + "range": [ + 261, + 262 + ] + }, + { + "type": "Identifier", + "value": "probe1", + "loc": { + "start": { + "line": 15, + "column": 17 + }, + "end": { + "line": 15, + "column": 23 + } + }, + "range": [ + 262, + 268 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 15, + "column": 23 + }, + "end": { + "line": 15, + "column": 24 + } + }, + "range": [ + 268, + 269 + ] + }, + { + "type": "String", + "value": "'first block'", + "loc": { + "start": { + "line": 15, + "column": 25 + }, + "end": { + "line": 15, + "column": 38 + } + }, + "range": [ + 270, + 283 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 15, + "column": 38 + }, + "end": { + "line": 15, + "column": 39 + } + }, + "range": [ + 283, + 284 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 15, + "column": 39 + }, + "end": { + "line": 15, + "column": 40 + } + }, + "range": [ + 284, + 285 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 6 + } + }, + "range": [ + 286, + 292 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 16, + "column": 6 + }, + "end": { + "line": 16, + "column": 7 + } + }, + "range": [ + 292, + 293 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 16, + "column": 7 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 293, + 302 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 16, + "column": 16 + }, + "end": { + "line": 16, + "column": 17 + } + }, + "range": [ + 302, + 303 + ] + }, + { + "type": "Identifier", + "value": "probe2", + "loc": { + "start": { + "line": 16, + "column": 17 + }, + "end": { + "line": 16, + "column": 23 + } + }, + "range": [ + 303, + 309 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 16, + "column": 23 + }, + "end": { + "line": 16, + "column": 24 + } + }, + "range": [ + 309, + 310 + ] + }, + { + "type": "String", + "value": "'second block'", + "loc": { + "start": { + "line": 16, + "column": 25 + }, + "end": { + "line": 16, + "column": 39 + } + }, + "range": [ + 311, + 325 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 16, + "column": 39 + }, + "end": { + "line": 16, + "column": 40 + } + }, + "range": [ + 325, + 326 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 16, + "column": 40 + }, + "end": { + "line": 16, + "column": 41 + } + }, + "range": [ + 326, + 327 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-lex-open.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-lex-open.src.js new file mode 100644 index 00000000..7c2fcbff --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-lex-open.src.js @@ -0,0 +1,16 @@ + +let test262 = 'outer scope'; +let probe1, probe2; +class C { + static { + let test262 = 'first block'; + probe1 = test262; + } + static { + let test262 = 'second block'; + probe2 = test262; + } +} +assert.sameValue(test262, 'outer scope'); +assert.sameValue(probe1, 'first block'); +assert.sameValue(probe2, 'second block'); diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-private.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-private.result.js new file mode 100644 index 00000000..af061d47 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-private.result.js @@ -0,0 +1,985 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 9, + "column": 35 + } + }, + "range": [ + 1, + 129 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "range": [ + 1, + 11 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 5, + 10 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 5, + 10 + ], + "name": "probe" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 12, + 93 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 18, + 19 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 20, + 93 + ], + "body": [ + { + "type": "PropertyDefinition", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 30 + } + }, + "range": [ + 24, + 52 + ], + "static": true, + "computed": false, + "key": { + "type": "PrivateIdentifier", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 17 + } + }, + "range": [ + 31, + 39 + ], + "name": "test262" + }, + "value": { + "type": "Literal", + "loc": { + "start": { + "line": 4, + "column": 20 + }, + "end": { + "line": 4, + "column": 29 + } + }, + "range": [ + 42, + 51 + ], + "value": "private", + "raw": "'private'" + } + }, + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 55, + 91 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 23 + } + }, + "range": [ + 68, + 87 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 22 + } + }, + "range": [ + 68, + 86 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 9 + } + }, + "range": [ + 68, + 73 + ], + "name": "probe" + }, + "right": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 6, + "column": 12 + }, + "end": { + "line": 6, + "column": 22 + } + }, + "range": [ + 76, + 86 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 12 + }, + "end": { + "line": 6, + "column": 13 + } + }, + "range": [ + 76, + 77 + ], + "name": "C" + }, + "property": { + "type": "PrivateIdentifier", + "loc": { + "start": { + "line": 6, + "column": 14 + }, + "end": { + "line": 6, + "column": 22 + } + }, + "range": [ + 78, + 86 + ], + "name": "test262" + }, + "computed": false, + "optional": false + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 9, + "column": 0 + }, + "end": { + "line": 9, + "column": 35 + } + }, + "range": [ + 94, + 129 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 9, + "column": 0 + }, + "end": { + "line": 9, + "column": 34 + } + }, + "range": [ + 94, + 128 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 9, + "column": 0 + }, + "end": { + "line": 9, + "column": 16 + } + }, + "range": [ + 94, + 110 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 0 + }, + "end": { + "line": 9, + "column": 6 + } + }, + "range": [ + 94, + 100 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 7 + }, + "end": { + "line": 9, + "column": 16 + } + }, + "range": [ + 101, + 110 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 17 + }, + "end": { + "line": 9, + "column": 22 + } + }, + "range": [ + 111, + 116 + ], + "name": "probe" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 9, + "column": 24 + }, + "end": { + "line": 9, + "column": 33 + } + }, + "range": [ + 118, + 127 + ], + "value": "private", + "raw": "'private'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "range": [ + 1, + 4 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 5, + 10 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "range": [ + 10, + 11 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "range": [ + 12, + 17 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 18, + 19 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 20, + 21 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 8 + } + }, + "range": [ + 24, + 30 + ] + }, + { + "type": "PrivateIdentifier", + "value": "test262", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 17 + } + }, + "range": [ + 31, + 39 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 4, + "column": 18 + }, + "end": { + "line": 4, + "column": 19 + } + }, + "range": [ + 40, + 41 + ] + }, + { + "type": "String", + "value": "'private'", + "loc": { + "start": { + "line": 4, + "column": 20 + }, + "end": { + "line": 4, + "column": 29 + } + }, + "range": [ + 42, + 51 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 29 + }, + "end": { + "line": 4, + "column": 30 + } + }, + "range": [ + 51, + 52 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 8 + } + }, + "range": [ + 55, + 61 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 62, + 63 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 9 + } + }, + "range": [ + 68, + 73 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 6, + "column": 10 + }, + "end": { + "line": 6, + "column": 11 + } + }, + "range": [ + 74, + 75 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 6, + "column": 12 + }, + "end": { + "line": 6, + "column": 13 + } + }, + "range": [ + 76, + 77 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 14 + } + }, + "range": [ + 77, + 78 + ] + }, + { + "type": "PrivateIdentifier", + "value": "test262", + "loc": { + "start": { + "line": 6, + "column": 14 + }, + "end": { + "line": 6, + "column": 22 + } + }, + "range": [ + 78, + 86 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 22 + }, + "end": { + "line": 6, + "column": 23 + } + }, + "range": [ + 86, + 87 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 90, + 91 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 92, + 93 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 9, + "column": 0 + }, + "end": { + "line": 9, + "column": 6 + } + }, + "range": [ + 94, + 100 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 9, + "column": 6 + }, + "end": { + "line": 9, + "column": 7 + } + }, + "range": [ + 100, + 101 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 9, + "column": 7 + }, + "end": { + "line": 9, + "column": 16 + } + }, + "range": [ + 101, + 110 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 9, + "column": 16 + }, + "end": { + "line": 9, + "column": 17 + } + }, + "range": [ + 110, + 111 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 9, + "column": 17 + }, + "end": { + "line": 9, + "column": 22 + } + }, + "range": [ + 111, + 116 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 9, + "column": 22 + }, + "end": { + "line": 9, + "column": 23 + } + }, + "range": [ + 116, + 117 + ] + }, + { + "type": "String", + "value": "'private'", + "loc": { + "start": { + "line": 9, + "column": 24 + }, + "end": { + "line": 9, + "column": 33 + } + }, + "range": [ + 118, + 127 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 9, + "column": 33 + }, + "end": { + "line": 9, + "column": 34 + } + }, + "range": [ + 127, + 128 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 9, + "column": 34 + }, + "end": { + "line": 9, + "column": 35 + } + }, + "range": [ + 128, + 129 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-private.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-private.src.js new file mode 100644 index 00000000..bfacaa12 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-private.src.js @@ -0,0 +1,9 @@ + +var probe; +class C { + static #test262 = 'private'; + static { + probe = C.#test262; + } +} +assert.sameValue(probe, 'private'); diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-var-close.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-var-close.result.js new file mode 100644 index 00000000..df37c06c --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-var-close.result.js @@ -0,0 +1,1167 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 12, + "column": 39 + } + }, + "range": [ + 1, + 176 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "range": [ + 1, + 29 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "range": [ + 5, + 28 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "range": [ + 5, + 12 + ], + "name": "test262" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "range": [ + 15, + 28 + ], + "value": "outer scope", + "raw": "'outer scope'" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 30, + 40 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 34, + 39 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 34, + 39 + ], + "name": "probe" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 11, + "column": 1 + } + }, + "range": [ + 41, + 136 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 47, + 48 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 11, + "column": 1 + } + }, + "range": [ + 49, + 136 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 53, + 98 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 32 + } + }, + "range": [ + 66, + 94 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 31 + } + }, + "range": [ + 70, + 93 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 15 + } + }, + "range": [ + 70, + 77 + ], + "name": "test262" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 6, + "column": 18 + }, + "end": { + "line": 6, + "column": 31 + } + }, + "range": [ + 80, + 93 + ], + "value": "first block", + "raw": "'first block'" + } + } + ], + "kind": "var" + } + ] + }, + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 10, + "column": 3 + } + }, + "range": [ + 101, + 134 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 20 + } + }, + "range": [ + 114, + 130 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 19 + } + }, + "range": [ + 114, + 129 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 9 + } + }, + "range": [ + 114, + 119 + ], + "name": "probe" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 12 + }, + "end": { + "line": 9, + "column": 19 + } + }, + "range": [ + 122, + 129 + ], + "name": "test262" + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 39 + } + }, + "range": [ + 137, + 176 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 38 + } + }, + "range": [ + 137, + 175 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 16 + } + }, + "range": [ + 137, + 153 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 6 + } + }, + "range": [ + 137, + 143 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 16 + } + }, + "range": [ + 144, + 153 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 17 + }, + "end": { + "line": 12, + "column": 22 + } + }, + "range": [ + 154, + 159 + ], + "name": "probe" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 12, + "column": 24 + }, + "end": { + "line": 12, + "column": 37 + } + }, + "range": [ + 161, + 174 + ], + "value": "outer scope", + "raw": "'outer scope'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "range": [ + 1, + 4 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "range": [ + 5, + 12 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "range": [ + 13, + 14 + ] + }, + { + "type": "String", + "value": "'outer scope'", + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "range": [ + 15, + 28 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 2, + "column": 27 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "range": [ + 28, + 29 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "range": [ + 30, + 33 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 34, + 39 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 39, + 40 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 41, + 46 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 47, + 48 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 8 + } + }, + "range": [ + 53, + 59 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 60, + 61 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 66, + 69 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 15 + } + }, + "range": [ + 70, + 77 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 6, + "column": 16 + }, + "end": { + "line": 6, + "column": 17 + } + }, + "range": [ + 78, + 79 + ] + }, + { + "type": "String", + "value": "'first block'", + "loc": { + "start": { + "line": 6, + "column": 18 + }, + "end": { + "line": 6, + "column": 31 + } + }, + "range": [ + 80, + 93 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 31 + }, + "end": { + "line": 6, + "column": 32 + } + }, + "range": [ + 93, + 94 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 97, + 98 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 8 + } + }, + "range": [ + 101, + 107 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 8, + "column": 10 + } + }, + "range": [ + 108, + 109 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 9 + } + }, + "range": [ + 114, + 119 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 11 + } + }, + "range": [ + 120, + 121 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 9, + "column": 12 + }, + "end": { + "line": 9, + "column": 19 + } + }, + "range": [ + 122, + 129 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 9, + "column": 19 + }, + "end": { + "line": 9, + "column": 20 + } + }, + "range": [ + 129, + 130 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 10, + "column": 2 + }, + "end": { + "line": 10, + "column": 3 + } + }, + "range": [ + 133, + 134 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 1 + } + }, + "range": [ + 135, + 136 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 6 + } + }, + "range": [ + 137, + 143 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 12, + "column": 6 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "range": [ + 143, + 144 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 16 + } + }, + "range": [ + 144, + 153 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 12, + "column": 16 + }, + "end": { + "line": 12, + "column": 17 + } + }, + "range": [ + 153, + 154 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 12, + "column": 17 + }, + "end": { + "line": 12, + "column": 22 + } + }, + "range": [ + 154, + 159 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 12, + "column": 22 + }, + "end": { + "line": 12, + "column": 23 + } + }, + "range": [ + 159, + 160 + ] + }, + { + "type": "String", + "value": "'outer scope'", + "loc": { + "start": { + "line": 12, + "column": 24 + }, + "end": { + "line": 12, + "column": 37 + } + }, + "range": [ + 161, + 174 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 12, + "column": 37 + }, + "end": { + "line": 12, + "column": 38 + } + }, + "range": [ + 174, + 175 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 12, + "column": 38 + }, + "end": { + "line": 12, + "column": 39 + } + }, + "range": [ + 175, + 176 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-var-close.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-var-close.src.js new file mode 100644 index 00000000..cd7dc396 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-var-close.src.js @@ -0,0 +1,12 @@ + +var test262 = 'outer scope'; +var probe; +class C { + static { + var test262 = 'first block'; + } + static { + probe = test262; + } +} +assert.sameValue(probe, 'outer scope'); diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-var-derived.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-var-derived.result.js new file mode 100644 index 00000000..358ab521 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-var-derived.result.js @@ -0,0 +1,930 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 9, + "column": 39 + } + }, + "range": [ + 1, + 128 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "range": [ + 1, + 29 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "range": [ + 5, + 28 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "range": [ + 5, + 12 + ], + "name": "test262" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "range": [ + 15, + 28 + ], + "value": "outer scope", + "raw": "'outer scope'" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 30, + 40 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 34, + 39 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 34, + 39 + ], + "name": "probe" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 41, + 88 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 47, + 48 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 49, + 88 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 53, + 86 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 20 + } + }, + "range": [ + 66, + 82 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 19 + } + }, + "range": [ + 66, + 81 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 9 + } + }, + "range": [ + 66, + 71 + ], + "name": "probe" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 12 + }, + "end": { + "line": 6, + "column": 19 + } + }, + "range": [ + 74, + 81 + ], + "name": "test262" + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 9, + "column": 0 + }, + "end": { + "line": 9, + "column": 39 + } + }, + "range": [ + 89, + 128 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 9, + "column": 0 + }, + "end": { + "line": 9, + "column": 38 + } + }, + "range": [ + 89, + 127 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 9, + "column": 0 + }, + "end": { + "line": 9, + "column": 16 + } + }, + "range": [ + 89, + 105 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 0 + }, + "end": { + "line": 9, + "column": 6 + } + }, + "range": [ + 89, + 95 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 7 + }, + "end": { + "line": 9, + "column": 16 + } + }, + "range": [ + 96, + 105 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 17 + }, + "end": { + "line": 9, + "column": 22 + } + }, + "range": [ + 106, + 111 + ], + "name": "probe" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 9, + "column": 24 + }, + "end": { + "line": 9, + "column": 37 + } + }, + "range": [ + 113, + 126 + ], + "value": "outer scope", + "raw": "'outer scope'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "range": [ + 1, + 4 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "range": [ + 5, + 12 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "range": [ + 13, + 14 + ] + }, + { + "type": "String", + "value": "'outer scope'", + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "range": [ + 15, + 28 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 2, + "column": 27 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "range": [ + 28, + 29 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "range": [ + 30, + 33 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 34, + 39 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 39, + 40 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 41, + 46 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 47, + 48 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 8 + } + }, + "range": [ + 53, + 59 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 60, + 61 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 9 + } + }, + "range": [ + 66, + 71 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 6, + "column": 10 + }, + "end": { + "line": 6, + "column": 11 + } + }, + "range": [ + 72, + 73 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 6, + "column": 12 + }, + "end": { + "line": 6, + "column": 19 + } + }, + "range": [ + 74, + 81 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 19 + }, + "end": { + "line": 6, + "column": 20 + } + }, + "range": [ + 81, + 82 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 85, + 86 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 87, + 88 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 9, + "column": 0 + }, + "end": { + "line": 9, + "column": 6 + } + }, + "range": [ + 89, + 95 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 9, + "column": 6 + }, + "end": { + "line": 9, + "column": 7 + } + }, + "range": [ + 95, + 96 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 9, + "column": 7 + }, + "end": { + "line": 9, + "column": 16 + } + }, + "range": [ + 96, + 105 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 9, + "column": 16 + }, + "end": { + "line": 9, + "column": 17 + } + }, + "range": [ + 105, + 106 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 9, + "column": 17 + }, + "end": { + "line": 9, + "column": 22 + } + }, + "range": [ + 106, + 111 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 9, + "column": 22 + }, + "end": { + "line": 9, + "column": 23 + } + }, + "range": [ + 111, + 112 + ] + }, + { + "type": "String", + "value": "'outer scope'", + "loc": { + "start": { + "line": 9, + "column": 24 + }, + "end": { + "line": 9, + "column": 37 + } + }, + "range": [ + 113, + 126 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 9, + "column": 37 + }, + "end": { + "line": 9, + "column": 38 + } + }, + "range": [ + 126, + 127 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 9, + "column": 38 + }, + "end": { + "line": 9, + "column": 39 + } + }, + "range": [ + 127, + 128 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-var-derived.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-var-derived.src.js new file mode 100644 index 00000000..593f2290 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-var-derived.src.js @@ -0,0 +1,9 @@ + +var test262 = 'outer scope'; +var probe; +class C { + static { + probe = test262; + } +} +assert.sameValue(probe, 'outer scope'); diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-var-open.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-var-open.result.js new file mode 100644 index 00000000..4425fb58 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-var-open.result.js @@ -0,0 +1,2128 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 16, + "column": 41 + } + }, + "range": [ + 1, + 327 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "range": [ + 1, + 29 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "range": [ + 5, + 28 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "range": [ + 5, + 12 + ], + "name": "test262" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "range": [ + 15, + 28 + ], + "value": "outer scope", + "raw": "'outer scope'" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 19 + } + }, + "range": [ + 30, + 49 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 34, + 40 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 34, + 40 + ], + "name": "probe1" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 18 + } + }, + "range": [ + 42, + 48 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 18 + } + }, + "range": [ + 42, + 48 + ], + "name": "probe2" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 13, + "column": 1 + } + }, + "range": [ + 50, + 202 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 56, + 57 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 13, + "column": 1 + } + }, + "range": [ + 58, + 202 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 8, + "column": 3 + } + }, + "range": [ + 62, + 129 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 32 + } + }, + "range": [ + 75, + 103 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 31 + } + }, + "range": [ + 79, + 102 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 15 + } + }, + "range": [ + 79, + 86 + ], + "name": "test262" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 6, + "column": 18 + }, + "end": { + "line": 6, + "column": 31 + } + }, + "range": [ + 89, + 102 + ], + "value": "first block", + "raw": "'first block'" + } + } + ], + "kind": "var" + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 21 + } + }, + "range": [ + 108, + 125 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 20 + } + }, + "range": [ + 108, + 124 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 10 + } + }, + "range": [ + 108, + 114 + ], + "name": "probe1" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 13 + }, + "end": { + "line": 7, + "column": 20 + } + }, + "range": [ + 117, + 124 + ], + "name": "test262" + } + } + } + ] + }, + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 12, + "column": 3 + } + }, + "range": [ + 132, + 200 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 33 + } + }, + "range": [ + 145, + 174 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 10, + "column": 8 + }, + "end": { + "line": 10, + "column": 32 + } + }, + "range": [ + 149, + 173 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 8 + }, + "end": { + "line": 10, + "column": 15 + } + }, + "range": [ + 149, + 156 + ], + "name": "test262" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 32 + } + }, + "range": [ + 159, + 173 + ], + "value": "second block", + "raw": "'second block'" + } + } + ], + "kind": "var" + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 11, + "column": 4 + }, + "end": { + "line": 11, + "column": 21 + } + }, + "range": [ + 179, + 196 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 11, + "column": 4 + }, + "end": { + "line": 11, + "column": 20 + } + }, + "range": [ + 179, + 195 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 4 + }, + "end": { + "line": 11, + "column": 10 + } + }, + "range": [ + 179, + 185 + ], + "name": "probe2" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 13 + }, + "end": { + "line": 11, + "column": 20 + } + }, + "range": [ + 188, + 195 + ], + "name": "test262" + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 41 + } + }, + "range": [ + 203, + 244 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 40 + } + }, + "range": [ + 203, + 243 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 16 + } + }, + "range": [ + 203, + 219 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 6 + } + }, + "range": [ + 203, + 209 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 7 + }, + "end": { + "line": 14, + "column": 16 + } + }, + "range": [ + 210, + 219 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 17 + }, + "end": { + "line": 14, + "column": 24 + } + }, + "range": [ + 220, + 227 + ], + "name": "test262" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 14, + "column": 26 + }, + "end": { + "line": 14, + "column": 39 + } + }, + "range": [ + 229, + 242 + ], + "value": "outer scope", + "raw": "'outer scope'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 40 + } + }, + "range": [ + 245, + 285 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 39 + } + }, + "range": [ + 245, + 284 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 16 + } + }, + "range": [ + 245, + 261 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 6 + } + }, + "range": [ + 245, + 251 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 7 + }, + "end": { + "line": 15, + "column": 16 + } + }, + "range": [ + 252, + 261 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 17 + }, + "end": { + "line": 15, + "column": 23 + } + }, + "range": [ + 262, + 268 + ], + "name": "probe1" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 15, + "column": 25 + }, + "end": { + "line": 15, + "column": 38 + } + }, + "range": [ + 270, + 283 + ], + "value": "first block", + "raw": "'first block'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 41 + } + }, + "range": [ + 286, + 327 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 40 + } + }, + "range": [ + 286, + 326 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 286, + 302 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 6 + } + }, + "range": [ + 286, + 292 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 7 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 293, + 302 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 17 + }, + "end": { + "line": 16, + "column": 23 + } + }, + "range": [ + 303, + 309 + ], + "name": "probe2" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 16, + "column": 25 + }, + "end": { + "line": 16, + "column": 39 + } + }, + "range": [ + 311, + 325 + ], + "value": "second block", + "raw": "'second block'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "range": [ + 1, + 4 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "range": [ + 5, + 12 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "range": [ + 13, + 14 + ] + }, + { + "type": "String", + "value": "'outer scope'", + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "range": [ + 15, + 28 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 2, + "column": 27 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "range": [ + 28, + 29 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "range": [ + 30, + 33 + ] + }, + { + "type": "Identifier", + "value": "probe1", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 34, + 40 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "range": [ + 40, + 41 + ] + }, + { + "type": "Identifier", + "value": "probe2", + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 18 + } + }, + "range": [ + 42, + 48 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 18 + }, + "end": { + "line": 3, + "column": 19 + } + }, + "range": [ + 48, + 49 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 50, + 55 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 56, + 57 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 58, + 59 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 8 + } + }, + "range": [ + 62, + 68 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 69, + 70 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 75, + 78 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 15 + } + }, + "range": [ + 79, + 86 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 6, + "column": 16 + }, + "end": { + "line": 6, + "column": 17 + } + }, + "range": [ + 87, + 88 + ] + }, + { + "type": "String", + "value": "'first block'", + "loc": { + "start": { + "line": 6, + "column": 18 + }, + "end": { + "line": 6, + "column": 31 + } + }, + "range": [ + 89, + 102 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 31 + }, + "end": { + "line": 6, + "column": 32 + } + }, + "range": [ + 102, + 103 + ] + }, + { + "type": "Identifier", + "value": "probe1", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 10 + } + }, + "range": [ + 108, + 114 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 7, + "column": 11 + }, + "end": { + "line": 7, + "column": 12 + } + }, + "range": [ + 115, + 116 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 7, + "column": 13 + }, + "end": { + "line": 7, + "column": 20 + } + }, + "range": [ + 117, + 124 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 7, + "column": 20 + }, + "end": { + "line": 7, + "column": 21 + } + }, + "range": [ + 124, + 125 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 3 + } + }, + "range": [ + 128, + 129 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 9, + "column": 8 + } + }, + "range": [ + 132, + 138 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 10 + } + }, + "range": [ + 139, + 140 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 7 + } + }, + "range": [ + 145, + 148 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 10, + "column": 8 + }, + "end": { + "line": 10, + "column": 15 + } + }, + "range": [ + 149, + 156 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 10, + "column": 16 + }, + "end": { + "line": 10, + "column": 17 + } + }, + "range": [ + 157, + 158 + ] + }, + { + "type": "String", + "value": "'second block'", + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 32 + } + }, + "range": [ + 159, + 173 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 10, + "column": 32 + }, + "end": { + "line": 10, + "column": 33 + } + }, + "range": [ + 173, + 174 + ] + }, + { + "type": "Identifier", + "value": "probe2", + "loc": { + "start": { + "line": 11, + "column": 4 + }, + "end": { + "line": 11, + "column": 10 + } + }, + "range": [ + 179, + 185 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 11, + "column": 11 + }, + "end": { + "line": 11, + "column": 12 + } + }, + "range": [ + 186, + 187 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 11, + "column": 13 + }, + "end": { + "line": 11, + "column": 20 + } + }, + "range": [ + 188, + 195 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 11, + "column": 20 + }, + "end": { + "line": 11, + "column": 21 + } + }, + "range": [ + 195, + 196 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 12, + "column": 2 + }, + "end": { + "line": 12, + "column": 3 + } + }, + "range": [ + 199, + 200 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 1 + } + }, + "range": [ + 201, + 202 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 6 + } + }, + "range": [ + 203, + 209 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 7 + } + }, + "range": [ + 209, + 210 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 14, + "column": 7 + }, + "end": { + "line": 14, + "column": 16 + } + }, + "range": [ + 210, + 219 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 14, + "column": 16 + }, + "end": { + "line": 14, + "column": 17 + } + }, + "range": [ + 219, + 220 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 14, + "column": 17 + }, + "end": { + "line": 14, + "column": 24 + } + }, + "range": [ + 220, + 227 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 14, + "column": 24 + }, + "end": { + "line": 14, + "column": 25 + } + }, + "range": [ + 227, + 228 + ] + }, + { + "type": "String", + "value": "'outer scope'", + "loc": { + "start": { + "line": 14, + "column": 26 + }, + "end": { + "line": 14, + "column": 39 + } + }, + "range": [ + 229, + 242 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 14, + "column": 39 + }, + "end": { + "line": 14, + "column": 40 + } + }, + "range": [ + 242, + 243 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 14, + "column": 40 + }, + "end": { + "line": 14, + "column": 41 + } + }, + "range": [ + 243, + 244 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 6 + } + }, + "range": [ + 245, + 251 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 15, + "column": 7 + } + }, + "range": [ + 251, + 252 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 15, + "column": 7 + }, + "end": { + "line": 15, + "column": 16 + } + }, + "range": [ + 252, + 261 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 15, + "column": 16 + }, + "end": { + "line": 15, + "column": 17 + } + }, + "range": [ + 261, + 262 + ] + }, + { + "type": "Identifier", + "value": "probe1", + "loc": { + "start": { + "line": 15, + "column": 17 + }, + "end": { + "line": 15, + "column": 23 + } + }, + "range": [ + 262, + 268 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 15, + "column": 23 + }, + "end": { + "line": 15, + "column": 24 + } + }, + "range": [ + 268, + 269 + ] + }, + { + "type": "String", + "value": "'first block'", + "loc": { + "start": { + "line": 15, + "column": 25 + }, + "end": { + "line": 15, + "column": 38 + } + }, + "range": [ + 270, + 283 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 15, + "column": 38 + }, + "end": { + "line": 15, + "column": 39 + } + }, + "range": [ + 283, + 284 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 15, + "column": 39 + }, + "end": { + "line": 15, + "column": 40 + } + }, + "range": [ + 284, + 285 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 6 + } + }, + "range": [ + 286, + 292 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 16, + "column": 6 + }, + "end": { + "line": 16, + "column": 7 + } + }, + "range": [ + 292, + 293 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 16, + "column": 7 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 293, + 302 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 16, + "column": 16 + }, + "end": { + "line": 16, + "column": 17 + } + }, + "range": [ + 302, + 303 + ] + }, + { + "type": "Identifier", + "value": "probe2", + "loc": { + "start": { + "line": 16, + "column": 17 + }, + "end": { + "line": 16, + "column": 23 + } + }, + "range": [ + 303, + 309 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 16, + "column": 23 + }, + "end": { + "line": 16, + "column": 24 + } + }, + "range": [ + 309, + 310 + ] + }, + { + "type": "String", + "value": "'second block'", + "loc": { + "start": { + "line": 16, + "column": 25 + }, + "end": { + "line": 16, + "column": 39 + } + }, + "range": [ + 311, + 325 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 16, + "column": 39 + }, + "end": { + "line": 16, + "column": 40 + } + }, + "range": [ + 325, + 326 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 16, + "column": 40 + }, + "end": { + "line": 16, + "column": 41 + } + }, + "range": [ + 326, + 327 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-var-open.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-var-open.src.js new file mode 100644 index 00000000..3df0c1b9 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-var-open.src.js @@ -0,0 +1,16 @@ + +var test262 = 'outer scope'; +var probe1, probe2; +class C { + static { + var test262 = 'first block'; + probe1 = test262; + } + static { + var test262 = 'second block'; + probe2 = test262; + } +} +assert.sameValue(test262, 'outer scope'); +assert.sameValue(probe1, 'first block'); +assert.sameValue(probe2, 'second block'); diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-sequence.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-sequence.result.js new file mode 100644 index 00000000..a0c1cf20 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-sequence.result.js @@ -0,0 +1,3104 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 16, + "column": 46 + } + }, + "range": [ + 1, + 403 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "range": [ + 1, + 19 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "range": [ + 5, + 18 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "range": [ + 5, + 13 + ], + "name": "sequence" + }, + "init": { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "range": [ + 16, + 18 + ], + "elements": [] + } + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 12, + "column": 1 + } + }, + "range": [ + 20, + 217 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 26, + 27 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 12, + "column": 1 + } + }, + "range": [ + 28, + 217 + ], + "body": [ + { + "type": "PropertyDefinition", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 42 + } + }, + "range": [ + 32, + 72 + ], + "static": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 39, + 40 + ], + "name": "x" + }, + "value": { + "type": "CallExpression", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 41 + } + }, + "range": [ + 43, + 71 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 26 + } + }, + "range": [ + 43, + 56 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 21 + } + }, + "range": [ + 43, + 51 + ], + "name": "sequence" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 22 + }, + "end": { + "line": 4, + "column": 26 + } + }, + "range": [ + 52, + 56 + ], + "name": "push" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 4, + "column": 27 + }, + "end": { + "line": 4, + "column": 40 + } + }, + "range": [ + 57, + 70 + ], + "value": "first field", + "raw": "'first field'" + } + ], + "optional": false + } + }, + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 75, + 121 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 33 + } + }, + "range": [ + 88, + 117 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 32 + } + }, + "range": [ + 88, + 116 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 17 + } + }, + "range": [ + 88, + 101 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 12 + } + }, + "range": [ + 88, + 96 + ], + "name": "sequence" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 17 + } + }, + "range": [ + 97, + 101 + ], + "name": "push" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 6, + "column": 18 + }, + "end": { + "line": 6, + "column": 31 + } + }, + "range": [ + 102, + 115 + ], + "value": "first block", + "raw": "'first block'" + } + ], + "optional": false + } + } + ] + }, + { + "type": "PropertyDefinition", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 43 + } + }, + "range": [ + 124, + 165 + ], + "static": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 8, + "column": 10 + } + }, + "range": [ + 131, + 132 + ], + "name": "x" + }, + "value": { + "type": "CallExpression", + "loc": { + "start": { + "line": 8, + "column": 13 + }, + "end": { + "line": 8, + "column": 42 + } + }, + "range": [ + 135, + 164 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 8, + "column": 13 + }, + "end": { + "line": 8, + "column": 26 + } + }, + "range": [ + 135, + 148 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 13 + }, + "end": { + "line": 8, + "column": 21 + } + }, + "range": [ + 135, + 143 + ], + "name": "sequence" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 22 + }, + "end": { + "line": 8, + "column": 26 + } + }, + "range": [ + 144, + 148 + ], + "name": "push" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 8, + "column": 27 + }, + "end": { + "line": 8, + "column": 41 + } + }, + "range": [ + 149, + 163 + ], + "value": "second field", + "raw": "'second field'" + } + ], + "optional": false + } + }, + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 11, + "column": 3 + } + }, + "range": [ + 168, + 215 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 34 + } + }, + "range": [ + 181, + 211 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 33 + } + }, + "range": [ + 181, + 210 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 17 + } + }, + "range": [ + 181, + 194 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 12 + } + }, + "range": [ + 181, + 189 + ], + "name": "sequence" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 13 + }, + "end": { + "line": 10, + "column": 17 + } + }, + "range": [ + 190, + 194 + ], + "name": "push" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 32 + } + }, + "range": [ + 195, + 209 + ], + "value": "second block", + "raw": "'second block'" + } + ], + "optional": false + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 45 + } + }, + "range": [ + 218, + 263 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 44 + } + }, + "range": [ + 218, + 262 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 16 + } + }, + "range": [ + 218, + 234 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 6 + } + }, + "range": [ + 218, + 224 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 7 + }, + "end": { + "line": 13, + "column": 16 + } + }, + "range": [ + 225, + 234 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "MemberExpression", + "loc": { + "start": { + "line": 13, + "column": 17 + }, + "end": { + "line": 13, + "column": 28 + } + }, + "range": [ + 235, + 246 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 17 + }, + "end": { + "line": 13, + "column": 25 + } + }, + "range": [ + 235, + 243 + ], + "name": "sequence" + }, + "property": { + "type": "Literal", + "loc": { + "start": { + "line": 13, + "column": 26 + }, + "end": { + "line": 13, + "column": 27 + } + }, + "range": [ + 244, + 245 + ], + "value": 0, + "raw": "0" + }, + "computed": true, + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 13, + "column": 30 + }, + "end": { + "line": 13, + "column": 43 + } + }, + "range": [ + 248, + 261 + ], + "value": "first field", + "raw": "'first field'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 45 + } + }, + "range": [ + 264, + 309 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 44 + } + }, + "range": [ + 264, + 308 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 16 + } + }, + "range": [ + 264, + 280 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 6 + } + }, + "range": [ + 264, + 270 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 7 + }, + "end": { + "line": 14, + "column": 16 + } + }, + "range": [ + 271, + 280 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "MemberExpression", + "loc": { + "start": { + "line": 14, + "column": 17 + }, + "end": { + "line": 14, + "column": 28 + } + }, + "range": [ + 281, + 292 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 17 + }, + "end": { + "line": 14, + "column": 25 + } + }, + "range": [ + 281, + 289 + ], + "name": "sequence" + }, + "property": { + "type": "Literal", + "loc": { + "start": { + "line": 14, + "column": 26 + }, + "end": { + "line": 14, + "column": 27 + } + }, + "range": [ + 290, + 291 + ], + "value": 1, + "raw": "1" + }, + "computed": true, + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 14, + "column": 30 + }, + "end": { + "line": 14, + "column": 43 + } + }, + "range": [ + 294, + 307 + ], + "value": "first block", + "raw": "'first block'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 46 + } + }, + "range": [ + 310, + 356 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 45 + } + }, + "range": [ + 310, + 355 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 16 + } + }, + "range": [ + 310, + 326 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 6 + } + }, + "range": [ + 310, + 316 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 7 + }, + "end": { + "line": 15, + "column": 16 + } + }, + "range": [ + 317, + 326 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "MemberExpression", + "loc": { + "start": { + "line": 15, + "column": 17 + }, + "end": { + "line": 15, + "column": 28 + } + }, + "range": [ + 327, + 338 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 17 + }, + "end": { + "line": 15, + "column": 25 + } + }, + "range": [ + 327, + 335 + ], + "name": "sequence" + }, + "property": { + "type": "Literal", + "loc": { + "start": { + "line": 15, + "column": 26 + }, + "end": { + "line": 15, + "column": 27 + } + }, + "range": [ + 336, + 337 + ], + "value": 2, + "raw": "2" + }, + "computed": true, + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 15, + "column": 30 + }, + "end": { + "line": 15, + "column": 44 + } + }, + "range": [ + 340, + 354 + ], + "value": "second field", + "raw": "'second field'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 46 + } + }, + "range": [ + 357, + 403 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 45 + } + }, + "range": [ + 357, + 402 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 357, + 373 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 6 + } + }, + "range": [ + 357, + 363 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 7 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 364, + 373 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "MemberExpression", + "loc": { + "start": { + "line": 16, + "column": 17 + }, + "end": { + "line": 16, + "column": 28 + } + }, + "range": [ + 374, + 385 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 17 + }, + "end": { + "line": 16, + "column": 25 + } + }, + "range": [ + 374, + 382 + ], + "name": "sequence" + }, + "property": { + "type": "Literal", + "loc": { + "start": { + "line": 16, + "column": 26 + }, + "end": { + "line": 16, + "column": 27 + } + }, + "range": [ + 383, + 384 + ], + "value": 3, + "raw": "3" + }, + "computed": true, + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 16, + "column": 30 + }, + "end": { + "line": 16, + "column": 44 + } + }, + "range": [ + 387, + 401 + ], + "value": "second block", + "raw": "'second block'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "range": [ + 1, + 4 + ] + }, + { + "type": "Identifier", + "value": "sequence", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "range": [ + 5, + 13 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "range": [ + 14, + 15 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "range": [ + 16, + 17 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "range": [ + 17, + 18 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "range": [ + 18, + 19 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "range": [ + 20, + 25 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 26, + 27 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 28, + 29 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 8 + } + }, + "range": [ + 32, + 38 + ] + }, + { + "type": "Identifier", + "value": "x", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 39, + 40 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 4, + "column": 11 + }, + "end": { + "line": 4, + "column": 12 + } + }, + "range": [ + 41, + 42 + ] + }, + { + "type": "Identifier", + "value": "sequence", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 21 + } + }, + "range": [ + 43, + 51 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 4, + "column": 21 + }, + "end": { + "line": 4, + "column": 22 + } + }, + "range": [ + 51, + 52 + ] + }, + { + "type": "Identifier", + "value": "push", + "loc": { + "start": { + "line": 4, + "column": 22 + }, + "end": { + "line": 4, + "column": 26 + } + }, + "range": [ + 52, + 56 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 26 + }, + "end": { + "line": 4, + "column": 27 + } + }, + "range": [ + 56, + 57 + ] + }, + { + "type": "String", + "value": "'first field'", + "loc": { + "start": { + "line": 4, + "column": 27 + }, + "end": { + "line": 4, + "column": 40 + } + }, + "range": [ + 57, + 70 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 40 + }, + "end": { + "line": 4, + "column": 41 + } + }, + "range": [ + 70, + 71 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 41 + }, + "end": { + "line": 4, + "column": 42 + } + }, + "range": [ + 71, + 72 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 8 + } + }, + "range": [ + 75, + 81 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 82, + 83 + ] + }, + { + "type": "Identifier", + "value": "sequence", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 12 + } + }, + "range": [ + 88, + 96 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 6, + "column": 12 + }, + "end": { + "line": 6, + "column": 13 + } + }, + "range": [ + 96, + 97 + ] + }, + { + "type": "Identifier", + "value": "push", + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 17 + } + }, + "range": [ + 97, + 101 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 17 + }, + "end": { + "line": 6, + "column": 18 + } + }, + "range": [ + 101, + 102 + ] + }, + { + "type": "String", + "value": "'first block'", + "loc": { + "start": { + "line": 6, + "column": 18 + }, + "end": { + "line": 6, + "column": 31 + } + }, + "range": [ + 102, + 115 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 31 + }, + "end": { + "line": 6, + "column": 32 + } + }, + "range": [ + 115, + 116 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 32 + }, + "end": { + "line": 6, + "column": 33 + } + }, + "range": [ + 116, + 117 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 120, + 121 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 8 + } + }, + "range": [ + 124, + 130 + ] + }, + { + "type": "Identifier", + "value": "x", + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 8, + "column": 10 + } + }, + "range": [ + 131, + 132 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 8, + "column": 11 + }, + "end": { + "line": 8, + "column": 12 + } + }, + "range": [ + 133, + 134 + ] + }, + { + "type": "Identifier", + "value": "sequence", + "loc": { + "start": { + "line": 8, + "column": 13 + }, + "end": { + "line": 8, + "column": 21 + } + }, + "range": [ + 135, + 143 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 8, + "column": 21 + }, + "end": { + "line": 8, + "column": 22 + } + }, + "range": [ + 143, + 144 + ] + }, + { + "type": "Identifier", + "value": "push", + "loc": { + "start": { + "line": 8, + "column": 22 + }, + "end": { + "line": 8, + "column": 26 + } + }, + "range": [ + 144, + 148 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 8, + "column": 26 + }, + "end": { + "line": 8, + "column": 27 + } + }, + "range": [ + 148, + 149 + ] + }, + { + "type": "String", + "value": "'second field'", + "loc": { + "start": { + "line": 8, + "column": 27 + }, + "end": { + "line": 8, + "column": 41 + } + }, + "range": [ + 149, + 163 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 8, + "column": 41 + }, + "end": { + "line": 8, + "column": 42 + } + }, + "range": [ + 163, + 164 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 8, + "column": 42 + }, + "end": { + "line": 8, + "column": 43 + } + }, + "range": [ + 164, + 165 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 9, + "column": 8 + } + }, + "range": [ + 168, + 174 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 10 + } + }, + "range": [ + 175, + 176 + ] + }, + { + "type": "Identifier", + "value": "sequence", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 12 + } + }, + "range": [ + 181, + 189 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 10, + "column": 12 + }, + "end": { + "line": 10, + "column": 13 + } + }, + "range": [ + 189, + 190 + ] + }, + { + "type": "Identifier", + "value": "push", + "loc": { + "start": { + "line": 10, + "column": 13 + }, + "end": { + "line": 10, + "column": 17 + } + }, + "range": [ + 190, + 194 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 10, + "column": 17 + }, + "end": { + "line": 10, + "column": 18 + } + }, + "range": [ + 194, + 195 + ] + }, + { + "type": "String", + "value": "'second block'", + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 32 + } + }, + "range": [ + 195, + 209 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 10, + "column": 32 + }, + "end": { + "line": 10, + "column": 33 + } + }, + "range": [ + 209, + 210 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 10, + "column": 33 + }, + "end": { + "line": 10, + "column": 34 + } + }, + "range": [ + 210, + 211 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 3 + } + }, + "range": [ + 214, + 215 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 1 + } + }, + "range": [ + 216, + 217 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 6 + } + }, + "range": [ + 218, + 224 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 13, + "column": 6 + }, + "end": { + "line": 13, + "column": 7 + } + }, + "range": [ + 224, + 225 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 13, + "column": 7 + }, + "end": { + "line": 13, + "column": 16 + } + }, + "range": [ + 225, + 234 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 13, + "column": 16 + }, + "end": { + "line": 13, + "column": 17 + } + }, + "range": [ + 234, + 235 + ] + }, + { + "type": "Identifier", + "value": "sequence", + "loc": { + "start": { + "line": 13, + "column": 17 + }, + "end": { + "line": 13, + "column": 25 + } + }, + "range": [ + 235, + 243 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 13, + "column": 25 + }, + "end": { + "line": 13, + "column": 26 + } + }, + "range": [ + 243, + 244 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 13, + "column": 26 + }, + "end": { + "line": 13, + "column": 27 + } + }, + "range": [ + 244, + 245 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 13, + "column": 27 + }, + "end": { + "line": 13, + "column": 28 + } + }, + "range": [ + 245, + 246 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 13, + "column": 28 + }, + "end": { + "line": 13, + "column": 29 + } + }, + "range": [ + 246, + 247 + ] + }, + { + "type": "String", + "value": "'first field'", + "loc": { + "start": { + "line": 13, + "column": 30 + }, + "end": { + "line": 13, + "column": 43 + } + }, + "range": [ + 248, + 261 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 13, + "column": 43 + }, + "end": { + "line": 13, + "column": 44 + } + }, + "range": [ + 261, + 262 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 13, + "column": 44 + }, + "end": { + "line": 13, + "column": 45 + } + }, + "range": [ + 262, + 263 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 6 + } + }, + "range": [ + 264, + 270 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 7 + } + }, + "range": [ + 270, + 271 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 14, + "column": 7 + }, + "end": { + "line": 14, + "column": 16 + } + }, + "range": [ + 271, + 280 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 14, + "column": 16 + }, + "end": { + "line": 14, + "column": 17 + } + }, + "range": [ + 280, + 281 + ] + }, + { + "type": "Identifier", + "value": "sequence", + "loc": { + "start": { + "line": 14, + "column": 17 + }, + "end": { + "line": 14, + "column": 25 + } + }, + "range": [ + 281, + 289 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 14, + "column": 25 + }, + "end": { + "line": 14, + "column": 26 + } + }, + "range": [ + 289, + 290 + ] + }, + { + "type": "Numeric", + "value": "1", + "loc": { + "start": { + "line": 14, + "column": 26 + }, + "end": { + "line": 14, + "column": 27 + } + }, + "range": [ + 290, + 291 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 14, + "column": 27 + }, + "end": { + "line": 14, + "column": 28 + } + }, + "range": [ + 291, + 292 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 14, + "column": 28 + }, + "end": { + "line": 14, + "column": 29 + } + }, + "range": [ + 292, + 293 + ] + }, + { + "type": "String", + "value": "'first block'", + "loc": { + "start": { + "line": 14, + "column": 30 + }, + "end": { + "line": 14, + "column": 43 + } + }, + "range": [ + 294, + 307 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 14, + "column": 43 + }, + "end": { + "line": 14, + "column": 44 + } + }, + "range": [ + 307, + 308 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 14, + "column": 44 + }, + "end": { + "line": 14, + "column": 45 + } + }, + "range": [ + 308, + 309 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 6 + } + }, + "range": [ + 310, + 316 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 15, + "column": 7 + } + }, + "range": [ + 316, + 317 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 15, + "column": 7 + }, + "end": { + "line": 15, + "column": 16 + } + }, + "range": [ + 317, + 326 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 15, + "column": 16 + }, + "end": { + "line": 15, + "column": 17 + } + }, + "range": [ + 326, + 327 + ] + }, + { + "type": "Identifier", + "value": "sequence", + "loc": { + "start": { + "line": 15, + "column": 17 + }, + "end": { + "line": 15, + "column": 25 + } + }, + "range": [ + 327, + 335 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 15, + "column": 25 + }, + "end": { + "line": 15, + "column": 26 + } + }, + "range": [ + 335, + 336 + ] + }, + { + "type": "Numeric", + "value": "2", + "loc": { + "start": { + "line": 15, + "column": 26 + }, + "end": { + "line": 15, + "column": 27 + } + }, + "range": [ + 336, + 337 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 15, + "column": 27 + }, + "end": { + "line": 15, + "column": 28 + } + }, + "range": [ + 337, + 338 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 15, + "column": 28 + }, + "end": { + "line": 15, + "column": 29 + } + }, + "range": [ + 338, + 339 + ] + }, + { + "type": "String", + "value": "'second field'", + "loc": { + "start": { + "line": 15, + "column": 30 + }, + "end": { + "line": 15, + "column": 44 + } + }, + "range": [ + 340, + 354 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 15, + "column": 44 + }, + "end": { + "line": 15, + "column": 45 + } + }, + "range": [ + 354, + 355 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 15, + "column": 45 + }, + "end": { + "line": 15, + "column": 46 + } + }, + "range": [ + 355, + 356 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 6 + } + }, + "range": [ + 357, + 363 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 16, + "column": 6 + }, + "end": { + "line": 16, + "column": 7 + } + }, + "range": [ + 363, + 364 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 16, + "column": 7 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 364, + 373 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 16, + "column": 16 + }, + "end": { + "line": 16, + "column": 17 + } + }, + "range": [ + 373, + 374 + ] + }, + { + "type": "Identifier", + "value": "sequence", + "loc": { + "start": { + "line": 16, + "column": 17 + }, + "end": { + "line": 16, + "column": 25 + } + }, + "range": [ + 374, + 382 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 16, + "column": 25 + }, + "end": { + "line": 16, + "column": 26 + } + }, + "range": [ + 382, + 383 + ] + }, + { + "type": "Numeric", + "value": "3", + "loc": { + "start": { + "line": 16, + "column": 26 + }, + "end": { + "line": 16, + "column": 27 + } + }, + "range": [ + 383, + 384 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 16, + "column": 27 + }, + "end": { + "line": 16, + "column": 28 + } + }, + "range": [ + 384, + 385 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 16, + "column": 28 + }, + "end": { + "line": 16, + "column": 29 + } + }, + "range": [ + 385, + 386 + ] + }, + { + "type": "String", + "value": "'second block'", + "loc": { + "start": { + "line": 16, + "column": 30 + }, + "end": { + "line": 16, + "column": 44 + } + }, + "range": [ + 387, + 401 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 16, + "column": 44 + }, + "end": { + "line": 16, + "column": 45 + } + }, + "range": [ + 401, + 402 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 16, + "column": 45 + }, + "end": { + "line": 16, + "column": 46 + } + }, + "range": [ + 402, + 403 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-sequence.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-sequence.src.js new file mode 100644 index 00000000..818ba7bd --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-sequence.src.js @@ -0,0 +1,16 @@ + +var sequence = []; +class C { + static x = sequence.push('first field'); + static { + sequence.push('first block'); + } + static x = sequence.push('second field'); + static { + sequence.push('second block'); + } +} +assert.sameValue(sequence[0], 'first field'); +assert.sameValue(sequence[1], 'first block'); +assert.sameValue(sequence[2], 'second field'); +assert.sameValue(sequence[3], 'second block'); diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-statement-list-optional.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-statement-list-optional.result.js new file mode 100644 index 00000000..5b01aff5 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-statement-list-optional.result.js @@ -0,0 +1,221 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "range": [ + 1, + 24 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "range": [ + 1, + 24 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 7, + 8 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "range": [ + 9, + 24 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "range": [ + 13, + 22 + ], + "body": [] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "range": [ + 1, + 6 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 7, + 8 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 9, + 10 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "range": [ + 13, + 19 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 20, + 21 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "range": [ + 21, + 22 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "range": [ + 23, + 24 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-statement-list-optional.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-statement-list-optional.src.js new file mode 100644 index 00000000..d8a5b1a8 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-statement-list-optional.src.js @@ -0,0 +1,4 @@ + +class C { + static {} +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-super-property.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-super-property.result.js new file mode 100644 index 00000000..a8db87bf --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-super-property.result.js @@ -0,0 +1,1273 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 10, + "column": 35 + } + }, + "range": [ + 1, + 165 + ], + "body": [ + { + "type": "FunctionDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "range": [ + 1, + 21 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "range": [ + 10, + 16 + ], + "name": "Parent" + }, + "expression": false, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "range": [ + 19, + 21 + ], + "body": [] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 27 + } + }, + "range": [ + 22, + 49 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 26 + } + }, + "range": [ + 22, + 48 + ], + "operator": "=", + "left": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "range": [ + 22, + 36 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "range": [ + 22, + 28 + ], + "name": "Parent" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "range": [ + 29, + 36 + ], + "name": "test262" + }, + "computed": false, + "optional": false + }, + "right": { + "type": "Literal", + "loc": { + "start": { + "line": 3, + "column": 17 + }, + "end": { + "line": 3, + "column": 26 + } + }, + "range": [ + 39, + 48 + ], + "value": "test262", + "raw": "'test262'" + } + } + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 50, + 60 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 54, + 59 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 54, + 59 + ], + "name": "value" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 9, + "column": 1 + } + }, + "range": [ + 61, + 129 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "range": [ + 67, + 68 + ], + "name": "C" + }, + "superClass": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 16 + }, + "end": { + "line": 5, + "column": 22 + } + }, + "range": [ + 77, + 83 + ], + "name": "Parent" + }, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 5, + "column": 23 + }, + "end": { + "line": 9, + "column": 1 + } + }, + "range": [ + 84, + 129 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 8, + "column": 3 + } + }, + "range": [ + 88, + 127 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 26 + } + }, + "range": [ + 101, + 123 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 25 + } + }, + "range": [ + 101, + 122 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 9 + } + }, + "range": [ + 101, + 106 + ], + "name": "value" + }, + "right": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 7, + "column": 12 + }, + "end": { + "line": 7, + "column": 25 + } + }, + "range": [ + 109, + 122 + ], + "object": { + "type": "Super", + "loc": { + "start": { + "line": 7, + "column": 12 + }, + "end": { + "line": 7, + "column": 17 + } + }, + "range": [ + 109, + 114 + ] + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 18 + }, + "end": { + "line": 7, + "column": 25 + } + }, + "range": [ + 115, + 122 + ], + "name": "test262" + }, + "computed": false, + "optional": false + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 10, + "column": 0 + }, + "end": { + "line": 10, + "column": 35 + } + }, + "range": [ + 130, + 165 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 10, + "column": 0 + }, + "end": { + "line": 10, + "column": 34 + } + }, + "range": [ + 130, + 164 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 10, + "column": 0 + }, + "end": { + "line": 10, + "column": 16 + } + }, + "range": [ + 130, + 146 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 0 + }, + "end": { + "line": 10, + "column": 6 + } + }, + "range": [ + 130, + 136 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 7 + }, + "end": { + "line": 10, + "column": 16 + } + }, + "range": [ + 137, + 146 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 17 + }, + "end": { + "line": 10, + "column": 22 + } + }, + "range": [ + 147, + 152 + ], + "name": "value" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 10, + "column": 24 + }, + "end": { + "line": 10, + "column": 33 + } + }, + "range": [ + 154, + 163 + ], + "value": "test262", + "raw": "'test262'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "function", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "range": [ + 1, + 9 + ] + }, + { + "type": "Identifier", + "value": "Parent", + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "range": [ + 10, + 16 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "range": [ + 16, + 17 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "range": [ + 17, + 18 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "range": [ + 19, + 20 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "range": [ + 20, + 21 + ] + }, + { + "type": "Identifier", + "value": "Parent", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "range": [ + 22, + 28 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 28, + 29 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "range": [ + 29, + 36 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "range": [ + 37, + 38 + ] + }, + { + "type": "String", + "value": "'test262'", + "loc": { + "start": { + "line": 3, + "column": 17 + }, + "end": { + "line": 3, + "column": 26 + } + }, + "range": [ + 39, + 48 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 26 + }, + "end": { + "line": 3, + "column": 27 + } + }, + "range": [ + 48, + 49 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 50, + 53 + ] + }, + { + "type": "Identifier", + "value": "value", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 54, + 59 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 59, + 60 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "range": [ + 61, + 66 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "range": [ + 67, + 68 + ] + }, + { + "type": "Keyword", + "value": "extends", + "loc": { + "start": { + "line": 5, + "column": 8 + }, + "end": { + "line": 5, + "column": 15 + } + }, + "range": [ + 69, + 76 + ] + }, + { + "type": "Identifier", + "value": "Parent", + "loc": { + "start": { + "line": 5, + "column": 16 + }, + "end": { + "line": 5, + "column": 22 + } + }, + "range": [ + 77, + 83 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 23 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "range": [ + 84, + 85 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 8 + } + }, + "range": [ + 88, + 94 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 9 + }, + "end": { + "line": 6, + "column": 10 + } + }, + "range": [ + 95, + 96 + ] + }, + { + "type": "Identifier", + "value": "value", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 9 + } + }, + "range": [ + 101, + 106 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 7, + "column": 10 + }, + "end": { + "line": 7, + "column": 11 + } + }, + "range": [ + 107, + 108 + ] + }, + { + "type": "Keyword", + "value": "super", + "loc": { + "start": { + "line": 7, + "column": 12 + }, + "end": { + "line": 7, + "column": 17 + } + }, + "range": [ + 109, + 114 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 7, + "column": 17 + }, + "end": { + "line": 7, + "column": 18 + } + }, + "range": [ + 114, + 115 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 7, + "column": 18 + }, + "end": { + "line": 7, + "column": 25 + } + }, + "range": [ + 115, + 122 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 7, + "column": 25 + }, + "end": { + "line": 7, + "column": 26 + } + }, + "range": [ + 122, + 123 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 3 + } + }, + "range": [ + 126, + 127 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 9, + "column": 0 + }, + "end": { + "line": 9, + "column": 1 + } + }, + "range": [ + 128, + 129 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 10, + "column": 0 + }, + "end": { + "line": 10, + "column": 6 + } + }, + "range": [ + 130, + 136 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 7 + } + }, + "range": [ + 136, + 137 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 10, + "column": 7 + }, + "end": { + "line": 10, + "column": 16 + } + }, + "range": [ + 137, + 146 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 10, + "column": 16 + }, + "end": { + "line": 10, + "column": 17 + } + }, + "range": [ + 146, + 147 + ] + }, + { + "type": "Identifier", + "value": "value", + "loc": { + "start": { + "line": 10, + "column": 17 + }, + "end": { + "line": 10, + "column": 22 + } + }, + "range": [ + 147, + 152 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 10, + "column": 22 + }, + "end": { + "line": 10, + "column": 23 + } + }, + "range": [ + 152, + 153 + ] + }, + { + "type": "String", + "value": "'test262'", + "loc": { + "start": { + "line": 10, + "column": 24 + }, + "end": { + "line": 10, + "column": 33 + } + }, + "range": [ + 154, + 163 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 10, + "column": 33 + }, + "end": { + "line": 10, + "column": 34 + } + }, + "range": [ + 163, + 164 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 10, + "column": 34 + }, + "end": { + "line": 10, + "column": 35 + } + }, + "range": [ + 164, + 165 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-super-property.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-super-property.src.js new file mode 100644 index 00000000..ad97f5f3 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-super-property.src.js @@ -0,0 +1,10 @@ + +function Parent() {} +Parent.test262 = 'test262'; +var value; +class C extends Parent { + static { + value = super.test262; + } +} +assert.sameValue(value, 'test262'); diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-const-static-init-await-binding-invalid.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-const-static-init-await-binding-invalid.result.js new file mode 100644 index 00000000..fe48265b --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-const-static-init-await-binding-invalid.result.js @@ -0,0 +1,6 @@ +export default { + "index": 32, + "lineNumber": 4, + "column": 11, + "message": "Cannot use await in class static initialization block" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-const-static-init-await-binding-invalid.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-const-static-init-await-binding-invalid.src.js new file mode 100644 index 00000000..bb9b18d2 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-const-static-init-await-binding-invalid.src.js @@ -0,0 +1,6 @@ + +class C { + static { + const await = 0; + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-const-static-init-await-binding-valid.module-result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-const-static-init-await-binding-valid.module-result.js new file mode 100644 index 00000000..416c950a --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-const-static-init-await-binding-valid.module-result.js @@ -0,0 +1,6 @@ +export default { + "index": 41, + "lineNumber": 4, + "column": 20, + "message": "Cannot use keyword 'await' outside an async function" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-const-static-init-await-binding-valid.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-const-static-init-await-binding-valid.result.js new file mode 100644 index 00000000..c63af986 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-const-static-init-await-binding-valid.result.js @@ -0,0 +1,588 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 1, + 61 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 1, + 61 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 7, + 8 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 9, + 61 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 13, + 59 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 33 + } + }, + "range": [ + 26, + 55 + ], + "expression": { + "type": "ArrowFunctionExpression", + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 31 + } + }, + "range": [ + 27, + 53 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 4, + "column": 11 + }, + "end": { + "line": 4, + "column": 31 + } + }, + "range": [ + 33, + 53 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 29 + } + }, + "range": [ + 35, + 51 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 19 + }, + "end": { + "line": 4, + "column": 28 + } + }, + "range": [ + 41, + 50 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 19 + }, + "end": { + "line": 4, + "column": 24 + } + }, + "range": [ + 41, + 46 + ], + "name": "await" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 4, + "column": 27 + }, + "end": { + "line": 4, + "column": 28 + } + }, + "range": [ + 49, + 50 + ], + "value": 0, + "raw": "0" + } + } + ], + "kind": "const" + } + ] + } + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "range": [ + 1, + 6 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 7, + 8 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 9, + 10 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "range": [ + 13, + 19 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 20, + 21 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 26, + 27 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 6 + } + }, + "range": [ + 27, + 28 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 28, + 29 + ] + }, + { + "type": "Punctuator", + "value": "=>", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 30, + 32 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 11 + }, + "end": { + "line": 4, + "column": 12 + } + }, + "range": [ + 33, + 34 + ] + }, + { + "type": "Keyword", + "value": "const", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 18 + } + }, + "range": [ + 35, + 40 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 4, + "column": 19 + }, + "end": { + "line": 4, + "column": 24 + } + }, + "range": [ + 41, + 46 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 4, + "column": 25 + }, + "end": { + "line": 4, + "column": 26 + } + }, + "range": [ + 47, + 48 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 4, + "column": 27 + }, + "end": { + "line": 4, + "column": 28 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 28 + }, + "end": { + "line": 4, + "column": 29 + } + }, + "range": [ + 50, + 51 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 4, + "column": 30 + }, + "end": { + "line": 4, + "column": 31 + } + }, + "range": [ + 52, + 53 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 31 + }, + "end": { + "line": 4, + "column": 32 + } + }, + "range": [ + 53, + 54 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 32 + }, + "end": { + "line": 4, + "column": 33 + } + }, + "range": [ + 54, + 55 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 58, + 59 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 60, + 61 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-const-static-init-await-binding-valid.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-const-static-init-await-binding-valid.src.js new file mode 100644 index 00000000..7b606585 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-const-static-init-await-binding-valid.src.js @@ -0,0 +1,6 @@ + +class C { + static { + (() => { const await = 0; }); + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-continue-static-init-with-label.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-continue-static-init-with-label.result.js new file mode 100644 index 00000000..e33b7f66 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-continue-static-init-with-label.result.js @@ -0,0 +1,6 @@ +export default { + "index": 54, + "lineNumber": 5, + "column": 7, + "message": "Unsyntactic continue" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-continue-static-init-with-label.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-continue-static-init-with-label.src.js new file mode 100644 index 00000000..9d58e1a6 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-continue-static-init-with-label.src.js @@ -0,0 +1,8 @@ + +label: while(false) { + class C { + static { + continue label; + } + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-continue-static-init-without-label.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-continue-static-init-without-label.result.js new file mode 100644 index 00000000..e33b7f66 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-continue-static-init-without-label.result.js @@ -0,0 +1,6 @@ +export default { + "index": 54, + "lineNumber": 5, + "column": 7, + "message": "Unsyntactic continue" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-continue-static-init-without-label.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-continue-static-init-without-label.src.js new file mode 100644 index 00000000..4d91b703 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-continue-static-init-without-label.src.js @@ -0,0 +1,8 @@ + +label: while(false) { + class C { + static { + continue; + } + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-function-static-init-await-binding-invalid.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-function-static-init-await-binding-invalid.result.js new file mode 100644 index 00000000..64a5b3ff --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-function-static-init-await-binding-invalid.result.js @@ -0,0 +1,6 @@ +export default { + "index": 35, + "lineNumber": 4, + "column": 14, + "message": "Cannot use await in class static initialization block" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-function-static-init-await-binding-invalid.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-function-static-init-await-binding-invalid.src.js new file mode 100644 index 00000000..885f9a4f --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-function-static-init-await-binding-invalid.src.js @@ -0,0 +1,6 @@ + +class C { + static { + function await() {} + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-function-static-init-await-binding-valid.module-result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-function-static-init-await-binding-valid.module-result.js new file mode 100644 index 00000000..7511278d --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-function-static-init-await-binding-valid.module-result.js @@ -0,0 +1,6 @@ +export default { + "index": 44, + "lineNumber": 4, + "column": 23, + "message": "Cannot use keyword 'await' outside an async function" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-function-static-init-await-binding-valid.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-function-static-init-await-binding-valid.result.js new file mode 100644 index 00000000..522564e1 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-function-static-init-await-binding-valid.result.js @@ -0,0 +1,589 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 1, + 64 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 1, + 64 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 7, + 8 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 9, + 64 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 13, + 62 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 36 + } + }, + "range": [ + 26, + 58 + ], + "expression": { + "type": "ArrowFunctionExpression", + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 34 + } + }, + "range": [ + 27, + 56 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 4, + "column": 11 + }, + "end": { + "line": 4, + "column": 34 + } + }, + "range": [ + 33, + 56 + ], + "body": [ + { + "type": "FunctionDeclaration", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 32 + } + }, + "range": [ + 35, + 54 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 22 + }, + "end": { + "line": 4, + "column": 27 + } + }, + "range": [ + 44, + 49 + ], + "name": "await" + }, + "expression": false, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 4, + "column": 30 + }, + "end": { + "line": 4, + "column": 32 + } + }, + "range": [ + 52, + 54 + ], + "body": [] + } + } + ] + } + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "range": [ + 1, + 6 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 7, + 8 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 9, + 10 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "range": [ + 13, + 19 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 20, + 21 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 26, + 27 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 6 + } + }, + "range": [ + 27, + 28 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 28, + 29 + ] + }, + { + "type": "Punctuator", + "value": "=>", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 30, + 32 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 11 + }, + "end": { + "line": 4, + "column": 12 + } + }, + "range": [ + 33, + 34 + ] + }, + { + "type": "Keyword", + "value": "function", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 21 + } + }, + "range": [ + 35, + 43 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 4, + "column": 22 + }, + "end": { + "line": 4, + "column": 27 + } + }, + "range": [ + 44, + 49 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 27 + }, + "end": { + "line": 4, + "column": 28 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 28 + }, + "end": { + "line": 4, + "column": 29 + } + }, + "range": [ + 50, + 51 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 30 + }, + "end": { + "line": 4, + "column": 31 + } + }, + "range": [ + 52, + 53 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 4, + "column": 31 + }, + "end": { + "line": 4, + "column": 32 + } + }, + "range": [ + 53, + 54 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 4, + "column": 33 + }, + "end": { + "line": 4, + "column": 34 + } + }, + "range": [ + 55, + 56 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 34 + }, + "end": { + "line": 4, + "column": 35 + } + }, + "range": [ + 56, + 57 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 35 + }, + "end": { + "line": 4, + "column": 36 + } + }, + "range": [ + 57, + 58 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 61, + 62 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 63, + 64 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-function-static-init-await-binding-valid.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-function-static-init-await-binding-valid.src.js new file mode 100644 index 00000000..97a55ffb --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-function-static-init-await-binding-valid.src.js @@ -0,0 +1,6 @@ + +class C { + static { + (() => { function await() {} }); + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-labeled-static-init-invalid-await.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-labeled-static-init-invalid-await.result.js new file mode 100644 index 00000000..99a56749 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-labeled-static-init-invalid-await.result.js @@ -0,0 +1,6 @@ +export default { + "index": 26, + "lineNumber": 4, + "column": 5, + "message": "Cannot use await in class static initialization block" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-labeled-static-init-invalid-await.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-labeled-static-init-invalid-await.src.js new file mode 100644 index 00000000..e6fd2e29 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-labeled-static-init-invalid-await.src.js @@ -0,0 +1,6 @@ + +class C { + static { + await: 0; + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-let-static-init-await-binding-invalid.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-let-static-init-await-binding-invalid.result.js new file mode 100644 index 00000000..ebb02bbd --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-let-static-init-await-binding-invalid.result.js @@ -0,0 +1,6 @@ +export default { + "index": 30, + "lineNumber": 4, + "column": 9, + "message": "Cannot use await in class static initialization block" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-let-static-init-await-binding-invalid.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-let-static-init-await-binding-invalid.src.js new file mode 100644 index 00000000..7f5e968f --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-let-static-init-await-binding-invalid.src.js @@ -0,0 +1,6 @@ + +class C { + static { + let await; + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-let-static-init-await-binding-valid.module-result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-let-static-init-await-binding-valid.module-result.js new file mode 100644 index 00000000..6d51c475 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-let-static-init-await-binding-valid.module-result.js @@ -0,0 +1,6 @@ +export default { + "index": 39, + "lineNumber": 4, + "column": 18, + "message": "Cannot use keyword 'await' outside an async function" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-let-static-init-await-binding-valid.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-let-static-init-await-binding-valid.result.js new file mode 100644 index 00000000..7fac06ab --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-let-static-init-await-binding-valid.result.js @@ -0,0 +1,534 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 1, + 55 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 1, + 55 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 7, + 8 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 9, + 55 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 13, + 53 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 27 + } + }, + "range": [ + 26, + 49 + ], + "expression": { + "type": "ArrowFunctionExpression", + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 25 + } + }, + "range": [ + 27, + 47 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 4, + "column": 11 + }, + "end": { + "line": 4, + "column": 25 + } + }, + "range": [ + 33, + 47 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 35, + 45 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 17 + }, + "end": { + "line": 4, + "column": 22 + } + }, + "range": [ + 39, + 44 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 17 + }, + "end": { + "line": 4, + "column": 22 + } + }, + "range": [ + 39, + 44 + ], + "name": "await" + }, + "init": null + } + ], + "kind": "let" + } + ] + } + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "range": [ + 1, + 6 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 7, + 8 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 9, + 10 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "range": [ + 13, + 19 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 20, + 21 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 26, + 27 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 6 + } + }, + "range": [ + 27, + 28 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 28, + 29 + ] + }, + { + "type": "Punctuator", + "value": "=>", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 30, + 32 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 11 + }, + "end": { + "line": 4, + "column": 12 + } + }, + "range": [ + 33, + 34 + ] + }, + { + "type": "Keyword", + "value": "let", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 16 + } + }, + "range": [ + 35, + 38 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 4, + "column": 17 + }, + "end": { + "line": 4, + "column": 22 + } + }, + "range": [ + 39, + 44 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 22 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 44, + 45 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 4, + "column": 24 + }, + "end": { + "line": 4, + "column": 25 + } + }, + "range": [ + 46, + 47 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 25 + }, + "end": { + "line": 4, + "column": 26 + } + }, + "range": [ + 47, + 48 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 26 + }, + "end": { + "line": 4, + "column": 27 + } + }, + "range": [ + 48, + 49 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 52, + 53 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 54, + 55 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-let-static-init-await-binding-valid.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-let-static-init-await-binding-valid.src.js new file mode 100644 index 00000000..a3ea5eab --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-let-static-init-await-binding-valid.src.js @@ -0,0 +1,6 @@ + +class C { + static { + (() => { let await; }); + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-try-static-init-await-binding-invalid.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-try-static-init-await-binding-invalid.result.js new file mode 100644 index 00000000..fe2cb55a --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-try-static-init-await-binding-invalid.result.js @@ -0,0 +1,6 @@ +export default { + "index": 40, + "lineNumber": 4, + "column": 19, + "message": "Cannot use await in class static initialization block" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-try-static-init-await-binding-invalid.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-try-static-init-await-binding-invalid.src.js new file mode 100644 index 00000000..48a6d673 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-try-static-init-await-binding-invalid.src.js @@ -0,0 +1,6 @@ + +class C { + static { + try {} catch (await) {} + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-try-static-init-await-binding-valid.module-result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-try-static-init-await-binding-valid.module-result.js new file mode 100644 index 00000000..652aefb4 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-try-static-init-await-binding-valid.module-result.js @@ -0,0 +1,6 @@ +export default { + "index": 49, + "lineNumber": 4, + "column": 28, + "message": "Cannot use keyword 'await' outside an async function" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-try-static-init-await-binding-valid.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-try-static-init-await-binding-valid.result.js new file mode 100644 index 00000000..ea8e10c9 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-try-static-init-await-binding-valid.result.js @@ -0,0 +1,675 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 1, + 68 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 1, + 68 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 7, + 8 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 9, + 68 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 13, + 66 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 40 + } + }, + "range": [ + 26, + 62 + ], + "expression": { + "type": "ArrowFunctionExpression", + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 38 + } + }, + "range": [ + 27, + 60 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 4, + "column": 11 + }, + "end": { + "line": 4, + "column": 38 + } + }, + "range": [ + 33, + 60 + ], + "body": [ + { + "type": "TryStatement", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 36 + } + }, + "range": [ + 35, + 58 + ], + "block": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 4, + "column": 17 + }, + "end": { + "line": 4, + "column": 19 + } + }, + "range": [ + 39, + 41 + ], + "body": [] + }, + "handler": { + "type": "CatchClause", + "loc": { + "start": { + "line": 4, + "column": 20 + }, + "end": { + "line": 4, + "column": 36 + } + }, + "range": [ + 42, + 58 + ], + "param": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 27 + }, + "end": { + "line": 4, + "column": 32 + } + }, + "range": [ + 49, + 54 + ], + "name": "await" + }, + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 4, + "column": 34 + }, + "end": { + "line": 4, + "column": 36 + } + }, + "range": [ + 56, + 58 + ], + "body": [] + } + }, + "finalizer": null + } + ] + } + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "range": [ + 1, + 6 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 7, + 8 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 9, + 10 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "range": [ + 13, + 19 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 20, + 21 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 26, + 27 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 6 + } + }, + "range": [ + 27, + 28 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 28, + 29 + ] + }, + { + "type": "Punctuator", + "value": "=>", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 30, + 32 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 11 + }, + "end": { + "line": 4, + "column": 12 + } + }, + "range": [ + 33, + 34 + ] + }, + { + "type": "Keyword", + "value": "try", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 16 + } + }, + "range": [ + 35, + 38 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 17 + }, + "end": { + "line": 4, + "column": 18 + } + }, + "range": [ + 39, + 40 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 4, + "column": 18 + }, + "end": { + "line": 4, + "column": 19 + } + }, + "range": [ + 40, + 41 + ] + }, + { + "type": "Keyword", + "value": "catch", + "loc": { + "start": { + "line": 4, + "column": 20 + }, + "end": { + "line": 4, + "column": 25 + } + }, + "range": [ + 42, + 47 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 26 + }, + "end": { + "line": 4, + "column": 27 + } + }, + "range": [ + 48, + 49 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 4, + "column": 27 + }, + "end": { + "line": 4, + "column": 32 + } + }, + "range": [ + 49, + 54 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 32 + }, + "end": { + "line": 4, + "column": 33 + } + }, + "range": [ + 54, + 55 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 34 + }, + "end": { + "line": 4, + "column": 35 + } + }, + "range": [ + 56, + 57 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 4, + "column": 35 + }, + "end": { + "line": 4, + "column": 36 + } + }, + "range": [ + 57, + 58 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 4, + "column": 37 + }, + "end": { + "line": 4, + "column": 38 + } + }, + "range": [ + 59, + 60 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 38 + }, + "end": { + "line": 4, + "column": 39 + } + }, + "range": [ + 60, + 61 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 39 + }, + "end": { + "line": 4, + "column": 40 + } + }, + "range": [ + 61, + 62 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 65, + 66 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 67, + 68 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-try-static-init-await-binding-valid.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-try-static-init-await-binding-valid.src.js new file mode 100644 index 00000000..fcb22fe6 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-try-static-init-await-binding-valid.src.js @@ -0,0 +1,6 @@ + +class C { + static { + (() => { try {} catch (await) {} }); + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-ary-ptrn-elem-id-static-init-await-invalid.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-ary-ptrn-elem-id-static-init-await-invalid.result.js new file mode 100644 index 00000000..379e4c1d --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-ary-ptrn-elem-id-static-init-await-invalid.result.js @@ -0,0 +1,6 @@ +export default { + "index": 31, + "lineNumber": 4, + "column": 10, + "message": "Cannot use await in class static initialization block" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-ary-ptrn-elem-id-static-init-await-invalid.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-ary-ptrn-elem-id-static-init-await-invalid.src.js new file mode 100644 index 00000000..e88b6662 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-ary-ptrn-elem-id-static-init-await-invalid.src.js @@ -0,0 +1,6 @@ + +class C { + static { + var [await] = []; + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-ary-ptrn-elem-id-static-init-await-valid.module-result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-ary-ptrn-elem-id-static-init-await-valid.module-result.js new file mode 100644 index 00000000..0bce94a3 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-ary-ptrn-elem-id-static-init-await-valid.module-result.js @@ -0,0 +1,6 @@ +export default { + "index": 40, + "lineNumber": 4, + "column": 19, + "message": "Cannot use keyword 'await' outside an async function" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-ary-ptrn-elem-id-static-init-await-valid.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-ary-ptrn-elem-id-static-init-await-valid.result.js new file mode 100644 index 00000000..e8b3ed7c --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-ary-ptrn-elem-id-static-init-await-valid.result.js @@ -0,0 +1,660 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 1, + 62 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 1, + 62 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 7, + 8 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 9, + 62 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 13, + 60 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 34 + } + }, + "range": [ + 26, + 56 + ], + "expression": { + "type": "ArrowFunctionExpression", + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 32 + } + }, + "range": [ + 27, + 54 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 4, + "column": 11 + }, + "end": { + "line": 4, + "column": 32 + } + }, + "range": [ + 33, + 54 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 30 + } + }, + "range": [ + 35, + 52 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 17 + }, + "end": { + "line": 4, + "column": 29 + } + }, + "range": [ + 39, + 51 + ], + "id": { + "type": "ArrayPattern", + "loc": { + "start": { + "line": 4, + "column": 17 + }, + "end": { + "line": 4, + "column": 24 + } + }, + "range": [ + 39, + 46 + ], + "elements": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 18 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 40, + 45 + ], + "name": "await" + } + ] + }, + "init": { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 4, + "column": 27 + }, + "end": { + "line": 4, + "column": 29 + } + }, + "range": [ + 49, + 51 + ], + "elements": [] + } + } + ], + "kind": "var" + } + ] + } + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "range": [ + 1, + 6 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 7, + 8 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 9, + 10 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "range": [ + 13, + 19 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 20, + 21 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 26, + 27 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 6 + } + }, + "range": [ + 27, + 28 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 28, + 29 + ] + }, + { + "type": "Punctuator", + "value": "=>", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 30, + 32 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 11 + }, + "end": { + "line": 4, + "column": 12 + } + }, + "range": [ + 33, + 34 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 16 + } + }, + "range": [ + 35, + 38 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 4, + "column": 17 + }, + "end": { + "line": 4, + "column": 18 + } + }, + "range": [ + 39, + 40 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 4, + "column": 18 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 40, + 45 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 4, + "column": 23 + }, + "end": { + "line": 4, + "column": 24 + } + }, + "range": [ + 45, + 46 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 4, + "column": 25 + }, + "end": { + "line": 4, + "column": 26 + } + }, + "range": [ + 47, + 48 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 4, + "column": 27 + }, + "end": { + "line": 4, + "column": 28 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 4, + "column": 28 + }, + "end": { + "line": 4, + "column": 29 + } + }, + "range": [ + 50, + 51 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 29 + }, + "end": { + "line": 4, + "column": 30 + } + }, + "range": [ + 51, + 52 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 4, + "column": 31 + }, + "end": { + "line": 4, + "column": 32 + } + }, + "range": [ + 53, + 54 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 32 + }, + "end": { + "line": 4, + "column": 33 + } + }, + "range": [ + 54, + 55 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 33 + }, + "end": { + "line": 4, + "column": 34 + } + }, + "range": [ + 55, + 56 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 59, + 60 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 61, + 62 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-ary-ptrn-elem-id-static-init-await-valid.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-ary-ptrn-elem-id-static-init-await-valid.src.js new file mode 100644 index 00000000..eb161d70 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-ary-ptrn-elem-id-static-init-await-valid.src.js @@ -0,0 +1,6 @@ + +class C { + static { + (() => { var [await] = []; }); + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-obj-ptrn-elem-id-static-init-await-invalid.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-obj-ptrn-elem-id-static-init-await-invalid.result.js new file mode 100644 index 00000000..379e4c1d --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-obj-ptrn-elem-id-static-init-await-invalid.result.js @@ -0,0 +1,6 @@ +export default { + "index": 31, + "lineNumber": 4, + "column": 10, + "message": "Cannot use await in class static initialization block" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-obj-ptrn-elem-id-static-init-await-invalid.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-obj-ptrn-elem-id-static-init-await-invalid.src.js new file mode 100644 index 00000000..4bf60d42 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-obj-ptrn-elem-id-static-init-await-invalid.src.js @@ -0,0 +1,6 @@ + +class C { + static { + var {await} = {}; + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-obj-ptrn-elem-id-static-init-await-valid.module-result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-obj-ptrn-elem-id-static-init-await-valid.module-result.js new file mode 100644 index 00000000..0bce94a3 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-obj-ptrn-elem-id-static-init-await-valid.module-result.js @@ -0,0 +1,6 @@ +export default { + "index": 40, + "lineNumber": 4, + "column": 19, + "message": "Cannot use keyword 'await' outside an async function" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-obj-ptrn-elem-id-static-init-await-valid.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-obj-ptrn-elem-id-static-init-await-valid.result.js new file mode 100644 index 00000000..82808ea7 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-obj-ptrn-elem-id-static-init-await-valid.result.js @@ -0,0 +1,699 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 1, + 62 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 1, + 62 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 7, + 8 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 9, + 62 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 13, + 60 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 34 + } + }, + "range": [ + 26, + 56 + ], + "expression": { + "type": "ArrowFunctionExpression", + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 32 + } + }, + "range": [ + 27, + 54 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 4, + "column": 11 + }, + "end": { + "line": 4, + "column": 32 + } + }, + "range": [ + 33, + 54 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 30 + } + }, + "range": [ + 35, + 52 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 17 + }, + "end": { + "line": 4, + "column": 29 + } + }, + "range": [ + 39, + 51 + ], + "id": { + "type": "ObjectPattern", + "loc": { + "start": { + "line": 4, + "column": 17 + }, + "end": { + "line": 4, + "column": 24 + } + }, + "range": [ + 39, + 46 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 4, + "column": 18 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 40, + 45 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 18 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 40, + 45 + ], + "name": "await" + }, + "kind": "init", + "value": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 18 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 40, + 45 + ], + "name": "await" + } + } + ] + }, + "init": { + "type": "ObjectExpression", + "loc": { + "start": { + "line": 4, + "column": 27 + }, + "end": { + "line": 4, + "column": 29 + } + }, + "range": [ + 49, + 51 + ], + "properties": [] + } + } + ], + "kind": "var" + } + ] + } + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "range": [ + 1, + 6 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 7, + 8 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 9, + 10 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "range": [ + 13, + 19 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 20, + 21 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 26, + 27 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 6 + } + }, + "range": [ + 27, + 28 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 28, + 29 + ] + }, + { + "type": "Punctuator", + "value": "=>", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 30, + 32 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 11 + }, + "end": { + "line": 4, + "column": 12 + } + }, + "range": [ + 33, + 34 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 16 + } + }, + "range": [ + 35, + 38 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 17 + }, + "end": { + "line": 4, + "column": 18 + } + }, + "range": [ + 39, + 40 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 4, + "column": 18 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 40, + 45 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 4, + "column": 23 + }, + "end": { + "line": 4, + "column": 24 + } + }, + "range": [ + 45, + 46 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 4, + "column": 25 + }, + "end": { + "line": 4, + "column": 26 + } + }, + "range": [ + 47, + 48 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 27 + }, + "end": { + "line": 4, + "column": 28 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 4, + "column": 28 + }, + "end": { + "line": 4, + "column": 29 + } + }, + "range": [ + 50, + 51 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 29 + }, + "end": { + "line": 4, + "column": 30 + } + }, + "range": [ + 51, + 52 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 4, + "column": 31 + }, + "end": { + "line": 4, + "column": 32 + } + }, + "range": [ + 53, + 54 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 32 + }, + "end": { + "line": 4, + "column": 33 + } + }, + "range": [ + 54, + 55 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 33 + }, + "end": { + "line": 4, + "column": 34 + } + }, + "range": [ + 55, + 56 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 59, + 60 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 61, + 62 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-obj-ptrn-elem-id-static-init-await-valid.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-obj-ptrn-elem-id-static-init-await-valid.src.js new file mode 100644 index 00000000..caeae90f --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-obj-ptrn-elem-id-static-init-await-valid.src.js @@ -0,0 +1,6 @@ + +class C { + static { + (() => { var {await} = {}; }); + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-static-init-await-binding-invalid.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-static-init-await-binding-invalid.result.js new file mode 100644 index 00000000..ebb02bbd --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-static-init-await-binding-invalid.result.js @@ -0,0 +1,6 @@ +export default { + "index": 30, + "lineNumber": 4, + "column": 9, + "message": "Cannot use await in class static initialization block" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-static-init-await-binding-invalid.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-static-init-await-binding-invalid.src.js new file mode 100644 index 00000000..920ac3c0 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-static-init-await-binding-invalid.src.js @@ -0,0 +1,6 @@ + +class C { + static { + var await; + } +} diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-static-init-await-binding-valid.module-result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-static-init-await-binding-valid.module-result.js new file mode 100644 index 00000000..6d51c475 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-static-init-await-binding-valid.module-result.js @@ -0,0 +1,6 @@ +export default { + "index": 39, + "lineNumber": 4, + "column": 18, + "message": "Cannot use keyword 'await' outside an async function" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-static-init-await-binding-valid.result.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-static-init-await-binding-valid.result.js new file mode 100644 index 00000000..8e20fab9 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-static-init-await-binding-valid.result.js @@ -0,0 +1,534 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 1, + 55 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 1, + 55 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 7, + 8 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 9, + 55 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 13, + 53 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 27 + } + }, + "range": [ + 26, + 49 + ], + "expression": { + "type": "ArrowFunctionExpression", + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 25 + } + }, + "range": [ + 27, + 47 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 4, + "column": 11 + }, + "end": { + "line": 4, + "column": 25 + } + }, + "range": [ + 33, + 47 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 35, + 45 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 17 + }, + "end": { + "line": 4, + "column": 22 + } + }, + "range": [ + 39, + 44 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 17 + }, + "end": { + "line": 4, + "column": 22 + } + }, + "range": [ + 39, + 44 + ], + "name": "await" + }, + "init": null + } + ], + "kind": "var" + } + ] + } + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "range": [ + 1, + 6 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 7, + 8 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 9, + 10 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "range": [ + 13, + 19 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 20, + 21 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 26, + 27 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 6 + } + }, + "range": [ + 27, + 28 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 28, + 29 + ] + }, + { + "type": "Punctuator", + "value": "=>", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 30, + 32 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 11 + }, + "end": { + "line": 4, + "column": 12 + } + }, + "range": [ + 33, + 34 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 16 + } + }, + "range": [ + 35, + 38 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 4, + "column": 17 + }, + "end": { + "line": 4, + "column": 22 + } + }, + "range": [ + 39, + 44 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 22 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 44, + 45 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 4, + "column": 24 + }, + "end": { + "line": 4, + "column": 25 + } + }, + "range": [ + 46, + 47 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 25 + }, + "end": { + "line": 4, + "column": 26 + } + }, + "range": [ + 47, + 48 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 26 + }, + "end": { + "line": 4, + "column": 27 + } + }, + "range": [ + 48, + 49 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 52, + 53 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 54, + 55 + ] + } + ] +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-static-init-await-binding-valid.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-static-init-await-binding-valid.src.js new file mode 100644 index 00000000..9aaa5752 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-static-init-await-binding-valid.src.js @@ -0,0 +1,6 @@ + +class C { + static { + (() => { var await; }); + } +}