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..b4bd4d1e --- /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": 26, + "lineNumber": 3, + "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..12400de0 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-arrow-function-static-init-await-binding.src.js @@ -0,0 +1,5 @@ +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..8b8b21f9 --- /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": 31, + "lineNumber": 3, + "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..5bcb413a --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-arrow-function-static-init-await-reference.src.js @@ -0,0 +1,5 @@ +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..58e121e3 --- /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": 32, + "lineNumber": 3, + "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..31b49f5c --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-class-static-init-await-binding.src.js @@ -0,0 +1,5 @@ +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..551e78ba --- /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": 6, + "lineNumber": 3, + "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..e7b0a795 --- /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": 3, + "column": 0 + }, + "end": { + "line": 17, + "column": 43 + } + }, + "range": [ + 2, + 266 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "range": [ + 2, + 16 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 6, + 15 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 6, + 11 + ], + "name": "await" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 14, + 15 + ], + "value": 0, + "raw": "0" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 24 + } + }, + "range": [ + 17, + 41 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 21, + 30 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 21, + 30 + ], + "name": "fromParam" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 32, + 40 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 32, + 40 + ], + "name": "fromBody" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 14, + "column": 1 + } + }, + "range": [ + 43, + 171 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 49, + 50 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 14, + "column": 1 + } + }, + "range": [ + 51, + 171 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 13, + "column": 3 + } + }, + "range": [ + 55, + 169 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "range": [ + 68, + 165 + ], + "expression": { + "type": "NewExpression", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 12, + "column": 6 + } + }, + "range": [ + 68, + 164 + ], + "callee": { + "type": "ClassExpression", + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 12, + "column": 5 + } + }, + "range": [ + 73, + 163 + ], + "id": null, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 8, + "column": 15 + }, + "end": { + "line": 12, + "column": 5 + } + }, + "range": [ + 79, + 163 + ], + "body": [ + { + "type": "MethodDefinition", + "loc": { + "start": { + "line": 9, + "column": 6 + }, + "end": { + "line": 11, + "column": 7 + } + }, + "range": [ + 87, + 157 + ], + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 6 + }, + "end": { + "line": 9, + "column": 17 + } + }, + "range": [ + 87, + 98 + ], + "name": "constructor" + }, + "kind": "constructor", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 9, + "column": 17 + }, + "end": { + "line": 11, + "column": 7 + } + }, + "range": [ + 98, + 157 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 39 + } + }, + "range": [ + 99, + 120 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 19 + } + }, + "range": [ + 99, + 100 + ], + "name": "x" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 9, + "column": 22 + }, + "end": { + "line": 9, + "column": 39 + } + }, + "range": [ + 103, + 120 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 22 + }, + "end": { + "line": 9, + "column": 31 + } + }, + "range": [ + 103, + 112 + ], + "name": "fromParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 34 + }, + "end": { + "line": 9, + "column": 39 + } + }, + "range": [ + 115, + 120 + ], + "name": "await" + } + } + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 9, + "column": 41 + }, + "end": { + "line": 11, + "column": 7 + } + }, + "range": [ + 122, + 157 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 10, + "column": 8 + }, + "end": { + "line": 10, + "column": 25 + } + }, + "range": [ + 132, + 149 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 10, + "column": 8 + }, + "end": { + "line": 10, + "column": 24 + } + }, + "range": [ + 132, + 148 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 8 + }, + "end": { + "line": 10, + "column": 16 + } + }, + "range": [ + 132, + 140 + ], + "name": "fromBody" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 24 + } + }, + "range": [ + 143, + 148 + ], + "name": "await" + } + } + } + ] + } + } + } + ] + } + }, + "arguments": [] + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 49 + } + }, + "range": [ + 173, + 222 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 48 + } + }, + "range": [ + 173, + 221 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 173, + 189 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 6 + } + }, + "range": [ + 173, + 179 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 7 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 180, + 189 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 17 + }, + "end": { + "line": 16, + "column": 26 + } + }, + "range": [ + 190, + 199 + ], + "name": "fromParam" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 16, + "column": 28 + }, + "end": { + "line": 16, + "column": 29 + } + }, + "range": [ + 201, + 202 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 16, + "column": 31 + }, + "end": { + "line": 16, + "column": 47 + } + }, + "range": [ + 204, + 220 + ], + "value": "from parameter", + "raw": "'from parameter'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 43 + } + }, + "range": [ + 223, + 266 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 42 + } + }, + "range": [ + 223, + 265 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 223, + 239 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 6 + } + }, + "range": [ + 223, + 229 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 7 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 230, + 239 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 17 + }, + "end": { + "line": 17, + "column": 25 + } + }, + "range": [ + 240, + 248 + ], + "name": "fromBody" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 17, + "column": 27 + }, + "end": { + "line": 17, + "column": 28 + } + }, + "range": [ + 250, + 251 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 17, + "column": 30 + }, + "end": { + "line": 17, + "column": 41 + } + }, + "range": [ + 253, + 264 + ], + "value": "from body", + "raw": "'from body'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "range": [ + 2, + 5 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 6, + 11 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "range": [ + 12, + 13 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 14, + 15 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "range": [ + 15, + 16 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 17, + 20 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 21, + 30 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 14 + } + }, + "range": [ + 30, + 31 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 32, + 40 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 23 + }, + "end": { + "line": 4, + "column": 24 + } + }, + "range": [ + 40, + 41 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 43, + 48 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 9 + } + }, + "range": [ + 51, + 52 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 8 + } + }, + "range": [ + 55, + 61 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 10 + } + }, + "range": [ + 62, + 63 + ] + }, + { + "type": "Keyword", + "value": "new", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 7 + } + }, + "range": [ + 68, + 71 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 9 + } + }, + "range": [ + 72, + 73 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 8, + "column": 14 + } + }, + "range": [ + 73, + 78 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 8, + "column": 15 + }, + "end": { + "line": 8, + "column": 16 + } + }, + "range": [ + 79, + 80 + ] + }, + { + "type": "Identifier", + "value": "constructor", + "loc": { + "start": { + "line": 9, + "column": 6 + }, + "end": { + "line": 9, + "column": 17 + } + }, + "range": [ + 87, + 98 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 9, + "column": 17 + }, + "end": { + "line": 9, + "column": 18 + } + }, + "range": [ + 98, + 99 + ] + }, + { + "type": "Identifier", + "value": "x", + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 19 + } + }, + "range": [ + 99, + 100 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 9, + "column": 20 + }, + "end": { + "line": 9, + "column": 21 + } + }, + "range": [ + 101, + 102 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 9, + "column": 22 + }, + "end": { + "line": 9, + "column": 31 + } + }, + "range": [ + 103, + 112 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 9, + "column": 32 + }, + "end": { + "line": 9, + "column": 33 + } + }, + "range": [ + 113, + 114 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 9, + "column": 34 + }, + "end": { + "line": 9, + "column": 39 + } + }, + "range": [ + 115, + 120 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 9, + "column": 39 + }, + "end": { + "line": 9, + "column": 40 + } + }, + "range": [ + 120, + 121 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 9, + "column": 41 + }, + "end": { + "line": 9, + "column": 42 + } + }, + "range": [ + 122, + 123 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 10, + "column": 8 + }, + "end": { + "line": 10, + "column": 16 + } + }, + "range": [ + 132, + 140 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 10, + "column": 17 + }, + "end": { + "line": 10, + "column": 18 + } + }, + "range": [ + 141, + 142 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 24 + } + }, + "range": [ + 143, + 148 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 10, + "column": 24 + }, + "end": { + "line": 10, + "column": 25 + } + }, + "range": [ + 148, + 149 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 7 + } + }, + "range": [ + 156, + 157 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 12, + "column": 4 + }, + "end": { + "line": 12, + "column": 5 + } + }, + "range": [ + 162, + 163 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 12, + "column": 5 + }, + "end": { + "line": 12, + "column": 6 + } + }, + "range": [ + 163, + 164 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 12, + "column": 6 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "range": [ + 164, + 165 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 13, + "column": 2 + }, + "end": { + "line": 13, + "column": 3 + } + }, + "range": [ + 168, + 169 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 1 + } + }, + "range": [ + 170, + 171 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 6 + } + }, + "range": [ + 173, + 179 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 16, + "column": 6 + }, + "end": { + "line": 16, + "column": 7 + } + }, + "range": [ + 179, + 180 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 16, + "column": 7 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 180, + 189 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 16, + "column": 16 + }, + "end": { + "line": 16, + "column": 17 + } + }, + "range": [ + 189, + 190 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 16, + "column": 17 + }, + "end": { + "line": 16, + "column": 26 + } + }, + "range": [ + 190, + 199 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 16, + "column": 26 + }, + "end": { + "line": 16, + "column": 27 + } + }, + "range": [ + 199, + 200 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 16, + "column": 28 + }, + "end": { + "line": 16, + "column": 29 + } + }, + "range": [ + 201, + 202 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 16, + "column": 29 + }, + "end": { + "line": 16, + "column": 30 + } + }, + "range": [ + 202, + 203 + ] + }, + { + "type": "String", + "value": "'from parameter'", + "loc": { + "start": { + "line": 16, + "column": 31 + }, + "end": { + "line": 16, + "column": 47 + } + }, + "range": [ + 204, + 220 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 16, + "column": 47 + }, + "end": { + "line": 16, + "column": 48 + } + }, + "range": [ + 220, + 221 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 16, + "column": 48 + }, + "end": { + "line": 16, + "column": 49 + } + }, + "range": [ + 221, + 222 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 6 + } + }, + "range": [ + 223, + 229 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 17, + "column": 6 + }, + "end": { + "line": 17, + "column": 7 + } + }, + "range": [ + 229, + 230 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 17, + "column": 7 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 230, + 239 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 17, + "column": 16 + }, + "end": { + "line": 17, + "column": 17 + } + }, + "range": [ + 239, + 240 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 17, + "column": 17 + }, + "end": { + "line": 17, + "column": 25 + } + }, + "range": [ + 240, + 248 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 17, + "column": 25 + }, + "end": { + "line": 17, + "column": 26 + } + }, + "range": [ + 248, + 249 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 17, + "column": 27 + }, + "end": { + "line": 17, + "column": 28 + } + }, + "range": [ + 250, + 251 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 17, + "column": 28 + }, + "end": { + "line": 17, + "column": 29 + } + }, + "range": [ + 251, + 252 + ] + }, + { + "type": "String", + "value": "'from body'", + "loc": { + "start": { + "line": 17, + "column": 30 + }, + "end": { + "line": 17, + "column": 41 + } + }, + "range": [ + 253, + 264 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 17, + "column": 41 + }, + "end": { + "line": 17, + "column": 42 + } + }, + "range": [ + 264, + 265 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 17, + "column": 42 + }, + "end": { + "line": 17, + "column": 43 + } + }, + "range": [ + 265, + 266 + ] + } + ] +}; \ 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..dabbe87c --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-class-static-init-await-reference.src.js @@ -0,0 +1,17 @@ + + +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..a84c821a --- /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": 37, + "lineNumber": 5, + "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..e82c7fd0 --- /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": 3, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 2, + 60 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 2, + 60 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 8, + 9 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 10, + 60 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 14, + 58 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 31 + } + }, + "range": [ + 27, + 54 + ], + "expression": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 29 + } + }, + "range": [ + 28, + 52 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 14 + }, + "end": { + "line": 5, + "column": 19 + } + }, + "range": [ + 37, + 42 + ], + "name": "await" + }, + "expression": false, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 20 + }, + "end": { + "line": 5, + "column": 25 + } + }, + "range": [ + 43, + 48 + ], + "name": "await" + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 5, + "column": 27 + }, + "end": { + "line": 5, + "column": 29 + } + }, + "range": [ + 50, + 52 + ], + "body": [] + } + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "range": [ + 2, + 7 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 8, + 9 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 10, + 11 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 8 + } + }, + "range": [ + 14, + 20 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 21, + 22 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "range": [ + 27, + 28 + ] + }, + { + "type": "Keyword", + "value": "function", + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "range": [ + 28, + 36 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 5, + "column": 14 + }, + "end": { + "line": 5, + "column": 19 + } + }, + "range": [ + 37, + 42 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 19 + }, + "end": { + "line": 5, + "column": 20 + } + }, + "range": [ + 42, + 43 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 5, + "column": 20 + }, + "end": { + "line": 5, + "column": 25 + } + }, + "range": [ + 43, + 48 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 25 + }, + "end": { + "line": 5, + "column": 26 + } + }, + "range": [ + 48, + 49 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 27 + }, + "end": { + "line": 5, + "column": 28 + } + }, + "range": [ + 50, + 51 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 28 + }, + "end": { + "line": 5, + "column": 29 + } + }, + "range": [ + 51, + 52 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 29 + }, + "end": { + "line": 5, + "column": 30 + } + }, + "range": [ + 52, + 53 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 30 + }, + "end": { + "line": 5, + "column": 31 + } + }, + "range": [ + 53, + 54 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 57, + 58 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 59, + 60 + ] + } + ] +}; \ 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..a863e05f --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-function-static-init-await-binding.src.js @@ -0,0 +1,7 @@ + + +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..551e78ba --- /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": 6, + "lineNumber": 3, + "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..c63cafca --- /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": 3, + "column": 0 + }, + "end": { + "line": 15, + "column": 43 + } + }, + "range": [ + 2, + 238 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "range": [ + 2, + 16 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 6, + 15 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 6, + 11 + ], + "name": "await" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 14, + 15 + ], + "value": 0, + "raw": "0" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 24 + } + }, + "range": [ + 17, + 41 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 21, + 30 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 21, + 30 + ], + "name": "fromParam" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 32, + 40 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 32, + 40 + ], + "name": "fromBody" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 12, + "column": 1 + } + }, + "range": [ + 43, + 143 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 49, + 50 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 12, + "column": 1 + } + }, + "range": [ + 51, + 143 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 11, + "column": 3 + } + }, + "range": [ + 55, + 141 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 10, + "column": 9 + } + }, + "range": [ + 68, + 137 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 10, + "column": 8 + } + }, + "range": [ + 68, + 136 + ], + "callee": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 8, + "column": 5 + }, + "end": { + "line": 10, + "column": 5 + } + }, + "range": [ + 69, + 133 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 8, + "column": 15 + }, + "end": { + "line": 8, + "column": 36 + } + }, + "range": [ + 79, + 100 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 15 + }, + "end": { + "line": 8, + "column": 16 + } + }, + "range": [ + 79, + 80 + ], + "name": "x" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 8, + "column": 19 + }, + "end": { + "line": 8, + "column": 36 + } + }, + "range": [ + 83, + 100 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 19 + }, + "end": { + "line": 8, + "column": 28 + } + }, + "range": [ + 83, + 92 + ], + "name": "fromParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 31 + }, + "end": { + "line": 8, + "column": 36 + } + }, + "range": [ + 95, + 100 + ], + "name": "await" + } + } + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 8, + "column": 38 + }, + "end": { + "line": 10, + "column": 5 + } + }, + "range": [ + 102, + 133 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 9, + "column": 6 + }, + "end": { + "line": 9, + "column": 23 + } + }, + "range": [ + 110, + 127 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 9, + "column": 6 + }, + "end": { + "line": 9, + "column": 22 + } + }, + "range": [ + 110, + 126 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 6 + }, + "end": { + "line": 9, + "column": 14 + } + }, + "range": [ + 110, + 118 + ], + "name": "fromBody" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 17 + }, + "end": { + "line": 9, + "column": 22 + } + }, + "range": [ + 121, + 126 + ], + "name": "await" + } + } + } + ] + } + }, + "arguments": [], + "optional": false + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 49 + } + }, + "range": [ + 145, + 194 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 48 + } + }, + "range": [ + 145, + 193 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 16 + } + }, + "range": [ + 145, + 161 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 6 + } + }, + "range": [ + 145, + 151 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 7 + }, + "end": { + "line": 14, + "column": 16 + } + }, + "range": [ + 152, + 161 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 17 + }, + "end": { + "line": 14, + "column": 26 + } + }, + "range": [ + 162, + 171 + ], + "name": "fromParam" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 14, + "column": 28 + }, + "end": { + "line": 14, + "column": 29 + } + }, + "range": [ + 173, + 174 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 14, + "column": 31 + }, + "end": { + "line": 14, + "column": 47 + } + }, + "range": [ + 176, + 192 + ], + "value": "from parameter", + "raw": "'from parameter'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 43 + } + }, + "range": [ + 195, + 238 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 42 + } + }, + "range": [ + 195, + 237 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 16 + } + }, + "range": [ + 195, + 211 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 6 + } + }, + "range": [ + 195, + 201 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 7 + }, + "end": { + "line": 15, + "column": 16 + } + }, + "range": [ + 202, + 211 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 17 + }, + "end": { + "line": 15, + "column": 25 + } + }, + "range": [ + 212, + 220 + ], + "name": "fromBody" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 15, + "column": 27 + }, + "end": { + "line": 15, + "column": 28 + } + }, + "range": [ + 222, + 223 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 15, + "column": 30 + }, + "end": { + "line": 15, + "column": 41 + } + }, + "range": [ + 225, + 236 + ], + "value": "from body", + "raw": "'from body'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "range": [ + 2, + 5 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 6, + 11 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "range": [ + 12, + 13 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 14, + 15 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "range": [ + 15, + 16 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 17, + 20 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 21, + 30 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 14 + } + }, + "range": [ + 30, + 31 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 32, + 40 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 23 + }, + "end": { + "line": 4, + "column": 24 + } + }, + "range": [ + 40, + 41 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 43, + 48 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 9 + } + }, + "range": [ + 51, + 52 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 8 + } + }, + "range": [ + 55, + 61 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 10 + } + }, + "range": [ + 62, + 63 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 5 + } + }, + "range": [ + 68, + 69 + ] + }, + { + "type": "Keyword", + "value": "function", + "loc": { + "start": { + "line": 8, + "column": 5 + }, + "end": { + "line": 8, + "column": 13 + } + }, + "range": [ + 69, + 77 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 8, + "column": 14 + }, + "end": { + "line": 8, + "column": 15 + } + }, + "range": [ + 78, + 79 + ] + }, + { + "type": "Identifier", + "value": "x", + "loc": { + "start": { + "line": 8, + "column": 15 + }, + "end": { + "line": 8, + "column": 16 + } + }, + "range": [ + 79, + 80 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 8, + "column": 17 + }, + "end": { + "line": 8, + "column": 18 + } + }, + "range": [ + 81, + 82 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 8, + "column": 19 + }, + "end": { + "line": 8, + "column": 28 + } + }, + "range": [ + 83, + 92 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 8, + "column": 29 + }, + "end": { + "line": 8, + "column": 30 + } + }, + "range": [ + 93, + 94 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 8, + "column": 31 + }, + "end": { + "line": 8, + "column": 36 + } + }, + "range": [ + 95, + 100 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 8, + "column": 36 + }, + "end": { + "line": 8, + "column": 37 + } + }, + "range": [ + 100, + 101 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 8, + "column": 38 + }, + "end": { + "line": 8, + "column": 39 + } + }, + "range": [ + 102, + 103 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 9, + "column": 6 + }, + "end": { + "line": 9, + "column": 14 + } + }, + "range": [ + 110, + 118 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 9, + "column": 15 + }, + "end": { + "line": 9, + "column": 16 + } + }, + "range": [ + 119, + 120 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 9, + "column": 17 + }, + "end": { + "line": 9, + "column": 22 + } + }, + "range": [ + 121, + 126 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 9, + "column": 22 + }, + "end": { + "line": 9, + "column": 23 + } + }, + "range": [ + 126, + 127 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 5 + } + }, + "range": [ + 132, + 133 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 10, + "column": 5 + }, + "end": { + "line": 10, + "column": 6 + } + }, + "range": [ + 133, + 134 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 7 + } + }, + "range": [ + 134, + 135 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 10, + "column": 7 + }, + "end": { + "line": 10, + "column": 8 + } + }, + "range": [ + 135, + 136 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 10, + "column": 8 + }, + "end": { + "line": 10, + "column": 9 + } + }, + "range": [ + 136, + 137 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 3 + } + }, + "range": [ + 140, + 141 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 1 + } + }, + "range": [ + 142, + 143 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 6 + } + }, + "range": [ + 145, + 151 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 7 + } + }, + "range": [ + 151, + 152 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 14, + "column": 7 + }, + "end": { + "line": 14, + "column": 16 + } + }, + "range": [ + 152, + 161 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 14, + "column": 16 + }, + "end": { + "line": 14, + "column": 17 + } + }, + "range": [ + 161, + 162 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 14, + "column": 17 + }, + "end": { + "line": 14, + "column": 26 + } + }, + "range": [ + 162, + 171 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 14, + "column": 26 + }, + "end": { + "line": 14, + "column": 27 + } + }, + "range": [ + 171, + 172 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 14, + "column": 28 + }, + "end": { + "line": 14, + "column": 29 + } + }, + "range": [ + 173, + 174 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 14, + "column": 29 + }, + "end": { + "line": 14, + "column": 30 + } + }, + "range": [ + 174, + 175 + ] + }, + { + "type": "String", + "value": "'from parameter'", + "loc": { + "start": { + "line": 14, + "column": 31 + }, + "end": { + "line": 14, + "column": 47 + } + }, + "range": [ + 176, + 192 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 14, + "column": 47 + }, + "end": { + "line": 14, + "column": 48 + } + }, + "range": [ + 192, + 193 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 14, + "column": 48 + }, + "end": { + "line": 14, + "column": 49 + } + }, + "range": [ + 193, + 194 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 6 + } + }, + "range": [ + 195, + 201 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 15, + "column": 7 + } + }, + "range": [ + 201, + 202 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 15, + "column": 7 + }, + "end": { + "line": 15, + "column": 16 + } + }, + "range": [ + 202, + 211 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 15, + "column": 16 + }, + "end": { + "line": 15, + "column": 17 + } + }, + "range": [ + 211, + 212 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 15, + "column": 17 + }, + "end": { + "line": 15, + "column": 25 + } + }, + "range": [ + 212, + 220 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 15, + "column": 25 + }, + "end": { + "line": 15, + "column": 26 + } + }, + "range": [ + 220, + 221 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 15, + "column": 27 + }, + "end": { + "line": 15, + "column": 28 + } + }, + "range": [ + 222, + 223 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 15, + "column": 28 + }, + "end": { + "line": 15, + "column": 29 + } + }, + "range": [ + 223, + 224 + ] + }, + { + "type": "String", + "value": "'from body'", + "loc": { + "start": { + "line": 15, + "column": 30 + }, + "end": { + "line": 15, + "column": 41 + } + }, + "range": [ + 225, + 236 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 15, + "column": 41 + }, + "end": { + "line": 15, + "column": 42 + } + }, + "range": [ + 236, + 237 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 15, + "column": 42 + }, + "end": { + "line": 15, + "column": 43 + } + }, + "range": [ + 237, + 238 + ] + } + ] +}; \ 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..ab6647d8 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-function-static-init-await-reference.src.js @@ -0,0 +1,15 @@ + + +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..2bf371d2 --- /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": 39, + "lineNumber": 5, + "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..57def129 --- /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": 3, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 2, + 63 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 2, + 63 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 8, + 9 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 10, + 63 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 14, + 61 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 34 + } + }, + "range": [ + 27, + 57 + ], + "expression": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 32 + } + }, + "range": [ + 28, + 55 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 16 + }, + "end": { + "line": 5, + "column": 21 + } + }, + "range": [ + 39, + 44 + ], + "name": "await" + }, + "expression": false, + "generator": true, + "async": false, + "params": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 23 + }, + "end": { + "line": 5, + "column": 28 + } + }, + "range": [ + 46, + 51 + ], + "name": "await" + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 5, + "column": 30 + }, + "end": { + "line": 5, + "column": 32 + } + }, + "range": [ + 53, + 55 + ], + "body": [] + } + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "range": [ + 2, + 7 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 8, + 9 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 10, + 11 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 8 + } + }, + "range": [ + 14, + 20 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 21, + 22 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "range": [ + 27, + 28 + ] + }, + { + "type": "Keyword", + "value": "function", + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "range": [ + 28, + 36 + ] + }, + { + "type": "Punctuator", + "value": "*", + "loc": { + "start": { + "line": 5, + "column": 14 + }, + "end": { + "line": 5, + "column": 15 + } + }, + "range": [ + 37, + 38 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 5, + "column": 16 + }, + "end": { + "line": 5, + "column": 21 + } + }, + "range": [ + 39, + 44 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 22 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 45, + 46 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 5, + "column": 23 + }, + "end": { + "line": 5, + "column": 28 + } + }, + "range": [ + 46, + 51 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 28 + }, + "end": { + "line": 5, + "column": 29 + } + }, + "range": [ + 51, + 52 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 30 + }, + "end": { + "line": 5, + "column": 31 + } + }, + "range": [ + 53, + 54 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 31 + }, + "end": { + "line": 5, + "column": 32 + } + }, + "range": [ + 54, + 55 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 32 + }, + "end": { + "line": 5, + "column": 33 + } + }, + "range": [ + 55, + 56 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 33 + }, + "end": { + "line": 5, + "column": 34 + } + }, + "range": [ + 56, + 57 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 60, + 61 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 62, + 63 + ] + } + ] +}; \ 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..7f163631 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-generators-static-init-await-binding.src.js @@ -0,0 +1,7 @@ + + +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..551e78ba --- /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": 6, + "lineNumber": 3, + "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..a4a34fb6 --- /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": 3, + "column": 0 + }, + "end": { + "line": 15, + "column": 43 + } + }, + "range": [ + 2, + 247 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "range": [ + 2, + 16 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 6, + 15 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 6, + 11 + ], + "name": "await" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 14, + 15 + ], + "value": 0, + "raw": "0" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 24 + } + }, + "range": [ + 17, + 41 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 21, + 30 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 21, + 30 + ], + "name": "fromParam" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 32, + 40 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 32, + 40 + ], + "name": "fromBody" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 12, + "column": 1 + } + }, + "range": [ + 43, + 152 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 49, + 50 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 12, + "column": 1 + } + }, + "range": [ + 51, + 152 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 11, + "column": 3 + } + }, + "range": [ + 55, + 150 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 10, + "column": 16 + } + }, + "range": [ + 68, + 146 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 10, + "column": 15 + } + }, + "range": [ + 68, + 145 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 10, + "column": 13 + } + }, + "range": [ + 68, + 143 + ], + "object": { + "type": "CallExpression", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 10, + "column": 8 + } + }, + "range": [ + 68, + 138 + ], + "callee": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 8, + "column": 5 + }, + "end": { + "line": 10, + "column": 5 + } + }, + "range": [ + 69, + 135 + ], + "id": null, + "expression": false, + "generator": true, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 8, + "column": 17 + }, + "end": { + "line": 8, + "column": 38 + } + }, + "range": [ + 81, + 102 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 17 + }, + "end": { + "line": 8, + "column": 18 + } + }, + "range": [ + 81, + 82 + ], + "name": "x" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 8, + "column": 21 + }, + "end": { + "line": 8, + "column": 38 + } + }, + "range": [ + 85, + 102 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 21 + }, + "end": { + "line": 8, + "column": 30 + } + }, + "range": [ + 85, + 94 + ], + "name": "fromParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 33 + }, + "end": { + "line": 8, + "column": 38 + } + }, + "range": [ + 97, + 102 + ], + "name": "await" + } + } + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 8, + "column": 40 + }, + "end": { + "line": 10, + "column": 5 + } + }, + "range": [ + 104, + 135 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 9, + "column": 6 + }, + "end": { + "line": 9, + "column": 23 + } + }, + "range": [ + 112, + 129 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 9, + "column": 6 + }, + "end": { + "line": 9, + "column": 22 + } + }, + "range": [ + 112, + 128 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 6 + }, + "end": { + "line": 9, + "column": 14 + } + }, + "range": [ + 112, + 120 + ], + "name": "fromBody" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 17 + }, + "end": { + "line": 9, + "column": 22 + } + }, + "range": [ + 123, + 128 + ], + "name": "await" + } + } + } + ] + } + }, + "arguments": [], + "optional": false + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 13 + } + }, + "range": [ + 139, + 143 + ], + "name": "next" + }, + "computed": false, + "optional": false + }, + "arguments": [], + "optional": false + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 49 + } + }, + "range": [ + 154, + 203 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 48 + } + }, + "range": [ + 154, + 202 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 16 + } + }, + "range": [ + 154, + 170 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 6 + } + }, + "range": [ + 154, + 160 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 7 + }, + "end": { + "line": 14, + "column": 16 + } + }, + "range": [ + 161, + 170 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 17 + }, + "end": { + "line": 14, + "column": 26 + } + }, + "range": [ + 171, + 180 + ], + "name": "fromParam" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 14, + "column": 28 + }, + "end": { + "line": 14, + "column": 29 + } + }, + "range": [ + 182, + 183 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 14, + "column": 31 + }, + "end": { + "line": 14, + "column": 47 + } + }, + "range": [ + 185, + 201 + ], + "value": "from parameter", + "raw": "'from parameter'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 43 + } + }, + "range": [ + 204, + 247 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 42 + } + }, + "range": [ + 204, + 246 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 16 + } + }, + "range": [ + 204, + 220 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 6 + } + }, + "range": [ + 204, + 210 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 7 + }, + "end": { + "line": 15, + "column": 16 + } + }, + "range": [ + 211, + 220 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 17 + }, + "end": { + "line": 15, + "column": 25 + } + }, + "range": [ + 221, + 229 + ], + "name": "fromBody" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 15, + "column": 27 + }, + "end": { + "line": 15, + "column": 28 + } + }, + "range": [ + 231, + 232 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 15, + "column": 30 + }, + "end": { + "line": 15, + "column": 41 + } + }, + "range": [ + 234, + 245 + ], + "value": "from body", + "raw": "'from body'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "range": [ + 2, + 5 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 6, + 11 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "range": [ + 12, + 13 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 14, + 15 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "range": [ + 15, + 16 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 17, + 20 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 21, + 30 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 14 + } + }, + "range": [ + 30, + 31 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 32, + 40 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 23 + }, + "end": { + "line": 4, + "column": 24 + } + }, + "range": [ + 40, + 41 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 43, + 48 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 9 + } + }, + "range": [ + 51, + 52 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 8 + } + }, + "range": [ + 55, + 61 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 10 + } + }, + "range": [ + 62, + 63 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 5 + } + }, + "range": [ + 68, + 69 + ] + }, + { + "type": "Keyword", + "value": "function", + "loc": { + "start": { + "line": 8, + "column": 5 + }, + "end": { + "line": 8, + "column": 13 + } + }, + "range": [ + 69, + 77 + ] + }, + { + "type": "Punctuator", + "value": "*", + "loc": { + "start": { + "line": 8, + "column": 14 + }, + "end": { + "line": 8, + "column": 15 + } + }, + "range": [ + 78, + 79 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 8, + "column": 16 + }, + "end": { + "line": 8, + "column": 17 + } + }, + "range": [ + 80, + 81 + ] + }, + { + "type": "Identifier", + "value": "x", + "loc": { + "start": { + "line": 8, + "column": 17 + }, + "end": { + "line": 8, + "column": 18 + } + }, + "range": [ + 81, + 82 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 8, + "column": 19 + }, + "end": { + "line": 8, + "column": 20 + } + }, + "range": [ + 83, + 84 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 8, + "column": 21 + }, + "end": { + "line": 8, + "column": 30 + } + }, + "range": [ + 85, + 94 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 8, + "column": 31 + }, + "end": { + "line": 8, + "column": 32 + } + }, + "range": [ + 95, + 96 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 8, + "column": 33 + }, + "end": { + "line": 8, + "column": 38 + } + }, + "range": [ + 97, + 102 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 8, + "column": 38 + }, + "end": { + "line": 8, + "column": 39 + } + }, + "range": [ + 102, + 103 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 8, + "column": 40 + }, + "end": { + "line": 8, + "column": 41 + } + }, + "range": [ + 104, + 105 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 9, + "column": 6 + }, + "end": { + "line": 9, + "column": 14 + } + }, + "range": [ + 112, + 120 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 9, + "column": 15 + }, + "end": { + "line": 9, + "column": 16 + } + }, + "range": [ + 121, + 122 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 9, + "column": 17 + }, + "end": { + "line": 9, + "column": 22 + } + }, + "range": [ + 123, + 128 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 9, + "column": 22 + }, + "end": { + "line": 9, + "column": 23 + } + }, + "range": [ + 128, + 129 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 5 + } + }, + "range": [ + 134, + 135 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 10, + "column": 5 + }, + "end": { + "line": 10, + "column": 6 + } + }, + "range": [ + 135, + 136 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 7 + } + }, + "range": [ + 136, + 137 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 10, + "column": 7 + }, + "end": { + "line": 10, + "column": 8 + } + }, + "range": [ + 137, + 138 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 10, + "column": 8 + }, + "end": { + "line": 10, + "column": 9 + } + }, + "range": [ + 138, + 139 + ] + }, + { + "type": "Identifier", + "value": "next", + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 13 + } + }, + "range": [ + 139, + 143 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 10, + "column": 13 + }, + "end": { + "line": 10, + "column": 14 + } + }, + "range": [ + 143, + 144 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 10, + "column": 14 + }, + "end": { + "line": 10, + "column": 15 + } + }, + "range": [ + 144, + 145 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 10, + "column": 15 + }, + "end": { + "line": 10, + "column": 16 + } + }, + "range": [ + 145, + 146 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 3 + } + }, + "range": [ + 149, + 150 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 1 + } + }, + "range": [ + 151, + 152 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 6 + } + }, + "range": [ + 154, + 160 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 7 + } + }, + "range": [ + 160, + 161 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 14, + "column": 7 + }, + "end": { + "line": 14, + "column": 16 + } + }, + "range": [ + 161, + 170 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 14, + "column": 16 + }, + "end": { + "line": 14, + "column": 17 + } + }, + "range": [ + 170, + 171 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 14, + "column": 17 + }, + "end": { + "line": 14, + "column": 26 + } + }, + "range": [ + 171, + 180 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 14, + "column": 26 + }, + "end": { + "line": 14, + "column": 27 + } + }, + "range": [ + 180, + 181 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 14, + "column": 28 + }, + "end": { + "line": 14, + "column": 29 + } + }, + "range": [ + 182, + 183 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 14, + "column": 29 + }, + "end": { + "line": 14, + "column": 30 + } + }, + "range": [ + 183, + 184 + ] + }, + { + "type": "String", + "value": "'from parameter'", + "loc": { + "start": { + "line": 14, + "column": 31 + }, + "end": { + "line": 14, + "column": 47 + } + }, + "range": [ + 185, + 201 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 14, + "column": 47 + }, + "end": { + "line": 14, + "column": 48 + } + }, + "range": [ + 201, + 202 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 14, + "column": 48 + }, + "end": { + "line": 14, + "column": 49 + } + }, + "range": [ + 202, + 203 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 6 + } + }, + "range": [ + 204, + 210 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 15, + "column": 7 + } + }, + "range": [ + 210, + 211 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 15, + "column": 7 + }, + "end": { + "line": 15, + "column": 16 + } + }, + "range": [ + 211, + 220 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 15, + "column": 16 + }, + "end": { + "line": 15, + "column": 17 + } + }, + "range": [ + 220, + 221 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 15, + "column": 17 + }, + "end": { + "line": 15, + "column": 25 + } + }, + "range": [ + 221, + 229 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 15, + "column": 25 + }, + "end": { + "line": 15, + "column": 26 + } + }, + "range": [ + 229, + 230 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 15, + "column": 27 + }, + "end": { + "line": 15, + "column": 28 + } + }, + "range": [ + 231, + 232 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 15, + "column": 28 + }, + "end": { + "line": 15, + "column": 29 + } + }, + "range": [ + 232, + 233 + ] + }, + { + "type": "String", + "value": "'from body'", + "loc": { + "start": { + "line": 15, + "column": 30 + }, + "end": { + "line": 15, + "column": 41 + } + }, + "range": [ + 234, + 245 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 15, + "column": 41 + }, + "end": { + "line": 15, + "column": 42 + } + }, + "range": [ + 245, + 246 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 15, + "column": 42 + }, + "end": { + "line": 15, + "column": 43 + } + }, + "range": [ + 246, + 247 + ] + } + ] +}; \ 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..feeb47ed --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-generators-static-init-await-reference.src.js @@ -0,0 +1,15 @@ + + +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..3078bc2d --- /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": 3, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 2, + 48 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 2, + 48 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 8, + 9 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 10, + 48 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 14, + 46 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 19 + } + }, + "range": [ + 27, + 42 + ], + "expression": { + "type": "ObjectExpression", + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 17 + } + }, + "range": [ + 28, + 40 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 5, + "column": 7 + }, + "end": { + "line": 5, + "column": 15 + } + }, + "range": [ + 30, + 38 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 7 + }, + "end": { + "line": 5, + "column": 12 + } + }, + "range": [ + 30, + 35 + ], + "name": "await" + }, + "value": { + "type": "Literal", + "loc": { + "start": { + "line": 5, + "column": 14 + }, + "end": { + "line": 5, + "column": 15 + } + }, + "range": [ + 37, + 38 + ], + "value": 0, + "raw": "0" + }, + "kind": "init" + } + ] + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "range": [ + 2, + 7 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 8, + 9 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 10, + 11 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 8 + } + }, + "range": [ + 14, + 20 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 21, + 22 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "range": [ + 27, + 28 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 6 + } + }, + "range": [ + 28, + 29 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 5, + "column": 7 + }, + "end": { + "line": 5, + "column": 12 + } + }, + "range": [ + 30, + 35 + ] + }, + { + "type": "Punctuator", + "value": ":", + "loc": { + "start": { + "line": 5, + "column": 12 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "range": [ + 35, + 36 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 5, + "column": 14 + }, + "end": { + "line": 5, + "column": 15 + } + }, + "range": [ + 37, + 38 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 16 + }, + "end": { + "line": 5, + "column": 17 + } + }, + "range": [ + 39, + 40 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 17 + }, + "end": { + "line": 5, + "column": 18 + } + }, + "range": [ + 40, + 41 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 18 + }, + "end": { + "line": 5, + "column": 19 + } + }, + "range": [ + 41, + 42 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 45, + 46 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 47, + 48 + ] + } + ] +}; \ 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..95ed4567 --- /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,8 @@ + + +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..35eeab83 --- /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": 28, + "lineNumber": 3, + "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..b2031731 --- /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..a84c821a --- /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": 37, + "lineNumber": 5, + "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..9a3e52b9 --- /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": 3, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 2, + 53 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 2, + 53 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 8, + 9 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 10, + 53 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 14, + 51 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "range": [ + 27, + 47 + ], + "expression": { + "type": "ArrowFunctionExpression", + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 22 + } + }, + "range": [ + 28, + 45 + ], + "id": null, + "expression": true, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "ObjectExpression", + "loc": { + "start": { + "line": 5, + "column": 12 + }, + "end": { + "line": 5, + "column": 21 + } + }, + "range": [ + 35, + 44 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 5, + "column": 14 + }, + "end": { + "line": 5, + "column": 19 + } + }, + "range": [ + 37, + 42 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 14 + }, + "end": { + "line": 5, + "column": 19 + } + }, + "range": [ + 37, + 42 + ], + "name": "await" + }, + "kind": "init", + "value": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 14 + }, + "end": { + "line": 5, + "column": 19 + } + }, + "range": [ + 37, + 42 + ], + "name": "await" + } + } + ] + } + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "range": [ + 2, + 7 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 8, + 9 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 10, + 11 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 8 + } + }, + "range": [ + 14, + 20 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 21, + 22 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "range": [ + 27, + 28 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 6 + } + }, + "range": [ + 28, + 29 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "range": [ + 29, + 30 + ] + }, + { + "type": "Punctuator", + "value": "=>", + "loc": { + "start": { + "line": 5, + "column": 8 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 31, + 33 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 11 + }, + "end": { + "line": 5, + "column": 12 + } + }, + "range": [ + 34, + 35 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 12 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "range": [ + 35, + 36 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 5, + "column": 14 + }, + "end": { + "line": 5, + "column": 19 + } + }, + "range": [ + 37, + 42 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 20 + }, + "end": { + "line": 5, + "column": 21 + } + }, + "range": [ + 43, + 44 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 5, + "column": 22 + } + }, + "range": [ + 44, + 45 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 22 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 45, + 46 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 23 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "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 + ] + } + ] +}; \ 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..0c1c2bc7 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-identifier-shorthand-static-init-await-valid.src.js @@ -0,0 +1,7 @@ + + +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..e0cdd494 --- /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": 42, + "lineNumber": 5, + "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..6b32b381 --- /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": 3, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 2, + 60 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 2, + 60 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 8, + 9 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 10, + 60 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 14, + 58 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 31 + } + }, + "range": [ + 27, + 54 + ], + "expression": { + "type": "ObjectExpression", + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 29 + } + }, + "range": [ + 28, + 52 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 28 + } + }, + "range": [ + 29, + 51 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 10 + }, + "end": { + "line": 5, + "column": 18 + } + }, + "range": [ + 33, + 41 + ], + "name": "accessor" + }, + "kind": "set", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 5, + "column": 18 + }, + "end": { + "line": 5, + "column": 28 + } + }, + "range": [ + 41, + 51 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 19 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "range": [ + 42, + 47 + ], + "name": "await" + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 5, + "column": 26 + }, + "end": { + "line": 5, + "column": 28 + } + }, + "range": [ + 49, + 51 + ], + "body": [] + } + } + } + ] + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "range": [ + 2, + 7 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 8, + 9 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 10, + 11 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 8 + } + }, + "range": [ + 14, + 20 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 21, + 22 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "range": [ + 27, + 28 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 6 + } + }, + "range": [ + 28, + 29 + ] + }, + { + "type": "Identifier", + "value": "set", + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 9 + } + }, + "range": [ + 29, + 32 + ] + }, + { + "type": "Identifier", + "value": "accessor", + "loc": { + "start": { + "line": 5, + "column": 10 + }, + "end": { + "line": 5, + "column": 18 + } + }, + "range": [ + 33, + 41 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 18 + }, + "end": { + "line": 5, + "column": 19 + } + }, + "range": [ + 41, + 42 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 5, + "column": 19 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "range": [ + 42, + 47 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 24 + }, + "end": { + "line": 5, + "column": 25 + } + }, + "range": [ + 47, + 48 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 26 + }, + "end": { + "line": 5, + "column": 27 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 27 + }, + "end": { + "line": 5, + "column": 28 + } + }, + "range": [ + 50, + 51 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 28 + }, + "end": { + "line": 5, + "column": 29 + } + }, + "range": [ + 51, + 52 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 29 + }, + "end": { + "line": 5, + "column": 30 + } + }, + "range": [ + 52, + 53 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 30 + }, + "end": { + "line": 5, + "column": 31 + } + }, + "range": [ + 53, + 54 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 57, + 58 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 59, + 60 + ] + } + ] +}; \ 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..73918442 --- /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,7 @@ + + +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..a84c821a --- /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": 37, + "lineNumber": 5, + "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..e77b2f25 --- /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": 3, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 2, + 55 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 2, + 55 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 8, + 9 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 10, + 55 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 14, + 53 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 26 + } + }, + "range": [ + 27, + 49 + ], + "expression": { + "type": "ObjectExpression", + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "range": [ + 28, + 47 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 29, + 46 + ], + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 7 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "range": [ + 30, + 36 + ], + "name": "method" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 36, + 46 + ], + "id": null, + "expression": false, + "generator": true, + "async": false, + "params": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 14 + }, + "end": { + "line": 5, + "column": 19 + } + }, + "range": [ + 37, + 42 + ], + "name": "await" + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 44, + 46 + ], + "body": [] + } + } + } + ] + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "range": [ + 2, + 7 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 8, + 9 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 10, + 11 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 8 + } + }, + "range": [ + 14, + 20 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 21, + 22 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "range": [ + 27, + 28 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 6 + } + }, + "range": [ + 28, + 29 + ] + }, + { + "type": "Punctuator", + "value": "*", + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "range": [ + 29, + 30 + ] + }, + { + "type": "Identifier", + "value": "method", + "loc": { + "start": { + "line": 5, + "column": 7 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "range": [ + 30, + 36 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 14 + } + }, + "range": [ + 36, + 37 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 5, + "column": 14 + }, + "end": { + "line": 5, + "column": 19 + } + }, + "range": [ + 37, + 42 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 19 + }, + "end": { + "line": 5, + "column": 20 + } + }, + "range": [ + 42, + 43 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 5, + "column": 22 + } + }, + "range": [ + 44, + 45 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 22 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 45, + 46 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 23 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "range": [ + 46, + 47 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 24 + }, + "end": { + "line": 5, + "column": 25 + } + }, + "range": [ + 47, + 48 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 25 + }, + "end": { + "line": 5, + "column": 26 + } + }, + "range": [ + 48, + 49 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 52, + 53 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 54, + 55 + ] + } + ] +}; \ 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..902fa1fd --- /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,7 @@ + + +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..f8054bf1 --- /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": 36, + "lineNumber": 5, + "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..ad1c840e --- /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": 3, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 2, + 54 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 2, + 54 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 8, + 9 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 10, + 54 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 14, + 52 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 25 + } + }, + "range": [ + 27, + 48 + ], + "expression": { + "type": "ObjectExpression", + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 28, + 46 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 22 + } + }, + "range": [ + 29, + 45 + ], + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 12 + } + }, + "range": [ + 29, + 35 + ], + "name": "method" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 5, + "column": 12 + }, + "end": { + "line": 5, + "column": 22 + } + }, + "range": [ + 35, + 45 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 18 + } + }, + "range": [ + 36, + 41 + ], + "name": "await" + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 5, + "column": 20 + }, + "end": { + "line": 5, + "column": 22 + } + }, + "range": [ + 43, + 45 + ], + "body": [] + } + } + } + ] + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "range": [ + 2, + 7 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 8, + 9 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 10, + 11 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 8 + } + }, + "range": [ + 14, + 20 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 21, + 22 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "range": [ + 27, + 28 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 6 + } + }, + "range": [ + 28, + 29 + ] + }, + { + "type": "Identifier", + "value": "method", + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 12 + } + }, + "range": [ + 29, + 35 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 12 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "range": [ + 35, + 36 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 18 + } + }, + "range": [ + 36, + 41 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 18 + }, + "end": { + "line": 5, + "column": 19 + } + }, + "range": [ + 41, + 42 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 20 + }, + "end": { + "line": 5, + "column": 21 + } + }, + "range": [ + 43, + 44 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 5, + "column": 22 + } + }, + "range": [ + 44, + 45 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 22 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 45, + 46 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 23 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "range": [ + 46, + 47 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 24 + }, + "end": { + "line": 5, + "column": 25 + } + }, + "range": [ + 47, + 48 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 51, + 52 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "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-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..c2adae1d --- /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,7 @@ + + +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..551e78ba --- /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": 6, + "lineNumber": 3, + "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..3815c542 --- /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": 3, + "column": 0 + }, + "end": { + "line": 17, + "column": 43 + } + }, + "range": [ + 2, + 278 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "range": [ + 2, + 16 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 6, + 15 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 6, + 11 + ], + "name": "await" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 14, + 15 + ], + "value": 0, + "raw": "0" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 24 + } + }, + "range": [ + 17, + 41 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 21, + 30 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 21, + 30 + ], + "name": "fromParam" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 32, + 40 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 32, + 40 + ], + "name": "fromBody" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 14, + "column": 1 + } + }, + "range": [ + 43, + 183 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 49, + 50 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 14, + "column": 1 + } + }, + "range": [ + 51, + 183 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 13, + "column": 3 + } + }, + "range": [ + 55, + 181 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 12, + "column": 28 + } + }, + "range": [ + 68, + 177 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 12, + "column": 27 + } + }, + "range": [ + 68, + 176 + ], + "operator": "=", + "left": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 12, + "column": 15 + } + }, + "range": [ + 68, + 164 + ], + "object": { + "type": "ObjectExpression", + "loc": { + "start": { + "line": 8, + "column": 5 + }, + "end": { + "line": 12, + "column": 5 + } + }, + "range": [ + 69, + 154 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 9, + "column": 6 + }, + "end": { + "line": 11, + "column": 7 + } + }, + "range": [ + 77, + 148 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 18 + } + }, + "range": [ + 81, + 89 + ], + "name": "accessor" + }, + "kind": "set", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 11, + "column": 7 + } + }, + "range": [ + 89, + 148 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 9, + "column": 19 + }, + "end": { + "line": 9, + "column": 40 + } + }, + "range": [ + 90, + 111 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 19 + }, + "end": { + "line": 9, + "column": 20 + } + }, + "range": [ + 90, + 91 + ], + "name": "x" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 9, + "column": 23 + }, + "end": { + "line": 9, + "column": 40 + } + }, + "range": [ + 94, + 111 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 23 + }, + "end": { + "line": 9, + "column": 32 + } + }, + "range": [ + 94, + 103 + ], + "name": "fromParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 35 + }, + "end": { + "line": 9, + "column": 40 + } + }, + "range": [ + 106, + 111 + ], + "name": "await" + } + } + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 9, + "column": 42 + }, + "end": { + "line": 11, + "column": 7 + } + }, + "range": [ + 113, + 148 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 10, + "column": 8 + }, + "end": { + "line": 10, + "column": 25 + } + }, + "range": [ + 123, + 140 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 10, + "column": 8 + }, + "end": { + "line": 10, + "column": 24 + } + }, + "range": [ + 123, + 139 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 8 + }, + "end": { + "line": 10, + "column": 16 + } + }, + "range": [ + 123, + 131 + ], + "name": "fromBody" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 24 + } + }, + "range": [ + 134, + 139 + ], + "name": "await" + } + } + } + ] + } + } + } + ] + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 15 + } + }, + "range": [ + 156, + 164 + ], + "name": "accessor" + }, + "computed": false, + "optional": false + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 18 + }, + "end": { + "line": 12, + "column": 27 + } + }, + "range": [ + 167, + 176 + ], + "name": "undefined" + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 49 + } + }, + "range": [ + 185, + 234 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 48 + } + }, + "range": [ + 185, + 233 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 185, + 201 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 6 + } + }, + "range": [ + 185, + 191 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 7 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 192, + 201 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 17 + }, + "end": { + "line": 16, + "column": 26 + } + }, + "range": [ + 202, + 211 + ], + "name": "fromParam" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 16, + "column": 28 + }, + "end": { + "line": 16, + "column": 29 + } + }, + "range": [ + 213, + 214 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 16, + "column": 31 + }, + "end": { + "line": 16, + "column": 47 + } + }, + "range": [ + 216, + 232 + ], + "value": "from parameter", + "raw": "'from parameter'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 43 + } + }, + "range": [ + 235, + 278 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 42 + } + }, + "range": [ + 235, + 277 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 235, + 251 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 6 + } + }, + "range": [ + 235, + 241 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 7 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 242, + 251 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 17 + }, + "end": { + "line": 17, + "column": 25 + } + }, + "range": [ + 252, + 260 + ], + "name": "fromBody" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 17, + "column": 27 + }, + "end": { + "line": 17, + "column": 28 + } + }, + "range": [ + 262, + 263 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 17, + "column": 30 + }, + "end": { + "line": 17, + "column": 41 + } + }, + "range": [ + 265, + 276 + ], + "value": "from body", + "raw": "'from body'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "range": [ + 2, + 5 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 6, + 11 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "range": [ + 12, + 13 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 14, + 15 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "range": [ + 15, + 16 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 17, + 20 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 21, + 30 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 14 + } + }, + "range": [ + 30, + 31 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 32, + 40 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 23 + }, + "end": { + "line": 4, + "column": 24 + } + }, + "range": [ + 40, + 41 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 43, + 48 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 9 + } + }, + "range": [ + 51, + 52 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 8 + } + }, + "range": [ + 55, + 61 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 10 + } + }, + "range": [ + 62, + 63 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 5 + } + }, + "range": [ + 68, + 69 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 8, + "column": 5 + }, + "end": { + "line": 8, + "column": 6 + } + }, + "range": [ + 69, + 70 + ] + }, + { + "type": "Identifier", + "value": "set", + "loc": { + "start": { + "line": 9, + "column": 6 + }, + "end": { + "line": 9, + "column": 9 + } + }, + "range": [ + 77, + 80 + ] + }, + { + "type": "Identifier", + "value": "accessor", + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 18 + } + }, + "range": [ + 81, + 89 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 19 + } + }, + "range": [ + 89, + 90 + ] + }, + { + "type": "Identifier", + "value": "x", + "loc": { + "start": { + "line": 9, + "column": 19 + }, + "end": { + "line": 9, + "column": 20 + } + }, + "range": [ + 90, + 91 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 9, + "column": 21 + }, + "end": { + "line": 9, + "column": 22 + } + }, + "range": [ + 92, + 93 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 9, + "column": 23 + }, + "end": { + "line": 9, + "column": 32 + } + }, + "range": [ + 94, + 103 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 9, + "column": 33 + }, + "end": { + "line": 9, + "column": 34 + } + }, + "range": [ + 104, + 105 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 9, + "column": 35 + }, + "end": { + "line": 9, + "column": 40 + } + }, + "range": [ + 106, + 111 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 9, + "column": 40 + }, + "end": { + "line": 9, + "column": 41 + } + }, + "range": [ + 111, + 112 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 9, + "column": 42 + }, + "end": { + "line": 9, + "column": 43 + } + }, + "range": [ + 113, + 114 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 10, + "column": 8 + }, + "end": { + "line": 10, + "column": 16 + } + }, + "range": [ + 123, + 131 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 10, + "column": 17 + }, + "end": { + "line": 10, + "column": 18 + } + }, + "range": [ + 132, + 133 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 24 + } + }, + "range": [ + 134, + 139 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 10, + "column": 24 + }, + "end": { + "line": 10, + "column": 25 + } + }, + "range": [ + 139, + 140 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 7 + } + }, + "range": [ + 147, + 148 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 12, + "column": 4 + }, + "end": { + "line": 12, + "column": 5 + } + }, + "range": [ + 153, + 154 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 12, + "column": 5 + }, + "end": { + "line": 12, + "column": 6 + } + }, + "range": [ + 154, + 155 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 12, + "column": 6 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "range": [ + 155, + 156 + ] + }, + { + "type": "Identifier", + "value": "accessor", + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 15 + } + }, + "range": [ + 156, + 164 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 12, + "column": 16 + }, + "end": { + "line": 12, + "column": 17 + } + }, + "range": [ + 165, + 166 + ] + }, + { + "type": "Identifier", + "value": "undefined", + "loc": { + "start": { + "line": 12, + "column": 18 + }, + "end": { + "line": 12, + "column": 27 + } + }, + "range": [ + 167, + 176 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 12, + "column": 27 + }, + "end": { + "line": 12, + "column": 28 + } + }, + "range": [ + 176, + 177 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 13, + "column": 2 + }, + "end": { + "line": 13, + "column": 3 + } + }, + "range": [ + 180, + 181 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 1 + } + }, + "range": [ + 182, + 183 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 6 + } + }, + "range": [ + 185, + 191 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 16, + "column": 6 + }, + "end": { + "line": 16, + "column": 7 + } + }, + "range": [ + 191, + 192 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 16, + "column": 7 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 192, + 201 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 16, + "column": 16 + }, + "end": { + "line": 16, + "column": 17 + } + }, + "range": [ + 201, + 202 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 16, + "column": 17 + }, + "end": { + "line": 16, + "column": 26 + } + }, + "range": [ + 202, + 211 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 16, + "column": 26 + }, + "end": { + "line": 16, + "column": 27 + } + }, + "range": [ + 211, + 212 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 16, + "column": 28 + }, + "end": { + "line": 16, + "column": 29 + } + }, + "range": [ + 213, + 214 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 16, + "column": 29 + }, + "end": { + "line": 16, + "column": 30 + } + }, + "range": [ + 214, + 215 + ] + }, + { + "type": "String", + "value": "'from parameter'", + "loc": { + "start": { + "line": 16, + "column": 31 + }, + "end": { + "line": 16, + "column": 47 + } + }, + "range": [ + 216, + 232 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 16, + "column": 47 + }, + "end": { + "line": 16, + "column": 48 + } + }, + "range": [ + 232, + 233 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 16, + "column": 48 + }, + "end": { + "line": 16, + "column": 49 + } + }, + "range": [ + 233, + 234 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 6 + } + }, + "range": [ + 235, + 241 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 17, + "column": 6 + }, + "end": { + "line": 17, + "column": 7 + } + }, + "range": [ + 241, + 242 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 17, + "column": 7 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 242, + 251 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 17, + "column": 16 + }, + "end": { + "line": 17, + "column": 17 + } + }, + "range": [ + 251, + 252 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 17, + "column": 17 + }, + "end": { + "line": 17, + "column": 25 + } + }, + "range": [ + 252, + 260 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 17, + "column": 25 + }, + "end": { + "line": 17, + "column": 26 + } + }, + "range": [ + 260, + 261 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 17, + "column": 27 + }, + "end": { + "line": 17, + "column": 28 + } + }, + "range": [ + 262, + 263 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 17, + "column": 28 + }, + "end": { + "line": 17, + "column": 29 + } + }, + "range": [ + 263, + 264 + ] + }, + { + "type": "String", + "value": "'from body'", + "loc": { + "start": { + "line": 17, + "column": 30 + }, + "end": { + "line": 17, + "column": 41 + } + }, + "range": [ + 265, + 276 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 17, + "column": 41 + }, + "end": { + "line": 17, + "column": 42 + } + }, + "range": [ + 276, + 277 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 17, + "column": 42 + }, + "end": { + "line": 17, + "column": 43 + } + }, + "range": [ + 277, + 278 + ] + } + ] +}; \ 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..da224f63 --- /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,17 @@ + + +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..551e78ba --- /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": 6, + "lineNumber": 3, + "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..29d5d69b --- /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": 3, + "column": 0 + }, + "end": { + "line": 17, + "column": 43 + } + }, + "range": [ + 2, + 268 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "range": [ + 2, + 16 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 6, + 15 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 6, + 11 + ], + "name": "await" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 14, + 15 + ], + "value": 0, + "raw": "0" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 24 + } + }, + "range": [ + 17, + 41 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 21, + 30 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 21, + 30 + ], + "name": "fromParam" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 32, + 40 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 32, + 40 + ], + "name": "fromBody" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 14, + "column": 1 + } + }, + "range": [ + 43, + 173 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 49, + 50 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 14, + "column": 1 + } + }, + "range": [ + 51, + 173 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 13, + "column": 3 + } + }, + "range": [ + 55, + 171 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 12, + "column": 23 + } + }, + "range": [ + 68, + 167 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 12, + "column": 22 + } + }, + "range": [ + 68, + 166 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 12, + "column": 20 + } + }, + "range": [ + 68, + 164 + ], + "object": { + "type": "CallExpression", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 12, + "column": 15 + } + }, + "range": [ + 68, + 159 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 12, + "column": 13 + } + }, + "range": [ + 68, + 157 + ], + "object": { + "type": "ObjectExpression", + "loc": { + "start": { + "line": 8, + "column": 5 + }, + "end": { + "line": 12, + "column": 5 + } + }, + "range": [ + 69, + 149 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 9, + "column": 6 + }, + "end": { + "line": 11, + "column": 7 + } + }, + "range": [ + 77, + 143 + ], + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 7 + }, + "end": { + "line": 9, + "column": 13 + } + }, + "range": [ + 78, + 84 + ], + "name": "method" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 9, + "column": 13 + }, + "end": { + "line": 11, + "column": 7 + } + }, + "range": [ + 84, + 143 + ], + "id": null, + "expression": false, + "generator": true, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 9, + "column": 14 + }, + "end": { + "line": 9, + "column": 35 + } + }, + "range": [ + 85, + 106 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 14 + }, + "end": { + "line": 9, + "column": 15 + } + }, + "range": [ + 85, + 86 + ], + "name": "x" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 35 + } + }, + "range": [ + 89, + 106 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 27 + } + }, + "range": [ + 89, + 98 + ], + "name": "fromParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 30 + }, + "end": { + "line": 9, + "column": 35 + } + }, + "range": [ + 101, + 106 + ], + "name": "await" + } + } + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 9, + "column": 37 + }, + "end": { + "line": 11, + "column": 7 + } + }, + "range": [ + 108, + 143 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 10, + "column": 8 + }, + "end": { + "line": 10, + "column": 25 + } + }, + "range": [ + 118, + 135 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 10, + "column": 8 + }, + "end": { + "line": 10, + "column": 24 + } + }, + "range": [ + 118, + 134 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 8 + }, + "end": { + "line": 10, + "column": 16 + } + }, + "range": [ + 118, + 126 + ], + "name": "fromBody" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 24 + } + }, + "range": [ + 129, + 134 + ], + "name": "await" + } + } + } + ] + } + } + } + ] + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 13 + } + }, + "range": [ + 151, + 157 + ], + "name": "method" + }, + "computed": false, + "optional": false + }, + "arguments": [], + "optional": false + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 16 + }, + "end": { + "line": 12, + "column": 20 + } + }, + "range": [ + 160, + 164 + ], + "name": "next" + }, + "computed": false, + "optional": false + }, + "arguments": [], + "optional": false + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 49 + } + }, + "range": [ + 175, + 224 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 48 + } + }, + "range": [ + 175, + 223 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 175, + 191 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 6 + } + }, + "range": [ + 175, + 181 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 7 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 182, + 191 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 17 + }, + "end": { + "line": 16, + "column": 26 + } + }, + "range": [ + 192, + 201 + ], + "name": "fromParam" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 16, + "column": 28 + }, + "end": { + "line": 16, + "column": 29 + } + }, + "range": [ + 203, + 204 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 16, + "column": 31 + }, + "end": { + "line": 16, + "column": 47 + } + }, + "range": [ + 206, + 222 + ], + "value": "from parameter", + "raw": "'from parameter'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 43 + } + }, + "range": [ + 225, + 268 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 42 + } + }, + "range": [ + 225, + 267 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 225, + 241 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 6 + } + }, + "range": [ + 225, + 231 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 7 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 232, + 241 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 17 + }, + "end": { + "line": 17, + "column": 25 + } + }, + "range": [ + 242, + 250 + ], + "name": "fromBody" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 17, + "column": 27 + }, + "end": { + "line": 17, + "column": 28 + } + }, + "range": [ + 252, + 253 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 17, + "column": 30 + }, + "end": { + "line": 17, + "column": 41 + } + }, + "range": [ + 255, + 266 + ], + "value": "from body", + "raw": "'from body'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "range": [ + 2, + 5 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 6, + 11 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "range": [ + 12, + 13 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 14, + 15 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "range": [ + 15, + 16 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 17, + 20 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 21, + 30 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 14 + } + }, + "range": [ + 30, + 31 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 32, + 40 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 23 + }, + "end": { + "line": 4, + "column": 24 + } + }, + "range": [ + 40, + 41 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 43, + 48 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 9 + } + }, + "range": [ + 51, + 52 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 8 + } + }, + "range": [ + 55, + 61 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 10 + } + }, + "range": [ + 62, + 63 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 5 + } + }, + "range": [ + 68, + 69 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 8, + "column": 5 + }, + "end": { + "line": 8, + "column": 6 + } + }, + "range": [ + 69, + 70 + ] + }, + { + "type": "Punctuator", + "value": "*", + "loc": { + "start": { + "line": 9, + "column": 6 + }, + "end": { + "line": 9, + "column": 7 + } + }, + "range": [ + 77, + 78 + ] + }, + { + "type": "Identifier", + "value": "method", + "loc": { + "start": { + "line": 9, + "column": 7 + }, + "end": { + "line": 9, + "column": 13 + } + }, + "range": [ + 78, + 84 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 9, + "column": 13 + }, + "end": { + "line": 9, + "column": 14 + } + }, + "range": [ + 84, + 85 + ] + }, + { + "type": "Identifier", + "value": "x", + "loc": { + "start": { + "line": 9, + "column": 14 + }, + "end": { + "line": 9, + "column": 15 + } + }, + "range": [ + 85, + 86 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 9, + "column": 16 + }, + "end": { + "line": 9, + "column": 17 + } + }, + "range": [ + 87, + 88 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 27 + } + }, + "range": [ + 89, + 98 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 9, + "column": 28 + }, + "end": { + "line": 9, + "column": 29 + } + }, + "range": [ + 99, + 100 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 9, + "column": 30 + }, + "end": { + "line": 9, + "column": 35 + } + }, + "range": [ + 101, + 106 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 9, + "column": 35 + }, + "end": { + "line": 9, + "column": 36 + } + }, + "range": [ + 106, + 107 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 9, + "column": 37 + }, + "end": { + "line": 9, + "column": 38 + } + }, + "range": [ + 108, + 109 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 10, + "column": 8 + }, + "end": { + "line": 10, + "column": 16 + } + }, + "range": [ + 118, + 126 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 10, + "column": 17 + }, + "end": { + "line": 10, + "column": 18 + } + }, + "range": [ + 127, + 128 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 24 + } + }, + "range": [ + 129, + 134 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 10, + "column": 24 + }, + "end": { + "line": 10, + "column": 25 + } + }, + "range": [ + 134, + 135 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 7 + } + }, + "range": [ + 142, + 143 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 12, + "column": 4 + }, + "end": { + "line": 12, + "column": 5 + } + }, + "range": [ + 148, + 149 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 12, + "column": 5 + }, + "end": { + "line": 12, + "column": 6 + } + }, + "range": [ + 149, + 150 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 12, + "column": 6 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "range": [ + 150, + 151 + ] + }, + { + "type": "Identifier", + "value": "method", + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 13 + } + }, + "range": [ + 151, + 157 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 12, + "column": 13 + }, + "end": { + "line": 12, + "column": 14 + } + }, + "range": [ + 157, + 158 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 12, + "column": 14 + }, + "end": { + "line": 12, + "column": 15 + } + }, + "range": [ + 158, + 159 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 12, + "column": 15 + }, + "end": { + "line": 12, + "column": 16 + } + }, + "range": [ + 159, + 160 + ] + }, + { + "type": "Identifier", + "value": "next", + "loc": { + "start": { + "line": 12, + "column": 16 + }, + "end": { + "line": 12, + "column": 20 + } + }, + "range": [ + 160, + 164 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 12, + "column": 20 + }, + "end": { + "line": 12, + "column": 21 + } + }, + "range": [ + 164, + 165 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 12, + "column": 21 + }, + "end": { + "line": 12, + "column": 22 + } + }, + "range": [ + 165, + 166 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 12, + "column": 22 + }, + "end": { + "line": 12, + "column": 23 + } + }, + "range": [ + 166, + 167 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 13, + "column": 2 + }, + "end": { + "line": 13, + "column": 3 + } + }, + "range": [ + 170, + 171 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 1 + } + }, + "range": [ + 172, + 173 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 6 + } + }, + "range": [ + 175, + 181 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 16, + "column": 6 + }, + "end": { + "line": 16, + "column": 7 + } + }, + "range": [ + 181, + 182 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 16, + "column": 7 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 182, + 191 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 16, + "column": 16 + }, + "end": { + "line": 16, + "column": 17 + } + }, + "range": [ + 191, + 192 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 16, + "column": 17 + }, + "end": { + "line": 16, + "column": 26 + } + }, + "range": [ + 192, + 201 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 16, + "column": 26 + }, + "end": { + "line": 16, + "column": 27 + } + }, + "range": [ + 201, + 202 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 16, + "column": 28 + }, + "end": { + "line": 16, + "column": 29 + } + }, + "range": [ + 203, + 204 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 16, + "column": 29 + }, + "end": { + "line": 16, + "column": 30 + } + }, + "range": [ + 204, + 205 + ] + }, + { + "type": "String", + "value": "'from parameter'", + "loc": { + "start": { + "line": 16, + "column": 31 + }, + "end": { + "line": 16, + "column": 47 + } + }, + "range": [ + 206, + 222 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 16, + "column": 47 + }, + "end": { + "line": 16, + "column": 48 + } + }, + "range": [ + 222, + 223 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 16, + "column": 48 + }, + "end": { + "line": 16, + "column": 49 + } + }, + "range": [ + 223, + 224 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 6 + } + }, + "range": [ + 225, + 231 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 17, + "column": 6 + }, + "end": { + "line": 17, + "column": 7 + } + }, + "range": [ + 231, + 232 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 17, + "column": 7 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 232, + 241 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 17, + "column": 16 + }, + "end": { + "line": 17, + "column": 17 + } + }, + "range": [ + 241, + 242 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 17, + "column": 17 + }, + "end": { + "line": 17, + "column": 25 + } + }, + "range": [ + 242, + 250 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 17, + "column": 25 + }, + "end": { + "line": 17, + "column": 26 + } + }, + "range": [ + 250, + 251 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 17, + "column": 27 + }, + "end": { + "line": 17, + "column": 28 + } + }, + "range": [ + 252, + 253 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 17, + "column": 28 + }, + "end": { + "line": 17, + "column": 29 + } + }, + "range": [ + 253, + 254 + ] + }, + { + "type": "String", + "value": "'from body'", + "loc": { + "start": { + "line": 17, + "column": 30 + }, + "end": { + "line": 17, + "column": 41 + } + }, + "range": [ + 255, + 266 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 17, + "column": 41 + }, + "end": { + "line": 17, + "column": 42 + } + }, + "range": [ + 266, + 267 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 17, + "column": 42 + }, + "end": { + "line": 17, + "column": 43 + } + }, + "range": [ + 267, + 268 + ] + } + ] +}; \ 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..bcd06448 --- /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,17 @@ + + +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..551e78ba --- /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": 6, + "lineNumber": 3, + "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..a9aaefac --- /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": 3, + "column": 0 + }, + "end": { + "line": 17, + "column": 43 + } + }, + "range": [ + 2, + 260 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "range": [ + 2, + 16 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 6, + 15 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 6, + 11 + ], + "name": "await" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 14, + 15 + ], + "value": 0, + "raw": "0" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 24 + } + }, + "range": [ + 17, + 41 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 21, + 30 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 21, + 30 + ], + "name": "fromParam" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 32, + 40 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 32, + 40 + ], + "name": "fromBody" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 14, + "column": 1 + } + }, + "range": [ + 43, + 165 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 49, + 50 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 14, + "column": 1 + } + }, + "range": [ + 51, + 165 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 13, + "column": 3 + } + }, + "range": [ + 55, + 163 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 12, + "column": 16 + } + }, + "range": [ + 68, + 159 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 12, + "column": 15 + } + }, + "range": [ + 68, + 158 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 12, + "column": 13 + } + }, + "range": [ + 68, + 156 + ], + "object": { + "type": "ObjectExpression", + "loc": { + "start": { + "line": 8, + "column": 5 + }, + "end": { + "line": 12, + "column": 5 + } + }, + "range": [ + 69, + 148 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 9, + "column": 6 + }, + "end": { + "line": 11, + "column": 7 + } + }, + "range": [ + 77, + 142 + ], + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 6 + }, + "end": { + "line": 9, + "column": 12 + } + }, + "range": [ + 77, + 83 + ], + "name": "method" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 9, + "column": 12 + }, + "end": { + "line": 11, + "column": 7 + } + }, + "range": [ + 83, + 142 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 9, + "column": 13 + }, + "end": { + "line": 9, + "column": 34 + } + }, + "range": [ + 84, + 105 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 13 + }, + "end": { + "line": 9, + "column": 14 + } + }, + "range": [ + 84, + 85 + ], + "name": "x" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 9, + "column": 17 + }, + "end": { + "line": 9, + "column": 34 + } + }, + "range": [ + 88, + 105 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 17 + }, + "end": { + "line": 9, + "column": 26 + } + }, + "range": [ + 88, + 97 + ], + "name": "fromParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 29 + }, + "end": { + "line": 9, + "column": 34 + } + }, + "range": [ + 100, + 105 + ], + "name": "await" + } + } + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 9, + "column": 36 + }, + "end": { + "line": 11, + "column": 7 + } + }, + "range": [ + 107, + 142 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 10, + "column": 8 + }, + "end": { + "line": 10, + "column": 25 + } + }, + "range": [ + 117, + 134 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 10, + "column": 8 + }, + "end": { + "line": 10, + "column": 24 + } + }, + "range": [ + 117, + 133 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 8 + }, + "end": { + "line": 10, + "column": 16 + } + }, + "range": [ + 117, + 125 + ], + "name": "fromBody" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 24 + } + }, + "range": [ + 128, + 133 + ], + "name": "await" + } + } + } + ] + } + } + } + ] + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 13 + } + }, + "range": [ + 150, + 156 + ], + "name": "method" + }, + "computed": false, + "optional": false + }, + "arguments": [], + "optional": false + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 49 + } + }, + "range": [ + 167, + 216 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 48 + } + }, + "range": [ + 167, + 215 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 167, + 183 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 6 + } + }, + "range": [ + 167, + 173 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 7 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 174, + 183 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 17 + }, + "end": { + "line": 16, + "column": 26 + } + }, + "range": [ + 184, + 193 + ], + "name": "fromParam" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 16, + "column": 28 + }, + "end": { + "line": 16, + "column": 29 + } + }, + "range": [ + 195, + 196 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 16, + "column": 31 + }, + "end": { + "line": 16, + "column": 47 + } + }, + "range": [ + 198, + 214 + ], + "value": "from parameter", + "raw": "'from parameter'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 43 + } + }, + "range": [ + 217, + 260 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 42 + } + }, + "range": [ + 217, + 259 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 217, + 233 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 6 + } + }, + "range": [ + 217, + 223 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 7 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 224, + 233 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 17 + }, + "end": { + "line": 17, + "column": 25 + } + }, + "range": [ + 234, + 242 + ], + "name": "fromBody" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 17, + "column": 27 + }, + "end": { + "line": 17, + "column": 28 + } + }, + "range": [ + 244, + 245 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 17, + "column": 30 + }, + "end": { + "line": 17, + "column": 41 + } + }, + "range": [ + 247, + 258 + ], + "value": "from body", + "raw": "'from body'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "range": [ + 2, + 5 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 6, + 11 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "range": [ + 12, + 13 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 14, + 15 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "range": [ + 15, + 16 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 17, + 20 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 21, + 30 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 14 + } + }, + "range": [ + 30, + 31 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 32, + 40 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 23 + }, + "end": { + "line": 4, + "column": 24 + } + }, + "range": [ + 40, + 41 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 43, + 48 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 9 + } + }, + "range": [ + 51, + 52 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 8 + } + }, + "range": [ + 55, + 61 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 10 + } + }, + "range": [ + 62, + 63 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 5 + } + }, + "range": [ + 68, + 69 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 8, + "column": 5 + }, + "end": { + "line": 8, + "column": 6 + } + }, + "range": [ + 69, + 70 + ] + }, + { + "type": "Identifier", + "value": "method", + "loc": { + "start": { + "line": 9, + "column": 6 + }, + "end": { + "line": 9, + "column": 12 + } + }, + "range": [ + 77, + 83 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 9, + "column": 12 + }, + "end": { + "line": 9, + "column": 13 + } + }, + "range": [ + 83, + 84 + ] + }, + { + "type": "Identifier", + "value": "x", + "loc": { + "start": { + "line": 9, + "column": 13 + }, + "end": { + "line": 9, + "column": 14 + } + }, + "range": [ + 84, + 85 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 9, + "column": 15 + }, + "end": { + "line": 9, + "column": 16 + } + }, + "range": [ + 86, + 87 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 9, + "column": 17 + }, + "end": { + "line": 9, + "column": 26 + } + }, + "range": [ + 88, + 97 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 9, + "column": 27 + }, + "end": { + "line": 9, + "column": 28 + } + }, + "range": [ + 98, + 99 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 9, + "column": 29 + }, + "end": { + "line": 9, + "column": 34 + } + }, + "range": [ + 100, + 105 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 9, + "column": 34 + }, + "end": { + "line": 9, + "column": 35 + } + }, + "range": [ + 105, + 106 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 9, + "column": 36 + }, + "end": { + "line": 9, + "column": 37 + } + }, + "range": [ + 107, + 108 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 10, + "column": 8 + }, + "end": { + "line": 10, + "column": 16 + } + }, + "range": [ + 117, + 125 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 10, + "column": 17 + }, + "end": { + "line": 10, + "column": 18 + } + }, + "range": [ + 126, + 127 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 24 + } + }, + "range": [ + 128, + 133 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 10, + "column": 24 + }, + "end": { + "line": 10, + "column": 25 + } + }, + "range": [ + 133, + 134 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 7 + } + }, + "range": [ + 141, + 142 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 12, + "column": 4 + }, + "end": { + "line": 12, + "column": 5 + } + }, + "range": [ + 147, + 148 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 12, + "column": 5 + }, + "end": { + "line": 12, + "column": 6 + } + }, + "range": [ + 148, + 149 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 12, + "column": 6 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "range": [ + 149, + 150 + ] + }, + { + "type": "Identifier", + "value": "method", + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 13 + } + }, + "range": [ + 150, + 156 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 12, + "column": 13 + }, + "end": { + "line": 12, + "column": 14 + } + }, + "range": [ + 156, + 157 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 12, + "column": 14 + }, + "end": { + "line": 12, + "column": 15 + } + }, + "range": [ + 157, + 158 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 12, + "column": 15 + }, + "end": { + "line": 12, + "column": 16 + } + }, + "range": [ + 158, + 159 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 13, + "column": 2 + }, + "end": { + "line": 13, + "column": 3 + } + }, + "range": [ + 162, + 163 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 1 + } + }, + "range": [ + 164, + 165 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 6 + } + }, + "range": [ + 167, + 173 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 16, + "column": 6 + }, + "end": { + "line": 16, + "column": 7 + } + }, + "range": [ + 173, + 174 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 16, + "column": 7 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 174, + 183 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 16, + "column": 16 + }, + "end": { + "line": 16, + "column": 17 + } + }, + "range": [ + 183, + 184 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 16, + "column": 17 + }, + "end": { + "line": 16, + "column": 26 + } + }, + "range": [ + 184, + 193 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 16, + "column": 26 + }, + "end": { + "line": 16, + "column": 27 + } + }, + "range": [ + 193, + 194 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 16, + "column": 28 + }, + "end": { + "line": 16, + "column": 29 + } + }, + "range": [ + 195, + 196 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 16, + "column": 29 + }, + "end": { + "line": 16, + "column": 30 + } + }, + "range": [ + 196, + 197 + ] + }, + { + "type": "String", + "value": "'from parameter'", + "loc": { + "start": { + "line": 16, + "column": 31 + }, + "end": { + "line": 16, + "column": 47 + } + }, + "range": [ + 198, + 214 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 16, + "column": 47 + }, + "end": { + "line": 16, + "column": 48 + } + }, + "range": [ + 214, + 215 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 16, + "column": 48 + }, + "end": { + "line": 16, + "column": 49 + } + }, + "range": [ + 215, + 216 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 6 + } + }, + "range": [ + 217, + 223 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 17, + "column": 6 + }, + "end": { + "line": 17, + "column": 7 + } + }, + "range": [ + 223, + 224 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 17, + "column": 7 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 224, + 233 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 17, + "column": 16 + }, + "end": { + "line": 17, + "column": 17 + } + }, + "range": [ + 233, + 234 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 17, + "column": 17 + }, + "end": { + "line": 17, + "column": 25 + } + }, + "range": [ + 234, + 242 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 17, + "column": 25 + }, + "end": { + "line": 17, + "column": 26 + } + }, + "range": [ + 242, + 243 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 17, + "column": 27 + }, + "end": { + "line": 17, + "column": 28 + } + }, + "range": [ + 244, + 245 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 17, + "column": 28 + }, + "end": { + "line": 17, + "column": 29 + } + }, + "range": [ + 245, + 246 + ] + }, + { + "type": "String", + "value": "'from body'", + "loc": { + "start": { + "line": 17, + "column": 30 + }, + "end": { + "line": 17, + "column": 41 + } + }, + "range": [ + 247, + 258 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 17, + "column": 41 + }, + "end": { + "line": 17, + "column": 42 + } + }, + "range": [ + 258, + 259 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 17, + "column": 42 + }, + "end": { + "line": 17, + "column": 43 + } + }, + "range": [ + 259, + 260 + ] + } + ] +}; \ 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..b86f406b --- /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,17 @@ + + +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..8d30cc9c --- /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": 25, + "lineNumber": 3, + "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..86967037 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/identifier-resolution-static-init-invalid-await.src.js @@ -0,0 +1,5 @@ +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..fe9c814c --- /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": 53, + "lineNumber": 4, + "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..58ea7721 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-break-static-init-without-label.src.js @@ -0,0 +1,7 @@ +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..800d0e2f --- /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": 3, + "column": 0 + }, + "end": { + "line": 27, + "column": 61 + } + }, + "range": [ + 2, + 548 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 32 + } + }, + "range": [ + 2, + 34 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 31 + } + }, + "range": [ + 6, + 33 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 6, + 12 + ], + "name": "thrown" + }, + "init": { + "type": "NewExpression", + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 31 + } + }, + "range": [ + 15, + 33 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 17 + }, + "end": { + "line": 3, + "column": 29 + } + }, + "range": [ + 19, + 31 + ], + "name": "Test262Error" + }, + "arguments": [] + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 11 + } + }, + "range": [ + 35, + 46 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 39, + 45 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 39, + 45 + ], + "name": "caught" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 22 + } + }, + "range": [ + 47, + 69 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 21 + } + }, + "range": [ + 51, + 68 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "range": [ + 51, + 60 + ], + "name": "sameBlock" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 5, + "column": 16 + }, + "end": { + "line": 5, + "column": 21 + } + }, + "range": [ + 63, + 68 + ], + "value": false, + "raw": "false" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 28 + } + }, + "range": [ + 70, + 98 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 27 + } + }, + "range": [ + 74, + 97 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 19 + } + }, + "range": [ + 74, + 89 + ], + "name": "subsequentField" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 6, + "column": 22 + }, + "end": { + "line": 6, + "column": 27 + } + }, + "range": [ + 92, + 97 + ], + "value": false, + "raw": "false" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 28 + } + }, + "range": [ + 99, + 127 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 27 + } + }, + "range": [ + 103, + 126 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 19 + } + }, + "range": [ + 103, + 118 + ], + "name": "subsequentBlock" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 7, + "column": 22 + }, + "end": { + "line": 7, + "column": 27 + } + }, + "range": [ + 121, + 126 + ], + "value": false, + "raw": "false" + } + } + ], + "kind": "var" + }, + { + "type": "TryStatement", + "loc": { + "start": { + "line": 9, + "column": 0 + }, + "end": { + "line": 22, + "column": 1 + } + }, + "range": [ + 129, + 339 + ], + "block": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 20, + "column": 1 + } + }, + "range": [ + 133, + 303 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 10, + "column": 2 + }, + "end": { + "line": 19, + "column": 3 + } + }, + "range": [ + 137, + 301 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 8 + }, + "end": { + "line": 10, + "column": 9 + } + }, + "range": [ + 143, + 144 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 10, + "column": 10 + }, + "end": { + "line": 19, + "column": 3 + } + }, + "range": [ + 145, + 301 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 11, + "column": 4 + }, + "end": { + "line": 14, + "column": 5 + } + }, + "range": [ + 151, + 209 + ], + "body": [ + { + "type": "ThrowStatement", + "loc": { + "start": { + "line": 12, + "column": 6 + }, + "end": { + "line": 12, + "column": 19 + } + }, + "range": [ + 166, + 179 + ], + "argument": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 12 + }, + "end": { + "line": 12, + "column": 18 + } + }, + "range": [ + 172, + 178 + ], + "name": "thrown" + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 13, + "column": 6 + }, + "end": { + "line": 13, + "column": 23 + } + }, + "range": [ + 186, + 203 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 13, + "column": 6 + }, + "end": { + "line": 13, + "column": 22 + } + }, + "range": [ + 186, + 202 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 6 + }, + "end": { + "line": 13, + "column": 15 + } + }, + "range": [ + 186, + 195 + ], + "name": "sameBlock" + }, + "right": { + "type": "Literal", + "loc": { + "start": { + "line": 13, + "column": 18 + }, + "end": { + "line": 13, + "column": 22 + } + }, + "range": [ + 198, + 202 + ], + "value": true, + "raw": "true" + } + } + } + ] + }, + { + "type": "PropertyDefinition", + "loc": { + "start": { + "line": 15, + "column": 4 + }, + "end": { + "line": 15, + "column": 38 + } + }, + "range": [ + 214, + 248 + ], + "static": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 11 + }, + "end": { + "line": 15, + "column": 12 + } + }, + "range": [ + 221, + 222 + ], + "name": "x" + }, + "value": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 15, + "column": 15 + }, + "end": { + "line": 15, + "column": 37 + } + }, + "range": [ + 225, + 247 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 15 + }, + "end": { + "line": 15, + "column": 30 + } + }, + "range": [ + 225, + 240 + ], + "name": "subsequentField" + }, + "right": { + "type": "Literal", + "loc": { + "start": { + "line": 15, + "column": 33 + }, + "end": { + "line": 15, + "column": 37 + } + }, + "range": [ + 243, + 247 + ], + "value": true, + "raw": "true" + } + } + }, + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 16, + "column": 4 + }, + "end": { + "line": 18, + "column": 5 + } + }, + "range": [ + 253, + 297 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 17, + "column": 6 + }, + "end": { + "line": 17, + "column": 29 + } + }, + "range": [ + 268, + 291 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 17, + "column": 6 + }, + "end": { + "line": 17, + "column": 28 + } + }, + "range": [ + 268, + 290 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 6 + }, + "end": { + "line": 17, + "column": 21 + } + }, + "range": [ + 268, + 283 + ], + "name": "subsequentBlock" + }, + "right": { + "type": "Literal", + "loc": { + "start": { + "line": 17, + "column": 24 + }, + "end": { + "line": 17, + "column": 28 + } + }, + "range": [ + 286, + 290 + ], + "value": true, + "raw": "true" + } + } + } + ] + } + ] + } + } + ] + }, + "handler": { + "type": "CatchClause", + "loc": { + "start": { + "line": 20, + "column": 2 + }, + "end": { + "line": 22, + "column": 1 + } + }, + "range": [ + 304, + 339 + ], + "param": { + "type": "Identifier", + "loc": { + "start": { + "line": 20, + "column": 9 + }, + "end": { + "line": 20, + "column": 14 + } + }, + "range": [ + 311, + 316 + ], + "name": "error" + }, + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 20, + "column": 16 + }, + "end": { + "line": 22, + "column": 1 + } + }, + "range": [ + 318, + 339 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 21, + "column": 2 + }, + "end": { + "line": 21, + "column": 17 + } + }, + "range": [ + 322, + 337 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 21, + "column": 2 + }, + "end": { + "line": 21, + "column": 16 + } + }, + "range": [ + 322, + 336 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 21, + "column": 2 + }, + "end": { + "line": 21, + "column": 8 + } + }, + "range": [ + 322, + 328 + ], + "name": "caught" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 21, + "column": 11 + }, + "end": { + "line": 21, + "column": 16 + } + }, + "range": [ + 331, + 336 + ], + "name": "error" + } + } + } + ] + } + }, + "finalizer": null + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 24, + "column": 0 + }, + "end": { + "line": 24, + "column": 33 + } + }, + "range": [ + 341, + 374 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 24, + "column": 0 + }, + "end": { + "line": 24, + "column": 32 + } + }, + "range": [ + 341, + 373 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 24, + "column": 0 + }, + "end": { + "line": 24, + "column": 16 + } + }, + "range": [ + 341, + 357 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 24, + "column": 0 + }, + "end": { + "line": 24, + "column": 6 + } + }, + "range": [ + 341, + 347 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 24, + "column": 7 + }, + "end": { + "line": 24, + "column": 16 + } + }, + "range": [ + 348, + 357 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 24, + "column": 17 + }, + "end": { + "line": 24, + "column": 23 + } + }, + "range": [ + 358, + 364 + ], + "name": "caught" + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 24, + "column": 25 + }, + "end": { + "line": 24, + "column": 31 + } + }, + "range": [ + 366, + 372 + ], + "name": "thrown" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 25, + "column": 0 + }, + "end": { + "line": 25, + "column": 49 + } + }, + "range": [ + 375, + 424 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 25, + "column": 0 + }, + "end": { + "line": 25, + "column": 48 + } + }, + "range": [ + 375, + 423 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 25, + "column": 0 + }, + "end": { + "line": 25, + "column": 16 + } + }, + "range": [ + 375, + 391 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 25, + "column": 0 + }, + "end": { + "line": 25, + "column": 6 + } + }, + "range": [ + 375, + 381 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 25, + "column": 7 + }, + "end": { + "line": 25, + "column": 16 + } + }, + "range": [ + 382, + 391 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 25, + "column": 17 + }, + "end": { + "line": 25, + "column": 26 + } + }, + "range": [ + 392, + 401 + ], + "name": "sameBlock" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 25, + "column": 28 + }, + "end": { + "line": 25, + "column": 33 + } + }, + "range": [ + 403, + 408 + ], + "value": false, + "raw": "false" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 25, + "column": 35 + }, + "end": { + "line": 25, + "column": 47 + } + }, + "range": [ + 410, + 422 + ], + "value": "same block", + "raw": "'same block'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 26, + "column": 0 + }, + "end": { + "line": 26, + "column": 61 + } + }, + "range": [ + 425, + 486 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 26, + "column": 0 + }, + "end": { + "line": 26, + "column": 60 + } + }, + "range": [ + 425, + 485 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 26, + "column": 0 + }, + "end": { + "line": 26, + "column": 16 + } + }, + "range": [ + 425, + 441 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 26, + "column": 0 + }, + "end": { + "line": 26, + "column": 6 + } + }, + "range": [ + 425, + 431 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 26, + "column": 7 + }, + "end": { + "line": 26, + "column": 16 + } + }, + "range": [ + 432, + 441 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 26, + "column": 17 + }, + "end": { + "line": 26, + "column": 32 + } + }, + "range": [ + 442, + 457 + ], + "name": "subsequentField" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 26, + "column": 34 + }, + "end": { + "line": 26, + "column": 39 + } + }, + "range": [ + 459, + 464 + ], + "value": false, + "raw": "false" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 26, + "column": 41 + }, + "end": { + "line": 26, + "column": 59 + } + }, + "range": [ + 466, + 484 + ], + "value": "subsequent field", + "raw": "'subsequent field'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 27, + "column": 0 + }, + "end": { + "line": 27, + "column": 61 + } + }, + "range": [ + 487, + 548 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 27, + "column": 0 + }, + "end": { + "line": 27, + "column": 60 + } + }, + "range": [ + 487, + 547 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 27, + "column": 0 + }, + "end": { + "line": 27, + "column": 16 + } + }, + "range": [ + 487, + 503 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 27, + "column": 0 + }, + "end": { + "line": 27, + "column": 6 + } + }, + "range": [ + 487, + 493 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 27, + "column": 7 + }, + "end": { + "line": 27, + "column": 16 + } + }, + "range": [ + 494, + 503 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 27, + "column": 17 + }, + "end": { + "line": 27, + "column": 32 + } + }, + "range": [ + 504, + 519 + ], + "name": "subsequentBlock" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 27, + "column": 34 + }, + "end": { + "line": 27, + "column": 39 + } + }, + "range": [ + 521, + 526 + ], + "value": false, + "raw": "false" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 27, + "column": 41 + }, + "end": { + "line": 27, + "column": 59 + } + }, + "range": [ + 528, + 546 + ], + "value": "subsequent block", + "raw": "'subsequent block'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "range": [ + 2, + 5 + ] + }, + { + "type": "Identifier", + "value": "thrown", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 6, + 12 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 3, + "column": 11 + }, + "end": { + "line": 3, + "column": 12 + } + }, + "range": [ + 13, + 14 + ] + }, + { + "type": "Keyword", + "value": "new", + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "range": [ + 15, + 18 + ] + }, + { + "type": "Identifier", + "value": "Test262Error", + "loc": { + "start": { + "line": 3, + "column": 17 + }, + "end": { + "line": 3, + "column": 29 + } + }, + "range": [ + 19, + 31 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 3, + "column": 29 + }, + "end": { + "line": 3, + "column": 30 + } + }, + "range": [ + 31, + 32 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 3, + "column": 30 + }, + "end": { + "line": 3, + "column": 31 + } + }, + "range": [ + 32, + 33 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 31 + }, + "end": { + "line": 3, + "column": 32 + } + }, + "range": [ + 33, + 34 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 35, + 38 + ] + }, + { + "type": "Identifier", + "value": "caught", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 39, + 45 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 10 + }, + "end": { + "line": 4, + "column": 11 + } + }, + "range": [ + 45, + 46 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 47, + 50 + ] + }, + { + "type": "Identifier", + "value": "sameBlock", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "range": [ + 51, + 60 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 5, + "column": 14 + }, + "end": { + "line": 5, + "column": 15 + } + }, + "range": [ + 61, + 62 + ] + }, + { + "type": "Boolean", + "value": "false", + "loc": { + "start": { + "line": 5, + "column": 16 + }, + "end": { + "line": 5, + "column": 21 + } + }, + "range": [ + 63, + 68 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 5, + "column": 22 + } + }, + "range": [ + 68, + 69 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 70, + 73 + ] + }, + { + "type": "Identifier", + "value": "subsequentField", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 19 + } + }, + "range": [ + 74, + 89 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 6, + "column": 20 + }, + "end": { + "line": 6, + "column": 21 + } + }, + "range": [ + 90, + 91 + ] + }, + { + "type": "Boolean", + "value": "false", + "loc": { + "start": { + "line": 6, + "column": 22 + }, + "end": { + "line": 6, + "column": 27 + } + }, + "range": [ + 92, + 97 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 27 + }, + "end": { + "line": 6, + "column": 28 + } + }, + "range": [ + 97, + 98 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 99, + 102 + ] + }, + { + "type": "Identifier", + "value": "subsequentBlock", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 19 + } + }, + "range": [ + 103, + 118 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 7, + "column": 20 + }, + "end": { + "line": 7, + "column": 21 + } + }, + "range": [ + 119, + 120 + ] + }, + { + "type": "Boolean", + "value": "false", + "loc": { + "start": { + "line": 7, + "column": 22 + }, + "end": { + "line": 7, + "column": 27 + } + }, + "range": [ + 121, + 126 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 7, + "column": 27 + }, + "end": { + "line": 7, + "column": 28 + } + }, + "range": [ + 126, + 127 + ] + }, + { + "type": "Keyword", + "value": "try", + "loc": { + "start": { + "line": 9, + "column": 0 + }, + "end": { + "line": 9, + "column": 3 + } + }, + "range": [ + 129, + 132 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 5 + } + }, + "range": [ + 133, + 134 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 10, + "column": 2 + }, + "end": { + "line": 10, + "column": 7 + } + }, + "range": [ + 137, + 142 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 10, + "column": 8 + }, + "end": { + "line": 10, + "column": 9 + } + }, + "range": [ + 143, + 144 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 10, + "column": 10 + }, + "end": { + "line": 10, + "column": 11 + } + }, + "range": [ + 145, + 146 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 11, + "column": 4 + }, + "end": { + "line": 11, + "column": 10 + } + }, + "range": [ + 151, + 157 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 11, + "column": 11 + }, + "end": { + "line": 11, + "column": 12 + } + }, + "range": [ + 158, + 159 + ] + }, + { + "type": "Keyword", + "value": "throw", + "loc": { + "start": { + "line": 12, + "column": 6 + }, + "end": { + "line": 12, + "column": 11 + } + }, + "range": [ + 166, + 171 + ] + }, + { + "type": "Identifier", + "value": "thrown", + "loc": { + "start": { + "line": 12, + "column": 12 + }, + "end": { + "line": 12, + "column": 18 + } + }, + "range": [ + 172, + 178 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 12, + "column": 18 + }, + "end": { + "line": 12, + "column": 19 + } + }, + "range": [ + 178, + 179 + ] + }, + { + "type": "Identifier", + "value": "sameBlock", + "loc": { + "start": { + "line": 13, + "column": 6 + }, + "end": { + "line": 13, + "column": 15 + } + }, + "range": [ + 186, + 195 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 13, + "column": 16 + }, + "end": { + "line": 13, + "column": 17 + } + }, + "range": [ + 196, + 197 + ] + }, + { + "type": "Boolean", + "value": "true", + "loc": { + "start": { + "line": 13, + "column": 18 + }, + "end": { + "line": 13, + "column": 22 + } + }, + "range": [ + 198, + 202 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 13, + "column": 22 + }, + "end": { + "line": 13, + "column": 23 + } + }, + "range": [ + 202, + 203 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 5 + } + }, + "range": [ + 208, + 209 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 15, + "column": 4 + }, + "end": { + "line": 15, + "column": 10 + } + }, + "range": [ + 214, + 220 + ] + }, + { + "type": "Identifier", + "value": "x", + "loc": { + "start": { + "line": 15, + "column": 11 + }, + "end": { + "line": 15, + "column": 12 + } + }, + "range": [ + 221, + 222 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 15, + "column": 13 + }, + "end": { + "line": 15, + "column": 14 + } + }, + "range": [ + 223, + 224 + ] + }, + { + "type": "Identifier", + "value": "subsequentField", + "loc": { + "start": { + "line": 15, + "column": 15 + }, + "end": { + "line": 15, + "column": 30 + } + }, + "range": [ + 225, + 240 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 15, + "column": 31 + }, + "end": { + "line": 15, + "column": 32 + } + }, + "range": [ + 241, + 242 + ] + }, + { + "type": "Boolean", + "value": "true", + "loc": { + "start": { + "line": 15, + "column": 33 + }, + "end": { + "line": 15, + "column": 37 + } + }, + "range": [ + 243, + 247 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 15, + "column": 37 + }, + "end": { + "line": 15, + "column": 38 + } + }, + "range": [ + 247, + 248 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 16, + "column": 4 + }, + "end": { + "line": 16, + "column": 10 + } + }, + "range": [ + 253, + 259 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 16, + "column": 11 + }, + "end": { + "line": 16, + "column": 12 + } + }, + "range": [ + 260, + 261 + ] + }, + { + "type": "Identifier", + "value": "subsequentBlock", + "loc": { + "start": { + "line": 17, + "column": 6 + }, + "end": { + "line": 17, + "column": 21 + } + }, + "range": [ + 268, + 283 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 17, + "column": 22 + }, + "end": { + "line": 17, + "column": 23 + } + }, + "range": [ + 284, + 285 + ] + }, + { + "type": "Boolean", + "value": "true", + "loc": { + "start": { + "line": 17, + "column": 24 + }, + "end": { + "line": 17, + "column": 28 + } + }, + "range": [ + 286, + 290 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 17, + "column": 28 + }, + "end": { + "line": 17, + "column": 29 + } + }, + "range": [ + 290, + 291 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 5 + } + }, + "range": [ + 296, + 297 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 19, + "column": 2 + }, + "end": { + "line": 19, + "column": 3 + } + }, + "range": [ + 300, + 301 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 20, + "column": 0 + }, + "end": { + "line": 20, + "column": 1 + } + }, + "range": [ + 302, + 303 + ] + }, + { + "type": "Keyword", + "value": "catch", + "loc": { + "start": { + "line": 20, + "column": 2 + }, + "end": { + "line": 20, + "column": 7 + } + }, + "range": [ + 304, + 309 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 20, + "column": 8 + }, + "end": { + "line": 20, + "column": 9 + } + }, + "range": [ + 310, + 311 + ] + }, + { + "type": "Identifier", + "value": "error", + "loc": { + "start": { + "line": 20, + "column": 9 + }, + "end": { + "line": 20, + "column": 14 + } + }, + "range": [ + 311, + 316 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 20, + "column": 14 + }, + "end": { + "line": 20, + "column": 15 + } + }, + "range": [ + 316, + 317 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 20, + "column": 16 + }, + "end": { + "line": 20, + "column": 17 + } + }, + "range": [ + 318, + 319 + ] + }, + { + "type": "Identifier", + "value": "caught", + "loc": { + "start": { + "line": 21, + "column": 2 + }, + "end": { + "line": 21, + "column": 8 + } + }, + "range": [ + 322, + 328 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 21, + "column": 9 + }, + "end": { + "line": 21, + "column": 10 + } + }, + "range": [ + 329, + 330 + ] + }, + { + "type": "Identifier", + "value": "error", + "loc": { + "start": { + "line": 21, + "column": 11 + }, + "end": { + "line": 21, + "column": 16 + } + }, + "range": [ + 331, + 336 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 21, + "column": 16 + }, + "end": { + "line": 21, + "column": 17 + } + }, + "range": [ + 336, + 337 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 22, + "column": 0 + }, + "end": { + "line": 22, + "column": 1 + } + }, + "range": [ + 338, + 339 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 24, + "column": 0 + }, + "end": { + "line": 24, + "column": 6 + } + }, + "range": [ + 341, + 347 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 24, + "column": 6 + }, + "end": { + "line": 24, + "column": 7 + } + }, + "range": [ + 347, + 348 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 24, + "column": 7 + }, + "end": { + "line": 24, + "column": 16 + } + }, + "range": [ + 348, + 357 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 24, + "column": 16 + }, + "end": { + "line": 24, + "column": 17 + } + }, + "range": [ + 357, + 358 + ] + }, + { + "type": "Identifier", + "value": "caught", + "loc": { + "start": { + "line": 24, + "column": 17 + }, + "end": { + "line": 24, + "column": 23 + } + }, + "range": [ + 358, + 364 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 24, + "column": 23 + }, + "end": { + "line": 24, + "column": 24 + } + }, + "range": [ + 364, + 365 + ] + }, + { + "type": "Identifier", + "value": "thrown", + "loc": { + "start": { + "line": 24, + "column": 25 + }, + "end": { + "line": 24, + "column": 31 + } + }, + "range": [ + 366, + 372 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 24, + "column": 31 + }, + "end": { + "line": 24, + "column": 32 + } + }, + "range": [ + 372, + 373 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 24, + "column": 32 + }, + "end": { + "line": 24, + "column": 33 + } + }, + "range": [ + 373, + 374 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 25, + "column": 0 + }, + "end": { + "line": 25, + "column": 6 + } + }, + "range": [ + 375, + 381 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 25, + "column": 6 + }, + "end": { + "line": 25, + "column": 7 + } + }, + "range": [ + 381, + 382 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 25, + "column": 7 + }, + "end": { + "line": 25, + "column": 16 + } + }, + "range": [ + 382, + 391 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 25, + "column": 16 + }, + "end": { + "line": 25, + "column": 17 + } + }, + "range": [ + 391, + 392 + ] + }, + { + "type": "Identifier", + "value": "sameBlock", + "loc": { + "start": { + "line": 25, + "column": 17 + }, + "end": { + "line": 25, + "column": 26 + } + }, + "range": [ + 392, + 401 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 25, + "column": 26 + }, + "end": { + "line": 25, + "column": 27 + } + }, + "range": [ + 401, + 402 + ] + }, + { + "type": "Boolean", + "value": "false", + "loc": { + "start": { + "line": 25, + "column": 28 + }, + "end": { + "line": 25, + "column": 33 + } + }, + "range": [ + 403, + 408 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 25, + "column": 33 + }, + "end": { + "line": 25, + "column": 34 + } + }, + "range": [ + 408, + 409 + ] + }, + { + "type": "String", + "value": "'same block'", + "loc": { + "start": { + "line": 25, + "column": 35 + }, + "end": { + "line": 25, + "column": 47 + } + }, + "range": [ + 410, + 422 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 25, + "column": 47 + }, + "end": { + "line": 25, + "column": 48 + } + }, + "range": [ + 422, + 423 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 25, + "column": 48 + }, + "end": { + "line": 25, + "column": 49 + } + }, + "range": [ + 423, + 424 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 26, + "column": 0 + }, + "end": { + "line": 26, + "column": 6 + } + }, + "range": [ + 425, + 431 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 26, + "column": 6 + }, + "end": { + "line": 26, + "column": 7 + } + }, + "range": [ + 431, + 432 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 26, + "column": 7 + }, + "end": { + "line": 26, + "column": 16 + } + }, + "range": [ + 432, + 441 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 26, + "column": 16 + }, + "end": { + "line": 26, + "column": 17 + } + }, + "range": [ + 441, + 442 + ] + }, + { + "type": "Identifier", + "value": "subsequentField", + "loc": { + "start": { + "line": 26, + "column": 17 + }, + "end": { + "line": 26, + "column": 32 + } + }, + "range": [ + 442, + 457 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 26, + "column": 32 + }, + "end": { + "line": 26, + "column": 33 + } + }, + "range": [ + 457, + 458 + ] + }, + { + "type": "Boolean", + "value": "false", + "loc": { + "start": { + "line": 26, + "column": 34 + }, + "end": { + "line": 26, + "column": 39 + } + }, + "range": [ + 459, + 464 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 26, + "column": 39 + }, + "end": { + "line": 26, + "column": 40 + } + }, + "range": [ + 464, + 465 + ] + }, + { + "type": "String", + "value": "'subsequent field'", + "loc": { + "start": { + "line": 26, + "column": 41 + }, + "end": { + "line": 26, + "column": 59 + } + }, + "range": [ + 466, + 484 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 26, + "column": 59 + }, + "end": { + "line": 26, + "column": 60 + } + }, + "range": [ + 484, + 485 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 26, + "column": 60 + }, + "end": { + "line": 26, + "column": 61 + } + }, + "range": [ + 485, + 486 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 27, + "column": 0 + }, + "end": { + "line": 27, + "column": 6 + } + }, + "range": [ + 487, + 493 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 27, + "column": 6 + }, + "end": { + "line": 27, + "column": 7 + } + }, + "range": [ + 493, + 494 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 27, + "column": 7 + }, + "end": { + "line": 27, + "column": 16 + } + }, + "range": [ + 494, + 503 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 27, + "column": 16 + }, + "end": { + "line": 27, + "column": 17 + } + }, + "range": [ + 503, + 504 + ] + }, + { + "type": "Identifier", + "value": "subsequentBlock", + "loc": { + "start": { + "line": 27, + "column": 17 + }, + "end": { + "line": 27, + "column": 32 + } + }, + "range": [ + 504, + 519 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 27, + "column": 32 + }, + "end": { + "line": 27, + "column": 33 + } + }, + "range": [ + 519, + 520 + ] + }, + { + "type": "Boolean", + "value": "false", + "loc": { + "start": { + "line": 27, + "column": 34 + }, + "end": { + "line": 27, + "column": 39 + } + }, + "range": [ + 521, + 526 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 27, + "column": 39 + }, + "end": { + "line": 27, + "column": 40 + } + }, + "range": [ + 526, + 527 + ] + }, + { + "type": "String", + "value": "'subsequent block'", + "loc": { + "start": { + "line": 27, + "column": 41 + }, + "end": { + "line": 27, + "column": 59 + } + }, + "range": [ + 528, + 546 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 27, + "column": 59 + }, + "end": { + "line": 27, + "column": 60 + } + }, + "range": [ + 546, + 547 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 27, + "column": 60 + }, + "end": { + "line": 27, + "column": 61 + } + }, + "range": [ + 547, + 548 + ] + } + ] +}; \ 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..e2fe1c8b --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-abrupt.src.js @@ -0,0 +1,27 @@ + + +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..744b44fd --- /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": 3, + "column": 0 + }, + "end": { + "line": 28, + "column": 68 + } + }, + "range": [ + 2, + 775 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "range": [ + 2, + 18 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "range": [ + 6, + 8 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "range": [ + 6, + 8 + ], + "name": "fn" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "range": [ + 10, + 17 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "range": [ + 10, + 17 + ], + "name": "fnParam" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 18 + } + }, + "range": [ + 19, + 37 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 23, + 26 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 23, + 26 + ], + "name": "gen" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 17 + } + }, + "range": [ + 28, + 36 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 17 + } + }, + "range": [ + 28, + 36 + ], + "name": "genParam" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 26 + } + }, + "range": [ + 38, + 64 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 11 + } + }, + "range": [ + 42, + 49 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 11 + } + }, + "range": [ + 42, + 49 + ], + "name": "asyncFn" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 25 + } + }, + "range": [ + 51, + 63 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 25 + } + }, + "range": [ + 51, + 63 + ], + "name": "asyncFnParam" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 21, + "column": 1 + } + }, + "range": [ + 66, + 412 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 7 + } + }, + "range": [ + 72, + 73 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 21, + "column": 1 + } + }, + "range": [ + 74, + 412 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 20, + "column": 3 + } + }, + "range": [ + 78, + 410 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 11, + "column": 19 + } + }, + "range": [ + 91, + 177 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 11, + "column": 18 + } + }, + "range": [ + 91, + 176 + ], + "callee": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 9, + "column": 5 + }, + "end": { + "line": 11, + "column": 5 + } + }, + "range": [ + 92, + 163 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [ + { + "type": "ObjectPattern", + "loc": { + "start": { + "line": 9, + "column": 14 + }, + "end": { + "line": 9, + "column": 45 + } + }, + "range": [ + 101, + 132 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 9, + "column": 15 + }, + "end": { + "line": 9, + "column": 44 + } + }, + "range": [ + 102, + 131 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 15 + }, + "end": { + "line": 9, + "column": 22 + } + }, + "range": [ + 102, + 109 + ], + "name": "test262" + }, + "kind": "init", + "value": { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 9, + "column": 15 + }, + "end": { + "line": 9, + "column": 44 + } + }, + "range": [ + 102, + 131 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 15 + }, + "end": { + "line": 9, + "column": 22 + } + }, + "range": [ + 102, + 109 + ], + "name": "test262" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 9, + "column": 25 + }, + "end": { + "line": 9, + "column": 44 + } + }, + "range": [ + 112, + 131 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 25 + }, + "end": { + "line": 9, + "column": 32 + } + }, + "range": [ + 112, + 119 + ], + "name": "fnParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 35 + }, + "end": { + "line": 9, + "column": 44 + } + }, + "range": [ + 122, + 131 + ], + "name": "arguments" + } + } + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 9, + "column": 47 + }, + "end": { + "line": 11, + "column": 5 + } + }, + "range": [ + 134, + 163 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 21 + } + }, + "range": [ + 142, + 157 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 20 + } + }, + "range": [ + 142, + 156 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 8 + } + }, + "range": [ + 142, + 144 + ], + "name": "fn" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 11 + }, + "end": { + "line": 10, + "column": 20 + } + }, + "range": [ + 147, + 156 + ], + "name": "arguments" + } + } + } + ] + } + }, + "arguments": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 11, + "column": 7 + }, + "end": { + "line": 11, + "column": 17 + } + }, + "range": [ + 165, + 175 + ], + "value": "function", + "raw": "'function'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 15, + "column": 36 + } + }, + "range": [ + 183, + 291 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 15, + "column": 35 + } + }, + "range": [ + 183, + 290 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 15, + "column": 33 + } + }, + "range": [ + 183, + 288 + ], + "object": { + "type": "CallExpression", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 15, + "column": 28 + } + }, + "range": [ + 183, + 283 + ], + "callee": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 13, + "column": 5 + }, + "end": { + "line": 15, + "column": 5 + } + }, + "range": [ + 184, + 260 + ], + "id": null, + "expression": false, + "generator": true, + "async": false, + "params": [ + { + "type": "ObjectPattern", + "loc": { + "start": { + "line": 13, + "column": 17 + }, + "end": { + "line": 13, + "column": 49 + } + }, + "range": [ + 196, + 228 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 13, + "column": 18 + }, + "end": { + "line": 13, + "column": 48 + } + }, + "range": [ + 197, + 227 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 18 + }, + "end": { + "line": 13, + "column": 25 + } + }, + "range": [ + 197, + 204 + ], + "name": "test262" + }, + "kind": "init", + "value": { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 13, + "column": 18 + }, + "end": { + "line": 13, + "column": 48 + } + }, + "range": [ + 197, + 227 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 18 + }, + "end": { + "line": 13, + "column": 25 + } + }, + "range": [ + 197, + 204 + ], + "name": "test262" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 13, + "column": 28 + }, + "end": { + "line": 13, + "column": 48 + } + }, + "range": [ + 207, + 227 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 28 + }, + "end": { + "line": 13, + "column": 36 + } + }, + "range": [ + 207, + 215 + ], + "name": "genParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 39 + }, + "end": { + "line": 13, + "column": 48 + } + }, + "range": [ + 218, + 227 + ], + "name": "arguments" + } + } + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 13, + "column": 51 + }, + "end": { + "line": 15, + "column": 5 + } + }, + "range": [ + 230, + 260 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 22 + } + }, + "range": [ + 238, + 254 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 21 + } + }, + "range": [ + 238, + 253 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 9 + } + }, + "range": [ + 238, + 241 + ], + "name": "gen" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 12 + }, + "end": { + "line": 14, + "column": 21 + } + }, + "range": [ + 244, + 253 + ], + "name": "arguments" + } + } + } + ] + } + }, + "arguments": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 15, + "column": 7 + }, + "end": { + "line": 15, + "column": 27 + } + }, + "range": [ + 262, + 282 + ], + "value": "generator function", + "raw": "'generator function'" + } + ], + "optional": false + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 29 + }, + "end": { + "line": 15, + "column": 33 + } + }, + "range": [ + 284, + 288 + ], + "name": "next" + }, + "computed": false, + "optional": false + }, + "arguments": [], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 17, + "column": 4 + }, + "end": { + "line": 19, + "column": 25 + } + }, + "range": [ + 297, + 406 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 17, + "column": 4 + }, + "end": { + "line": 19, + "column": 24 + } + }, + "range": [ + 297, + 405 + ], + "callee": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 17, + "column": 5 + }, + "end": { + "line": 19, + "column": 5 + } + }, + "range": [ + 298, + 386 + ], + "id": null, + "expression": false, + "generator": false, + "async": true, + "params": [ + { + "type": "ObjectPattern", + "loc": { + "start": { + "line": 17, + "column": 21 + }, + "end": { + "line": 17, + "column": 57 + } + }, + "range": [ + 314, + 350 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 17, + "column": 22 + }, + "end": { + "line": 17, + "column": 56 + } + }, + "range": [ + 315, + 349 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 22 + }, + "end": { + "line": 17, + "column": 29 + } + }, + "range": [ + 315, + 322 + ], + "name": "test262" + }, + "kind": "init", + "value": { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 17, + "column": 22 + }, + "end": { + "line": 17, + "column": 56 + } + }, + "range": [ + 315, + 349 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 22 + }, + "end": { + "line": 17, + "column": 29 + } + }, + "range": [ + 315, + 322 + ], + "name": "test262" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 17, + "column": 32 + }, + "end": { + "line": 17, + "column": 56 + } + }, + "range": [ + 325, + 349 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 32 + }, + "end": { + "line": 17, + "column": 44 + } + }, + "range": [ + 325, + 337 + ], + "name": "asyncFnParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 47 + }, + "end": { + "line": 17, + "column": 56 + } + }, + "range": [ + 340, + 349 + ], + "name": "arguments" + } + } + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 17, + "column": 59 + }, + "end": { + "line": 19, + "column": 5 + } + }, + "range": [ + 352, + 386 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 18, + "column": 6 + }, + "end": { + "line": 18, + "column": 26 + } + }, + "range": [ + 360, + 380 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 18, + "column": 6 + }, + "end": { + "line": 18, + "column": 25 + } + }, + "range": [ + 360, + 379 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 6 + }, + "end": { + "line": 18, + "column": 13 + } + }, + "range": [ + 360, + 367 + ], + "name": "asyncFn" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 16 + }, + "end": { + "line": 18, + "column": 25 + } + }, + "range": [ + 370, + 379 + ], + "name": "arguments" + } + } + } + ] + } + }, + "arguments": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 19, + "column": 7 + }, + "end": { + "line": 19, + "column": 23 + } + }, + "range": [ + 388, + 404 + ], + "value": "async function", + "raw": "'async function'" + } + ], + "optional": false + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 23, + "column": 0 + }, + "end": { + "line": 23, + "column": 47 + } + }, + "range": [ + 414, + 461 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 23, + "column": 0 + }, + "end": { + "line": 23, + "column": 46 + } + }, + "range": [ + 414, + 460 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 23, + "column": 0 + }, + "end": { + "line": 23, + "column": 6 + } + }, + "range": [ + 414, + 420 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 23, + "column": 7 + }, + "end": { + "line": 23, + "column": 37 + } + }, + "range": [ + 421, + 451 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 23, + "column": 7 + }, + "end": { + "line": 23, + "column": 19 + } + }, + "range": [ + 421, + 433 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 23, + "column": 20 + }, + "end": { + "line": 23, + "column": 32 + } + }, + "range": [ + 434, + 446 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 23, + "column": 21 + }, + "end": { + "line": 23, + "column": 31 + } + }, + "range": [ + 435, + 445 + ], + "value": "function", + "raw": "'function'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 23, + "column": 34 + }, + "end": { + "line": 23, + "column": 36 + } + }, + "range": [ + 448, + 450 + ], + "name": "fn" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 23, + "column": 39 + }, + "end": { + "line": 23, + "column": 45 + } + }, + "range": [ + 453, + 459 + ], + "value": "body", + "raw": "'body'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 24, + "column": 0 + }, + "end": { + "line": 24, + "column": 57 + } + }, + "range": [ + 462, + 519 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 24, + "column": 0 + }, + "end": { + "line": 24, + "column": 56 + } + }, + "range": [ + 462, + 518 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 24, + "column": 0 + }, + "end": { + "line": 24, + "column": 6 + } + }, + "range": [ + 462, + 468 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 24, + "column": 7 + }, + "end": { + "line": 24, + "column": 42 + } + }, + "range": [ + 469, + 504 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 24, + "column": 7 + }, + "end": { + "line": 24, + "column": 19 + } + }, + "range": [ + 469, + 481 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 24, + "column": 20 + }, + "end": { + "line": 24, + "column": 32 + } + }, + "range": [ + 482, + 494 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 24, + "column": 21 + }, + "end": { + "line": 24, + "column": 31 + } + }, + "range": [ + 483, + 493 + ], + "value": "function", + "raw": "'function'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 24, + "column": 34 + }, + "end": { + "line": 24, + "column": 41 + } + }, + "range": [ + 496, + 503 + ], + "name": "fnParam" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 24, + "column": 44 + }, + "end": { + "line": 24, + "column": 55 + } + }, + "range": [ + 506, + 517 + ], + "value": "parameter", + "raw": "'parameter'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 25, + "column": 0 + }, + "end": { + "line": 25, + "column": 58 + } + }, + "range": [ + 520, + 578 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 25, + "column": 0 + }, + "end": { + "line": 25, + "column": 57 + } + }, + "range": [ + 520, + 577 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 25, + "column": 0 + }, + "end": { + "line": 25, + "column": 6 + } + }, + "range": [ + 520, + 526 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 25, + "column": 7 + }, + "end": { + "line": 25, + "column": 48 + } + }, + "range": [ + 527, + 568 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 25, + "column": 7 + }, + "end": { + "line": 25, + "column": 19 + } + }, + "range": [ + 527, + 539 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 25, + "column": 20 + }, + "end": { + "line": 25, + "column": 42 + } + }, + "range": [ + 540, + 562 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 25, + "column": 21 + }, + "end": { + "line": 25, + "column": 41 + } + }, + "range": [ + 541, + 561 + ], + "value": "generator function", + "raw": "'generator function'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 25, + "column": 44 + }, + "end": { + "line": 25, + "column": 47 + } + }, + "range": [ + 564, + 567 + ], + "name": "gen" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 25, + "column": 50 + }, + "end": { + "line": 25, + "column": 56 + } + }, + "range": [ + 570, + 576 + ], + "value": "body", + "raw": "'body'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 26, + "column": 0 + }, + "end": { + "line": 26, + "column": 68 + } + }, + "range": [ + 579, + 647 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 26, + "column": 0 + }, + "end": { + "line": 26, + "column": 67 + } + }, + "range": [ + 579, + 646 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 26, + "column": 0 + }, + "end": { + "line": 26, + "column": 6 + } + }, + "range": [ + 579, + 585 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 26, + "column": 7 + }, + "end": { + "line": 26, + "column": 53 + } + }, + "range": [ + 586, + 632 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 26, + "column": 7 + }, + "end": { + "line": 26, + "column": 19 + } + }, + "range": [ + 586, + 598 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 26, + "column": 20 + }, + "end": { + "line": 26, + "column": 42 + } + }, + "range": [ + 599, + 621 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 26, + "column": 21 + }, + "end": { + "line": 26, + "column": 41 + } + }, + "range": [ + 600, + 620 + ], + "value": "generator function", + "raw": "'generator function'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 26, + "column": 44 + }, + "end": { + "line": 26, + "column": 52 + } + }, + "range": [ + 623, + 631 + ], + "name": "genParam" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 26, + "column": 55 + }, + "end": { + "line": 26, + "column": 66 + } + }, + "range": [ + 634, + 645 + ], + "value": "parameter", + "raw": "'parameter'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 27, + "column": 0 + }, + "end": { + "line": 27, + "column": 58 + } + }, + "range": [ + 648, + 706 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 27, + "column": 0 + }, + "end": { + "line": 27, + "column": 57 + } + }, + "range": [ + 648, + 705 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 27, + "column": 0 + }, + "end": { + "line": 27, + "column": 6 + } + }, + "range": [ + 648, + 654 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 27, + "column": 7 + }, + "end": { + "line": 27, + "column": 48 + } + }, + "range": [ + 655, + 696 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 27, + "column": 7 + }, + "end": { + "line": 27, + "column": 19 + } + }, + "range": [ + 655, + 667 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 27, + "column": 20 + }, + "end": { + "line": 27, + "column": 38 + } + }, + "range": [ + 668, + 686 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 27, + "column": 21 + }, + "end": { + "line": 27, + "column": 37 + } + }, + "range": [ + 669, + 685 + ], + "value": "async function", + "raw": "'async function'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 27, + "column": 40 + }, + "end": { + "line": 27, + "column": 47 + } + }, + "range": [ + 688, + 695 + ], + "name": "asyncFn" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 27, + "column": 50 + }, + "end": { + "line": 27, + "column": 56 + } + }, + "range": [ + 698, + 704 + ], + "value": "body", + "raw": "'body'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 28, + "column": 0 + }, + "end": { + "line": 28, + "column": 68 + } + }, + "range": [ + 707, + 775 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 28, + "column": 0 + }, + "end": { + "line": 28, + "column": 67 + } + }, + "range": [ + 707, + 774 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 28, + "column": 0 + }, + "end": { + "line": 28, + "column": 6 + } + }, + "range": [ + 707, + 713 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 28, + "column": 7 + }, + "end": { + "line": 28, + "column": 53 + } + }, + "range": [ + 714, + 760 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 28, + "column": 7 + }, + "end": { + "line": 28, + "column": 19 + } + }, + "range": [ + 714, + 726 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 28, + "column": 20 + }, + "end": { + "line": 28, + "column": 38 + } + }, + "range": [ + 727, + 745 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 28, + "column": 21 + }, + "end": { + "line": 28, + "column": 37 + } + }, + "range": [ + 728, + 744 + ], + "value": "async function", + "raw": "'async function'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 28, + "column": 40 + }, + "end": { + "line": 28, + "column": 52 + } + }, + "range": [ + 747, + 759 + ], + "name": "asyncFnParam" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 28, + "column": 55 + }, + "end": { + "line": 28, + "column": 66 + } + }, + "range": [ + 762, + 773 + ], + "value": "parameter", + "raw": "'parameter'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "range": [ + 2, + 5 + ] + }, + { + "type": "Identifier", + "value": "fn", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "range": [ + 6, + 8 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 8, + 9 + ] + }, + { + "type": "Identifier", + "value": "fnParam", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "range": [ + 10, + 17 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "range": [ + 17, + 18 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 19, + 22 + ] + }, + { + "type": "Identifier", + "value": "gen", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 23, + 26 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 4, + "column": 7 + }, + "end": { + "line": 4, + "column": 8 + } + }, + "range": [ + 26, + 27 + ] + }, + { + "type": "Identifier", + "value": "genParam", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 17 + } + }, + "range": [ + 28, + 36 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 17 + }, + "end": { + "line": 4, + "column": 18 + } + }, + "range": [ + 36, + 37 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 38, + 41 + ] + }, + { + "type": "Identifier", + "value": "asyncFn", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 11 + } + }, + "range": [ + 42, + 49 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 5, + "column": 11 + }, + "end": { + "line": 5, + "column": 12 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Identifier", + "value": "asyncFnParam", + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 25 + } + }, + "range": [ + 51, + 63 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 25 + }, + "end": { + "line": 5, + "column": 26 + } + }, + "range": [ + 63, + 64 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "range": [ + 66, + 71 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 7 + } + }, + "range": [ + 72, + 73 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 7, + "column": 9 + } + }, + "range": [ + 74, + 75 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 8 + } + }, + "range": [ + 78, + 84 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 8, + "column": 10 + } + }, + "range": [ + 85, + 86 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 5 + } + }, + "range": [ + 91, + 92 + ] + }, + { + "type": "Keyword", + "value": "function", + "loc": { + "start": { + "line": 9, + "column": 5 + }, + "end": { + "line": 9, + "column": 13 + } + }, + "range": [ + 92, + 100 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 9, + "column": 13 + }, + "end": { + "line": 9, + "column": 14 + } + }, + "range": [ + 100, + 101 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 9, + "column": 14 + }, + "end": { + "line": 9, + "column": 15 + } + }, + "range": [ + 101, + 102 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 9, + "column": 15 + }, + "end": { + "line": 9, + "column": 22 + } + }, + "range": [ + 102, + 109 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 9, + "column": 23 + }, + "end": { + "line": 9, + "column": 24 + } + }, + "range": [ + 110, + 111 + ] + }, + { + "type": "Identifier", + "value": "fnParam", + "loc": { + "start": { + "line": 9, + "column": 25 + }, + "end": { + "line": 9, + "column": 32 + } + }, + "range": [ + 112, + 119 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 9, + "column": 33 + }, + "end": { + "line": 9, + "column": 34 + } + }, + "range": [ + 120, + 121 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 9, + "column": 35 + }, + "end": { + "line": 9, + "column": 44 + } + }, + "range": [ + 122, + 131 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 9, + "column": 44 + }, + "end": { + "line": 9, + "column": 45 + } + }, + "range": [ + 131, + 132 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 9, + "column": 45 + }, + "end": { + "line": 9, + "column": 46 + } + }, + "range": [ + 132, + 133 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 9, + "column": 47 + }, + "end": { + "line": 9, + "column": 48 + } + }, + "range": [ + 134, + 135 + ] + }, + { + "type": "Identifier", + "value": "fn", + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 8 + } + }, + "range": [ + 142, + 144 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 10 + } + }, + "range": [ + 145, + 146 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 10, + "column": 11 + }, + "end": { + "line": 10, + "column": 20 + } + }, + "range": [ + 147, + 156 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 10, + "column": 20 + }, + "end": { + "line": 10, + "column": 21 + } + }, + "range": [ + 156, + 157 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 11, + "column": 4 + }, + "end": { + "line": 11, + "column": 5 + } + }, + "range": [ + 162, + 163 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 11, + "column": 5 + }, + "end": { + "line": 11, + "column": 6 + } + }, + "range": [ + 163, + 164 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 7 + } + }, + "range": [ + 164, + 165 + ] + }, + { + "type": "String", + "value": "'function'", + "loc": { + "start": { + "line": 11, + "column": 7 + }, + "end": { + "line": 11, + "column": 17 + } + }, + "range": [ + 165, + 175 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 11, + "column": 17 + }, + "end": { + "line": 11, + "column": 18 + } + }, + "range": [ + 175, + 176 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 11, + "column": 18 + }, + "end": { + "line": 11, + "column": 19 + } + }, + "range": [ + 176, + 177 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 5 + } + }, + "range": [ + 183, + 184 + ] + }, + { + "type": "Keyword", + "value": "function", + "loc": { + "start": { + "line": 13, + "column": 5 + }, + "end": { + "line": 13, + "column": 13 + } + }, + "range": [ + 184, + 192 + ] + }, + { + "type": "Punctuator", + "value": "*", + "loc": { + "start": { + "line": 13, + "column": 14 + }, + "end": { + "line": 13, + "column": 15 + } + }, + "range": [ + 193, + 194 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 13, + "column": 16 + }, + "end": { + "line": 13, + "column": 17 + } + }, + "range": [ + 195, + 196 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 13, + "column": 17 + }, + "end": { + "line": 13, + "column": 18 + } + }, + "range": [ + 196, + 197 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 13, + "column": 18 + }, + "end": { + "line": 13, + "column": 25 + } + }, + "range": [ + 197, + 204 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 13, + "column": 26 + }, + "end": { + "line": 13, + "column": 27 + } + }, + "range": [ + 205, + 206 + ] + }, + { + "type": "Identifier", + "value": "genParam", + "loc": { + "start": { + "line": 13, + "column": 28 + }, + "end": { + "line": 13, + "column": 36 + } + }, + "range": [ + 207, + 215 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 13, + "column": 37 + }, + "end": { + "line": 13, + "column": 38 + } + }, + "range": [ + 216, + 217 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 13, + "column": 39 + }, + "end": { + "line": 13, + "column": 48 + } + }, + "range": [ + 218, + 227 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 13, + "column": 48 + }, + "end": { + "line": 13, + "column": 49 + } + }, + "range": [ + 227, + 228 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 13, + "column": 49 + }, + "end": { + "line": 13, + "column": 50 + } + }, + "range": [ + 228, + 229 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 13, + "column": 51 + }, + "end": { + "line": 13, + "column": 52 + } + }, + "range": [ + 230, + 231 + ] + }, + { + "type": "Identifier", + "value": "gen", + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 9 + } + }, + "range": [ + 238, + 241 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 14, + "column": 10 + }, + "end": { + "line": 14, + "column": 11 + } + }, + "range": [ + 242, + 243 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 14, + "column": 12 + }, + "end": { + "line": 14, + "column": 21 + } + }, + "range": [ + 244, + 253 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 14, + "column": 21 + }, + "end": { + "line": 14, + "column": 22 + } + }, + "range": [ + 253, + 254 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 15, + "column": 4 + }, + "end": { + "line": 15, + "column": 5 + } + }, + "range": [ + 259, + 260 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 15, + "column": 5 + }, + "end": { + "line": 15, + "column": 6 + } + }, + "range": [ + 260, + 261 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 15, + "column": 7 + } + }, + "range": [ + 261, + 262 + ] + }, + { + "type": "String", + "value": "'generator function'", + "loc": { + "start": { + "line": 15, + "column": 7 + }, + "end": { + "line": 15, + "column": 27 + } + }, + "range": [ + 262, + 282 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 15, + "column": 27 + }, + "end": { + "line": 15, + "column": 28 + } + }, + "range": [ + 282, + 283 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 15, + "column": 28 + }, + "end": { + "line": 15, + "column": 29 + } + }, + "range": [ + 283, + 284 + ] + }, + { + "type": "Identifier", + "value": "next", + "loc": { + "start": { + "line": 15, + "column": 29 + }, + "end": { + "line": 15, + "column": 33 + } + }, + "range": [ + 284, + 288 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 15, + "column": 33 + }, + "end": { + "line": 15, + "column": 34 + } + }, + "range": [ + 288, + 289 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 15, + "column": 34 + }, + "end": { + "line": 15, + "column": 35 + } + }, + "range": [ + 289, + 290 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 15, + "column": 35 + }, + "end": { + "line": 15, + "column": 36 + } + }, + "range": [ + 290, + 291 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 17, + "column": 4 + }, + "end": { + "line": 17, + "column": 5 + } + }, + "range": [ + 297, + 298 + ] + }, + { + "type": "Identifier", + "value": "async", + "loc": { + "start": { + "line": 17, + "column": 5 + }, + "end": { + "line": 17, + "column": 10 + } + }, + "range": [ + 298, + 303 + ] + }, + { + "type": "Keyword", + "value": "function", + "loc": { + "start": { + "line": 17, + "column": 11 + }, + "end": { + "line": 17, + "column": 19 + } + }, + "range": [ + 304, + 312 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 17, + "column": 20 + }, + "end": { + "line": 17, + "column": 21 + } + }, + "range": [ + 313, + 314 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 17, + "column": 21 + }, + "end": { + "line": 17, + "column": 22 + } + }, + "range": [ + 314, + 315 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 17, + "column": 22 + }, + "end": { + "line": 17, + "column": 29 + } + }, + "range": [ + 315, + 322 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 17, + "column": 30 + }, + "end": { + "line": 17, + "column": 31 + } + }, + "range": [ + 323, + 324 + ] + }, + { + "type": "Identifier", + "value": "asyncFnParam", + "loc": { + "start": { + "line": 17, + "column": 32 + }, + "end": { + "line": 17, + "column": 44 + } + }, + "range": [ + 325, + 337 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 17, + "column": 45 + }, + "end": { + "line": 17, + "column": 46 + } + }, + "range": [ + 338, + 339 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 17, + "column": 47 + }, + "end": { + "line": 17, + "column": 56 + } + }, + "range": [ + 340, + 349 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 17, + "column": 56 + }, + "end": { + "line": 17, + "column": 57 + } + }, + "range": [ + 349, + 350 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 17, + "column": 57 + }, + "end": { + "line": 17, + "column": 58 + } + }, + "range": [ + 350, + 351 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 17, + "column": 59 + }, + "end": { + "line": 17, + "column": 60 + } + }, + "range": [ + 352, + 353 + ] + }, + { + "type": "Identifier", + "value": "asyncFn", + "loc": { + "start": { + "line": 18, + "column": 6 + }, + "end": { + "line": 18, + "column": 13 + } + }, + "range": [ + 360, + 367 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 18, + "column": 14 + }, + "end": { + "line": 18, + "column": 15 + } + }, + "range": [ + 368, + 369 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 18, + "column": 16 + }, + "end": { + "line": 18, + "column": 25 + } + }, + "range": [ + 370, + 379 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 18, + "column": 25 + }, + "end": { + "line": 18, + "column": 26 + } + }, + "range": [ + 379, + 380 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 19, + "column": 4 + }, + "end": { + "line": 19, + "column": 5 + } + }, + "range": [ + 385, + 386 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 19, + "column": 5 + }, + "end": { + "line": 19, + "column": 6 + } + }, + "range": [ + 386, + 387 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 19, + "column": 6 + }, + "end": { + "line": 19, + "column": 7 + } + }, + "range": [ + 387, + 388 + ] + }, + { + "type": "String", + "value": "'async function'", + "loc": { + "start": { + "line": 19, + "column": 7 + }, + "end": { + "line": 19, + "column": 23 + } + }, + "range": [ + 388, + 404 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 19, + "column": 23 + }, + "end": { + "line": 19, + "column": 24 + } + }, + "range": [ + 404, + 405 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 19, + "column": 24 + }, + "end": { + "line": 19, + "column": 25 + } + }, + "range": [ + 405, + 406 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 20, + "column": 2 + }, + "end": { + "line": 20, + "column": 3 + } + }, + "range": [ + 409, + 410 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 21, + "column": 0 + }, + "end": { + "line": 21, + "column": 1 + } + }, + "range": [ + 411, + 412 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 23, + "column": 0 + }, + "end": { + "line": 23, + "column": 6 + } + }, + "range": [ + 414, + 420 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 23, + "column": 6 + }, + "end": { + "line": 23, + "column": 7 + } + }, + "range": [ + 420, + 421 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 23, + "column": 7 + }, + "end": { + "line": 23, + "column": 19 + } + }, + "range": [ + 421, + 433 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 23, + "column": 19 + }, + "end": { + "line": 23, + "column": 20 + } + }, + "range": [ + 433, + 434 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 23, + "column": 20 + }, + "end": { + "line": 23, + "column": 21 + } + }, + "range": [ + 434, + 435 + ] + }, + { + "type": "String", + "value": "'function'", + "loc": { + "start": { + "line": 23, + "column": 21 + }, + "end": { + "line": 23, + "column": 31 + } + }, + "range": [ + 435, + 445 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 23, + "column": 31 + }, + "end": { + "line": 23, + "column": 32 + } + }, + "range": [ + 445, + 446 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 23, + "column": 32 + }, + "end": { + "line": 23, + "column": 33 + } + }, + "range": [ + 446, + 447 + ] + }, + { + "type": "Identifier", + "value": "fn", + "loc": { + "start": { + "line": 23, + "column": 34 + }, + "end": { + "line": 23, + "column": 36 + } + }, + "range": [ + 448, + 450 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 23, + "column": 36 + }, + "end": { + "line": 23, + "column": 37 + } + }, + "range": [ + 450, + 451 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 23, + "column": 37 + }, + "end": { + "line": 23, + "column": 38 + } + }, + "range": [ + 451, + 452 + ] + }, + { + "type": "String", + "value": "'body'", + "loc": { + "start": { + "line": 23, + "column": 39 + }, + "end": { + "line": 23, + "column": 45 + } + }, + "range": [ + 453, + 459 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 23, + "column": 45 + }, + "end": { + "line": 23, + "column": 46 + } + }, + "range": [ + 459, + 460 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 23, + "column": 46 + }, + "end": { + "line": 23, + "column": 47 + } + }, + "range": [ + 460, + 461 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 24, + "column": 0 + }, + "end": { + "line": 24, + "column": 6 + } + }, + "range": [ + 462, + 468 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 24, + "column": 6 + }, + "end": { + "line": 24, + "column": 7 + } + }, + "range": [ + 468, + 469 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 24, + "column": 7 + }, + "end": { + "line": 24, + "column": 19 + } + }, + "range": [ + 469, + 481 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 24, + "column": 19 + }, + "end": { + "line": 24, + "column": 20 + } + }, + "range": [ + 481, + 482 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 24, + "column": 20 + }, + "end": { + "line": 24, + "column": 21 + } + }, + "range": [ + 482, + 483 + ] + }, + { + "type": "String", + "value": "'function'", + "loc": { + "start": { + "line": 24, + "column": 21 + }, + "end": { + "line": 24, + "column": 31 + } + }, + "range": [ + 483, + 493 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 24, + "column": 31 + }, + "end": { + "line": 24, + "column": 32 + } + }, + "range": [ + 493, + 494 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 24, + "column": 32 + }, + "end": { + "line": 24, + "column": 33 + } + }, + "range": [ + 494, + 495 + ] + }, + { + "type": "Identifier", + "value": "fnParam", + "loc": { + "start": { + "line": 24, + "column": 34 + }, + "end": { + "line": 24, + "column": 41 + } + }, + "range": [ + 496, + 503 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 24, + "column": 41 + }, + "end": { + "line": 24, + "column": 42 + } + }, + "range": [ + 503, + 504 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 24, + "column": 42 + }, + "end": { + "line": 24, + "column": 43 + } + }, + "range": [ + 504, + 505 + ] + }, + { + "type": "String", + "value": "'parameter'", + "loc": { + "start": { + "line": 24, + "column": 44 + }, + "end": { + "line": 24, + "column": 55 + } + }, + "range": [ + 506, + 517 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 24, + "column": 55 + }, + "end": { + "line": 24, + "column": 56 + } + }, + "range": [ + 517, + 518 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 24, + "column": 56 + }, + "end": { + "line": 24, + "column": 57 + } + }, + "range": [ + 518, + 519 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 25, + "column": 0 + }, + "end": { + "line": 25, + "column": 6 + } + }, + "range": [ + 520, + 526 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 25, + "column": 6 + }, + "end": { + "line": 25, + "column": 7 + } + }, + "range": [ + 526, + 527 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 25, + "column": 7 + }, + "end": { + "line": 25, + "column": 19 + } + }, + "range": [ + 527, + 539 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 25, + "column": 19 + }, + "end": { + "line": 25, + "column": 20 + } + }, + "range": [ + 539, + 540 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 25, + "column": 20 + }, + "end": { + "line": 25, + "column": 21 + } + }, + "range": [ + 540, + 541 + ] + }, + { + "type": "String", + "value": "'generator function'", + "loc": { + "start": { + "line": 25, + "column": 21 + }, + "end": { + "line": 25, + "column": 41 + } + }, + "range": [ + 541, + 561 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 25, + "column": 41 + }, + "end": { + "line": 25, + "column": 42 + } + }, + "range": [ + 561, + 562 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 25, + "column": 42 + }, + "end": { + "line": 25, + "column": 43 + } + }, + "range": [ + 562, + 563 + ] + }, + { + "type": "Identifier", + "value": "gen", + "loc": { + "start": { + "line": 25, + "column": 44 + }, + "end": { + "line": 25, + "column": 47 + } + }, + "range": [ + 564, + 567 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 25, + "column": 47 + }, + "end": { + "line": 25, + "column": 48 + } + }, + "range": [ + 567, + 568 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 25, + "column": 48 + }, + "end": { + "line": 25, + "column": 49 + } + }, + "range": [ + 568, + 569 + ] + }, + { + "type": "String", + "value": "'body'", + "loc": { + "start": { + "line": 25, + "column": 50 + }, + "end": { + "line": 25, + "column": 56 + } + }, + "range": [ + 570, + 576 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 25, + "column": 56 + }, + "end": { + "line": 25, + "column": 57 + } + }, + "range": [ + 576, + 577 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 25, + "column": 57 + }, + "end": { + "line": 25, + "column": 58 + } + }, + "range": [ + 577, + 578 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 26, + "column": 0 + }, + "end": { + "line": 26, + "column": 6 + } + }, + "range": [ + 579, + 585 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 26, + "column": 6 + }, + "end": { + "line": 26, + "column": 7 + } + }, + "range": [ + 585, + 586 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 26, + "column": 7 + }, + "end": { + "line": 26, + "column": 19 + } + }, + "range": [ + 586, + 598 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 26, + "column": 19 + }, + "end": { + "line": 26, + "column": 20 + } + }, + "range": [ + 598, + 599 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 26, + "column": 20 + }, + "end": { + "line": 26, + "column": 21 + } + }, + "range": [ + 599, + 600 + ] + }, + { + "type": "String", + "value": "'generator function'", + "loc": { + "start": { + "line": 26, + "column": 21 + }, + "end": { + "line": 26, + "column": 41 + } + }, + "range": [ + 600, + 620 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 26, + "column": 41 + }, + "end": { + "line": 26, + "column": 42 + } + }, + "range": [ + 620, + 621 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 26, + "column": 42 + }, + "end": { + "line": 26, + "column": 43 + } + }, + "range": [ + 621, + 622 + ] + }, + { + "type": "Identifier", + "value": "genParam", + "loc": { + "start": { + "line": 26, + "column": 44 + }, + "end": { + "line": 26, + "column": 52 + } + }, + "range": [ + 623, + 631 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 26, + "column": 52 + }, + "end": { + "line": 26, + "column": 53 + } + }, + "range": [ + 631, + 632 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 26, + "column": 53 + }, + "end": { + "line": 26, + "column": 54 + } + }, + "range": [ + 632, + 633 + ] + }, + { + "type": "String", + "value": "'parameter'", + "loc": { + "start": { + "line": 26, + "column": 55 + }, + "end": { + "line": 26, + "column": 66 + } + }, + "range": [ + 634, + 645 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 26, + "column": 66 + }, + "end": { + "line": 26, + "column": 67 + } + }, + "range": [ + 645, + 646 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 26, + "column": 67 + }, + "end": { + "line": 26, + "column": 68 + } + }, + "range": [ + 646, + 647 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 27, + "column": 0 + }, + "end": { + "line": 27, + "column": 6 + } + }, + "range": [ + 648, + 654 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 27, + "column": 6 + }, + "end": { + "line": 27, + "column": 7 + } + }, + "range": [ + 654, + 655 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 27, + "column": 7 + }, + "end": { + "line": 27, + "column": 19 + } + }, + "range": [ + 655, + 667 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 27, + "column": 19 + }, + "end": { + "line": 27, + "column": 20 + } + }, + "range": [ + 667, + 668 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 27, + "column": 20 + }, + "end": { + "line": 27, + "column": 21 + } + }, + "range": [ + 668, + 669 + ] + }, + { + "type": "String", + "value": "'async function'", + "loc": { + "start": { + "line": 27, + "column": 21 + }, + "end": { + "line": 27, + "column": 37 + } + }, + "range": [ + 669, + 685 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 27, + "column": 37 + }, + "end": { + "line": 27, + "column": 38 + } + }, + "range": [ + 685, + 686 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 27, + "column": 38 + }, + "end": { + "line": 27, + "column": 39 + } + }, + "range": [ + 686, + 687 + ] + }, + { + "type": "Identifier", + "value": "asyncFn", + "loc": { + "start": { + "line": 27, + "column": 40 + }, + "end": { + "line": 27, + "column": 47 + } + }, + "range": [ + 688, + 695 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 27, + "column": 47 + }, + "end": { + "line": 27, + "column": 48 + } + }, + "range": [ + 695, + 696 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 27, + "column": 48 + }, + "end": { + "line": 27, + "column": 49 + } + }, + "range": [ + 696, + 697 + ] + }, + { + "type": "String", + "value": "'body'", + "loc": { + "start": { + "line": 27, + "column": 50 + }, + "end": { + "line": 27, + "column": 56 + } + }, + "range": [ + 698, + 704 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 27, + "column": 56 + }, + "end": { + "line": 27, + "column": 57 + } + }, + "range": [ + 704, + 705 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 27, + "column": 57 + }, + "end": { + "line": 27, + "column": 58 + } + }, + "range": [ + 705, + 706 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 28, + "column": 0 + }, + "end": { + "line": 28, + "column": 6 + } + }, + "range": [ + 707, + 713 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 28, + "column": 6 + }, + "end": { + "line": 28, + "column": 7 + } + }, + "range": [ + 713, + 714 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 28, + "column": 7 + }, + "end": { + "line": 28, + "column": 19 + } + }, + "range": [ + 714, + 726 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 28, + "column": 19 + }, + "end": { + "line": 28, + "column": 20 + } + }, + "range": [ + 726, + 727 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 28, + "column": 20 + }, + "end": { + "line": 28, + "column": 21 + } + }, + "range": [ + 727, + 728 + ] + }, + { + "type": "String", + "value": "'async function'", + "loc": { + "start": { + "line": 28, + "column": 21 + }, + "end": { + "line": 28, + "column": 37 + } + }, + "range": [ + 728, + 744 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 28, + "column": 37 + }, + "end": { + "line": 28, + "column": 38 + } + }, + "range": [ + 744, + 745 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 28, + "column": 38 + }, + "end": { + "line": 28, + "column": 39 + } + }, + "range": [ + 745, + 746 + ] + }, + { + "type": "Identifier", + "value": "asyncFnParam", + "loc": { + "start": { + "line": 28, + "column": 40 + }, + "end": { + "line": 28, + "column": 52 + } + }, + "range": [ + 747, + 759 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 28, + "column": 52 + }, + "end": { + "line": 28, + "column": 53 + } + }, + "range": [ + 759, + 760 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 28, + "column": 53 + }, + "end": { + "line": 28, + "column": 54 + } + }, + "range": [ + 760, + 761 + ] + }, + { + "type": "String", + "value": "'parameter'", + "loc": { + "start": { + "line": 28, + "column": 55 + }, + "end": { + "line": 28, + "column": 66 + } + }, + "range": [ + 762, + 773 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 28, + "column": 66 + }, + "end": { + "line": 28, + "column": 67 + } + }, + "range": [ + 773, + 774 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 28, + "column": 67 + }, + "end": { + "line": 28, + "column": 68 + } + }, + "range": [ + 774, + 775 + ] + } + ] +}; \ 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..6ffe67fa --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-arguments-functions.src.js @@ -0,0 +1,28 @@ + + +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..8e058bac --- /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": 3, + "column": 0 + }, + "end": { + "line": 46, + "column": 70 + } + }, + "range": [ + 2, + 1324 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 2, + 15 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 12 + } + }, + "range": [ + 6, + 14 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 12 + } + }, + "range": [ + 6, + 14 + ], + "name": "instance" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 24 + } + }, + "range": [ + 16, + 40 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 20, + 26 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 20, + 26 + ], + "name": "method" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 28, + 39 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 28, + 39 + ], + "name": "methodParam" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 11 + } + }, + "range": [ + 41, + 52 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 45, + 51 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 45, + 51 + ], + "name": "getter" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 24 + } + }, + "range": [ + 53, + 77 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 10 + } + }, + "range": [ + 57, + 63 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 10 + } + }, + "range": [ + 57, + 63 + ], + "name": "setter" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 6, + "column": 12 + }, + "end": { + "line": 6, + "column": 23 + } + }, + "range": [ + 65, + 76 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 12 + }, + "end": { + "line": 6, + "column": 23 + } + }, + "range": [ + 65, + 76 + ], + "name": "setterParam" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 30 + } + }, + "range": [ + 78, + 108 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 13 + } + }, + "range": [ + 82, + 91 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 13 + } + }, + "range": [ + 82, + 91 + ], + "name": "genMethod" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 7, + "column": 15 + }, + "end": { + "line": 7, + "column": 29 + } + }, + "range": [ + 93, + 107 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 15 + }, + "end": { + "line": 7, + "column": 29 + } + }, + "range": [ + 93, + 107 + ], + "name": "genMethodParam" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 34 + } + }, + "range": [ + 109, + 143 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 15 + } + }, + "range": [ + 113, + 124 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 15 + } + }, + "range": [ + 113, + 124 + ], + "name": "asyncMethod" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 8, + "column": 17 + }, + "end": { + "line": 8, + "column": 33 + } + }, + "range": [ + 126, + 142 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 17 + }, + "end": { + "line": 8, + "column": 33 + } + }, + "range": [ + 126, + 142 + ], + "name": "asyncMethodParam" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 10, + "column": 0 + }, + "end": { + "line": 30, + "column": 1 + } + }, + "range": [ + 145, + 643 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 7 + } + }, + "range": [ + 151, + 152 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 10, + "column": 8 + }, + "end": { + "line": 30, + "column": 1 + } + }, + "range": [ + 153, + 643 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 29, + "column": 3 + } + }, + "range": [ + 157, + 641 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 12, + "column": 4 + }, + "end": { + "line": 28, + "column": 8 + } + }, + "range": [ + 170, + 637 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 12, + "column": 4 + }, + "end": { + "line": 28, + "column": 7 + } + }, + "range": [ + 170, + 636 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 4 + }, + "end": { + "line": 12, + "column": 12 + } + }, + "range": [ + 170, + 178 + ], + "name": "instance" + }, + "right": { + "type": "NewExpression", + "loc": { + "start": { + "line": 12, + "column": 15 + }, + "end": { + "line": 28, + "column": 7 + } + }, + "range": [ + 181, + 636 + ], + "callee": { + "type": "ClassExpression", + "loc": { + "start": { + "line": 12, + "column": 19 + }, + "end": { + "line": 28, + "column": 5 + } + }, + "range": [ + 185, + 634 + ], + "id": null, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 12, + "column": 25 + }, + "end": { + "line": 28, + "column": 5 + } + }, + "range": [ + 191, + 634 + ], + "body": [ + { + "type": "MethodDefinition", + "loc": { + "start": { + "line": 13, + "column": 6 + }, + "end": { + "line": 15, + "column": 7 + } + }, + "range": [ + 199, + 280 + ], + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 6 + }, + "end": { + "line": 13, + "column": 12 + } + }, + "range": [ + 199, + 205 + ], + "name": "method" + }, + "kind": "method", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 15, + "column": 7 + } + }, + "range": [ + 205, + 280 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [ + { + "type": "ObjectPattern", + "loc": { + "start": { + "line": 13, + "column": 13 + }, + "end": { + "line": 13, + "column": 48 + } + }, + "range": [ + 206, + 241 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 13, + "column": 14 + }, + "end": { + "line": 13, + "column": 47 + } + }, + "range": [ + 207, + 240 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 14 + }, + "end": { + "line": 13, + "column": 21 + } + }, + "range": [ + 207, + 214 + ], + "name": "test262" + }, + "kind": "init", + "value": { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 13, + "column": 14 + }, + "end": { + "line": 13, + "column": 47 + } + }, + "range": [ + 207, + 240 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 14 + }, + "end": { + "line": 13, + "column": 21 + } + }, + "range": [ + 207, + 214 + ], + "name": "test262" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 13, + "column": 24 + }, + "end": { + "line": 13, + "column": 47 + } + }, + "range": [ + 217, + 240 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 24 + }, + "end": { + "line": 13, + "column": 35 + } + }, + "range": [ + 217, + 228 + ], + "name": "methodParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 38 + }, + "end": { + "line": 13, + "column": 47 + } + }, + "range": [ + 231, + 240 + ], + "name": "arguments" + } + } + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 13, + "column": 50 + }, + "end": { + "line": 15, + "column": 7 + } + }, + "range": [ + 243, + 280 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 14, + "column": 8 + }, + "end": { + "line": 14, + "column": 27 + } + }, + "range": [ + 253, + 272 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 14, + "column": 8 + }, + "end": { + "line": 14, + "column": 26 + } + }, + "range": [ + 253, + 271 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 8 + }, + "end": { + "line": 14, + "column": 14 + } + }, + "range": [ + 253, + 259 + ], + "name": "method" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 17 + }, + "end": { + "line": 14, + "column": 26 + } + }, + "range": [ + 262, + 271 + ], + "name": "arguments" + } + } + } + ] + } + } + }, + { + "type": "MethodDefinition", + "loc": { + "start": { + "line": 16, + "column": 6 + }, + "end": { + "line": 18, + "column": 7 + } + }, + "range": [ + 287, + 339 + ], + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 10 + }, + "end": { + "line": 16, + "column": 18 + } + }, + "range": [ + 291, + 299 + ], + "name": "accessor" + }, + "kind": "get", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 16, + "column": 18 + }, + "end": { + "line": 18, + "column": 7 + } + }, + "range": [ + 299, + 339 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 16, + "column": 21 + }, + "end": { + "line": 18, + "column": 7 + } + }, + "range": [ + 302, + 339 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 17, + "column": 8 + }, + "end": { + "line": 17, + "column": 27 + } + }, + "range": [ + 312, + 331 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 17, + "column": 8 + }, + "end": { + "line": 17, + "column": 26 + } + }, + "range": [ + 312, + 330 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 8 + }, + "end": { + "line": 17, + "column": 14 + } + }, + "range": [ + 312, + 318 + ], + "name": "getter" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 17 + }, + "end": { + "line": 17, + "column": 26 + } + }, + "range": [ + 321, + 330 + ], + "name": "arguments" + } + } + } + ] + } + } + }, + { + "type": "MethodDefinition", + "loc": { + "start": { + "line": 19, + "column": 6 + }, + "end": { + "line": 21, + "column": 7 + } + }, + "range": [ + 346, + 433 + ], + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 19, + "column": 10 + }, + "end": { + "line": 19, + "column": 18 + } + }, + "range": [ + 350, + 358 + ], + "name": "accessor" + }, + "kind": "set", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 19, + "column": 18 + }, + "end": { + "line": 21, + "column": 7 + } + }, + "range": [ + 358, + 433 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [ + { + "type": "ObjectPattern", + "loc": { + "start": { + "line": 19, + "column": 19 + }, + "end": { + "line": 19, + "column": 54 + } + }, + "range": [ + 359, + 394 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 19, + "column": 20 + }, + "end": { + "line": 19, + "column": 53 + } + }, + "range": [ + 360, + 393 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 19, + "column": 20 + }, + "end": { + "line": 19, + "column": 27 + } + }, + "range": [ + 360, + 367 + ], + "name": "test262" + }, + "kind": "init", + "value": { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 19, + "column": 20 + }, + "end": { + "line": 19, + "column": 53 + } + }, + "range": [ + 360, + 393 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 19, + "column": 20 + }, + "end": { + "line": 19, + "column": 27 + } + }, + "range": [ + 360, + 367 + ], + "name": "test262" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 19, + "column": 30 + }, + "end": { + "line": 19, + "column": 53 + } + }, + "range": [ + 370, + 393 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 19, + "column": 30 + }, + "end": { + "line": 19, + "column": 41 + } + }, + "range": [ + 370, + 381 + ], + "name": "setterParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 19, + "column": 44 + }, + "end": { + "line": 19, + "column": 53 + } + }, + "range": [ + 384, + 393 + ], + "name": "arguments" + } + } + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 19, + "column": 56 + }, + "end": { + "line": 21, + "column": 7 + } + }, + "range": [ + 396, + 433 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 20, + "column": 8 + }, + "end": { + "line": 20, + "column": 27 + } + }, + "range": [ + 406, + 425 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 20, + "column": 8 + }, + "end": { + "line": 20, + "column": 26 + } + }, + "range": [ + 406, + 424 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 20, + "column": 8 + }, + "end": { + "line": 20, + "column": 14 + } + }, + "range": [ + 406, + 412 + ], + "name": "setter" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 20, + "column": 17 + }, + "end": { + "line": 20, + "column": 26 + } + }, + "range": [ + 415, + 424 + ], + "name": "arguments" + } + } + } + ] + } + } + }, + { + "type": "MethodDefinition", + "loc": { + "start": { + "line": 22, + "column": 6 + }, + "end": { + "line": 24, + "column": 7 + } + }, + "range": [ + 440, + 525 + ], + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 22, + "column": 7 + }, + "end": { + "line": 22, + "column": 10 + } + }, + "range": [ + 441, + 444 + ], + "name": "gen" + }, + "kind": "method", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 22, + "column": 10 + }, + "end": { + "line": 24, + "column": 7 + } + }, + "range": [ + 444, + 525 + ], + "id": null, + "expression": false, + "generator": true, + "async": false, + "params": [ + { + "type": "ObjectPattern", + "loc": { + "start": { + "line": 22, + "column": 11 + }, + "end": { + "line": 22, + "column": 49 + } + }, + "range": [ + 445, + 483 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 22, + "column": 12 + }, + "end": { + "line": 22, + "column": 48 + } + }, + "range": [ + 446, + 482 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 22, + "column": 12 + }, + "end": { + "line": 22, + "column": 19 + } + }, + "range": [ + 446, + 453 + ], + "name": "test262" + }, + "kind": "init", + "value": { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 22, + "column": 12 + }, + "end": { + "line": 22, + "column": 48 + } + }, + "range": [ + 446, + 482 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 22, + "column": 12 + }, + "end": { + "line": 22, + "column": 19 + } + }, + "range": [ + 446, + 453 + ], + "name": "test262" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 22, + "column": 22 + }, + "end": { + "line": 22, + "column": 48 + } + }, + "range": [ + 456, + 482 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 22, + "column": 22 + }, + "end": { + "line": 22, + "column": 36 + } + }, + "range": [ + 456, + 470 + ], + "name": "genMethodParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 22, + "column": 39 + }, + "end": { + "line": 22, + "column": 48 + } + }, + "range": [ + 473, + 482 + ], + "name": "arguments" + } + } + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 22, + "column": 51 + }, + "end": { + "line": 24, + "column": 7 + } + }, + "range": [ + 485, + 525 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 23, + "column": 8 + }, + "end": { + "line": 23, + "column": 30 + } + }, + "range": [ + 495, + 517 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 23, + "column": 8 + }, + "end": { + "line": 23, + "column": 29 + } + }, + "range": [ + 495, + 516 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 23, + "column": 8 + }, + "end": { + "line": 23, + "column": 17 + } + }, + "range": [ + 495, + 504 + ], + "name": "genMethod" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 23, + "column": 20 + }, + "end": { + "line": 23, + "column": 29 + } + }, + "range": [ + 507, + 516 + ], + "name": "arguments" + } + } + } + ] + } + } + }, + { + "type": "MethodDefinition", + "loc": { + "start": { + "line": 25, + "column": 6 + }, + "end": { + "line": 27, + "column": 7 + } + }, + "range": [ + 532, + 628 + ], + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 25, + "column": 12 + }, + "end": { + "line": 25, + "column": 17 + } + }, + "range": [ + 538, + 543 + ], + "name": "async" + }, + "kind": "method", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 25, + "column": 17 + }, + "end": { + "line": 27, + "column": 7 + } + }, + "range": [ + 543, + 628 + ], + "id": null, + "expression": false, + "generator": false, + "async": true, + "params": [ + { + "type": "ObjectPattern", + "loc": { + "start": { + "line": 25, + "column": 18 + }, + "end": { + "line": 25, + "column": 58 + } + }, + "range": [ + 544, + 584 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 25, + "column": 19 + }, + "end": { + "line": 25, + "column": 57 + } + }, + "range": [ + 545, + 583 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 25, + "column": 19 + }, + "end": { + "line": 25, + "column": 26 + } + }, + "range": [ + 545, + 552 + ], + "name": "test262" + }, + "kind": "init", + "value": { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 25, + "column": 19 + }, + "end": { + "line": 25, + "column": 57 + } + }, + "range": [ + 545, + 583 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 25, + "column": 19 + }, + "end": { + "line": 25, + "column": 26 + } + }, + "range": [ + 545, + 552 + ], + "name": "test262" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 25, + "column": 29 + }, + "end": { + "line": 25, + "column": 57 + } + }, + "range": [ + 555, + 583 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 25, + "column": 29 + }, + "end": { + "line": 25, + "column": 45 + } + }, + "range": [ + 555, + 571 + ], + "name": "asyncMethodParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 25, + "column": 48 + }, + "end": { + "line": 25, + "column": 57 + } + }, + "range": [ + 574, + 583 + ], + "name": "arguments" + } + } + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 25, + "column": 60 + }, + "end": { + "line": 27, + "column": 7 + } + }, + "range": [ + 586, + 628 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 26, + "column": 8 + }, + "end": { + "line": 26, + "column": 32 + } + }, + "range": [ + 596, + 620 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 26, + "column": 8 + }, + "end": { + "line": 26, + "column": 31 + } + }, + "range": [ + 596, + 619 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 26, + "column": 8 + }, + "end": { + "line": 26, + "column": 19 + } + }, + "range": [ + 596, + 607 + ], + "name": "asyncMethod" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 26, + "column": 22 + }, + "end": { + "line": 26, + "column": 31 + } + }, + "range": [ + 610, + 619 + ], + "name": "arguments" + } + } + } + ] + } + } + } + ] + } + }, + "arguments": [] + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 32, + "column": 0 + }, + "end": { + "line": 32, + "column": 26 + } + }, + "range": [ + 645, + 671 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 32, + "column": 0 + }, + "end": { + "line": 32, + "column": 25 + } + }, + "range": [ + 645, + 670 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 32, + "column": 0 + }, + "end": { + "line": 32, + "column": 15 + } + }, + "range": [ + 645, + 660 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 32, + "column": 0 + }, + "end": { + "line": 32, + "column": 8 + } + }, + "range": [ + 645, + 653 + ], + "name": "instance" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 32, + "column": 9 + }, + "end": { + "line": 32, + "column": 15 + } + }, + "range": [ + 654, + 660 + ], + "name": "method" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 32, + "column": 16 + }, + "end": { + "line": 32, + "column": 24 + } + }, + "range": [ + 661, + 669 + ], + "value": "method", + "raw": "'method'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 33, + "column": 0 + }, + "end": { + "line": 33, + "column": 18 + } + }, + "range": [ + 672, + 690 + ], + "expression": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 33, + "column": 0 + }, + "end": { + "line": 33, + "column": 17 + } + }, + "range": [ + 672, + 689 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 33, + "column": 0 + }, + "end": { + "line": 33, + "column": 8 + } + }, + "range": [ + 672, + 680 + ], + "name": "instance" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 33, + "column": 9 + }, + "end": { + "line": 33, + "column": 17 + } + }, + "range": [ + 681, + 689 + ], + "name": "accessor" + }, + "computed": false, + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 34, + "column": 0 + }, + "end": { + "line": 34, + "column": 29 + } + }, + "range": [ + 691, + 720 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 34, + "column": 0 + }, + "end": { + "line": 34, + "column": 28 + } + }, + "range": [ + 691, + 719 + ], + "operator": "=", + "left": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 34, + "column": 0 + }, + "end": { + "line": 34, + "column": 17 + } + }, + "range": [ + 691, + 708 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 34, + "column": 0 + }, + "end": { + "line": 34, + "column": 8 + } + }, + "range": [ + 691, + 699 + ], + "name": "instance" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 34, + "column": 9 + }, + "end": { + "line": 34, + "column": 17 + } + }, + "range": [ + 700, + 708 + ], + "name": "accessor" + }, + "computed": false, + "optional": false + }, + "right": { + "type": "Literal", + "loc": { + "start": { + "line": 34, + "column": 20 + }, + "end": { + "line": 34, + "column": 28 + } + }, + "range": [ + 711, + 719 + ], + "value": "setter", + "raw": "'setter'" + } + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 35, + "column": 0 + }, + "end": { + "line": 35, + "column": 40 + } + }, + "range": [ + 721, + 761 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 35, + "column": 0 + }, + "end": { + "line": 35, + "column": 39 + } + }, + "range": [ + 721, + 760 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 35, + "column": 0 + }, + "end": { + "line": 35, + "column": 37 + } + }, + "range": [ + 721, + 758 + ], + "object": { + "type": "CallExpression", + "loc": { + "start": { + "line": 35, + "column": 0 + }, + "end": { + "line": 35, + "column": 32 + } + }, + "range": [ + 721, + 753 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 35, + "column": 0 + }, + "end": { + "line": 35, + "column": 12 + } + }, + "range": [ + 721, + 733 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 35, + "column": 0 + }, + "end": { + "line": 35, + "column": 8 + } + }, + "range": [ + 721, + 729 + ], + "name": "instance" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 35, + "column": 9 + }, + "end": { + "line": 35, + "column": 12 + } + }, + "range": [ + 730, + 733 + ], + "name": "gen" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 35, + "column": 13 + }, + "end": { + "line": 35, + "column": 31 + } + }, + "range": [ + 734, + 752 + ], + "value": "generator method", + "raw": "'generator method'" + } + ], + "optional": false + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 35, + "column": 33 + }, + "end": { + "line": 35, + "column": 37 + } + }, + "range": [ + 754, + 758 + ], + "name": "next" + }, + "computed": false, + "optional": false + }, + "arguments": [], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 36, + "column": 0 + }, + "end": { + "line": 36, + "column": 31 + } + }, + "range": [ + 762, + 793 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 36, + "column": 0 + }, + "end": { + "line": 36, + "column": 30 + } + }, + "range": [ + 762, + 792 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 36, + "column": 0 + }, + "end": { + "line": 36, + "column": 14 + } + }, + "range": [ + 762, + 776 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 36, + "column": 0 + }, + "end": { + "line": 36, + "column": 8 + } + }, + "range": [ + 762, + 770 + ], + "name": "instance" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 36, + "column": 9 + }, + "end": { + "line": 36, + "column": 14 + } + }, + "range": [ + 771, + 776 + ], + "name": "async" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 36, + "column": 15 + }, + "end": { + "line": 36, + "column": 29 + } + }, + "range": [ + 777, + 791 + ], + "value": "async method", + "raw": "'async method'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 38, + "column": 0 + }, + "end": { + "line": 38, + "column": 49 + } + }, + "range": [ + 795, + 844 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 38, + "column": 0 + }, + "end": { + "line": 38, + "column": 48 + } + }, + "range": [ + 795, + 843 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 38, + "column": 0 + }, + "end": { + "line": 38, + "column": 6 + } + }, + "range": [ + 795, + 801 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 38, + "column": 7 + }, + "end": { + "line": 38, + "column": 39 + } + }, + "range": [ + 802, + 834 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 38, + "column": 7 + }, + "end": { + "line": 38, + "column": 19 + } + }, + "range": [ + 802, + 814 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 38, + "column": 20 + }, + "end": { + "line": 38, + "column": 30 + } + }, + "range": [ + 815, + 825 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 38, + "column": 21 + }, + "end": { + "line": 38, + "column": 29 + } + }, + "range": [ + 816, + 824 + ], + "value": "method", + "raw": "'method'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 38, + "column": 32 + }, + "end": { + "line": 38, + "column": 38 + } + }, + "range": [ + 827, + 833 + ], + "name": "method" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 38, + "column": 41 + }, + "end": { + "line": 38, + "column": 47 + } + }, + "range": [ + 836, + 842 + ], + "value": "body", + "raw": "'body'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 39, + "column": 0 + }, + "end": { + "line": 39, + "column": 59 + } + }, + "range": [ + 845, + 904 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 39, + "column": 0 + }, + "end": { + "line": 39, + "column": 58 + } + }, + "range": [ + 845, + 903 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 39, + "column": 0 + }, + "end": { + "line": 39, + "column": 6 + } + }, + "range": [ + 845, + 851 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 39, + "column": 7 + }, + "end": { + "line": 39, + "column": 44 + } + }, + "range": [ + 852, + 889 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 39, + "column": 7 + }, + "end": { + "line": 39, + "column": 19 + } + }, + "range": [ + 852, + 864 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 39, + "column": 20 + }, + "end": { + "line": 39, + "column": 30 + } + }, + "range": [ + 865, + 875 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 39, + "column": 21 + }, + "end": { + "line": 39, + "column": 29 + } + }, + "range": [ + 866, + 874 + ], + "value": "method", + "raw": "'method'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 39, + "column": 32 + }, + "end": { + "line": 39, + "column": 43 + } + }, + "range": [ + 877, + 888 + ], + "name": "methodParam" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 39, + "column": 46 + }, + "end": { + "line": 39, + "column": 57 + } + }, + "range": [ + 891, + 902 + ], + "value": "parameter", + "raw": "'parameter'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 40, + "column": 0 + }, + "end": { + "line": 40, + "column": 41 + } + }, + "range": [ + 905, + 946 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 40, + "column": 0 + }, + "end": { + "line": 40, + "column": 40 + } + }, + "range": [ + 905, + 945 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 40, + "column": 0 + }, + "end": { + "line": 40, + "column": 6 + } + }, + "range": [ + 905, + 911 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 40, + "column": 7 + }, + "end": { + "line": 40, + "column": 31 + } + }, + "range": [ + 912, + 936 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 40, + "column": 7 + }, + "end": { + "line": 40, + "column": 19 + } + }, + "range": [ + 912, + 924 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 40, + "column": 20 + }, + "end": { + "line": 40, + "column": 22 + } + }, + "range": [ + 925, + 927 + ], + "elements": [] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 40, + "column": 24 + }, + "end": { + "line": 40, + "column": 30 + } + }, + "range": [ + 929, + 935 + ], + "name": "getter" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 40, + "column": 33 + }, + "end": { + "line": 40, + "column": 39 + } + }, + "range": [ + 938, + 944 + ], + "value": "body", + "raw": "'body'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 41, + "column": 0 + }, + "end": { + "line": 41, + "column": 49 + } + }, + "range": [ + 947, + 996 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 41, + "column": 0 + }, + "end": { + "line": 41, + "column": 48 + } + }, + "range": [ + 947, + 995 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 41, + "column": 0 + }, + "end": { + "line": 41, + "column": 6 + } + }, + "range": [ + 947, + 953 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 41, + "column": 7 + }, + "end": { + "line": 41, + "column": 39 + } + }, + "range": [ + 954, + 986 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 41, + "column": 7 + }, + "end": { + "line": 41, + "column": 19 + } + }, + "range": [ + 954, + 966 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 41, + "column": 20 + }, + "end": { + "line": 41, + "column": 30 + } + }, + "range": [ + 967, + 977 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 41, + "column": 21 + }, + "end": { + "line": 41, + "column": 29 + } + }, + "range": [ + 968, + 976 + ], + "value": "setter", + "raw": "'setter'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 41, + "column": 32 + }, + "end": { + "line": 41, + "column": 38 + } + }, + "range": [ + 979, + 985 + ], + "name": "setter" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 41, + "column": 41 + }, + "end": { + "line": 41, + "column": 47 + } + }, + "range": [ + 988, + 994 + ], + "value": "body", + "raw": "'body'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 42, + "column": 0 + }, + "end": { + "line": 42, + "column": 59 + } + }, + "range": [ + 997, + 1056 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 42, + "column": 0 + }, + "end": { + "line": 42, + "column": 58 + } + }, + "range": [ + 997, + 1055 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 42, + "column": 0 + }, + "end": { + "line": 42, + "column": 6 + } + }, + "range": [ + 997, + 1003 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 42, + "column": 7 + }, + "end": { + "line": 42, + "column": 44 + } + }, + "range": [ + 1004, + 1041 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 42, + "column": 7 + }, + "end": { + "line": 42, + "column": 19 + } + }, + "range": [ + 1004, + 1016 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 42, + "column": 20 + }, + "end": { + "line": 42, + "column": 30 + } + }, + "range": [ + 1017, + 1027 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 42, + "column": 21 + }, + "end": { + "line": 42, + "column": 29 + } + }, + "range": [ + 1018, + 1026 + ], + "value": "setter", + "raw": "'setter'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 42, + "column": 32 + }, + "end": { + "line": 42, + "column": 43 + } + }, + "range": [ + 1029, + 1040 + ], + "name": "setterParam" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 42, + "column": 46 + }, + "end": { + "line": 42, + "column": 57 + } + }, + "range": [ + 1043, + 1054 + ], + "value": "parameter", + "raw": "'parameter'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 43, + "column": 0 + }, + "end": { + "line": 43, + "column": 62 + } + }, + "range": [ + 1057, + 1119 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 43, + "column": 0 + }, + "end": { + "line": 43, + "column": 61 + } + }, + "range": [ + 1057, + 1118 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 43, + "column": 0 + }, + "end": { + "line": 43, + "column": 6 + } + }, + "range": [ + 1057, + 1063 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 43, + "column": 7 + }, + "end": { + "line": 43, + "column": 52 + } + }, + "range": [ + 1064, + 1109 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 43, + "column": 7 + }, + "end": { + "line": 43, + "column": 19 + } + }, + "range": [ + 1064, + 1076 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 43, + "column": 20 + }, + "end": { + "line": 43, + "column": 40 + } + }, + "range": [ + 1077, + 1097 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 43, + "column": 21 + }, + "end": { + "line": 43, + "column": 39 + } + }, + "range": [ + 1078, + 1096 + ], + "value": "generator method", + "raw": "'generator method'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 43, + "column": 42 + }, + "end": { + "line": 43, + "column": 51 + } + }, + "range": [ + 1099, + 1108 + ], + "name": "genMethod" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 43, + "column": 54 + }, + "end": { + "line": 43, + "column": 60 + } + }, + "range": [ + 1111, + 1117 + ], + "value": "body", + "raw": "'body'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 44, + "column": 0 + }, + "end": { + "line": 44, + "column": 72 + } + }, + "range": [ + 1120, + 1192 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 44, + "column": 0 + }, + "end": { + "line": 44, + "column": 71 + } + }, + "range": [ + 1120, + 1191 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 44, + "column": 0 + }, + "end": { + "line": 44, + "column": 6 + } + }, + "range": [ + 1120, + 1126 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 44, + "column": 7 + }, + "end": { + "line": 44, + "column": 57 + } + }, + "range": [ + 1127, + 1177 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 44, + "column": 7 + }, + "end": { + "line": 44, + "column": 19 + } + }, + "range": [ + 1127, + 1139 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 44, + "column": 20 + }, + "end": { + "line": 44, + "column": 40 + } + }, + "range": [ + 1140, + 1160 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 44, + "column": 21 + }, + "end": { + "line": 44, + "column": 39 + } + }, + "range": [ + 1141, + 1159 + ], + "value": "generator method", + "raw": "'generator method'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 44, + "column": 42 + }, + "end": { + "line": 44, + "column": 56 + } + }, + "range": [ + 1162, + 1176 + ], + "name": "genMethodParam" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 44, + "column": 59 + }, + "end": { + "line": 44, + "column": 70 + } + }, + "range": [ + 1179, + 1190 + ], + "value": "parameter", + "raw": "'parameter'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 45, + "column": 0 + }, + "end": { + "line": 45, + "column": 60 + } + }, + "range": [ + 1193, + 1253 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 45, + "column": 0 + }, + "end": { + "line": 45, + "column": 59 + } + }, + "range": [ + 1193, + 1252 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 45, + "column": 0 + }, + "end": { + "line": 45, + "column": 6 + } + }, + "range": [ + 1193, + 1199 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 45, + "column": 7 + }, + "end": { + "line": 45, + "column": 50 + } + }, + "range": [ + 1200, + 1243 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 45, + "column": 7 + }, + "end": { + "line": 45, + "column": 19 + } + }, + "range": [ + 1200, + 1212 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 45, + "column": 20 + }, + "end": { + "line": 45, + "column": 36 + } + }, + "range": [ + 1213, + 1229 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 45, + "column": 21 + }, + "end": { + "line": 45, + "column": 35 + } + }, + "range": [ + 1214, + 1228 + ], + "value": "async method", + "raw": "'async method'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 45, + "column": 38 + }, + "end": { + "line": 45, + "column": 49 + } + }, + "range": [ + 1231, + 1242 + ], + "name": "asyncMethod" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 45, + "column": 52 + }, + "end": { + "line": 45, + "column": 58 + } + }, + "range": [ + 1245, + 1251 + ], + "value": "body", + "raw": "'body'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 46, + "column": 0 + }, + "end": { + "line": 46, + "column": 70 + } + }, + "range": [ + 1254, + 1324 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 46, + "column": 0 + }, + "end": { + "line": 46, + "column": 69 + } + }, + "range": [ + 1254, + 1323 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 46, + "column": 0 + }, + "end": { + "line": 46, + "column": 6 + } + }, + "range": [ + 1254, + 1260 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 46, + "column": 7 + }, + "end": { + "line": 46, + "column": 55 + } + }, + "range": [ + 1261, + 1309 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 46, + "column": 7 + }, + "end": { + "line": 46, + "column": 19 + } + }, + "range": [ + 1261, + 1273 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 46, + "column": 20 + }, + "end": { + "line": 46, + "column": 36 + } + }, + "range": [ + 1274, + 1290 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 46, + "column": 21 + }, + "end": { + "line": 46, + "column": 35 + } + }, + "range": [ + 1275, + 1289 + ], + "value": "async method", + "raw": "'async method'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 46, + "column": 38 + }, + "end": { + "line": 46, + "column": 54 + } + }, + "range": [ + 1292, + 1308 + ], + "name": "asyncMethodParam" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 46, + "column": 57 + }, + "end": { + "line": 46, + "column": 68 + } + }, + "range": [ + 1311, + 1322 + ], + "value": "parameter", + "raw": "'parameter'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "range": [ + 2, + 5 + ] + }, + { + "type": "Identifier", + "value": "instance", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 12 + } + }, + "range": [ + 6, + 14 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 14, + 15 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 16, + 19 + ] + }, + { + "type": "Identifier", + "value": "method", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 20, + 26 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 4, + "column": 10 + }, + "end": { + "line": 4, + "column": 11 + } + }, + "range": [ + 26, + 27 + ] + }, + { + "type": "Identifier", + "value": "methodParam", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "range": [ + 28, + 39 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 23 + }, + "end": { + "line": 4, + "column": 24 + } + }, + "range": [ + 39, + 40 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 41, + 44 + ] + }, + { + "type": "Identifier", + "value": "getter", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 45, + 51 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 10 + }, + "end": { + "line": 5, + "column": 11 + } + }, + "range": [ + 51, + 52 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 53, + 56 + ] + }, + { + "type": "Identifier", + "value": "setter", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 10 + } + }, + "range": [ + 57, + 63 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 6, + "column": 10 + }, + "end": { + "line": 6, + "column": 11 + } + }, + "range": [ + 63, + 64 + ] + }, + { + "type": "Identifier", + "value": "setterParam", + "loc": { + "start": { + "line": 6, + "column": 12 + }, + "end": { + "line": 6, + "column": 23 + } + }, + "range": [ + 65, + 76 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 23 + }, + "end": { + "line": 6, + "column": 24 + } + }, + "range": [ + 76, + 77 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 78, + 81 + ] + }, + { + "type": "Identifier", + "value": "genMethod", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 13 + } + }, + "range": [ + 82, + 91 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 7, + "column": 13 + }, + "end": { + "line": 7, + "column": 14 + } + }, + "range": [ + 91, + 92 + ] + }, + { + "type": "Identifier", + "value": "genMethodParam", + "loc": { + "start": { + "line": 7, + "column": 15 + }, + "end": { + "line": 7, + "column": 29 + } + }, + "range": [ + 93, + 107 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 7, + "column": 29 + }, + "end": { + "line": 7, + "column": 30 + } + }, + "range": [ + 107, + 108 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 3 + } + }, + "range": [ + 109, + 112 + ] + }, + { + "type": "Identifier", + "value": "asyncMethod", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 15 + } + }, + "range": [ + 113, + 124 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 8, + "column": 15 + }, + "end": { + "line": 8, + "column": 16 + } + }, + "range": [ + 124, + 125 + ] + }, + { + "type": "Identifier", + "value": "asyncMethodParam", + "loc": { + "start": { + "line": 8, + "column": 17 + }, + "end": { + "line": 8, + "column": 33 + } + }, + "range": [ + 126, + 142 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 8, + "column": 33 + }, + "end": { + "line": 8, + "column": 34 + } + }, + "range": [ + 142, + 143 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 10, + "column": 0 + }, + "end": { + "line": 10, + "column": 5 + } + }, + "range": [ + 145, + 150 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 7 + } + }, + "range": [ + 151, + 152 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 10, + "column": 8 + }, + "end": { + "line": 10, + "column": 9 + } + }, + "range": [ + 153, + 154 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 8 + } + }, + "range": [ + 157, + 163 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 11, + "column": 9 + }, + "end": { + "line": 11, + "column": 10 + } + }, + "range": [ + 164, + 165 + ] + }, + { + "type": "Identifier", + "value": "instance", + "loc": { + "start": { + "line": 12, + "column": 4 + }, + "end": { + "line": 12, + "column": 12 + } + }, + "range": [ + 170, + 178 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 12, + "column": 13 + }, + "end": { + "line": 12, + "column": 14 + } + }, + "range": [ + 179, + 180 + ] + }, + { + "type": "Keyword", + "value": "new", + "loc": { + "start": { + "line": 12, + "column": 15 + }, + "end": { + "line": 12, + "column": 18 + } + }, + "range": [ + 181, + 184 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 12, + "column": 19 + }, + "end": { + "line": 12, + "column": 24 + } + }, + "range": [ + 185, + 190 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 12, + "column": 25 + }, + "end": { + "line": 12, + "column": 26 + } + }, + "range": [ + 191, + 192 + ] + }, + { + "type": "Identifier", + "value": "method", + "loc": { + "start": { + "line": 13, + "column": 6 + }, + "end": { + "line": 13, + "column": 12 + } + }, + "range": [ + 199, + 205 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 13 + } + }, + "range": [ + 205, + 206 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 13, + "column": 13 + }, + "end": { + "line": 13, + "column": 14 + } + }, + "range": [ + 206, + 207 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 13, + "column": 14 + }, + "end": { + "line": 13, + "column": 21 + } + }, + "range": [ + 207, + 214 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 13, + "column": 22 + }, + "end": { + "line": 13, + "column": 23 + } + }, + "range": [ + 215, + 216 + ] + }, + { + "type": "Identifier", + "value": "methodParam", + "loc": { + "start": { + "line": 13, + "column": 24 + }, + "end": { + "line": 13, + "column": 35 + } + }, + "range": [ + 217, + 228 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 13, + "column": 36 + }, + "end": { + "line": 13, + "column": 37 + } + }, + "range": [ + 229, + 230 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 13, + "column": 38 + }, + "end": { + "line": 13, + "column": 47 + } + }, + "range": [ + 231, + 240 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 13, + "column": 47 + }, + "end": { + "line": 13, + "column": 48 + } + }, + "range": [ + 240, + 241 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 13, + "column": 48 + }, + "end": { + "line": 13, + "column": 49 + } + }, + "range": [ + 241, + 242 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 13, + "column": 50 + }, + "end": { + "line": 13, + "column": 51 + } + }, + "range": [ + 243, + 244 + ] + }, + { + "type": "Identifier", + "value": "method", + "loc": { + "start": { + "line": 14, + "column": 8 + }, + "end": { + "line": 14, + "column": 14 + } + }, + "range": [ + 253, + 259 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 14, + "column": 15 + }, + "end": { + "line": 14, + "column": 16 + } + }, + "range": [ + 260, + 261 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 14, + "column": 17 + }, + "end": { + "line": 14, + "column": 26 + } + }, + "range": [ + 262, + 271 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 14, + "column": 26 + }, + "end": { + "line": 14, + "column": 27 + } + }, + "range": [ + 271, + 272 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 15, + "column": 7 + } + }, + "range": [ + 279, + 280 + ] + }, + { + "type": "Identifier", + "value": "get", + "loc": { + "start": { + "line": 16, + "column": 6 + }, + "end": { + "line": 16, + "column": 9 + } + }, + "range": [ + 287, + 290 + ] + }, + { + "type": "Identifier", + "value": "accessor", + "loc": { + "start": { + "line": 16, + "column": 10 + }, + "end": { + "line": 16, + "column": 18 + } + }, + "range": [ + 291, + 299 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 16, + "column": 18 + }, + "end": { + "line": 16, + "column": 19 + } + }, + "range": [ + 299, + 300 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 16, + "column": 19 + }, + "end": { + "line": 16, + "column": 20 + } + }, + "range": [ + 300, + 301 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 16, + "column": 21 + }, + "end": { + "line": 16, + "column": 22 + } + }, + "range": [ + 302, + 303 + ] + }, + { + "type": "Identifier", + "value": "getter", + "loc": { + "start": { + "line": 17, + "column": 8 + }, + "end": { + "line": 17, + "column": 14 + } + }, + "range": [ + 312, + 318 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 17, + "column": 15 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 319, + 320 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 17, + "column": 17 + }, + "end": { + "line": 17, + "column": 26 + } + }, + "range": [ + 321, + 330 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 17, + "column": 26 + }, + "end": { + "line": 17, + "column": 27 + } + }, + "range": [ + 330, + 331 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 18, + "column": 6 + }, + "end": { + "line": 18, + "column": 7 + } + }, + "range": [ + 338, + 339 + ] + }, + { + "type": "Identifier", + "value": "set", + "loc": { + "start": { + "line": 19, + "column": 6 + }, + "end": { + "line": 19, + "column": 9 + } + }, + "range": [ + 346, + 349 + ] + }, + { + "type": "Identifier", + "value": "accessor", + "loc": { + "start": { + "line": 19, + "column": 10 + }, + "end": { + "line": 19, + "column": 18 + } + }, + "range": [ + 350, + 358 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 19, + "column": 18 + }, + "end": { + "line": 19, + "column": 19 + } + }, + "range": [ + 358, + 359 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 19, + "column": 19 + }, + "end": { + "line": 19, + "column": 20 + } + }, + "range": [ + 359, + 360 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 19, + "column": 20 + }, + "end": { + "line": 19, + "column": 27 + } + }, + "range": [ + 360, + 367 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 19, + "column": 28 + }, + "end": { + "line": 19, + "column": 29 + } + }, + "range": [ + 368, + 369 + ] + }, + { + "type": "Identifier", + "value": "setterParam", + "loc": { + "start": { + "line": 19, + "column": 30 + }, + "end": { + "line": 19, + "column": 41 + } + }, + "range": [ + 370, + 381 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 19, + "column": 42 + }, + "end": { + "line": 19, + "column": 43 + } + }, + "range": [ + 382, + 383 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 19, + "column": 44 + }, + "end": { + "line": 19, + "column": 53 + } + }, + "range": [ + 384, + 393 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 19, + "column": 53 + }, + "end": { + "line": 19, + "column": 54 + } + }, + "range": [ + 393, + 394 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 19, + "column": 54 + }, + "end": { + "line": 19, + "column": 55 + } + }, + "range": [ + 394, + 395 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 19, + "column": 56 + }, + "end": { + "line": 19, + "column": 57 + } + }, + "range": [ + 396, + 397 + ] + }, + { + "type": "Identifier", + "value": "setter", + "loc": { + "start": { + "line": 20, + "column": 8 + }, + "end": { + "line": 20, + "column": 14 + } + }, + "range": [ + 406, + 412 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 20, + "column": 15 + }, + "end": { + "line": 20, + "column": 16 + } + }, + "range": [ + 413, + 414 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 20, + "column": 17 + }, + "end": { + "line": 20, + "column": 26 + } + }, + "range": [ + 415, + 424 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 20, + "column": 26 + }, + "end": { + "line": 20, + "column": 27 + } + }, + "range": [ + 424, + 425 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 21, + "column": 6 + }, + "end": { + "line": 21, + "column": 7 + } + }, + "range": [ + 432, + 433 + ] + }, + { + "type": "Punctuator", + "value": "*", + "loc": { + "start": { + "line": 22, + "column": 6 + }, + "end": { + "line": 22, + "column": 7 + } + }, + "range": [ + 440, + 441 + ] + }, + { + "type": "Identifier", + "value": "gen", + "loc": { + "start": { + "line": 22, + "column": 7 + }, + "end": { + "line": 22, + "column": 10 + } + }, + "range": [ + 441, + 444 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 22, + "column": 10 + }, + "end": { + "line": 22, + "column": 11 + } + }, + "range": [ + 444, + 445 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 22, + "column": 11 + }, + "end": { + "line": 22, + "column": 12 + } + }, + "range": [ + 445, + 446 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 22, + "column": 12 + }, + "end": { + "line": 22, + "column": 19 + } + }, + "range": [ + 446, + 453 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 22, + "column": 20 + }, + "end": { + "line": 22, + "column": 21 + } + }, + "range": [ + 454, + 455 + ] + }, + { + "type": "Identifier", + "value": "genMethodParam", + "loc": { + "start": { + "line": 22, + "column": 22 + }, + "end": { + "line": 22, + "column": 36 + } + }, + "range": [ + 456, + 470 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 22, + "column": 37 + }, + "end": { + "line": 22, + "column": 38 + } + }, + "range": [ + 471, + 472 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 22, + "column": 39 + }, + "end": { + "line": 22, + "column": 48 + } + }, + "range": [ + 473, + 482 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 22, + "column": 48 + }, + "end": { + "line": 22, + "column": 49 + } + }, + "range": [ + 482, + 483 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 22, + "column": 49 + }, + "end": { + "line": 22, + "column": 50 + } + }, + "range": [ + 483, + 484 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 22, + "column": 51 + }, + "end": { + "line": 22, + "column": 52 + } + }, + "range": [ + 485, + 486 + ] + }, + { + "type": "Identifier", + "value": "genMethod", + "loc": { + "start": { + "line": 23, + "column": 8 + }, + "end": { + "line": 23, + "column": 17 + } + }, + "range": [ + 495, + 504 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 23, + "column": 18 + }, + "end": { + "line": 23, + "column": 19 + } + }, + "range": [ + 505, + 506 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 23, + "column": 20 + }, + "end": { + "line": 23, + "column": 29 + } + }, + "range": [ + 507, + 516 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 23, + "column": 29 + }, + "end": { + "line": 23, + "column": 30 + } + }, + "range": [ + 516, + 517 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 24, + "column": 6 + }, + "end": { + "line": 24, + "column": 7 + } + }, + "range": [ + 524, + 525 + ] + }, + { + "type": "Identifier", + "value": "async", + "loc": { + "start": { + "line": 25, + "column": 6 + }, + "end": { + "line": 25, + "column": 11 + } + }, + "range": [ + 532, + 537 + ] + }, + { + "type": "Identifier", + "value": "async", + "loc": { + "start": { + "line": 25, + "column": 12 + }, + "end": { + "line": 25, + "column": 17 + } + }, + "range": [ + 538, + 543 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 25, + "column": 17 + }, + "end": { + "line": 25, + "column": 18 + } + }, + "range": [ + 543, + 544 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 25, + "column": 18 + }, + "end": { + "line": 25, + "column": 19 + } + }, + "range": [ + 544, + 545 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 25, + "column": 19 + }, + "end": { + "line": 25, + "column": 26 + } + }, + "range": [ + 545, + 552 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 25, + "column": 27 + }, + "end": { + "line": 25, + "column": 28 + } + }, + "range": [ + 553, + 554 + ] + }, + { + "type": "Identifier", + "value": "asyncMethodParam", + "loc": { + "start": { + "line": 25, + "column": 29 + }, + "end": { + "line": 25, + "column": 45 + } + }, + "range": [ + 555, + 571 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 25, + "column": 46 + }, + "end": { + "line": 25, + "column": 47 + } + }, + "range": [ + 572, + 573 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 25, + "column": 48 + }, + "end": { + "line": 25, + "column": 57 + } + }, + "range": [ + 574, + 583 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 25, + "column": 57 + }, + "end": { + "line": 25, + "column": 58 + } + }, + "range": [ + 583, + 584 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 25, + "column": 58 + }, + "end": { + "line": 25, + "column": 59 + } + }, + "range": [ + 584, + 585 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 25, + "column": 60 + }, + "end": { + "line": 25, + "column": 61 + } + }, + "range": [ + 586, + 587 + ] + }, + { + "type": "Identifier", + "value": "asyncMethod", + "loc": { + "start": { + "line": 26, + "column": 8 + }, + "end": { + "line": 26, + "column": 19 + } + }, + "range": [ + 596, + 607 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 26, + "column": 20 + }, + "end": { + "line": 26, + "column": 21 + } + }, + "range": [ + 608, + 609 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 26, + "column": 22 + }, + "end": { + "line": 26, + "column": 31 + } + }, + "range": [ + 610, + 619 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 26, + "column": 31 + }, + "end": { + "line": 26, + "column": 32 + } + }, + "range": [ + 619, + 620 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 27, + "column": 6 + }, + "end": { + "line": 27, + "column": 7 + } + }, + "range": [ + 627, + 628 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 28, + "column": 4 + }, + "end": { + "line": 28, + "column": 5 + } + }, + "range": [ + 633, + 634 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 28, + "column": 5 + }, + "end": { + "line": 28, + "column": 6 + } + }, + "range": [ + 634, + 635 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 28, + "column": 6 + }, + "end": { + "line": 28, + "column": 7 + } + }, + "range": [ + 635, + 636 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 28, + "column": 7 + }, + "end": { + "line": 28, + "column": 8 + } + }, + "range": [ + 636, + 637 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 29, + "column": 2 + }, + "end": { + "line": 29, + "column": 3 + } + }, + "range": [ + 640, + 641 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 30, + "column": 0 + }, + "end": { + "line": 30, + "column": 1 + } + }, + "range": [ + 642, + 643 + ] + }, + { + "type": "Identifier", + "value": "instance", + "loc": { + "start": { + "line": 32, + "column": 0 + }, + "end": { + "line": 32, + "column": 8 + } + }, + "range": [ + 645, + 653 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 32, + "column": 8 + }, + "end": { + "line": 32, + "column": 9 + } + }, + "range": [ + 653, + 654 + ] + }, + { + "type": "Identifier", + "value": "method", + "loc": { + "start": { + "line": 32, + "column": 9 + }, + "end": { + "line": 32, + "column": 15 + } + }, + "range": [ + 654, + 660 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 32, + "column": 15 + }, + "end": { + "line": 32, + "column": 16 + } + }, + "range": [ + 660, + 661 + ] + }, + { + "type": "String", + "value": "'method'", + "loc": { + "start": { + "line": 32, + "column": 16 + }, + "end": { + "line": 32, + "column": 24 + } + }, + "range": [ + 661, + 669 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 32, + "column": 24 + }, + "end": { + "line": 32, + "column": 25 + } + }, + "range": [ + 669, + 670 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 32, + "column": 25 + }, + "end": { + "line": 32, + "column": 26 + } + }, + "range": [ + 670, + 671 + ] + }, + { + "type": "Identifier", + "value": "instance", + "loc": { + "start": { + "line": 33, + "column": 0 + }, + "end": { + "line": 33, + "column": 8 + } + }, + "range": [ + 672, + 680 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 33, + "column": 8 + }, + "end": { + "line": 33, + "column": 9 + } + }, + "range": [ + 680, + 681 + ] + }, + { + "type": "Identifier", + "value": "accessor", + "loc": { + "start": { + "line": 33, + "column": 9 + }, + "end": { + "line": 33, + "column": 17 + } + }, + "range": [ + 681, + 689 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 33, + "column": 17 + }, + "end": { + "line": 33, + "column": 18 + } + }, + "range": [ + 689, + 690 + ] + }, + { + "type": "Identifier", + "value": "instance", + "loc": { + "start": { + "line": 34, + "column": 0 + }, + "end": { + "line": 34, + "column": 8 + } + }, + "range": [ + 691, + 699 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 34, + "column": 8 + }, + "end": { + "line": 34, + "column": 9 + } + }, + "range": [ + 699, + 700 + ] + }, + { + "type": "Identifier", + "value": "accessor", + "loc": { + "start": { + "line": 34, + "column": 9 + }, + "end": { + "line": 34, + "column": 17 + } + }, + "range": [ + 700, + 708 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 34, + "column": 18 + }, + "end": { + "line": 34, + "column": 19 + } + }, + "range": [ + 709, + 710 + ] + }, + { + "type": "String", + "value": "'setter'", + "loc": { + "start": { + "line": 34, + "column": 20 + }, + "end": { + "line": 34, + "column": 28 + } + }, + "range": [ + 711, + 719 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 34, + "column": 28 + }, + "end": { + "line": 34, + "column": 29 + } + }, + "range": [ + 719, + 720 + ] + }, + { + "type": "Identifier", + "value": "instance", + "loc": { + "start": { + "line": 35, + "column": 0 + }, + "end": { + "line": 35, + "column": 8 + } + }, + "range": [ + 721, + 729 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 35, + "column": 8 + }, + "end": { + "line": 35, + "column": 9 + } + }, + "range": [ + 729, + 730 + ] + }, + { + "type": "Identifier", + "value": "gen", + "loc": { + "start": { + "line": 35, + "column": 9 + }, + "end": { + "line": 35, + "column": 12 + } + }, + "range": [ + 730, + 733 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 35, + "column": 12 + }, + "end": { + "line": 35, + "column": 13 + } + }, + "range": [ + 733, + 734 + ] + }, + { + "type": "String", + "value": "'generator method'", + "loc": { + "start": { + "line": 35, + "column": 13 + }, + "end": { + "line": 35, + "column": 31 + } + }, + "range": [ + 734, + 752 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 35, + "column": 31 + }, + "end": { + "line": 35, + "column": 32 + } + }, + "range": [ + 752, + 753 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 35, + "column": 32 + }, + "end": { + "line": 35, + "column": 33 + } + }, + "range": [ + 753, + 754 + ] + }, + { + "type": "Identifier", + "value": "next", + "loc": { + "start": { + "line": 35, + "column": 33 + }, + "end": { + "line": 35, + "column": 37 + } + }, + "range": [ + 754, + 758 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 35, + "column": 37 + }, + "end": { + "line": 35, + "column": 38 + } + }, + "range": [ + 758, + 759 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 35, + "column": 38 + }, + "end": { + "line": 35, + "column": 39 + } + }, + "range": [ + 759, + 760 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 35, + "column": 39 + }, + "end": { + "line": 35, + "column": 40 + } + }, + "range": [ + 760, + 761 + ] + }, + { + "type": "Identifier", + "value": "instance", + "loc": { + "start": { + "line": 36, + "column": 0 + }, + "end": { + "line": 36, + "column": 8 + } + }, + "range": [ + 762, + 770 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 36, + "column": 8 + }, + "end": { + "line": 36, + "column": 9 + } + }, + "range": [ + 770, + 771 + ] + }, + { + "type": "Identifier", + "value": "async", + "loc": { + "start": { + "line": 36, + "column": 9 + }, + "end": { + "line": 36, + "column": 14 + } + }, + "range": [ + 771, + 776 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 36, + "column": 14 + }, + "end": { + "line": 36, + "column": 15 + } + }, + "range": [ + 776, + 777 + ] + }, + { + "type": "String", + "value": "'async method'", + "loc": { + "start": { + "line": 36, + "column": 15 + }, + "end": { + "line": 36, + "column": 29 + } + }, + "range": [ + 777, + 791 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 36, + "column": 29 + }, + "end": { + "line": 36, + "column": 30 + } + }, + "range": [ + 791, + 792 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 36, + "column": 30 + }, + "end": { + "line": 36, + "column": 31 + } + }, + "range": [ + 792, + 793 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 38, + "column": 0 + }, + "end": { + "line": 38, + "column": 6 + } + }, + "range": [ + 795, + 801 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 38, + "column": 6 + }, + "end": { + "line": 38, + "column": 7 + } + }, + "range": [ + 801, + 802 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 38, + "column": 7 + }, + "end": { + "line": 38, + "column": 19 + } + }, + "range": [ + 802, + 814 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 38, + "column": 19 + }, + "end": { + "line": 38, + "column": 20 + } + }, + "range": [ + 814, + 815 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 38, + "column": 20 + }, + "end": { + "line": 38, + "column": 21 + } + }, + "range": [ + 815, + 816 + ] + }, + { + "type": "String", + "value": "'method'", + "loc": { + "start": { + "line": 38, + "column": 21 + }, + "end": { + "line": 38, + "column": 29 + } + }, + "range": [ + 816, + 824 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 38, + "column": 29 + }, + "end": { + "line": 38, + "column": 30 + } + }, + "range": [ + 824, + 825 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 38, + "column": 30 + }, + "end": { + "line": 38, + "column": 31 + } + }, + "range": [ + 825, + 826 + ] + }, + { + "type": "Identifier", + "value": "method", + "loc": { + "start": { + "line": 38, + "column": 32 + }, + "end": { + "line": 38, + "column": 38 + } + }, + "range": [ + 827, + 833 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 38, + "column": 38 + }, + "end": { + "line": 38, + "column": 39 + } + }, + "range": [ + 833, + 834 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 38, + "column": 39 + }, + "end": { + "line": 38, + "column": 40 + } + }, + "range": [ + 834, + 835 + ] + }, + { + "type": "String", + "value": "'body'", + "loc": { + "start": { + "line": 38, + "column": 41 + }, + "end": { + "line": 38, + "column": 47 + } + }, + "range": [ + 836, + 842 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 38, + "column": 47 + }, + "end": { + "line": 38, + "column": 48 + } + }, + "range": [ + 842, + 843 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 38, + "column": 48 + }, + "end": { + "line": 38, + "column": 49 + } + }, + "range": [ + 843, + 844 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 39, + "column": 0 + }, + "end": { + "line": 39, + "column": 6 + } + }, + "range": [ + 845, + 851 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 39, + "column": 6 + }, + "end": { + "line": 39, + "column": 7 + } + }, + "range": [ + 851, + 852 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 39, + "column": 7 + }, + "end": { + "line": 39, + "column": 19 + } + }, + "range": [ + 852, + 864 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 39, + "column": 19 + }, + "end": { + "line": 39, + "column": 20 + } + }, + "range": [ + 864, + 865 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 39, + "column": 20 + }, + "end": { + "line": 39, + "column": 21 + } + }, + "range": [ + 865, + 866 + ] + }, + { + "type": "String", + "value": "'method'", + "loc": { + "start": { + "line": 39, + "column": 21 + }, + "end": { + "line": 39, + "column": 29 + } + }, + "range": [ + 866, + 874 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 39, + "column": 29 + }, + "end": { + "line": 39, + "column": 30 + } + }, + "range": [ + 874, + 875 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 39, + "column": 30 + }, + "end": { + "line": 39, + "column": 31 + } + }, + "range": [ + 875, + 876 + ] + }, + { + "type": "Identifier", + "value": "methodParam", + "loc": { + "start": { + "line": 39, + "column": 32 + }, + "end": { + "line": 39, + "column": 43 + } + }, + "range": [ + 877, + 888 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 39, + "column": 43 + }, + "end": { + "line": 39, + "column": 44 + } + }, + "range": [ + 888, + 889 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 39, + "column": 44 + }, + "end": { + "line": 39, + "column": 45 + } + }, + "range": [ + 889, + 890 + ] + }, + { + "type": "String", + "value": "'parameter'", + "loc": { + "start": { + "line": 39, + "column": 46 + }, + "end": { + "line": 39, + "column": 57 + } + }, + "range": [ + 891, + 902 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 39, + "column": 57 + }, + "end": { + "line": 39, + "column": 58 + } + }, + "range": [ + 902, + 903 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 39, + "column": 58 + }, + "end": { + "line": 39, + "column": 59 + } + }, + "range": [ + 903, + 904 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 40, + "column": 0 + }, + "end": { + "line": 40, + "column": 6 + } + }, + "range": [ + 905, + 911 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 40, + "column": 6 + }, + "end": { + "line": 40, + "column": 7 + } + }, + "range": [ + 911, + 912 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 40, + "column": 7 + }, + "end": { + "line": 40, + "column": 19 + } + }, + "range": [ + 912, + 924 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 40, + "column": 19 + }, + "end": { + "line": 40, + "column": 20 + } + }, + "range": [ + 924, + 925 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 40, + "column": 20 + }, + "end": { + "line": 40, + "column": 21 + } + }, + "range": [ + 925, + 926 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 40, + "column": 21 + }, + "end": { + "line": 40, + "column": 22 + } + }, + "range": [ + 926, + 927 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 40, + "column": 22 + }, + "end": { + "line": 40, + "column": 23 + } + }, + "range": [ + 927, + 928 + ] + }, + { + "type": "Identifier", + "value": "getter", + "loc": { + "start": { + "line": 40, + "column": 24 + }, + "end": { + "line": 40, + "column": 30 + } + }, + "range": [ + 929, + 935 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 40, + "column": 30 + }, + "end": { + "line": 40, + "column": 31 + } + }, + "range": [ + 935, + 936 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 40, + "column": 31 + }, + "end": { + "line": 40, + "column": 32 + } + }, + "range": [ + 936, + 937 + ] + }, + { + "type": "String", + "value": "'body'", + "loc": { + "start": { + "line": 40, + "column": 33 + }, + "end": { + "line": 40, + "column": 39 + } + }, + "range": [ + 938, + 944 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 40, + "column": 39 + }, + "end": { + "line": 40, + "column": 40 + } + }, + "range": [ + 944, + 945 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 40, + "column": 40 + }, + "end": { + "line": 40, + "column": 41 + } + }, + "range": [ + 945, + 946 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 41, + "column": 0 + }, + "end": { + "line": 41, + "column": 6 + } + }, + "range": [ + 947, + 953 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 41, + "column": 6 + }, + "end": { + "line": 41, + "column": 7 + } + }, + "range": [ + 953, + 954 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 41, + "column": 7 + }, + "end": { + "line": 41, + "column": 19 + } + }, + "range": [ + 954, + 966 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 41, + "column": 19 + }, + "end": { + "line": 41, + "column": 20 + } + }, + "range": [ + 966, + 967 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 41, + "column": 20 + }, + "end": { + "line": 41, + "column": 21 + } + }, + "range": [ + 967, + 968 + ] + }, + { + "type": "String", + "value": "'setter'", + "loc": { + "start": { + "line": 41, + "column": 21 + }, + "end": { + "line": 41, + "column": 29 + } + }, + "range": [ + 968, + 976 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 41, + "column": 29 + }, + "end": { + "line": 41, + "column": 30 + } + }, + "range": [ + 976, + 977 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 41, + "column": 30 + }, + "end": { + "line": 41, + "column": 31 + } + }, + "range": [ + 977, + 978 + ] + }, + { + "type": "Identifier", + "value": "setter", + "loc": { + "start": { + "line": 41, + "column": 32 + }, + "end": { + "line": 41, + "column": 38 + } + }, + "range": [ + 979, + 985 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 41, + "column": 38 + }, + "end": { + "line": 41, + "column": 39 + } + }, + "range": [ + 985, + 986 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 41, + "column": 39 + }, + "end": { + "line": 41, + "column": 40 + } + }, + "range": [ + 986, + 987 + ] + }, + { + "type": "String", + "value": "'body'", + "loc": { + "start": { + "line": 41, + "column": 41 + }, + "end": { + "line": 41, + "column": 47 + } + }, + "range": [ + 988, + 994 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 41, + "column": 47 + }, + "end": { + "line": 41, + "column": 48 + } + }, + "range": [ + 994, + 995 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 41, + "column": 48 + }, + "end": { + "line": 41, + "column": 49 + } + }, + "range": [ + 995, + 996 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 42, + "column": 0 + }, + "end": { + "line": 42, + "column": 6 + } + }, + "range": [ + 997, + 1003 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 42, + "column": 6 + }, + "end": { + "line": 42, + "column": 7 + } + }, + "range": [ + 1003, + 1004 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 42, + "column": 7 + }, + "end": { + "line": 42, + "column": 19 + } + }, + "range": [ + 1004, + 1016 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 42, + "column": 19 + }, + "end": { + "line": 42, + "column": 20 + } + }, + "range": [ + 1016, + 1017 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 42, + "column": 20 + }, + "end": { + "line": 42, + "column": 21 + } + }, + "range": [ + 1017, + 1018 + ] + }, + { + "type": "String", + "value": "'setter'", + "loc": { + "start": { + "line": 42, + "column": 21 + }, + "end": { + "line": 42, + "column": 29 + } + }, + "range": [ + 1018, + 1026 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 42, + "column": 29 + }, + "end": { + "line": 42, + "column": 30 + } + }, + "range": [ + 1026, + 1027 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 42, + "column": 30 + }, + "end": { + "line": 42, + "column": 31 + } + }, + "range": [ + 1027, + 1028 + ] + }, + { + "type": "Identifier", + "value": "setterParam", + "loc": { + "start": { + "line": 42, + "column": 32 + }, + "end": { + "line": 42, + "column": 43 + } + }, + "range": [ + 1029, + 1040 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 42, + "column": 43 + }, + "end": { + "line": 42, + "column": 44 + } + }, + "range": [ + 1040, + 1041 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 42, + "column": 44 + }, + "end": { + "line": 42, + "column": 45 + } + }, + "range": [ + 1041, + 1042 + ] + }, + { + "type": "String", + "value": "'parameter'", + "loc": { + "start": { + "line": 42, + "column": 46 + }, + "end": { + "line": 42, + "column": 57 + } + }, + "range": [ + 1043, + 1054 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 42, + "column": 57 + }, + "end": { + "line": 42, + "column": 58 + } + }, + "range": [ + 1054, + 1055 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 42, + "column": 58 + }, + "end": { + "line": 42, + "column": 59 + } + }, + "range": [ + 1055, + 1056 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 43, + "column": 0 + }, + "end": { + "line": 43, + "column": 6 + } + }, + "range": [ + 1057, + 1063 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 43, + "column": 6 + }, + "end": { + "line": 43, + "column": 7 + } + }, + "range": [ + 1063, + 1064 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 43, + "column": 7 + }, + "end": { + "line": 43, + "column": 19 + } + }, + "range": [ + 1064, + 1076 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 43, + "column": 19 + }, + "end": { + "line": 43, + "column": 20 + } + }, + "range": [ + 1076, + 1077 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 43, + "column": 20 + }, + "end": { + "line": 43, + "column": 21 + } + }, + "range": [ + 1077, + 1078 + ] + }, + { + "type": "String", + "value": "'generator method'", + "loc": { + "start": { + "line": 43, + "column": 21 + }, + "end": { + "line": 43, + "column": 39 + } + }, + "range": [ + 1078, + 1096 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 43, + "column": 39 + }, + "end": { + "line": 43, + "column": 40 + } + }, + "range": [ + 1096, + 1097 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 43, + "column": 40 + }, + "end": { + "line": 43, + "column": 41 + } + }, + "range": [ + 1097, + 1098 + ] + }, + { + "type": "Identifier", + "value": "genMethod", + "loc": { + "start": { + "line": 43, + "column": 42 + }, + "end": { + "line": 43, + "column": 51 + } + }, + "range": [ + 1099, + 1108 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 43, + "column": 51 + }, + "end": { + "line": 43, + "column": 52 + } + }, + "range": [ + 1108, + 1109 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 43, + "column": 52 + }, + "end": { + "line": 43, + "column": 53 + } + }, + "range": [ + 1109, + 1110 + ] + }, + { + "type": "String", + "value": "'body'", + "loc": { + "start": { + "line": 43, + "column": 54 + }, + "end": { + "line": 43, + "column": 60 + } + }, + "range": [ + 1111, + 1117 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 43, + "column": 60 + }, + "end": { + "line": 43, + "column": 61 + } + }, + "range": [ + 1117, + 1118 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 43, + "column": 61 + }, + "end": { + "line": 43, + "column": 62 + } + }, + "range": [ + 1118, + 1119 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 44, + "column": 0 + }, + "end": { + "line": 44, + "column": 6 + } + }, + "range": [ + 1120, + 1126 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 44, + "column": 6 + }, + "end": { + "line": 44, + "column": 7 + } + }, + "range": [ + 1126, + 1127 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 44, + "column": 7 + }, + "end": { + "line": 44, + "column": 19 + } + }, + "range": [ + 1127, + 1139 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 44, + "column": 19 + }, + "end": { + "line": 44, + "column": 20 + } + }, + "range": [ + 1139, + 1140 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 44, + "column": 20 + }, + "end": { + "line": 44, + "column": 21 + } + }, + "range": [ + 1140, + 1141 + ] + }, + { + "type": "String", + "value": "'generator method'", + "loc": { + "start": { + "line": 44, + "column": 21 + }, + "end": { + "line": 44, + "column": 39 + } + }, + "range": [ + 1141, + 1159 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 44, + "column": 39 + }, + "end": { + "line": 44, + "column": 40 + } + }, + "range": [ + 1159, + 1160 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 44, + "column": 40 + }, + "end": { + "line": 44, + "column": 41 + } + }, + "range": [ + 1160, + 1161 + ] + }, + { + "type": "Identifier", + "value": "genMethodParam", + "loc": { + "start": { + "line": 44, + "column": 42 + }, + "end": { + "line": 44, + "column": 56 + } + }, + "range": [ + 1162, + 1176 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 44, + "column": 56 + }, + "end": { + "line": 44, + "column": 57 + } + }, + "range": [ + 1176, + 1177 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 44, + "column": 57 + }, + "end": { + "line": 44, + "column": 58 + } + }, + "range": [ + 1177, + 1178 + ] + }, + { + "type": "String", + "value": "'parameter'", + "loc": { + "start": { + "line": 44, + "column": 59 + }, + "end": { + "line": 44, + "column": 70 + } + }, + "range": [ + 1179, + 1190 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 44, + "column": 70 + }, + "end": { + "line": 44, + "column": 71 + } + }, + "range": [ + 1190, + 1191 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 44, + "column": 71 + }, + "end": { + "line": 44, + "column": 72 + } + }, + "range": [ + 1191, + 1192 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 45, + "column": 0 + }, + "end": { + "line": 45, + "column": 6 + } + }, + "range": [ + 1193, + 1199 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 45, + "column": 6 + }, + "end": { + "line": 45, + "column": 7 + } + }, + "range": [ + 1199, + 1200 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 45, + "column": 7 + }, + "end": { + "line": 45, + "column": 19 + } + }, + "range": [ + 1200, + 1212 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 45, + "column": 19 + }, + "end": { + "line": 45, + "column": 20 + } + }, + "range": [ + 1212, + 1213 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 45, + "column": 20 + }, + "end": { + "line": 45, + "column": 21 + } + }, + "range": [ + 1213, + 1214 + ] + }, + { + "type": "String", + "value": "'async method'", + "loc": { + "start": { + "line": 45, + "column": 21 + }, + "end": { + "line": 45, + "column": 35 + } + }, + "range": [ + 1214, + 1228 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 45, + "column": 35 + }, + "end": { + "line": 45, + "column": 36 + } + }, + "range": [ + 1228, + 1229 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 45, + "column": 36 + }, + "end": { + "line": 45, + "column": 37 + } + }, + "range": [ + 1229, + 1230 + ] + }, + { + "type": "Identifier", + "value": "asyncMethod", + "loc": { + "start": { + "line": 45, + "column": 38 + }, + "end": { + "line": 45, + "column": 49 + } + }, + "range": [ + 1231, + 1242 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 45, + "column": 49 + }, + "end": { + "line": 45, + "column": 50 + } + }, + "range": [ + 1242, + 1243 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 45, + "column": 50 + }, + "end": { + "line": 45, + "column": 51 + } + }, + "range": [ + 1243, + 1244 + ] + }, + { + "type": "String", + "value": "'body'", + "loc": { + "start": { + "line": 45, + "column": 52 + }, + "end": { + "line": 45, + "column": 58 + } + }, + "range": [ + 1245, + 1251 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 45, + "column": 58 + }, + "end": { + "line": 45, + "column": 59 + } + }, + "range": [ + 1251, + 1252 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 45, + "column": 59 + }, + "end": { + "line": 45, + "column": 60 + } + }, + "range": [ + 1252, + 1253 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 46, + "column": 0 + }, + "end": { + "line": 46, + "column": 6 + } + }, + "range": [ + 1254, + 1260 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 46, + "column": 6 + }, + "end": { + "line": 46, + "column": 7 + } + }, + "range": [ + 1260, + 1261 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 46, + "column": 7 + }, + "end": { + "line": 46, + "column": 19 + } + }, + "range": [ + 1261, + 1273 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 46, + "column": 19 + }, + "end": { + "line": 46, + "column": 20 + } + }, + "range": [ + 1273, + 1274 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 46, + "column": 20 + }, + "end": { + "line": 46, + "column": 21 + } + }, + "range": [ + 1274, + 1275 + ] + }, + { + "type": "String", + "value": "'async method'", + "loc": { + "start": { + "line": 46, + "column": 21 + }, + "end": { + "line": 46, + "column": 35 + } + }, + "range": [ + 1275, + 1289 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 46, + "column": 35 + }, + "end": { + "line": 46, + "column": 36 + } + }, + "range": [ + 1289, + 1290 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 46, + "column": 36 + }, + "end": { + "line": 46, + "column": 37 + } + }, + "range": [ + 1290, + 1291 + ] + }, + { + "type": "Identifier", + "value": "asyncMethodParam", + "loc": { + "start": { + "line": 46, + "column": 38 + }, + "end": { + "line": 46, + "column": 54 + } + }, + "range": [ + 1292, + 1308 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 46, + "column": 54 + }, + "end": { + "line": 46, + "column": 55 + } + }, + "range": [ + 1308, + 1309 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 46, + "column": 55 + }, + "end": { + "line": 46, + "column": 56 + } + }, + "range": [ + 1309, + 1310 + ] + }, + { + "type": "String", + "value": "'parameter'", + "loc": { + "start": { + "line": 46, + "column": 57 + }, + "end": { + "line": 46, + "column": 68 + } + }, + "range": [ + 1311, + 1322 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 46, + "column": 68 + }, + "end": { + "line": 46, + "column": 69 + } + }, + "range": [ + 1322, + 1323 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 46, + "column": 69 + }, + "end": { + "line": 46, + "column": 70 + } + }, + "range": [ + 1323, + 1324 + ] + } + ] +}; \ 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..953cce3a --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-arguments-methods.src.js @@ -0,0 +1,46 @@ + + +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..8b8b21f9 --- /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": 31, + "lineNumber": 3, + "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..96c68269 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-await-binding-invalid.src.js @@ -0,0 +1,5 @@ +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..e0cdd494 --- /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": 42, + "lineNumber": 5, + "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..36cdcd66 --- /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": 3, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 2, + 60 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 2, + 60 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 8, + 9 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 10, + 60 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 14, + 58 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 31 + } + }, + "range": [ + 27, + 54 + ], + "expression": { + "type": "ArrowFunctionExpression", + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 29 + } + }, + "range": [ + 28, + 52 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 5, + "column": 11 + }, + "end": { + "line": 5, + "column": 29 + } + }, + "range": [ + 34, + 52 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 27 + } + }, + "range": [ + 36, + 50 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 19 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "range": [ + 42, + 47 + ], + "name": "await" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 5, + "column": 25 + }, + "end": { + "line": 5, + "column": 27 + } + }, + "range": [ + 48, + 50 + ], + "body": [] + } + } + ] + } + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "range": [ + 2, + 7 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 8, + 9 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 10, + 11 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 8 + } + }, + "range": [ + 14, + 20 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 21, + 22 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "range": [ + 27, + 28 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 6 + } + }, + "range": [ + 28, + 29 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "range": [ + 29, + 30 + ] + }, + { + "type": "Punctuator", + "value": "=>", + "loc": { + "start": { + "line": 5, + "column": 8 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 31, + 33 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 11 + }, + "end": { + "line": 5, + "column": 12 + } + }, + "range": [ + 34, + 35 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 18 + } + }, + "range": [ + 36, + 41 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 5, + "column": 19 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "range": [ + 42, + 47 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 25 + }, + "end": { + "line": 5, + "column": 26 + } + }, + "range": [ + 48, + 49 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 26 + }, + "end": { + "line": 5, + "column": 27 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 28 + }, + "end": { + "line": 5, + "column": 29 + } + }, + "range": [ + 51, + 52 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 29 + }, + "end": { + "line": 5, + "column": 30 + } + }, + "range": [ + 52, + 53 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 30 + }, + "end": { + "line": 5, + "column": 31 + } + }, + "range": [ + 53, + 54 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 57, + 58 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 59, + 60 + ] + } + ] +}; \ 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..0839bff4 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-await-binding-valid.src.js @@ -0,0 +1,7 @@ + + +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..80948460 --- /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": 3, + "column": 0 + }, + "end": { + "line": 11, + "column": 35 + } + }, + "range": [ + 2, + 108 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 17 + } + }, + "range": [ + 2, + 19 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "range": [ + 6, + 18 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 6, + 11 + ], + "name": "value" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "range": [ + 14, + 18 + ], + "value": null, + "raw": "null" + } + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 9, + "column": 1 + } + }, + "range": [ + 21, + 71 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "range": [ + 27, + 28 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 5, + "column": 8 + }, + "end": { + "line": 9, + "column": 1 + } + }, + "range": [ + 29, + 71 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 8, + "column": 3 + } + }, + "range": [ + 33, + 69 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 23 + } + }, + "range": [ + 46, + 65 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 22 + } + }, + "range": [ + 46, + 64 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 9 + } + }, + "range": [ + 46, + 51 + ], + "name": "value" + }, + "right": { + "type": "MetaProperty", + "loc": { + "start": { + "line": 7, + "column": 12 + }, + "end": { + "line": 7, + "column": 22 + } + }, + "range": [ + 54, + 64 + ], + "meta": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 12 + }, + "end": { + "line": 7, + "column": 15 + } + }, + "range": [ + 54, + 57 + ], + "name": "new" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 16 + }, + "end": { + "line": 7, + "column": 22 + } + }, + "range": [ + 58, + 64 + ], + "name": "target" + } + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 35 + } + }, + "range": [ + 73, + 108 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 34 + } + }, + "range": [ + 73, + 107 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 16 + } + }, + "range": [ + 73, + 89 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 6 + } + }, + "range": [ + 73, + 79 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 7 + }, + "end": { + "line": 11, + "column": 16 + } + }, + "range": [ + 80, + 89 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 17 + }, + "end": { + "line": 11, + "column": 22 + } + }, + "range": [ + 90, + 95 + ], + "name": "value" + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 24 + }, + "end": { + "line": 11, + "column": 33 + } + }, + "range": [ + 97, + 106 + ], + "name": "undefined" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "range": [ + 2, + 5 + ] + }, + { + "type": "Identifier", + "value": "value", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 6, + 11 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "range": [ + 12, + 13 + ] + }, + { + "type": "Null", + "value": "null", + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "range": [ + 14, + 18 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 16 + }, + "end": { + "line": 3, + "column": 17 + } + }, + "range": [ + 18, + 19 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "range": [ + 21, + 26 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "range": [ + 27, + 28 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 8 + }, + "end": { + "line": 5, + "column": 9 + } + }, + "range": [ + 29, + 30 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 8 + } + }, + "range": [ + 33, + 39 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 9 + }, + "end": { + "line": 6, + "column": 10 + } + }, + "range": [ + 40, + 41 + ] + }, + { + "type": "Identifier", + "value": "value", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 9 + } + }, + "range": [ + 46, + 51 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 7, + "column": 10 + }, + "end": { + "line": 7, + "column": 11 + } + }, + "range": [ + 52, + 53 + ] + }, + { + "type": "Keyword", + "value": "new", + "loc": { + "start": { + "line": 7, + "column": 12 + }, + "end": { + "line": 7, + "column": 15 + } + }, + "range": [ + 54, + 57 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 7, + "column": 15 + }, + "end": { + "line": 7, + "column": 16 + } + }, + "range": [ + 57, + 58 + ] + }, + { + "type": "Identifier", + "value": "target", + "loc": { + "start": { + "line": 7, + "column": 16 + }, + "end": { + "line": 7, + "column": 22 + } + }, + "range": [ + 58, + 64 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 7, + "column": 22 + }, + "end": { + "line": 7, + "column": 23 + } + }, + "range": [ + 64, + 65 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 3 + } + }, + "range": [ + 68, + 69 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 9, + "column": 0 + }, + "end": { + "line": 9, + "column": 1 + } + }, + "range": [ + 70, + 71 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 6 + } + }, + "range": [ + 73, + 79 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 7 + } + }, + "range": [ + 79, + 80 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 11, + "column": 7 + }, + "end": { + "line": 11, + "column": 16 + } + }, + "range": [ + 80, + 89 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 11, + "column": 16 + }, + "end": { + "line": 11, + "column": 17 + } + }, + "range": [ + 89, + 90 + ] + }, + { + "type": "Identifier", + "value": "value", + "loc": { + "start": { + "line": 11, + "column": 17 + }, + "end": { + "line": 11, + "column": 22 + } + }, + "range": [ + 90, + 95 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 11, + "column": 22 + }, + "end": { + "line": 11, + "column": 23 + } + }, + "range": [ + 95, + 96 + ] + }, + { + "type": "Identifier", + "value": "undefined", + "loc": { + "start": { + "line": 11, + "column": 24 + }, + "end": { + "line": 11, + "column": 33 + } + }, + "range": [ + 97, + 106 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 11, + "column": 33 + }, + "end": { + "line": 11, + "column": 34 + } + }, + "range": [ + 106, + 107 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 11, + "column": 34 + }, + "end": { + "line": 11, + "column": 35 + } + }, + "range": [ + 107, + 108 + ] + } + ] +}; \ 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..cf32166e --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-expr-new-target.src.js @@ -0,0 +1,11 @@ + + +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..15947c0f --- /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": 3, + "column": 0 + }, + "end": { + "line": 11, + "column": 27 + } + }, + "range": [ + 2, + 87 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 2, + 12 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 6, + 11 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 6, + 11 + ], + "name": "value" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 9, + "column": 1 + } + }, + "range": [ + 14, + 58 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "range": [ + 20, + 21 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 5, + "column": 8 + }, + "end": { + "line": 9, + "column": 1 + } + }, + "range": [ + 22, + 58 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 8, + "column": 3 + } + }, + "range": [ + 26, + 56 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 17 + } + }, + "range": [ + 39, + 52 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 16 + } + }, + "range": [ + 39, + 51 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 9 + } + }, + "range": [ + 39, + 44 + ], + "name": "value" + }, + "right": { + "type": "ThisExpression", + "loc": { + "start": { + "line": 7, + "column": 12 + }, + "end": { + "line": 7, + "column": 16 + } + }, + "range": [ + 47, + 51 + ] + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 27 + } + }, + "range": [ + 60, + 87 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 26 + } + }, + "range": [ + 60, + 86 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 16 + } + }, + "range": [ + 60, + 76 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 6 + } + }, + "range": [ + 60, + 66 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 7 + }, + "end": { + "line": 11, + "column": 16 + } + }, + "range": [ + 67, + 76 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 17 + }, + "end": { + "line": 11, + "column": 22 + } + }, + "range": [ + 77, + 82 + ], + "name": "value" + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 24 + }, + "end": { + "line": 11, + "column": 25 + } + }, + "range": [ + 84, + 85 + ], + "name": "C" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "range": [ + 2, + 5 + ] + }, + { + "type": "Identifier", + "value": "value", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 6, + 11 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 11, + 12 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "range": [ + 14, + 19 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "range": [ + 20, + 21 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 8 + }, + "end": { + "line": 5, + "column": 9 + } + }, + "range": [ + 22, + 23 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 8 + } + }, + "range": [ + 26, + 32 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 9 + }, + "end": { + "line": 6, + "column": 10 + } + }, + "range": [ + 33, + 34 + ] + }, + { + "type": "Identifier", + "value": "value", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 9 + } + }, + "range": [ + 39, + 44 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 7, + "column": 10 + }, + "end": { + "line": 7, + "column": 11 + } + }, + "range": [ + 45, + 46 + ] + }, + { + "type": "Keyword", + "value": "this", + "loc": { + "start": { + "line": 7, + "column": 12 + }, + "end": { + "line": 7, + "column": 16 + } + }, + "range": [ + 47, + 51 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 7, + "column": 16 + }, + "end": { + "line": 7, + "column": 17 + } + }, + "range": [ + 51, + 52 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 3 + } + }, + "range": [ + 55, + 56 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 9, + "column": 0 + }, + "end": { + "line": 9, + "column": 1 + } + }, + "range": [ + 57, + 58 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 6 + } + }, + "range": [ + 60, + 66 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 7 + } + }, + "range": [ + 66, + 67 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 11, + "column": 7 + }, + "end": { + "line": 11, + "column": 16 + } + }, + "range": [ + 67, + 76 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 11, + "column": 16 + }, + "end": { + "line": 11, + "column": 17 + } + }, + "range": [ + 76, + 77 + ] + }, + { + "type": "Identifier", + "value": "value", + "loc": { + "start": { + "line": 11, + "column": 17 + }, + "end": { + "line": 11, + "column": 22 + } + }, + "range": [ + 77, + 82 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 11, + "column": 22 + }, + "end": { + "line": 11, + "column": 23 + } + }, + "range": [ + 82, + 83 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 11, + "column": 24 + }, + "end": { + "line": 11, + "column": 25 + } + }, + "range": [ + 84, + 85 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 11, + "column": 25 + }, + "end": { + "line": 11, + "column": 26 + } + }, + "range": [ + 85, + 86 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 11, + "column": 26 + }, + "end": { + "line": 11, + "column": 27 + } + }, + "range": [ + 86, + 87 + ] + } + ] +}; \ 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..9d0ed2d9 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-expr-this.src.js @@ -0,0 +1,11 @@ + + +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..8cb71d2f --- /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": 35, + "lineNumber": 3, + "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..348dd6fb --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-arguments.src.js @@ -0,0 +1,5 @@ +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..8ee1d254 --- /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": 52, + "lineNumber": 4, + "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..065d96ee --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-await.src.js @@ -0,0 +1,7 @@ +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..513cc7c9 --- /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": 28, + "lineNumber": 3, + "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..8e4805fc --- /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..ece5d1c8 --- /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": 40, + "lineNumber": 4, + "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..354338c6 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-lex-dup.src.js @@ -0,0 +1,6 @@ +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..ece5d1c8 --- /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": 40, + "lineNumber": 4, + "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..2a387a5c --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-lex-var.src.js @@ -0,0 +1,6 @@ +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..15de4305 --- /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": 46, + "lineNumber": 4, + "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..d19ca186 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-return.src.js @@ -0,0 +1,7 @@ +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..408594b4 --- /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": 25, + "lineNumber": 3, + "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..56de626c --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-super-call.src.js @@ -0,0 +1,5 @@ +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..7c84d11e --- /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": 50, + "lineNumber": 4, + "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..4aef3961 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-undefined-break-target.src.js @@ -0,0 +1,7 @@ +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..8f6ad7a4 --- /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": 50, + "lineNumber": 4, + "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..6d7b1a8f --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-undefined-continue-target.src.js @@ -0,0 +1,7 @@ +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..025edd70 --- /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": 48, + "lineNumber": 4, + "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..a26138ac --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-yield.src.js @@ -0,0 +1,7 @@ +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..e931ac48 --- /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": 3, + "column": 0 + }, + "end": { + "line": 15, + "column": 39 + } + }, + "range": [ + 2, + 179 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 28 + } + }, + "range": [ + 2, + 30 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 27 + } + }, + "range": [ + 6, + 29 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "range": [ + 6, + 13 + ], + "name": "test262" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 27 + } + }, + "range": [ + 16, + 29 + ], + "value": "outer scope", + "raw": "'outer scope'" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 31, + 41 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 35, + 40 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 35, + 40 + ], + "name": "probe" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 13, + "column": 1 + } + }, + "range": [ + 43, + 138 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 49, + 50 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 13, + "column": 1 + } + }, + "range": [ + 51, + 138 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 9, + "column": 3 + } + }, + "range": [ + 55, + 100 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 32 + } + }, + "range": [ + 68, + 96 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 31 + } + }, + "range": [ + 72, + 95 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 15 + } + }, + "range": [ + 72, + 79 + ], + "name": "test262" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 8, + "column": 31 + } + }, + "range": [ + 82, + 95 + ], + "value": "first block", + "raw": "'first block'" + } + } + ], + "kind": "let" + } + ] + }, + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 10, + "column": 2 + }, + "end": { + "line": 12, + "column": 3 + } + }, + "range": [ + 103, + 136 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 11, + "column": 4 + }, + "end": { + "line": 11, + "column": 20 + } + }, + "range": [ + 116, + 132 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 11, + "column": 4 + }, + "end": { + "line": 11, + "column": 19 + } + }, + "range": [ + 116, + 131 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 4 + }, + "end": { + "line": 11, + "column": 9 + } + }, + "range": [ + 116, + 121 + ], + "name": "probe" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 12 + }, + "end": { + "line": 11, + "column": 19 + } + }, + "range": [ + 124, + 131 + ], + "name": "test262" + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 39 + } + }, + "range": [ + 140, + 179 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 38 + } + }, + "range": [ + 140, + 178 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 16 + } + }, + "range": [ + 140, + 156 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 6 + } + }, + "range": [ + 140, + 146 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 7 + }, + "end": { + "line": 15, + "column": 16 + } + }, + "range": [ + 147, + 156 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 17 + }, + "end": { + "line": 15, + "column": 22 + } + }, + "range": [ + 157, + 162 + ], + "name": "probe" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 15, + "column": 24 + }, + "end": { + "line": 15, + "column": 37 + } + }, + "range": [ + 164, + 177 + ], + "value": "outer scope", + "raw": "'outer scope'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "range": [ + 2, + 5 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "range": [ + 6, + 13 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 14, + 15 + ] + }, + { + "type": "String", + "value": "'outer scope'", + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 27 + } + }, + "range": [ + 16, + 29 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 27 + }, + "end": { + "line": 3, + "column": 28 + } + }, + "range": [ + 29, + 30 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 31, + 34 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 35, + 40 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 40, + 41 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 43, + 48 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 9 + } + }, + "range": [ + 51, + 52 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 8 + } + }, + "range": [ + 55, + 61 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 10 + } + }, + "range": [ + 62, + 63 + ] + }, + { + "type": "Keyword", + "value": "let", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 7 + } + }, + "range": [ + 68, + 71 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 15 + } + }, + "range": [ + 72, + 79 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 8, + "column": 16 + }, + "end": { + "line": 8, + "column": 17 + } + }, + "range": [ + 80, + 81 + ] + }, + { + "type": "String", + "value": "'first block'", + "loc": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 8, + "column": 31 + } + }, + "range": [ + 82, + 95 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 8, + "column": 31 + }, + "end": { + "line": 8, + "column": 32 + } + }, + "range": [ + 95, + 96 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 9, + "column": 3 + } + }, + "range": [ + 99, + 100 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 10, + "column": 2 + }, + "end": { + "line": 10, + "column": 8 + } + }, + "range": [ + 103, + 109 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 10 + } + }, + "range": [ + 110, + 111 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 11, + "column": 4 + }, + "end": { + "line": 11, + "column": 9 + } + }, + "range": [ + 116, + 121 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 11 + } + }, + "range": [ + 122, + 123 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 11, + "column": 12 + }, + "end": { + "line": 11, + "column": 19 + } + }, + "range": [ + 124, + 131 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 11, + "column": 19 + }, + "end": { + "line": 11, + "column": 20 + } + }, + "range": [ + 131, + 132 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 12, + "column": 2 + }, + "end": { + "line": 12, + "column": 3 + } + }, + "range": [ + 135, + 136 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 1 + } + }, + "range": [ + 137, + 138 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 6 + } + }, + "range": [ + 140, + 146 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 15, + "column": 7 + } + }, + "range": [ + 146, + 147 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 15, + "column": 7 + }, + "end": { + "line": 15, + "column": 16 + } + }, + "range": [ + 147, + 156 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 15, + "column": 16 + }, + "end": { + "line": 15, + "column": 17 + } + }, + "range": [ + 156, + 157 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 15, + "column": 17 + }, + "end": { + "line": 15, + "column": 22 + } + }, + "range": [ + 157, + 162 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 15, + "column": 22 + }, + "end": { + "line": 15, + "column": 23 + } + }, + "range": [ + 162, + 163 + ] + }, + { + "type": "String", + "value": "'outer scope'", + "loc": { + "start": { + "line": 15, + "column": 24 + }, + "end": { + "line": 15, + "column": 37 + } + }, + "range": [ + 164, + 177 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 15, + "column": 37 + }, + "end": { + "line": 15, + "column": 38 + } + }, + "range": [ + 177, + 178 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 15, + "column": 38 + }, + "end": { + "line": 15, + "column": 39 + } + }, + "range": [ + 178, + 179 + ] + } + ] +}; \ 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..38eacf31 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-lex-close.src.js @@ -0,0 +1,15 @@ + + +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..394093ad --- /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": 3, + "column": 0 + }, + "end": { + "line": 11, + "column": 27 + } + }, + "range": [ + 2, + 84 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 2, + 12 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 6, + 11 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 6, + 11 + ], + "name": "probe" + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 9, + "column": 1 + } + }, + "range": [ + 14, + 55 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "range": [ + 20, + 21 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 5, + "column": 8 + }, + "end": { + "line": 9, + "column": 1 + } + }, + "range": [ + 22, + 55 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 8, + "column": 3 + } + }, + "range": [ + 26, + 53 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 14 + } + }, + "range": [ + 39, + 49 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 13 + } + }, + "range": [ + 39, + 48 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 9 + } + }, + "range": [ + 39, + 44 + ], + "name": "probe" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 12 + }, + "end": { + "line": 7, + "column": 13 + } + }, + "range": [ + 47, + 48 + ], + "name": "C" + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 27 + } + }, + "range": [ + 57, + 84 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 26 + } + }, + "range": [ + 57, + 83 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 16 + } + }, + "range": [ + 57, + 73 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 6 + } + }, + "range": [ + 57, + 63 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 7 + }, + "end": { + "line": 11, + "column": 16 + } + }, + "range": [ + 64, + 73 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 17 + }, + "end": { + "line": 11, + "column": 22 + } + }, + "range": [ + 74, + 79 + ], + "name": "probe" + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 24 + }, + "end": { + "line": 11, + "column": 25 + } + }, + "range": [ + 81, + 82 + ], + "name": "C" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "let", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "range": [ + 2, + 5 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 6, + 11 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 11, + 12 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "range": [ + 14, + 19 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "range": [ + 20, + 21 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 8 + }, + "end": { + "line": 5, + "column": 9 + } + }, + "range": [ + 22, + 23 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 8 + } + }, + "range": [ + 26, + 32 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 9 + }, + "end": { + "line": 6, + "column": 10 + } + }, + "range": [ + 33, + 34 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 9 + } + }, + "range": [ + 39, + 44 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 7, + "column": 10 + }, + "end": { + "line": 7, + "column": 11 + } + }, + "range": [ + 45, + 46 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 7, + "column": 12 + }, + "end": { + "line": 7, + "column": 13 + } + }, + "range": [ + 47, + 48 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 7, + "column": 13 + }, + "end": { + "line": 7, + "column": 14 + } + }, + "range": [ + 48, + 49 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 3 + } + }, + "range": [ + 52, + 53 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 9, + "column": 0 + }, + "end": { + "line": 9, + "column": 1 + } + }, + "range": [ + 54, + 55 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 6 + } + }, + "range": [ + 57, + 63 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 7 + } + }, + "range": [ + 63, + 64 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 11, + "column": 7 + }, + "end": { + "line": 11, + "column": 16 + } + }, + "range": [ + 64, + 73 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 11, + "column": 16 + }, + "end": { + "line": 11, + "column": 17 + } + }, + "range": [ + 73, + 74 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 11, + "column": 17 + }, + "end": { + "line": 11, + "column": 22 + } + }, + "range": [ + 74, + 79 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 11, + "column": 22 + }, + "end": { + "line": 11, + "column": 23 + } + }, + "range": [ + 79, + 80 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 11, + "column": 24 + }, + "end": { + "line": 11, + "column": 25 + } + }, + "range": [ + 81, + 82 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 11, + "column": 25 + }, + "end": { + "line": 11, + "column": 26 + } + }, + "range": [ + 82, + 83 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 11, + "column": 26 + }, + "end": { + "line": 11, + "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-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..2e45a5f9 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-lex-derived.src.js @@ -0,0 +1,11 @@ + + +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..3b5d36e4 --- /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": 3, + "column": 0 + }, + "end": { + "line": 19, + "column": 41 + } + }, + "range": [ + 2, + 330 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 28 + } + }, + "range": [ + 2, + 30 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 27 + } + }, + "range": [ + 6, + 29 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "range": [ + 6, + 13 + ], + "name": "test262" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 27 + } + }, + "range": [ + 16, + 29 + ], + "value": "outer scope", + "raw": "'outer scope'" + } + } + ], + "kind": "let" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 19 + } + }, + "range": [ + 31, + 50 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 35, + 41 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 35, + 41 + ], + "name": "probe1" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 18 + } + }, + "range": [ + 43, + 49 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 18 + } + }, + "range": [ + 43, + 49 + ], + "name": "probe2" + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 15, + "column": 1 + } + }, + "range": [ + 52, + 204 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 58, + 59 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 15, + "column": 1 + } + }, + "range": [ + 60, + 204 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 10, + "column": 3 + } + }, + "range": [ + 64, + 131 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 32 + } + }, + "range": [ + 77, + 105 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 31 + } + }, + "range": [ + 81, + 104 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 15 + } + }, + "range": [ + 81, + 88 + ], + "name": "test262" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 8, + "column": 31 + } + }, + "range": [ + 91, + 104 + ], + "value": "first block", + "raw": "'first block'" + } + } + ], + "kind": "let" + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 21 + } + }, + "range": [ + 110, + 127 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 20 + } + }, + "range": [ + 110, + 126 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 10 + } + }, + "range": [ + 110, + 116 + ], + "name": "probe1" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 13 + }, + "end": { + "line": 9, + "column": 20 + } + }, + "range": [ + 119, + 126 + ], + "name": "test262" + } + } + } + ] + }, + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 14, + "column": 3 + } + }, + "range": [ + 134, + 202 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 12, + "column": 4 + }, + "end": { + "line": 12, + "column": 33 + } + }, + "range": [ + 147, + 176 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 12, + "column": 8 + }, + "end": { + "line": 12, + "column": 32 + } + }, + "range": [ + 151, + 175 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 8 + }, + "end": { + "line": 12, + "column": 15 + } + }, + "range": [ + 151, + 158 + ], + "name": "test262" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 12, + "column": 18 + }, + "end": { + "line": 12, + "column": 32 + } + }, + "range": [ + 161, + 175 + ], + "value": "second block", + "raw": "'second block'" + } + } + ], + "kind": "let" + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 21 + } + }, + "range": [ + 181, + 198 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 20 + } + }, + "range": [ + 181, + 197 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 10 + } + }, + "range": [ + 181, + 187 + ], + "name": "probe2" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 13 + }, + "end": { + "line": 13, + "column": 20 + } + }, + "range": [ + 190, + 197 + ], + "name": "test262" + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 41 + } + }, + "range": [ + 206, + 247 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 40 + } + }, + "range": [ + 206, + 246 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 206, + 222 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 6 + } + }, + "range": [ + 206, + 212 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 7 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 213, + 222 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 17 + }, + "end": { + "line": 17, + "column": 24 + } + }, + "range": [ + 223, + 230 + ], + "name": "test262" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 17, + "column": 26 + }, + "end": { + "line": 17, + "column": 39 + } + }, + "range": [ + 232, + 245 + ], + "value": "outer scope", + "raw": "'outer scope'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 40 + } + }, + "range": [ + 248, + 288 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 39 + } + }, + "range": [ + 248, + 287 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 16 + } + }, + "range": [ + 248, + 264 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 6 + } + }, + "range": [ + 248, + 254 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 7 + }, + "end": { + "line": 18, + "column": 16 + } + }, + "range": [ + 255, + 264 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 23 + } + }, + "range": [ + 265, + 271 + ], + "name": "probe1" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 18, + "column": 25 + }, + "end": { + "line": 18, + "column": 38 + } + }, + "range": [ + 273, + 286 + ], + "value": "first block", + "raw": "'first block'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 41 + } + }, + "range": [ + 289, + 330 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 40 + } + }, + "range": [ + 289, + 329 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 16 + } + }, + "range": [ + 289, + 305 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 6 + } + }, + "range": [ + 289, + 295 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 19, + "column": 7 + }, + "end": { + "line": 19, + "column": 16 + } + }, + "range": [ + 296, + 305 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 19, + "column": 17 + }, + "end": { + "line": 19, + "column": 23 + } + }, + "range": [ + 306, + 312 + ], + "name": "probe2" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 19, + "column": 25 + }, + "end": { + "line": 19, + "column": 39 + } + }, + "range": [ + 314, + 328 + ], + "value": "second block", + "raw": "'second block'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "let", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "range": [ + 2, + 5 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "range": [ + 6, + 13 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 14, + 15 + ] + }, + { + "type": "String", + "value": "'outer scope'", + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 27 + } + }, + "range": [ + 16, + 29 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 27 + }, + "end": { + "line": 3, + "column": 28 + } + }, + "range": [ + 29, + 30 + ] + }, + { + "type": "Keyword", + "value": "let", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 31, + 34 + ] + }, + { + "type": "Identifier", + "value": "probe1", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 35, + 41 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 4, + "column": 10 + }, + "end": { + "line": 4, + "column": 11 + } + }, + "range": [ + 41, + 42 + ] + }, + { + "type": "Identifier", + "value": "probe2", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 18 + } + }, + "range": [ + 43, + 49 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 18 + }, + "end": { + "line": 4, + "column": 19 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 52, + 57 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 58, + 59 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 9 + } + }, + "range": [ + 60, + 61 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 8 + } + }, + "range": [ + 64, + 70 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 10 + } + }, + "range": [ + 71, + 72 + ] + }, + { + "type": "Keyword", + "value": "let", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 7 + } + }, + "range": [ + 77, + 80 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 15 + } + }, + "range": [ + 81, + 88 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 8, + "column": 16 + }, + "end": { + "line": 8, + "column": 17 + } + }, + "range": [ + 89, + 90 + ] + }, + { + "type": "String", + "value": "'first block'", + "loc": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 8, + "column": 31 + } + }, + "range": [ + 91, + 104 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 8, + "column": 31 + }, + "end": { + "line": 8, + "column": 32 + } + }, + "range": [ + 104, + 105 + ] + }, + { + "type": "Identifier", + "value": "probe1", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 10 + } + }, + "range": [ + 110, + 116 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 9, + "column": 11 + }, + "end": { + "line": 9, + "column": 12 + } + }, + "range": [ + 117, + 118 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 9, + "column": 13 + }, + "end": { + "line": 9, + "column": 20 + } + }, + "range": [ + 119, + 126 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 9, + "column": 20 + }, + "end": { + "line": 9, + "column": 21 + } + }, + "range": [ + 126, + 127 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 10, + "column": 2 + }, + "end": { + "line": 10, + "column": 3 + } + }, + "range": [ + 130, + 131 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 8 + } + }, + "range": [ + 134, + 140 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 11, + "column": 9 + }, + "end": { + "line": 11, + "column": 10 + } + }, + "range": [ + 141, + 142 + ] + }, + { + "type": "Keyword", + "value": "let", + "loc": { + "start": { + "line": 12, + "column": 4 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "range": [ + 147, + 150 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 12, + "column": 8 + }, + "end": { + "line": 12, + "column": 15 + } + }, + "range": [ + 151, + 158 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 12, + "column": 16 + }, + "end": { + "line": 12, + "column": 17 + } + }, + "range": [ + 159, + 160 + ] + }, + { + "type": "String", + "value": "'second block'", + "loc": { + "start": { + "line": 12, + "column": 18 + }, + "end": { + "line": 12, + "column": 32 + } + }, + "range": [ + 161, + 175 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 12, + "column": 32 + }, + "end": { + "line": 12, + "column": 33 + } + }, + "range": [ + 175, + 176 + ] + }, + { + "type": "Identifier", + "value": "probe2", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 10 + } + }, + "range": [ + 181, + 187 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 13, + "column": 11 + }, + "end": { + "line": 13, + "column": 12 + } + }, + "range": [ + 188, + 189 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 13, + "column": 13 + }, + "end": { + "line": 13, + "column": 20 + } + }, + "range": [ + 190, + 197 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 13, + "column": 20 + }, + "end": { + "line": 13, + "column": 21 + } + }, + "range": [ + 197, + 198 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 14, + "column": 2 + }, + "end": { + "line": 14, + "column": 3 + } + }, + "range": [ + 201, + 202 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 1 + } + }, + "range": [ + 203, + 204 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 6 + } + }, + "range": [ + 206, + 212 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 17, + "column": 6 + }, + "end": { + "line": 17, + "column": 7 + } + }, + "range": [ + 212, + 213 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 17, + "column": 7 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 213, + 222 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 17, + "column": 16 + }, + "end": { + "line": 17, + "column": 17 + } + }, + "range": [ + 222, + 223 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 17, + "column": 17 + }, + "end": { + "line": 17, + "column": 24 + } + }, + "range": [ + 223, + 230 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 17, + "column": 24 + }, + "end": { + "line": 17, + "column": 25 + } + }, + "range": [ + 230, + 231 + ] + }, + { + "type": "String", + "value": "'outer scope'", + "loc": { + "start": { + "line": 17, + "column": 26 + }, + "end": { + "line": 17, + "column": 39 + } + }, + "range": [ + 232, + 245 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 17, + "column": 39 + }, + "end": { + "line": 17, + "column": 40 + } + }, + "range": [ + 245, + 246 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 17, + "column": 40 + }, + "end": { + "line": 17, + "column": 41 + } + }, + "range": [ + 246, + 247 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 6 + } + }, + "range": [ + 248, + 254 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 18, + "column": 6 + }, + "end": { + "line": 18, + "column": 7 + } + }, + "range": [ + 254, + 255 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 18, + "column": 7 + }, + "end": { + "line": 18, + "column": 16 + } + }, + "range": [ + 255, + 264 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 18, + "column": 16 + }, + "end": { + "line": 18, + "column": 17 + } + }, + "range": [ + 264, + 265 + ] + }, + { + "type": "Identifier", + "value": "probe1", + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 23 + } + }, + "range": [ + 265, + 271 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 18, + "column": 23 + }, + "end": { + "line": 18, + "column": 24 + } + }, + "range": [ + 271, + 272 + ] + }, + { + "type": "String", + "value": "'first block'", + "loc": { + "start": { + "line": 18, + "column": 25 + }, + "end": { + "line": 18, + "column": 38 + } + }, + "range": [ + 273, + 286 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 18, + "column": 38 + }, + "end": { + "line": 18, + "column": 39 + } + }, + "range": [ + 286, + 287 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 18, + "column": 39 + }, + "end": { + "line": 18, + "column": 40 + } + }, + "range": [ + 287, + 288 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 6 + } + }, + "range": [ + 289, + 295 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 19, + "column": 6 + }, + "end": { + "line": 19, + "column": 7 + } + }, + "range": [ + 295, + 296 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 19, + "column": 7 + }, + "end": { + "line": 19, + "column": 16 + } + }, + "range": [ + 296, + 305 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 19, + "column": 16 + }, + "end": { + "line": 19, + "column": 17 + } + }, + "range": [ + 305, + 306 + ] + }, + { + "type": "Identifier", + "value": "probe2", + "loc": { + "start": { + "line": 19, + "column": 17 + }, + "end": { + "line": 19, + "column": 23 + } + }, + "range": [ + 306, + 312 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 19, + "column": 23 + }, + "end": { + "line": 19, + "column": 24 + } + }, + "range": [ + 312, + 313 + ] + }, + { + "type": "String", + "value": "'second block'", + "loc": { + "start": { + "line": 19, + "column": 25 + }, + "end": { + "line": 19, + "column": 39 + } + }, + "range": [ + 314, + 328 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 19, + "column": 39 + }, + "end": { + "line": 19, + "column": 40 + } + }, + "range": [ + 328, + 329 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 19, + "column": 40 + }, + "end": { + "line": 19, + "column": 41 + } + }, + "range": [ + 329, + 330 + ] + } + ] +}; \ 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..2c1ae1ba --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-lex-open.src.js @@ -0,0 +1,19 @@ + + +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..31756bdc --- /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": 3, + "column": 0 + }, + "end": { + "line": 13, + "column": 35 + } + }, + "range": [ + 2, + 133 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 2, + 12 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 6, + 11 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 6, + 11 + ], + "name": "probe" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 11, + "column": 1 + } + }, + "range": [ + 14, + 96 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "range": [ + 20, + 21 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 5, + "column": 8 + }, + "end": { + "line": 11, + "column": 1 + } + }, + "range": [ + 22, + 96 + ], + "body": [ + { + "type": "PropertyDefinition", + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 30 + } + }, + "range": [ + 26, + 54 + ], + "static": true, + "computed": false, + "key": { + "type": "PrivateIdentifier", + "loc": { + "start": { + "line": 6, + "column": 9 + }, + "end": { + "line": 6, + "column": 17 + } + }, + "range": [ + 33, + 41 + ], + "name": "test262" + }, + "value": { + "type": "Literal", + "loc": { + "start": { + "line": 6, + "column": 20 + }, + "end": { + "line": 6, + "column": 29 + } + }, + "range": [ + 44, + 53 + ], + "value": "private", + "raw": "'private'" + } + }, + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 10, + "column": 3 + } + }, + "range": [ + 58, + 94 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 23 + } + }, + "range": [ + 71, + 90 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 22 + } + }, + "range": [ + 71, + 89 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 9 + } + }, + "range": [ + 71, + 76 + ], + "name": "probe" + }, + "right": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 9, + "column": 12 + }, + "end": { + "line": 9, + "column": 22 + } + }, + "range": [ + 79, + 89 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 12 + }, + "end": { + "line": 9, + "column": 13 + } + }, + "range": [ + 79, + 80 + ], + "name": "C" + }, + "property": { + "type": "PrivateIdentifier", + "loc": { + "start": { + "line": 9, + "column": 14 + }, + "end": { + "line": 9, + "column": 22 + } + }, + "range": [ + 81, + 89 + ], + "name": "test262" + }, + "computed": false, + "optional": false + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 35 + } + }, + "range": [ + 98, + 133 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 34 + } + }, + "range": [ + 98, + 132 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 16 + } + }, + "range": [ + 98, + 114 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 6 + } + }, + "range": [ + 98, + 104 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 7 + }, + "end": { + "line": 13, + "column": 16 + } + }, + "range": [ + 105, + 114 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 17 + }, + "end": { + "line": 13, + "column": 22 + } + }, + "range": [ + 115, + 120 + ], + "name": "probe" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 13, + "column": 24 + }, + "end": { + "line": 13, + "column": 33 + } + }, + "range": [ + 122, + 131 + ], + "value": "private", + "raw": "'private'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "range": [ + 2, + 5 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 6, + 11 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "range": [ + 11, + 12 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "range": [ + 14, + 19 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "range": [ + 20, + 21 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 8 + }, + "end": { + "line": 5, + "column": 9 + } + }, + "range": [ + 22, + 23 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 8 + } + }, + "range": [ + 26, + 32 + ] + }, + { + "type": "PrivateIdentifier", + "value": "test262", + "loc": { + "start": { + "line": 6, + "column": 9 + }, + "end": { + "line": 6, + "column": 17 + } + }, + "range": [ + 33, + 41 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 6, + "column": 18 + }, + "end": { + "line": 6, + "column": 19 + } + }, + "range": [ + 42, + 43 + ] + }, + { + "type": "String", + "value": "'private'", + "loc": { + "start": { + "line": 6, + "column": 20 + }, + "end": { + "line": 6, + "column": 29 + } + }, + "range": [ + 44, + 53 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 29 + }, + "end": { + "line": 6, + "column": 30 + } + }, + "range": [ + 53, + 54 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 8 + } + }, + "range": [ + 58, + 64 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 8, + "column": 10 + } + }, + "range": [ + 65, + 66 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 9 + } + }, + "range": [ + 71, + 76 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 11 + } + }, + "range": [ + 77, + 78 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 9, + "column": 12 + }, + "end": { + "line": 9, + "column": 13 + } + }, + "range": [ + 79, + 80 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 9, + "column": 13 + }, + "end": { + "line": 9, + "column": 14 + } + }, + "range": [ + 80, + 81 + ] + }, + { + "type": "PrivateIdentifier", + "value": "test262", + "loc": { + "start": { + "line": 9, + "column": 14 + }, + "end": { + "line": 9, + "column": 22 + } + }, + "range": [ + 81, + 89 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 9, + "column": 22 + }, + "end": { + "line": 9, + "column": 23 + } + }, + "range": [ + 89, + 90 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 10, + "column": 2 + }, + "end": { + "line": 10, + "column": 3 + } + }, + "range": [ + 93, + 94 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 1 + } + }, + "range": [ + 95, + 96 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 6 + } + }, + "range": [ + 98, + 104 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 13, + "column": 6 + }, + "end": { + "line": 13, + "column": 7 + } + }, + "range": [ + 104, + 105 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 13, + "column": 7 + }, + "end": { + "line": 13, + "column": 16 + } + }, + "range": [ + 105, + 114 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 13, + "column": 16 + }, + "end": { + "line": 13, + "column": 17 + } + }, + "range": [ + 114, + 115 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 13, + "column": 17 + }, + "end": { + "line": 13, + "column": 22 + } + }, + "range": [ + 115, + 120 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 13, + "column": 22 + }, + "end": { + "line": 13, + "column": 23 + } + }, + "range": [ + 120, + 121 + ] + }, + { + "type": "String", + "value": "'private'", + "loc": { + "start": { + "line": 13, + "column": 24 + }, + "end": { + "line": 13, + "column": 33 + } + }, + "range": [ + 122, + 131 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 13, + "column": 33 + }, + "end": { + "line": 13, + "column": 34 + } + }, + "range": [ + 131, + 132 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 13, + "column": 34 + }, + "end": { + "line": 13, + "column": 35 + } + }, + "range": [ + 132, + 133 + ] + } + ] +}; \ 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..650c91aa --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-private.src.js @@ -0,0 +1,13 @@ + + +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..5b39ef59 --- /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": 3, + "column": 0 + }, + "end": { + "line": 15, + "column": 39 + } + }, + "range": [ + 2, + 179 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 28 + } + }, + "range": [ + 2, + 30 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 27 + } + }, + "range": [ + 6, + 29 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "range": [ + 6, + 13 + ], + "name": "test262" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 27 + } + }, + "range": [ + 16, + 29 + ], + "value": "outer scope", + "raw": "'outer scope'" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 31, + 41 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 35, + 40 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 35, + 40 + ], + "name": "probe" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 13, + "column": 1 + } + }, + "range": [ + 43, + 138 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 49, + 50 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 13, + "column": 1 + } + }, + "range": [ + 51, + 138 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 9, + "column": 3 + } + }, + "range": [ + 55, + 100 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 32 + } + }, + "range": [ + 68, + 96 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 31 + } + }, + "range": [ + 72, + 95 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 15 + } + }, + "range": [ + 72, + 79 + ], + "name": "test262" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 8, + "column": 31 + } + }, + "range": [ + 82, + 95 + ], + "value": "first block", + "raw": "'first block'" + } + } + ], + "kind": "var" + } + ] + }, + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 10, + "column": 2 + }, + "end": { + "line": 12, + "column": 3 + } + }, + "range": [ + 103, + 136 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 11, + "column": 4 + }, + "end": { + "line": 11, + "column": 20 + } + }, + "range": [ + 116, + 132 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 11, + "column": 4 + }, + "end": { + "line": 11, + "column": 19 + } + }, + "range": [ + 116, + 131 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 4 + }, + "end": { + "line": 11, + "column": 9 + } + }, + "range": [ + 116, + 121 + ], + "name": "probe" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 12 + }, + "end": { + "line": 11, + "column": 19 + } + }, + "range": [ + 124, + 131 + ], + "name": "test262" + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 39 + } + }, + "range": [ + 140, + 179 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 38 + } + }, + "range": [ + 140, + 178 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 16 + } + }, + "range": [ + 140, + 156 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 6 + } + }, + "range": [ + 140, + 146 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 7 + }, + "end": { + "line": 15, + "column": 16 + } + }, + "range": [ + 147, + 156 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 17 + }, + "end": { + "line": 15, + "column": 22 + } + }, + "range": [ + 157, + 162 + ], + "name": "probe" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 15, + "column": 24 + }, + "end": { + "line": 15, + "column": 37 + } + }, + "range": [ + 164, + 177 + ], + "value": "outer scope", + "raw": "'outer scope'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "range": [ + 2, + 5 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "range": [ + 6, + 13 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 14, + 15 + ] + }, + { + "type": "String", + "value": "'outer scope'", + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 27 + } + }, + "range": [ + 16, + 29 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 27 + }, + "end": { + "line": 3, + "column": 28 + } + }, + "range": [ + 29, + 30 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 31, + 34 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 35, + 40 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 40, + 41 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 43, + 48 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 9 + } + }, + "range": [ + 51, + 52 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 8 + } + }, + "range": [ + 55, + 61 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 10 + } + }, + "range": [ + 62, + 63 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 7 + } + }, + "range": [ + 68, + 71 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 15 + } + }, + "range": [ + 72, + 79 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 8, + "column": 16 + }, + "end": { + "line": 8, + "column": 17 + } + }, + "range": [ + 80, + 81 + ] + }, + { + "type": "String", + "value": "'first block'", + "loc": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 8, + "column": 31 + } + }, + "range": [ + 82, + 95 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 8, + "column": 31 + }, + "end": { + "line": 8, + "column": 32 + } + }, + "range": [ + 95, + 96 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 9, + "column": 3 + } + }, + "range": [ + 99, + 100 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 10, + "column": 2 + }, + "end": { + "line": 10, + "column": 8 + } + }, + "range": [ + 103, + 109 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 10 + } + }, + "range": [ + 110, + 111 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 11, + "column": 4 + }, + "end": { + "line": 11, + "column": 9 + } + }, + "range": [ + 116, + 121 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 11 + } + }, + "range": [ + 122, + 123 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 11, + "column": 12 + }, + "end": { + "line": 11, + "column": 19 + } + }, + "range": [ + 124, + 131 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 11, + "column": 19 + }, + "end": { + "line": 11, + "column": 20 + } + }, + "range": [ + 131, + 132 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 12, + "column": 2 + }, + "end": { + "line": 12, + "column": 3 + } + }, + "range": [ + 135, + 136 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 1 + } + }, + "range": [ + 137, + 138 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 6 + } + }, + "range": [ + 140, + 146 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 15, + "column": 7 + } + }, + "range": [ + 146, + 147 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 15, + "column": 7 + }, + "end": { + "line": 15, + "column": 16 + } + }, + "range": [ + 147, + 156 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 15, + "column": 16 + }, + "end": { + "line": 15, + "column": 17 + } + }, + "range": [ + 156, + 157 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 15, + "column": 17 + }, + "end": { + "line": 15, + "column": 22 + } + }, + "range": [ + 157, + 162 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 15, + "column": 22 + }, + "end": { + "line": 15, + "column": 23 + } + }, + "range": [ + 162, + 163 + ] + }, + { + "type": "String", + "value": "'outer scope'", + "loc": { + "start": { + "line": 15, + "column": 24 + }, + "end": { + "line": 15, + "column": 37 + } + }, + "range": [ + 164, + 177 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 15, + "column": 37 + }, + "end": { + "line": 15, + "column": 38 + } + }, + "range": [ + 177, + 178 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 15, + "column": 38 + }, + "end": { + "line": 15, + "column": 39 + } + }, + "range": [ + 178, + 179 + ] + } + ] +}; \ 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..c406cf31 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-var-close.src.js @@ -0,0 +1,15 @@ + + +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..a5d2911b --- /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": 3, + "column": 0 + }, + "end": { + "line": 12, + "column": 39 + } + }, + "range": [ + 2, + 131 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 28 + } + }, + "range": [ + 2, + 30 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 27 + } + }, + "range": [ + 6, + 29 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "range": [ + 6, + 13 + ], + "name": "test262" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 27 + } + }, + "range": [ + 16, + 29 + ], + "value": "outer scope", + "raw": "'outer scope'" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 31, + 41 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 35, + 40 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 35, + 40 + ], + "name": "probe" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 10, + "column": 1 + } + }, + "range": [ + 43, + 90 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 49, + 50 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 10, + "column": 1 + } + }, + "range": [ + 51, + 90 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 9, + "column": 3 + } + }, + "range": [ + 55, + 88 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 20 + } + }, + "range": [ + 68, + 84 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 19 + } + }, + "range": [ + 68, + 83 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 9 + } + }, + "range": [ + 68, + 73 + ], + "name": "probe" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 12 + }, + "end": { + "line": 8, + "column": 19 + } + }, + "range": [ + 76, + 83 + ], + "name": "test262" + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 39 + } + }, + "range": [ + 92, + 131 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 38 + } + }, + "range": [ + 92, + 130 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 16 + } + }, + "range": [ + 92, + 108 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 6 + } + }, + "range": [ + 92, + 98 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 16 + } + }, + "range": [ + 99, + 108 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 17 + }, + "end": { + "line": 12, + "column": 22 + } + }, + "range": [ + 109, + 114 + ], + "name": "probe" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 12, + "column": 24 + }, + "end": { + "line": 12, + "column": 37 + } + }, + "range": [ + 116, + 129 + ], + "value": "outer scope", + "raw": "'outer scope'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "range": [ + 2, + 5 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "range": [ + 6, + 13 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 14, + 15 + ] + }, + { + "type": "String", + "value": "'outer scope'", + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 27 + } + }, + "range": [ + 16, + 29 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 27 + }, + "end": { + "line": 3, + "column": 28 + } + }, + "range": [ + 29, + 30 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 31, + 34 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 35, + 40 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 40, + 41 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 43, + 48 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 9 + } + }, + "range": [ + 51, + 52 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 8 + } + }, + "range": [ + 55, + 61 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 10 + } + }, + "range": [ + 62, + 63 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 9 + } + }, + "range": [ + 68, + 73 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 11 + } + }, + "range": [ + 74, + 75 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 8, + "column": 12 + }, + "end": { + "line": 8, + "column": 19 + } + }, + "range": [ + 76, + 83 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 8, + "column": 19 + }, + "end": { + "line": 8, + "column": 20 + } + }, + "range": [ + 83, + 84 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 9, + "column": 3 + } + }, + "range": [ + 87, + 88 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 10, + "column": 0 + }, + "end": { + "line": 10, + "column": 1 + } + }, + "range": [ + 89, + 90 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 6 + } + }, + "range": [ + 92, + 98 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 12, + "column": 6 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "range": [ + 98, + 99 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 16 + } + }, + "range": [ + 99, + 108 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 12, + "column": 16 + }, + "end": { + "line": 12, + "column": 17 + } + }, + "range": [ + 108, + 109 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 12, + "column": 17 + }, + "end": { + "line": 12, + "column": 22 + } + }, + "range": [ + 109, + 114 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 12, + "column": 22 + }, + "end": { + "line": 12, + "column": 23 + } + }, + "range": [ + 114, + 115 + ] + }, + { + "type": "String", + "value": "'outer scope'", + "loc": { + "start": { + "line": 12, + "column": 24 + }, + "end": { + "line": 12, + "column": 37 + } + }, + "range": [ + 116, + 129 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 12, + "column": 37 + }, + "end": { + "line": 12, + "column": 38 + } + }, + "range": [ + 129, + 130 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 12, + "column": 38 + }, + "end": { + "line": 12, + "column": 39 + } + }, + "range": [ + 130, + 131 + ] + } + ] +}; \ 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..af38817c --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-var-derived.src.js @@ -0,0 +1,12 @@ + + +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..8c735216 --- /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": 3, + "column": 0 + }, + "end": { + "line": 19, + "column": 41 + } + }, + "range": [ + 2, + 330 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 28 + } + }, + "range": [ + 2, + 30 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 27 + } + }, + "range": [ + 6, + 29 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "range": [ + 6, + 13 + ], + "name": "test262" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 27 + } + }, + "range": [ + 16, + 29 + ], + "value": "outer scope", + "raw": "'outer scope'" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 19 + } + }, + "range": [ + 31, + 50 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 35, + 41 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 35, + 41 + ], + "name": "probe1" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 18 + } + }, + "range": [ + 43, + 49 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 18 + } + }, + "range": [ + 43, + 49 + ], + "name": "probe2" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 15, + "column": 1 + } + }, + "range": [ + 52, + 204 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 58, + 59 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 15, + "column": 1 + } + }, + "range": [ + 60, + 204 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 10, + "column": 3 + } + }, + "range": [ + 64, + 131 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 32 + } + }, + "range": [ + 77, + 105 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 31 + } + }, + "range": [ + 81, + 104 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 15 + } + }, + "range": [ + 81, + 88 + ], + "name": "test262" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 8, + "column": 31 + } + }, + "range": [ + 91, + 104 + ], + "value": "first block", + "raw": "'first block'" + } + } + ], + "kind": "var" + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 21 + } + }, + "range": [ + 110, + 127 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 20 + } + }, + "range": [ + 110, + 126 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 10 + } + }, + "range": [ + 110, + 116 + ], + "name": "probe1" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 13 + }, + "end": { + "line": 9, + "column": 20 + } + }, + "range": [ + 119, + 126 + ], + "name": "test262" + } + } + } + ] + }, + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 14, + "column": 3 + } + }, + "range": [ + 134, + 202 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 12, + "column": 4 + }, + "end": { + "line": 12, + "column": 33 + } + }, + "range": [ + 147, + 176 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 12, + "column": 8 + }, + "end": { + "line": 12, + "column": 32 + } + }, + "range": [ + 151, + 175 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 8 + }, + "end": { + "line": 12, + "column": 15 + } + }, + "range": [ + 151, + 158 + ], + "name": "test262" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 12, + "column": 18 + }, + "end": { + "line": 12, + "column": 32 + } + }, + "range": [ + 161, + 175 + ], + "value": "second block", + "raw": "'second block'" + } + } + ], + "kind": "var" + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 21 + } + }, + "range": [ + 181, + 198 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 20 + } + }, + "range": [ + 181, + 197 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 10 + } + }, + "range": [ + 181, + 187 + ], + "name": "probe2" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 13 + }, + "end": { + "line": 13, + "column": 20 + } + }, + "range": [ + 190, + 197 + ], + "name": "test262" + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 41 + } + }, + "range": [ + 206, + 247 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 40 + } + }, + "range": [ + 206, + 246 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 206, + 222 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 6 + } + }, + "range": [ + 206, + 212 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 7 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 213, + 222 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 17 + }, + "end": { + "line": 17, + "column": 24 + } + }, + "range": [ + 223, + 230 + ], + "name": "test262" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 17, + "column": 26 + }, + "end": { + "line": 17, + "column": 39 + } + }, + "range": [ + 232, + 245 + ], + "value": "outer scope", + "raw": "'outer scope'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 40 + } + }, + "range": [ + 248, + 288 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 39 + } + }, + "range": [ + 248, + 287 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 16 + } + }, + "range": [ + 248, + 264 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 6 + } + }, + "range": [ + 248, + 254 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 7 + }, + "end": { + "line": 18, + "column": 16 + } + }, + "range": [ + 255, + 264 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 23 + } + }, + "range": [ + 265, + 271 + ], + "name": "probe1" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 18, + "column": 25 + }, + "end": { + "line": 18, + "column": 38 + } + }, + "range": [ + 273, + 286 + ], + "value": "first block", + "raw": "'first block'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 41 + } + }, + "range": [ + 289, + 330 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 40 + } + }, + "range": [ + 289, + 329 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 16 + } + }, + "range": [ + 289, + 305 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 6 + } + }, + "range": [ + 289, + 295 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 19, + "column": 7 + }, + "end": { + "line": 19, + "column": 16 + } + }, + "range": [ + 296, + 305 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 19, + "column": 17 + }, + "end": { + "line": 19, + "column": 23 + } + }, + "range": [ + 306, + 312 + ], + "name": "probe2" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 19, + "column": 25 + }, + "end": { + "line": 19, + "column": 39 + } + }, + "range": [ + 314, + 328 + ], + "value": "second block", + "raw": "'second block'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "range": [ + 2, + 5 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "range": [ + 6, + 13 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 14, + 15 + ] + }, + { + "type": "String", + "value": "'outer scope'", + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 27 + } + }, + "range": [ + 16, + 29 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 27 + }, + "end": { + "line": 3, + "column": 28 + } + }, + "range": [ + 29, + 30 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 31, + 34 + ] + }, + { + "type": "Identifier", + "value": "probe1", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 35, + 41 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 4, + "column": 10 + }, + "end": { + "line": 4, + "column": 11 + } + }, + "range": [ + 41, + 42 + ] + }, + { + "type": "Identifier", + "value": "probe2", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 18 + } + }, + "range": [ + 43, + 49 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 18 + }, + "end": { + "line": 4, + "column": 19 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 52, + 57 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 58, + 59 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 9 + } + }, + "range": [ + 60, + 61 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 8 + } + }, + "range": [ + 64, + 70 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 10 + } + }, + "range": [ + 71, + 72 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 7 + } + }, + "range": [ + 77, + 80 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 15 + } + }, + "range": [ + 81, + 88 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 8, + "column": 16 + }, + "end": { + "line": 8, + "column": 17 + } + }, + "range": [ + 89, + 90 + ] + }, + { + "type": "String", + "value": "'first block'", + "loc": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 8, + "column": 31 + } + }, + "range": [ + 91, + 104 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 8, + "column": 31 + }, + "end": { + "line": 8, + "column": 32 + } + }, + "range": [ + 104, + 105 + ] + }, + { + "type": "Identifier", + "value": "probe1", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 10 + } + }, + "range": [ + 110, + 116 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 9, + "column": 11 + }, + "end": { + "line": 9, + "column": 12 + } + }, + "range": [ + 117, + 118 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 9, + "column": 13 + }, + "end": { + "line": 9, + "column": 20 + } + }, + "range": [ + 119, + 126 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 9, + "column": 20 + }, + "end": { + "line": 9, + "column": 21 + } + }, + "range": [ + 126, + 127 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 10, + "column": 2 + }, + "end": { + "line": 10, + "column": 3 + } + }, + "range": [ + 130, + 131 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 8 + } + }, + "range": [ + 134, + 140 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 11, + "column": 9 + }, + "end": { + "line": 11, + "column": 10 + } + }, + "range": [ + 141, + 142 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 12, + "column": 4 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "range": [ + 147, + 150 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 12, + "column": 8 + }, + "end": { + "line": 12, + "column": 15 + } + }, + "range": [ + 151, + 158 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 12, + "column": 16 + }, + "end": { + "line": 12, + "column": 17 + } + }, + "range": [ + 159, + 160 + ] + }, + { + "type": "String", + "value": "'second block'", + "loc": { + "start": { + "line": 12, + "column": 18 + }, + "end": { + "line": 12, + "column": 32 + } + }, + "range": [ + 161, + 175 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 12, + "column": 32 + }, + "end": { + "line": 12, + "column": 33 + } + }, + "range": [ + 175, + 176 + ] + }, + { + "type": "Identifier", + "value": "probe2", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 10 + } + }, + "range": [ + 181, + 187 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 13, + "column": 11 + }, + "end": { + "line": 13, + "column": 12 + } + }, + "range": [ + 188, + 189 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 13, + "column": 13 + }, + "end": { + "line": 13, + "column": 20 + } + }, + "range": [ + 190, + 197 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 13, + "column": 20 + }, + "end": { + "line": 13, + "column": 21 + } + }, + "range": [ + 197, + 198 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 14, + "column": 2 + }, + "end": { + "line": 14, + "column": 3 + } + }, + "range": [ + 201, + 202 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 1 + } + }, + "range": [ + 203, + 204 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 6 + } + }, + "range": [ + 206, + 212 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 17, + "column": 6 + }, + "end": { + "line": 17, + "column": 7 + } + }, + "range": [ + 212, + 213 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 17, + "column": 7 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 213, + 222 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 17, + "column": 16 + }, + "end": { + "line": 17, + "column": 17 + } + }, + "range": [ + 222, + 223 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 17, + "column": 17 + }, + "end": { + "line": 17, + "column": 24 + } + }, + "range": [ + 223, + 230 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 17, + "column": 24 + }, + "end": { + "line": 17, + "column": 25 + } + }, + "range": [ + 230, + 231 + ] + }, + { + "type": "String", + "value": "'outer scope'", + "loc": { + "start": { + "line": 17, + "column": 26 + }, + "end": { + "line": 17, + "column": 39 + } + }, + "range": [ + 232, + 245 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 17, + "column": 39 + }, + "end": { + "line": 17, + "column": 40 + } + }, + "range": [ + 245, + 246 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 17, + "column": 40 + }, + "end": { + "line": 17, + "column": 41 + } + }, + "range": [ + 246, + 247 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 6 + } + }, + "range": [ + 248, + 254 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 18, + "column": 6 + }, + "end": { + "line": 18, + "column": 7 + } + }, + "range": [ + 254, + 255 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 18, + "column": 7 + }, + "end": { + "line": 18, + "column": 16 + } + }, + "range": [ + 255, + 264 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 18, + "column": 16 + }, + "end": { + "line": 18, + "column": 17 + } + }, + "range": [ + 264, + 265 + ] + }, + { + "type": "Identifier", + "value": "probe1", + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 23 + } + }, + "range": [ + 265, + 271 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 18, + "column": 23 + }, + "end": { + "line": 18, + "column": 24 + } + }, + "range": [ + 271, + 272 + ] + }, + { + "type": "String", + "value": "'first block'", + "loc": { + "start": { + "line": 18, + "column": 25 + }, + "end": { + "line": 18, + "column": 38 + } + }, + "range": [ + 273, + 286 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 18, + "column": 38 + }, + "end": { + "line": 18, + "column": 39 + } + }, + "range": [ + 286, + 287 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 18, + "column": 39 + }, + "end": { + "line": 18, + "column": 40 + } + }, + "range": [ + 287, + 288 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 6 + } + }, + "range": [ + 289, + 295 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 19, + "column": 6 + }, + "end": { + "line": 19, + "column": 7 + } + }, + "range": [ + 295, + 296 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 19, + "column": 7 + }, + "end": { + "line": 19, + "column": 16 + } + }, + "range": [ + 296, + 305 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 19, + "column": 16 + }, + "end": { + "line": 19, + "column": 17 + } + }, + "range": [ + 305, + 306 + ] + }, + { + "type": "Identifier", + "value": "probe2", + "loc": { + "start": { + "line": 19, + "column": 17 + }, + "end": { + "line": 19, + "column": 23 + } + }, + "range": [ + 306, + 312 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 19, + "column": 23 + }, + "end": { + "line": 19, + "column": 24 + } + }, + "range": [ + 312, + 313 + ] + }, + { + "type": "String", + "value": "'second block'", + "loc": { + "start": { + "line": 19, + "column": 25 + }, + "end": { + "line": 19, + "column": 39 + } + }, + "range": [ + 314, + 328 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 19, + "column": 39 + }, + "end": { + "line": 19, + "column": 40 + } + }, + "range": [ + 328, + 329 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 19, + "column": 40 + }, + "end": { + "line": 19, + "column": 41 + } + }, + "range": [ + 329, + 330 + ] + } + ] +}; \ 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..b934c673 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-var-open.src.js @@ -0,0 +1,19 @@ + + +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..fc846d0c --- /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": 3, + "column": 0 + }, + "end": { + "line": 19, + "column": 46 + } + }, + "range": [ + 2, + 406 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 18 + } + }, + "range": [ + 2, + 20 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 17 + } + }, + "range": [ + 6, + 19 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 12 + } + }, + "range": [ + 6, + 14 + ], + "name": "sequence" + }, + "init": { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 17 + } + }, + "range": [ + 17, + 19 + ], + "elements": [] + } + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 14, + "column": 1 + } + }, + "range": [ + 22, + 219 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "range": [ + 28, + 29 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 5, + "column": 8 + }, + "end": { + "line": 14, + "column": 1 + } + }, + "range": [ + 30, + 219 + ], + "body": [ + { + "type": "PropertyDefinition", + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 42 + } + }, + "range": [ + 34, + 74 + ], + "static": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 9 + }, + "end": { + "line": 6, + "column": 10 + } + }, + "range": [ + 41, + 42 + ], + "name": "x" + }, + "value": { + "type": "CallExpression", + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 41 + } + }, + "range": [ + 45, + 73 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 26 + } + }, + "range": [ + 45, + 58 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 21 + } + }, + "range": [ + 45, + 53 + ], + "name": "sequence" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 22 + }, + "end": { + "line": 6, + "column": 26 + } + }, + "range": [ + 54, + 58 + ], + "name": "push" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 6, + "column": 27 + }, + "end": { + "line": 6, + "column": 40 + } + }, + "range": [ + 59, + 72 + ], + "value": "first field", + "raw": "'first field'" + } + ], + "optional": false + } + }, + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 9, + "column": 3 + } + }, + "range": [ + 77, + 123 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 33 + } + }, + "range": [ + 90, + 119 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 32 + } + }, + "range": [ + 90, + 118 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 17 + } + }, + "range": [ + 90, + 103 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 12 + } + }, + "range": [ + 90, + 98 + ], + "name": "sequence" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 13 + }, + "end": { + "line": 8, + "column": 17 + } + }, + "range": [ + 99, + 103 + ], + "name": "push" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 8, + "column": 31 + } + }, + "range": [ + 104, + 117 + ], + "value": "first block", + "raw": "'first block'" + } + ], + "optional": false + } + } + ] + }, + { + "type": "PropertyDefinition", + "loc": { + "start": { + "line": 10, + "column": 2 + }, + "end": { + "line": 10, + "column": 43 + } + }, + "range": [ + 126, + 167 + ], + "static": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 10 + } + }, + "range": [ + 133, + 134 + ], + "name": "x" + }, + "value": { + "type": "CallExpression", + "loc": { + "start": { + "line": 10, + "column": 13 + }, + "end": { + "line": 10, + "column": 42 + } + }, + "range": [ + 137, + 166 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 10, + "column": 13 + }, + "end": { + "line": 10, + "column": 26 + } + }, + "range": [ + 137, + 150 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 13 + }, + "end": { + "line": 10, + "column": 21 + } + }, + "range": [ + 137, + 145 + ], + "name": "sequence" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 22 + }, + "end": { + "line": 10, + "column": 26 + } + }, + "range": [ + 146, + 150 + ], + "name": "push" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 10, + "column": 27 + }, + "end": { + "line": 10, + "column": 41 + } + }, + "range": [ + 151, + 165 + ], + "value": "second field", + "raw": "'second field'" + } + ], + "optional": false + } + }, + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 13, + "column": 3 + } + }, + "range": [ + 170, + 217 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 12, + "column": 4 + }, + "end": { + "line": 12, + "column": 34 + } + }, + "range": [ + 183, + 213 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 12, + "column": 4 + }, + "end": { + "line": 12, + "column": 33 + } + }, + "range": [ + 183, + 212 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 12, + "column": 4 + }, + "end": { + "line": 12, + "column": 17 + } + }, + "range": [ + 183, + 196 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 4 + }, + "end": { + "line": 12, + "column": 12 + } + }, + "range": [ + 183, + 191 + ], + "name": "sequence" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 13 + }, + "end": { + "line": 12, + "column": 17 + } + }, + "range": [ + 192, + 196 + ], + "name": "push" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 12, + "column": 18 + }, + "end": { + "line": 12, + "column": 32 + } + }, + "range": [ + 197, + 211 + ], + "value": "second block", + "raw": "'second block'" + } + ], + "optional": false + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 45 + } + }, + "range": [ + 221, + 266 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 44 + } + }, + "range": [ + 221, + 265 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 221, + 237 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 6 + } + }, + "range": [ + 221, + 227 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 7 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 228, + 237 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "MemberExpression", + "loc": { + "start": { + "line": 16, + "column": 17 + }, + "end": { + "line": 16, + "column": 28 + } + }, + "range": [ + 238, + 249 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 17 + }, + "end": { + "line": 16, + "column": 25 + } + }, + "range": [ + 238, + 246 + ], + "name": "sequence" + }, + "property": { + "type": "Literal", + "loc": { + "start": { + "line": 16, + "column": 26 + }, + "end": { + "line": 16, + "column": 27 + } + }, + "range": [ + 247, + 248 + ], + "value": 0, + "raw": "0" + }, + "computed": true, + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 16, + "column": 30 + }, + "end": { + "line": 16, + "column": 43 + } + }, + "range": [ + 251, + 264 + ], + "value": "first field", + "raw": "'first field'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 45 + } + }, + "range": [ + 267, + 312 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 44 + } + }, + "range": [ + 267, + 311 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 267, + 283 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 6 + } + }, + "range": [ + 267, + 273 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 7 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 274, + 283 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "MemberExpression", + "loc": { + "start": { + "line": 17, + "column": 17 + }, + "end": { + "line": 17, + "column": 28 + } + }, + "range": [ + 284, + 295 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 17 + }, + "end": { + "line": 17, + "column": 25 + } + }, + "range": [ + 284, + 292 + ], + "name": "sequence" + }, + "property": { + "type": "Literal", + "loc": { + "start": { + "line": 17, + "column": 26 + }, + "end": { + "line": 17, + "column": 27 + } + }, + "range": [ + 293, + 294 + ], + "value": 1, + "raw": "1" + }, + "computed": true, + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 17, + "column": 30 + }, + "end": { + "line": 17, + "column": 43 + } + }, + "range": [ + 297, + 310 + ], + "value": "first block", + "raw": "'first block'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 46 + } + }, + "range": [ + 313, + 359 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 45 + } + }, + "range": [ + 313, + 358 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 16 + } + }, + "range": [ + 313, + 329 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 6 + } + }, + "range": [ + 313, + 319 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 7 + }, + "end": { + "line": 18, + "column": 16 + } + }, + "range": [ + 320, + 329 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "MemberExpression", + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 28 + } + }, + "range": [ + 330, + 341 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 25 + } + }, + "range": [ + 330, + 338 + ], + "name": "sequence" + }, + "property": { + "type": "Literal", + "loc": { + "start": { + "line": 18, + "column": 26 + }, + "end": { + "line": 18, + "column": 27 + } + }, + "range": [ + 339, + 340 + ], + "value": 2, + "raw": "2" + }, + "computed": true, + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 18, + "column": 30 + }, + "end": { + "line": 18, + "column": 44 + } + }, + "range": [ + 343, + 357 + ], + "value": "second field", + "raw": "'second field'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 46 + } + }, + "range": [ + 360, + 406 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 45 + } + }, + "range": [ + 360, + 405 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 16 + } + }, + "range": [ + 360, + 376 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 6 + } + }, + "range": [ + 360, + 366 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 19, + "column": 7 + }, + "end": { + "line": 19, + "column": 16 + } + }, + "range": [ + 367, + 376 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "MemberExpression", + "loc": { + "start": { + "line": 19, + "column": 17 + }, + "end": { + "line": 19, + "column": 28 + } + }, + "range": [ + 377, + 388 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 19, + "column": 17 + }, + "end": { + "line": 19, + "column": 25 + } + }, + "range": [ + 377, + 385 + ], + "name": "sequence" + }, + "property": { + "type": "Literal", + "loc": { + "start": { + "line": 19, + "column": 26 + }, + "end": { + "line": 19, + "column": 27 + } + }, + "range": [ + 386, + 387 + ], + "value": 3, + "raw": "3" + }, + "computed": true, + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 19, + "column": 30 + }, + "end": { + "line": 19, + "column": 44 + } + }, + "range": [ + 390, + 404 + ], + "value": "second block", + "raw": "'second block'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "range": [ + 2, + 5 + ] + }, + { + "type": "Identifier", + "value": "sequence", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 12 + } + }, + "range": [ + 6, + 14 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "range": [ + 15, + 16 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "range": [ + 17, + 18 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 3, + "column": 16 + }, + "end": { + "line": 3, + "column": 17 + } + }, + "range": [ + 18, + 19 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 17 + }, + "end": { + "line": 3, + "column": 18 + } + }, + "range": [ + 19, + 20 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "range": [ + 22, + 27 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "range": [ + 28, + 29 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 8 + }, + "end": { + "line": 5, + "column": 9 + } + }, + "range": [ + 30, + 31 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 8 + } + }, + "range": [ + 34, + 40 + ] + }, + { + "type": "Identifier", + "value": "x", + "loc": { + "start": { + "line": 6, + "column": 9 + }, + "end": { + "line": 6, + "column": 10 + } + }, + "range": [ + 41, + 42 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 6, + "column": 11 + }, + "end": { + "line": 6, + "column": 12 + } + }, + "range": [ + 43, + 44 + ] + }, + { + "type": "Identifier", + "value": "sequence", + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 21 + } + }, + "range": [ + 45, + 53 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 6, + "column": 21 + }, + "end": { + "line": 6, + "column": 22 + } + }, + "range": [ + 53, + 54 + ] + }, + { + "type": "Identifier", + "value": "push", + "loc": { + "start": { + "line": 6, + "column": 22 + }, + "end": { + "line": 6, + "column": 26 + } + }, + "range": [ + 54, + 58 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 26 + }, + "end": { + "line": 6, + "column": 27 + } + }, + "range": [ + 58, + 59 + ] + }, + { + "type": "String", + "value": "'first field'", + "loc": { + "start": { + "line": 6, + "column": 27 + }, + "end": { + "line": 6, + "column": 40 + } + }, + "range": [ + 59, + 72 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 40 + }, + "end": { + "line": 6, + "column": 41 + } + }, + "range": [ + 72, + 73 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 41 + }, + "end": { + "line": 6, + "column": 42 + } + }, + "range": [ + 73, + 74 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 8 + } + }, + "range": [ + 77, + 83 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 10 + } + }, + "range": [ + 84, + 85 + ] + }, + { + "type": "Identifier", + "value": "sequence", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 12 + } + }, + "range": [ + 90, + 98 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 8, + "column": 12 + }, + "end": { + "line": 8, + "column": 13 + } + }, + "range": [ + 98, + 99 + ] + }, + { + "type": "Identifier", + "value": "push", + "loc": { + "start": { + "line": 8, + "column": 13 + }, + "end": { + "line": 8, + "column": 17 + } + }, + "range": [ + 99, + 103 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 8, + "column": 17 + }, + "end": { + "line": 8, + "column": 18 + } + }, + "range": [ + 103, + 104 + ] + }, + { + "type": "String", + "value": "'first block'", + "loc": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 8, + "column": 31 + } + }, + "range": [ + 104, + 117 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 8, + "column": 31 + }, + "end": { + "line": 8, + "column": 32 + } + }, + "range": [ + 117, + 118 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 8, + "column": 32 + }, + "end": { + "line": 8, + "column": 33 + } + }, + "range": [ + 118, + 119 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 9, + "column": 3 + } + }, + "range": [ + 122, + 123 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 10, + "column": 2 + }, + "end": { + "line": 10, + "column": 8 + } + }, + "range": [ + 126, + 132 + ] + }, + { + "type": "Identifier", + "value": "x", + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 10 + } + }, + "range": [ + 133, + 134 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 10, + "column": 11 + }, + "end": { + "line": 10, + "column": 12 + } + }, + "range": [ + 135, + 136 + ] + }, + { + "type": "Identifier", + "value": "sequence", + "loc": { + "start": { + "line": 10, + "column": 13 + }, + "end": { + "line": 10, + "column": 21 + } + }, + "range": [ + 137, + 145 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 10, + "column": 21 + }, + "end": { + "line": 10, + "column": 22 + } + }, + "range": [ + 145, + 146 + ] + }, + { + "type": "Identifier", + "value": "push", + "loc": { + "start": { + "line": 10, + "column": 22 + }, + "end": { + "line": 10, + "column": 26 + } + }, + "range": [ + 146, + 150 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 10, + "column": 26 + }, + "end": { + "line": 10, + "column": 27 + } + }, + "range": [ + 150, + 151 + ] + }, + { + "type": "String", + "value": "'second field'", + "loc": { + "start": { + "line": 10, + "column": 27 + }, + "end": { + "line": 10, + "column": 41 + } + }, + "range": [ + 151, + 165 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 10, + "column": 41 + }, + "end": { + "line": 10, + "column": 42 + } + }, + "range": [ + 165, + 166 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 10, + "column": 42 + }, + "end": { + "line": 10, + "column": 43 + } + }, + "range": [ + 166, + 167 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 8 + } + }, + "range": [ + 170, + 176 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 11, + "column": 9 + }, + "end": { + "line": 11, + "column": 10 + } + }, + "range": [ + 177, + 178 + ] + }, + { + "type": "Identifier", + "value": "sequence", + "loc": { + "start": { + "line": 12, + "column": 4 + }, + "end": { + "line": 12, + "column": 12 + } + }, + "range": [ + 183, + 191 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 12, + "column": 12 + }, + "end": { + "line": 12, + "column": 13 + } + }, + "range": [ + 191, + 192 + ] + }, + { + "type": "Identifier", + "value": "push", + "loc": { + "start": { + "line": 12, + "column": 13 + }, + "end": { + "line": 12, + "column": 17 + } + }, + "range": [ + 192, + 196 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 12, + "column": 17 + }, + "end": { + "line": 12, + "column": 18 + } + }, + "range": [ + 196, + 197 + ] + }, + { + "type": "String", + "value": "'second block'", + "loc": { + "start": { + "line": 12, + "column": 18 + }, + "end": { + "line": 12, + "column": 32 + } + }, + "range": [ + 197, + 211 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 12, + "column": 32 + }, + "end": { + "line": 12, + "column": 33 + } + }, + "range": [ + 211, + 212 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 12, + "column": 33 + }, + "end": { + "line": 12, + "column": 34 + } + }, + "range": [ + 212, + 213 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 13, + "column": 2 + }, + "end": { + "line": 13, + "column": 3 + } + }, + "range": [ + 216, + 217 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 1 + } + }, + "range": [ + 218, + 219 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 6 + } + }, + "range": [ + 221, + 227 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 16, + "column": 6 + }, + "end": { + "line": 16, + "column": 7 + } + }, + "range": [ + 227, + 228 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 16, + "column": 7 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 228, + 237 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 16, + "column": 16 + }, + "end": { + "line": 16, + "column": 17 + } + }, + "range": [ + 237, + 238 + ] + }, + { + "type": "Identifier", + "value": "sequence", + "loc": { + "start": { + "line": 16, + "column": 17 + }, + "end": { + "line": 16, + "column": 25 + } + }, + "range": [ + 238, + 246 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 16, + "column": 25 + }, + "end": { + "line": 16, + "column": 26 + } + }, + "range": [ + 246, + 247 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 16, + "column": 26 + }, + "end": { + "line": 16, + "column": 27 + } + }, + "range": [ + 247, + 248 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 16, + "column": 27 + }, + "end": { + "line": 16, + "column": 28 + } + }, + "range": [ + 248, + 249 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 16, + "column": 28 + }, + "end": { + "line": 16, + "column": 29 + } + }, + "range": [ + 249, + 250 + ] + }, + { + "type": "String", + "value": "'first field'", + "loc": { + "start": { + "line": 16, + "column": 30 + }, + "end": { + "line": 16, + "column": 43 + } + }, + "range": [ + 251, + 264 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 16, + "column": 43 + }, + "end": { + "line": 16, + "column": 44 + } + }, + "range": [ + 264, + 265 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 16, + "column": 44 + }, + "end": { + "line": 16, + "column": 45 + } + }, + "range": [ + 265, + 266 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 6 + } + }, + "range": [ + 267, + 273 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 17, + "column": 6 + }, + "end": { + "line": 17, + "column": 7 + } + }, + "range": [ + 273, + 274 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 17, + "column": 7 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 274, + 283 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 17, + "column": 16 + }, + "end": { + "line": 17, + "column": 17 + } + }, + "range": [ + 283, + 284 + ] + }, + { + "type": "Identifier", + "value": "sequence", + "loc": { + "start": { + "line": 17, + "column": 17 + }, + "end": { + "line": 17, + "column": 25 + } + }, + "range": [ + 284, + 292 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 17, + "column": 25 + }, + "end": { + "line": 17, + "column": 26 + } + }, + "range": [ + 292, + 293 + ] + }, + { + "type": "Numeric", + "value": "1", + "loc": { + "start": { + "line": 17, + "column": 26 + }, + "end": { + "line": 17, + "column": 27 + } + }, + "range": [ + 293, + 294 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 17, + "column": 27 + }, + "end": { + "line": 17, + "column": 28 + } + }, + "range": [ + 294, + 295 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 17, + "column": 28 + }, + "end": { + "line": 17, + "column": 29 + } + }, + "range": [ + 295, + 296 + ] + }, + { + "type": "String", + "value": "'first block'", + "loc": { + "start": { + "line": 17, + "column": 30 + }, + "end": { + "line": 17, + "column": 43 + } + }, + "range": [ + 297, + 310 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 17, + "column": 43 + }, + "end": { + "line": 17, + "column": 44 + } + }, + "range": [ + 310, + 311 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 17, + "column": 44 + }, + "end": { + "line": 17, + "column": 45 + } + }, + "range": [ + 311, + 312 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 6 + } + }, + "range": [ + 313, + 319 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 18, + "column": 6 + }, + "end": { + "line": 18, + "column": 7 + } + }, + "range": [ + 319, + 320 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 18, + "column": 7 + }, + "end": { + "line": 18, + "column": 16 + } + }, + "range": [ + 320, + 329 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 18, + "column": 16 + }, + "end": { + "line": 18, + "column": 17 + } + }, + "range": [ + 329, + 330 + ] + }, + { + "type": "Identifier", + "value": "sequence", + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 25 + } + }, + "range": [ + 330, + 338 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 18, + "column": 25 + }, + "end": { + "line": 18, + "column": 26 + } + }, + "range": [ + 338, + 339 + ] + }, + { + "type": "Numeric", + "value": "2", + "loc": { + "start": { + "line": 18, + "column": 26 + }, + "end": { + "line": 18, + "column": 27 + } + }, + "range": [ + 339, + 340 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 18, + "column": 27 + }, + "end": { + "line": 18, + "column": 28 + } + }, + "range": [ + 340, + 341 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 18, + "column": 28 + }, + "end": { + "line": 18, + "column": 29 + } + }, + "range": [ + 341, + 342 + ] + }, + { + "type": "String", + "value": "'second field'", + "loc": { + "start": { + "line": 18, + "column": 30 + }, + "end": { + "line": 18, + "column": 44 + } + }, + "range": [ + 343, + 357 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 18, + "column": 44 + }, + "end": { + "line": 18, + "column": 45 + } + }, + "range": [ + 357, + 358 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 18, + "column": 45 + }, + "end": { + "line": 18, + "column": 46 + } + }, + "range": [ + 358, + 359 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 6 + } + }, + "range": [ + 360, + 366 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 19, + "column": 6 + }, + "end": { + "line": 19, + "column": 7 + } + }, + "range": [ + 366, + 367 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 19, + "column": 7 + }, + "end": { + "line": 19, + "column": 16 + } + }, + "range": [ + 367, + 376 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 19, + "column": 16 + }, + "end": { + "line": 19, + "column": 17 + } + }, + "range": [ + 376, + 377 + ] + }, + { + "type": "Identifier", + "value": "sequence", + "loc": { + "start": { + "line": 19, + "column": 17 + }, + "end": { + "line": 19, + "column": 25 + } + }, + "range": [ + 377, + 385 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 19, + "column": 25 + }, + "end": { + "line": 19, + "column": 26 + } + }, + "range": [ + 385, + 386 + ] + }, + { + "type": "Numeric", + "value": "3", + "loc": { + "start": { + "line": 19, + "column": 26 + }, + "end": { + "line": 19, + "column": 27 + } + }, + "range": [ + 386, + 387 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 19, + "column": 27 + }, + "end": { + "line": 19, + "column": 28 + } + }, + "range": [ + 387, + 388 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 19, + "column": 28 + }, + "end": { + "line": 19, + "column": 29 + } + }, + "range": [ + 388, + 389 + ] + }, + { + "type": "String", + "value": "'second block'", + "loc": { + "start": { + "line": 19, + "column": 30 + }, + "end": { + "line": 19, + "column": 44 + } + }, + "range": [ + 390, + 404 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 19, + "column": 44 + }, + "end": { + "line": 19, + "column": 45 + } + }, + "range": [ + 404, + 405 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 19, + "column": 45 + }, + "end": { + "line": 19, + "column": 46 + } + }, + "range": [ + 405, + 406 + ] + } + ] +}; \ 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..ee59f6ec --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-sequence.src.js @@ -0,0 +1,19 @@ + + +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..083d48cd --- /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": 3, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "range": [ + 2, + 25 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "range": [ + 2, + 25 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 8, + 9 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "range": [ + 10, + 25 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 11 + } + }, + "range": [ + 14, + 23 + ], + "body": [] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "range": [ + 2, + 7 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 8, + 9 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 10, + 11 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 8 + } + }, + "range": [ + 14, + 20 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 21, + 22 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 4, + "column": 10 + }, + "end": { + "line": 4, + "column": 11 + } + }, + "range": [ + 22, + 23 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "range": [ + 24, + 25 + ] + } + ] +}; \ 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..782fb282 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-statement-list-optional.src.js @@ -0,0 +1,5 @@ + + +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..705bd9f6 --- /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": 3, + "column": 0 + }, + "end": { + "line": 13, + "column": 35 + } + }, + "range": [ + 2, + 168 + ], + "body": [ + { + "type": "FunctionDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 20 + } + }, + "range": [ + 2, + 22 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "range": [ + 11, + 17 + ], + "name": "Parent" + }, + "expression": false, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 3, + "column": 18 + }, + "end": { + "line": 3, + "column": 20 + } + }, + "range": [ + 20, + 22 + ], + "body": [] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 27 + } + }, + "range": [ + 23, + 50 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 26 + } + }, + "range": [ + 23, + 49 + ], + "operator": "=", + "left": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 14 + } + }, + "range": [ + 23, + 37 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 6 + } + }, + "range": [ + 23, + 29 + ], + "name": "Parent" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 7 + }, + "end": { + "line": 4, + "column": 14 + } + }, + "range": [ + 30, + 37 + ], + "name": "test262" + }, + "computed": false, + "optional": false + }, + "right": { + "type": "Literal", + "loc": { + "start": { + "line": 4, + "column": 17 + }, + "end": { + "line": 4, + "column": 26 + } + }, + "range": [ + 40, + 49 + ], + "value": "test262", + "raw": "'test262'" + } + } + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 51, + 61 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 9 + } + }, + "range": [ + 55, + 60 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 9 + } + }, + "range": [ + 55, + 60 + ], + "name": "value" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 11, + "column": 1 + } + }, + "range": [ + 63, + 131 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 7 + } + }, + "range": [ + 69, + 70 + ], + "name": "C" + }, + "superClass": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 16 + }, + "end": { + "line": 7, + "column": 22 + } + }, + "range": [ + 79, + 85 + ], + "name": "Parent" + }, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 7, + "column": 23 + }, + "end": { + "line": 11, + "column": 1 + } + }, + "range": [ + 86, + 131 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 10, + "column": 3 + } + }, + "range": [ + 90, + 129 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 26 + } + }, + "range": [ + 103, + 125 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 25 + } + }, + "range": [ + 103, + 124 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 9 + } + }, + "range": [ + 103, + 108 + ], + "name": "value" + }, + "right": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 9, + "column": 12 + }, + "end": { + "line": 9, + "column": 25 + } + }, + "range": [ + 111, + 124 + ], + "object": { + "type": "Super", + "loc": { + "start": { + "line": 9, + "column": 12 + }, + "end": { + "line": 9, + "column": 17 + } + }, + "range": [ + 111, + 116 + ] + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 25 + } + }, + "range": [ + 117, + 124 + ], + "name": "test262" + }, + "computed": false, + "optional": false + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 35 + } + }, + "range": [ + 133, + 168 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 34 + } + }, + "range": [ + 133, + 167 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 16 + } + }, + "range": [ + 133, + 149 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 6 + } + }, + "range": [ + 133, + 139 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 7 + }, + "end": { + "line": 13, + "column": 16 + } + }, + "range": [ + 140, + 149 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 17 + }, + "end": { + "line": 13, + "column": 22 + } + }, + "range": [ + 150, + 155 + ], + "name": "value" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 13, + "column": 24 + }, + "end": { + "line": 13, + "column": 33 + } + }, + "range": [ + 157, + 166 + ], + "value": "test262", + "raw": "'test262'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "function", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "range": [ + 2, + 10 + ] + }, + { + "type": "Identifier", + "value": "Parent", + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "range": [ + 11, + 17 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "range": [ + 17, + 18 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 3, + "column": 16 + }, + "end": { + "line": 3, + "column": 17 + } + }, + "range": [ + 18, + 19 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 18 + }, + "end": { + "line": 3, + "column": 19 + } + }, + "range": [ + 20, + 21 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 3, + "column": 19 + }, + "end": { + "line": 3, + "column": 20 + } + }, + "range": [ + 21, + 22 + ] + }, + { + "type": "Identifier", + "value": "Parent", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 6 + } + }, + "range": [ + 23, + 29 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 29, + 30 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 4, + "column": 7 + }, + "end": { + "line": 4, + "column": 14 + } + }, + "range": [ + 30, + 37 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 16 + } + }, + "range": [ + 38, + 39 + ] + }, + { + "type": "String", + "value": "'test262'", + "loc": { + "start": { + "line": 4, + "column": 17 + }, + "end": { + "line": 4, + "column": 26 + } + }, + "range": [ + 40, + 49 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 26 + }, + "end": { + "line": 4, + "column": 27 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 51, + 54 + ] + }, + { + "type": "Identifier", + "value": "value", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 9 + } + }, + "range": [ + 55, + 60 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 60, + 61 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "range": [ + 63, + 68 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 7 + } + }, + "range": [ + 69, + 70 + ] + }, + { + "type": "Keyword", + "value": "extends", + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 7, + "column": 15 + } + }, + "range": [ + 71, + 78 + ] + }, + { + "type": "Identifier", + "value": "Parent", + "loc": { + "start": { + "line": 7, + "column": 16 + }, + "end": { + "line": 7, + "column": 22 + } + }, + "range": [ + 79, + 85 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 23 + }, + "end": { + "line": 7, + "column": 24 + } + }, + "range": [ + 86, + 87 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 8 + } + }, + "range": [ + 90, + 96 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 8, + "column": 10 + } + }, + "range": [ + 97, + 98 + ] + }, + { + "type": "Identifier", + "value": "value", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 9 + } + }, + "range": [ + 103, + 108 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 11 + } + }, + "range": [ + 109, + 110 + ] + }, + { + "type": "Keyword", + "value": "super", + "loc": { + "start": { + "line": 9, + "column": 12 + }, + "end": { + "line": 9, + "column": 17 + } + }, + "range": [ + 111, + 116 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 9, + "column": 17 + }, + "end": { + "line": 9, + "column": 18 + } + }, + "range": [ + 116, + 117 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 25 + } + }, + "range": [ + 117, + 124 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 9, + "column": 25 + }, + "end": { + "line": 9, + "column": 26 + } + }, + "range": [ + 124, + 125 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 10, + "column": 2 + }, + "end": { + "line": 10, + "column": 3 + } + }, + "range": [ + 128, + 129 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 1 + } + }, + "range": [ + 130, + 131 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 6 + } + }, + "range": [ + 133, + 139 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 13, + "column": 6 + }, + "end": { + "line": 13, + "column": 7 + } + }, + "range": [ + 139, + 140 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 13, + "column": 7 + }, + "end": { + "line": 13, + "column": 16 + } + }, + "range": [ + 140, + 149 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 13, + "column": 16 + }, + "end": { + "line": 13, + "column": 17 + } + }, + "range": [ + 149, + 150 + ] + }, + { + "type": "Identifier", + "value": "value", + "loc": { + "start": { + "line": 13, + "column": 17 + }, + "end": { + "line": 13, + "column": 22 + } + }, + "range": [ + 150, + 155 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 13, + "column": 22 + }, + "end": { + "line": 13, + "column": 23 + } + }, + "range": [ + 155, + 156 + ] + }, + { + "type": "String", + "value": "'test262'", + "loc": { + "start": { + "line": 13, + "column": 24 + }, + "end": { + "line": 13, + "column": 33 + } + }, + "range": [ + 157, + 166 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 13, + "column": 33 + }, + "end": { + "line": 13, + "column": 34 + } + }, + "range": [ + 166, + 167 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 13, + "column": 34 + }, + "end": { + "line": 13, + "column": 35 + } + }, + "range": [ + 167, + 168 + ] + } + ] +}; \ 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..233f11f1 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-super-property.src.js @@ -0,0 +1,13 @@ + + +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..8b8b21f9 --- /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": 31, + "lineNumber": 3, + "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..92b6d674 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-const-static-init-await-binding-invalid.src.js @@ -0,0 +1,5 @@ +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..e0cdd494 --- /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": 42, + "lineNumber": 5, + "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..be202a8c --- /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": 3, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 2, + 62 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 2, + 62 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 8, + 9 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 10, + 62 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 14, + 60 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 33 + } + }, + "range": [ + 27, + 56 + ], + "expression": { + "type": "ArrowFunctionExpression", + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 31 + } + }, + "range": [ + 28, + 54 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 5, + "column": 11 + }, + "end": { + "line": 5, + "column": 31 + } + }, + "range": [ + 34, + 54 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 29 + } + }, + "range": [ + 36, + 52 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 19 + }, + "end": { + "line": 5, + "column": 28 + } + }, + "range": [ + 42, + 51 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 19 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "range": [ + 42, + 47 + ], + "name": "await" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 5, + "column": 27 + }, + "end": { + "line": 5, + "column": 28 + } + }, + "range": [ + 50, + 51 + ], + "value": 0, + "raw": "0" + } + } + ], + "kind": "const" + } + ] + } + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "range": [ + 2, + 7 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 8, + 9 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 10, + 11 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 8 + } + }, + "range": [ + 14, + 20 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 21, + 22 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "range": [ + 27, + 28 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 6 + } + }, + "range": [ + 28, + 29 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "range": [ + 29, + 30 + ] + }, + { + "type": "Punctuator", + "value": "=>", + "loc": { + "start": { + "line": 5, + "column": 8 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 31, + 33 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 11 + }, + "end": { + "line": 5, + "column": 12 + } + }, + "range": [ + 34, + 35 + ] + }, + { + "type": "Keyword", + "value": "const", + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 18 + } + }, + "range": [ + 36, + 41 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 5, + "column": 19 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "range": [ + 42, + 47 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 5, + "column": 25 + }, + "end": { + "line": 5, + "column": 26 + } + }, + "range": [ + 48, + 49 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 5, + "column": 27 + }, + "end": { + "line": 5, + "column": 28 + } + }, + "range": [ + 50, + 51 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 28 + }, + "end": { + "line": 5, + "column": 29 + } + }, + "range": [ + 51, + 52 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 30 + }, + "end": { + "line": 5, + "column": 31 + } + }, + "range": [ + 53, + 54 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 31 + }, + "end": { + "line": 5, + "column": 32 + } + }, + "range": [ + 54, + 55 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 32 + }, + "end": { + "line": 5, + "column": 33 + } + }, + "range": [ + 55, + 56 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 59, + 60 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 61, + 62 + ] + } + ] +}; \ 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..240c2391 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-const-static-init-await-binding-valid.src.js @@ -0,0 +1,7 @@ + + +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..37c3c639 --- /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": 53, + "lineNumber": 4, + "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..b8dbb050 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-continue-static-init-with-label.src.js @@ -0,0 +1,7 @@ +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..37c3c639 --- /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": 53, + "lineNumber": 4, + "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..e56aa61f --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-continue-static-init-without-label.src.js @@ -0,0 +1,7 @@ +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..9d6be10f --- /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": 34, + "lineNumber": 3, + "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..e1bcb413 --- /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..0c649d5c --- /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": 45, + "lineNumber": 5, + "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..d42bc174 --- /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": 3, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 2, + 65 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 2, + 65 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 8, + 9 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 10, + 65 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 14, + 63 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 36 + } + }, + "range": [ + 27, + 59 + ], + "expression": { + "type": "ArrowFunctionExpression", + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 34 + } + }, + "range": [ + 28, + 57 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 5, + "column": 11 + }, + "end": { + "line": 5, + "column": 34 + } + }, + "range": [ + 34, + 57 + ], + "body": [ + { + "type": "FunctionDeclaration", + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 32 + } + }, + "range": [ + 36, + 55 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 22 + }, + "end": { + "line": 5, + "column": 27 + } + }, + "range": [ + 45, + 50 + ], + "name": "await" + }, + "expression": false, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 5, + "column": 30 + }, + "end": { + "line": 5, + "column": 32 + } + }, + "range": [ + 53, + 55 + ], + "body": [] + } + } + ] + } + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "range": [ + 2, + 7 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 8, + 9 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 10, + 11 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 8 + } + }, + "range": [ + 14, + 20 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 21, + 22 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "range": [ + 27, + 28 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 6 + } + }, + "range": [ + 28, + 29 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "range": [ + 29, + 30 + ] + }, + { + "type": "Punctuator", + "value": "=>", + "loc": { + "start": { + "line": 5, + "column": 8 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 31, + 33 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 11 + }, + "end": { + "line": 5, + "column": 12 + } + }, + "range": [ + 34, + 35 + ] + }, + { + "type": "Keyword", + "value": "function", + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 21 + } + }, + "range": [ + 36, + 44 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 5, + "column": 22 + }, + "end": { + "line": 5, + "column": 27 + } + }, + "range": [ + 45, + 50 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 27 + }, + "end": { + "line": 5, + "column": 28 + } + }, + "range": [ + 50, + 51 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 28 + }, + "end": { + "line": 5, + "column": 29 + } + }, + "range": [ + 51, + 52 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 30 + }, + "end": { + "line": 5, + "column": 31 + } + }, + "range": [ + 53, + 54 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 31 + }, + "end": { + "line": 5, + "column": 32 + } + }, + "range": [ + 54, + 55 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 33 + }, + "end": { + "line": 5, + "column": 34 + } + }, + "range": [ + 56, + 57 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 34 + }, + "end": { + "line": 5, + "column": 35 + } + }, + "range": [ + 57, + 58 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 35 + }, + "end": { + "line": 5, + "column": 36 + } + }, + "range": [ + 58, + 59 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 62, + 63 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 64, + 65 + ] + } + ] +}; \ 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..1fe48583 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-function-static-init-await-binding-valid.src.js @@ -0,0 +1,7 @@ + + +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..8d30cc9c --- /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": 25, + "lineNumber": 3, + "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..b7db8793 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-labeled-static-init-invalid-await.src.js @@ -0,0 +1,5 @@ +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..3be705f2 --- /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": 29, + "lineNumber": 3, + "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..1dd4f6f5 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-let-static-init-await-binding-invalid.src.js @@ -0,0 +1,5 @@ +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..ac9718b2 --- /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": 40, + "lineNumber": 5, + "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..6d735a48 --- /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": 3, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 2, + 56 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 2, + 56 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 8, + 9 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 10, + 56 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 14, + 54 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 27 + } + }, + "range": [ + 27, + 50 + ], + "expression": { + "type": "ArrowFunctionExpression", + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 25 + } + }, + "range": [ + 28, + 48 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 5, + "column": 11 + }, + "end": { + "line": 5, + "column": 25 + } + }, + "range": [ + 34, + 48 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 36, + 46 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 17 + }, + "end": { + "line": 5, + "column": 22 + } + }, + "range": [ + 40, + 45 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 17 + }, + "end": { + "line": 5, + "column": 22 + } + }, + "range": [ + 40, + 45 + ], + "name": "await" + }, + "init": null + } + ], + "kind": "let" + } + ] + } + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "range": [ + 2, + 7 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 8, + 9 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 10, + 11 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 8 + } + }, + "range": [ + 14, + 20 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 21, + 22 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "range": [ + 27, + 28 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 6 + } + }, + "range": [ + 28, + 29 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "range": [ + 29, + 30 + ] + }, + { + "type": "Punctuator", + "value": "=>", + "loc": { + "start": { + "line": 5, + "column": 8 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 31, + 33 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 11 + }, + "end": { + "line": 5, + "column": 12 + } + }, + "range": [ + 34, + 35 + ] + }, + { + "type": "Keyword", + "value": "let", + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 16 + } + }, + "range": [ + 36, + 39 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 5, + "column": 17 + }, + "end": { + "line": 5, + "column": 22 + } + }, + "range": [ + 40, + 45 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 22 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 45, + 46 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 24 + }, + "end": { + "line": 5, + "column": 25 + } + }, + "range": [ + 47, + 48 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 25 + }, + "end": { + "line": 5, + "column": 26 + } + }, + "range": [ + 48, + 49 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 26 + }, + "end": { + "line": 5, + "column": 27 + } + }, + "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 + ] + } + ] +}; \ 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..1b2d82a3 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-let-static-init-await-binding-valid.src.js @@ -0,0 +1,7 @@ + + +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..f5aebcda --- /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": 39, + "lineNumber": 3, + "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..884b0101 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-try-static-init-await-binding-invalid.src.js @@ -0,0 +1,5 @@ +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..40fd1cf0 --- /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": 50, + "lineNumber": 5, + "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..73b242be --- /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": 3, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 2, + 69 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 2, + 69 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 8, + 9 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 10, + 69 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 14, + 67 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 40 + } + }, + "range": [ + 27, + 63 + ], + "expression": { + "type": "ArrowFunctionExpression", + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 38 + } + }, + "range": [ + 28, + 61 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 5, + "column": 11 + }, + "end": { + "line": 5, + "column": 38 + } + }, + "range": [ + 34, + 61 + ], + "body": [ + { + "type": "TryStatement", + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 36 + } + }, + "range": [ + 36, + 59 + ], + "block": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 5, + "column": 17 + }, + "end": { + "line": 5, + "column": 19 + } + }, + "range": [ + 40, + 42 + ], + "body": [] + }, + "handler": { + "type": "CatchClause", + "loc": { + "start": { + "line": 5, + "column": 20 + }, + "end": { + "line": 5, + "column": 36 + } + }, + "range": [ + 43, + 59 + ], + "param": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 27 + }, + "end": { + "line": 5, + "column": 32 + } + }, + "range": [ + 50, + 55 + ], + "name": "await" + }, + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 5, + "column": 34 + }, + "end": { + "line": 5, + "column": 36 + } + }, + "range": [ + 57, + 59 + ], + "body": [] + } + }, + "finalizer": null + } + ] + } + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "range": [ + 2, + 7 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 8, + 9 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 10, + 11 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 8 + } + }, + "range": [ + 14, + 20 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 21, + 22 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "range": [ + 27, + 28 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 6 + } + }, + "range": [ + 28, + 29 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "range": [ + 29, + 30 + ] + }, + { + "type": "Punctuator", + "value": "=>", + "loc": { + "start": { + "line": 5, + "column": 8 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 31, + 33 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 11 + }, + "end": { + "line": 5, + "column": 12 + } + }, + "range": [ + 34, + 35 + ] + }, + { + "type": "Keyword", + "value": "try", + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 16 + } + }, + "range": [ + 36, + 39 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 17 + }, + "end": { + "line": 5, + "column": 18 + } + }, + "range": [ + 40, + 41 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 18 + }, + "end": { + "line": 5, + "column": 19 + } + }, + "range": [ + 41, + 42 + ] + }, + { + "type": "Keyword", + "value": "catch", + "loc": { + "start": { + "line": 5, + "column": 20 + }, + "end": { + "line": 5, + "column": 25 + } + }, + "range": [ + 43, + 48 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 26 + }, + "end": { + "line": 5, + "column": 27 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 5, + "column": 27 + }, + "end": { + "line": 5, + "column": 32 + } + }, + "range": [ + 50, + 55 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 32 + }, + "end": { + "line": 5, + "column": 33 + } + }, + "range": [ + 55, + 56 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 34 + }, + "end": { + "line": 5, + "column": 35 + } + }, + "range": [ + 57, + 58 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 35 + }, + "end": { + "line": 5, + "column": 36 + } + }, + "range": [ + 58, + 59 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 37 + }, + "end": { + "line": 5, + "column": 38 + } + }, + "range": [ + 60, + 61 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 38 + }, + "end": { + "line": 5, + "column": 39 + } + }, + "range": [ + 61, + 62 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 39 + }, + "end": { + "line": 5, + "column": 40 + } + }, + "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 + ] + } + ] +}; \ 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..b847ae5f --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-try-static-init-await-binding-valid.src.js @@ -0,0 +1,7 @@ + + +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..dfed0660 --- /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": 30, + "lineNumber": 3, + "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..7a93bb9f --- /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,5 @@ +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..73001815 --- /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": 41, + "lineNumber": 5, + "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..009781f0 --- /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": 3, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 2, + 63 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 2, + 63 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 8, + 9 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 10, + 63 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 14, + 61 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 34 + } + }, + "range": [ + 27, + 57 + ], + "expression": { + "type": "ArrowFunctionExpression", + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 32 + } + }, + "range": [ + 28, + 55 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 5, + "column": 11 + }, + "end": { + "line": 5, + "column": 32 + } + }, + "range": [ + 34, + 55 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 30 + } + }, + "range": [ + 36, + 53 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 17 + }, + "end": { + "line": 5, + "column": 29 + } + }, + "range": [ + 40, + 52 + ], + "id": { + "type": "ArrayPattern", + "loc": { + "start": { + "line": 5, + "column": 17 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "range": [ + 40, + 47 + ], + "elements": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 18 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 41, + 46 + ], + "name": "await" + } + ] + }, + "init": { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 5, + "column": 27 + }, + "end": { + "line": 5, + "column": 29 + } + }, + "range": [ + 50, + 52 + ], + "elements": [] + } + } + ], + "kind": "var" + } + ] + } + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "range": [ + 2, + 7 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 8, + 9 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 10, + 11 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 8 + } + }, + "range": [ + 14, + 20 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 21, + 22 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "range": [ + 27, + 28 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 6 + } + }, + "range": [ + 28, + 29 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "range": [ + 29, + 30 + ] + }, + { + "type": "Punctuator", + "value": "=>", + "loc": { + "start": { + "line": 5, + "column": 8 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 31, + 33 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 11 + }, + "end": { + "line": 5, + "column": 12 + } + }, + "range": [ + 34, + 35 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 16 + } + }, + "range": [ + 36, + 39 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 5, + "column": 17 + }, + "end": { + "line": 5, + "column": 18 + } + }, + "range": [ + 40, + 41 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 5, + "column": 18 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 41, + 46 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 5, + "column": 23 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "range": [ + 46, + 47 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 5, + "column": 25 + }, + "end": { + "line": 5, + "column": 26 + } + }, + "range": [ + 48, + 49 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 5, + "column": 27 + }, + "end": { + "line": 5, + "column": 28 + } + }, + "range": [ + 50, + 51 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 5, + "column": 28 + }, + "end": { + "line": 5, + "column": 29 + } + }, + "range": [ + 51, + 52 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 29 + }, + "end": { + "line": 5, + "column": 30 + } + }, + "range": [ + 52, + 53 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 31 + }, + "end": { + "line": 5, + "column": 32 + } + }, + "range": [ + 54, + 55 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 32 + }, + "end": { + "line": 5, + "column": 33 + } + }, + "range": [ + 55, + 56 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 33 + }, + "end": { + "line": 5, + "column": 34 + } + }, + "range": [ + 56, + 57 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 60, + 61 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 62, + 63 + ] + } + ] +}; \ 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..69127ade --- /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,7 @@ + + +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..dfed0660 --- /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": 30, + "lineNumber": 3, + "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..40581349 --- /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,5 @@ +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..73001815 --- /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": 41, + "lineNumber": 5, + "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..424bc9ef --- /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": 3, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 2, + 63 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 2, + 63 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 8, + 9 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 10, + 63 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 14, + 61 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 34 + } + }, + "range": [ + 27, + 57 + ], + "expression": { + "type": "ArrowFunctionExpression", + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 32 + } + }, + "range": [ + 28, + 55 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 5, + "column": 11 + }, + "end": { + "line": 5, + "column": 32 + } + }, + "range": [ + 34, + 55 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 30 + } + }, + "range": [ + 36, + 53 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 17 + }, + "end": { + "line": 5, + "column": 29 + } + }, + "range": [ + 40, + 52 + ], + "id": { + "type": "ObjectPattern", + "loc": { + "start": { + "line": 5, + "column": 17 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "range": [ + 40, + 47 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 5, + "column": 18 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 41, + 46 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 18 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 41, + 46 + ], + "name": "await" + }, + "kind": "init", + "value": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 18 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 41, + 46 + ], + "name": "await" + } + } + ] + }, + "init": { + "type": "ObjectExpression", + "loc": { + "start": { + "line": 5, + "column": 27 + }, + "end": { + "line": 5, + "column": 29 + } + }, + "range": [ + 50, + 52 + ], + "properties": [] + } + } + ], + "kind": "var" + } + ] + } + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "range": [ + 2, + 7 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 8, + 9 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 10, + 11 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 8 + } + }, + "range": [ + 14, + 20 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 21, + 22 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "range": [ + 27, + 28 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 6 + } + }, + "range": [ + 28, + 29 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "range": [ + 29, + 30 + ] + }, + { + "type": "Punctuator", + "value": "=>", + "loc": { + "start": { + "line": 5, + "column": 8 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 31, + 33 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 11 + }, + "end": { + "line": 5, + "column": 12 + } + }, + "range": [ + 34, + 35 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 16 + } + }, + "range": [ + 36, + 39 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 17 + }, + "end": { + "line": 5, + "column": 18 + } + }, + "range": [ + 40, + 41 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 5, + "column": 18 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 41, + 46 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 23 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "range": [ + 46, + 47 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 5, + "column": 25 + }, + "end": { + "line": 5, + "column": 26 + } + }, + "range": [ + 48, + 49 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 27 + }, + "end": { + "line": 5, + "column": 28 + } + }, + "range": [ + 50, + 51 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 28 + }, + "end": { + "line": 5, + "column": 29 + } + }, + "range": [ + 51, + 52 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 29 + }, + "end": { + "line": 5, + "column": 30 + } + }, + "range": [ + 52, + 53 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 31 + }, + "end": { + "line": 5, + "column": 32 + } + }, + "range": [ + 54, + 55 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 32 + }, + "end": { + "line": 5, + "column": 33 + } + }, + "range": [ + 55, + 56 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 33 + }, + "end": { + "line": 5, + "column": 34 + } + }, + "range": [ + 56, + 57 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 60, + 61 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 62, + 63 + ] + } + ] +}; \ 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..aa0811e4 --- /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,7 @@ + + +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..3be705f2 --- /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": 29, + "lineNumber": 3, + "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..47910019 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-static-init-await-binding-invalid.src.js @@ -0,0 +1,5 @@ +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..ac9718b2 --- /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": 40, + "lineNumber": 5, + "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..b757ab76 --- /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": 3, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 2, + 56 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 2, + 56 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 8, + 9 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "range": [ + 10, + 56 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 14, + 54 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 27 + } + }, + "range": [ + 27, + 50 + ], + "expression": { + "type": "ArrowFunctionExpression", + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 25 + } + }, + "range": [ + 28, + 48 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 5, + "column": 11 + }, + "end": { + "line": 5, + "column": 25 + } + }, + "range": [ + 34, + 48 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 36, + 46 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 17 + }, + "end": { + "line": 5, + "column": 22 + } + }, + "range": [ + 40, + 45 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 17 + }, + "end": { + "line": 5, + "column": 22 + } + }, + "range": [ + 40, + 45 + ], + "name": "await" + }, + "init": null + } + ], + "kind": "var" + } + ] + } + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "range": [ + 2, + 7 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 8, + 9 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 10, + 11 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 8 + } + }, + "range": [ + 14, + 20 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 21, + 22 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "range": [ + 27, + 28 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 6 + } + }, + "range": [ + 28, + 29 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "range": [ + 29, + 30 + ] + }, + { + "type": "Punctuator", + "value": "=>", + "loc": { + "start": { + "line": 5, + "column": 8 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 31, + 33 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 11 + }, + "end": { + "line": 5, + "column": 12 + } + }, + "range": [ + 34, + 35 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 16 + } + }, + "range": [ + 36, + 39 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 5, + "column": 17 + }, + "end": { + "line": 5, + "column": 22 + } + }, + "range": [ + 40, + 45 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 22 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 45, + 46 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 24 + }, + "end": { + "line": 5, + "column": 25 + } + }, + "range": [ + 47, + 48 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 25 + }, + "end": { + "line": 5, + "column": 26 + } + }, + "range": [ + 48, + 49 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 26 + }, + "end": { + "line": 5, + "column": 27 + } + }, + "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 + ] + } + ] +}; \ 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..8926ffa7 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-static-init-await-binding-valid.src.js @@ -0,0 +1,7 @@ + + +class C { + static { + (() => { var await; }); + } +}