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..ff5cb285 --- /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": 185, + "lineNumber": 4, + "column": 6, + "message": "Cannot use await in class static initialization block" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-arrow-function-static-init-await-binding.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-arrow-function-static-init-await-binding.src.js new file mode 100644 index 00000000..65c42105 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-arrow-function-static-init-await-binding.src.js @@ -0,0 +1,6 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/expressions/arrow-function/static-init-await-binding.js +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..986b50f7 --- /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": 192, + "lineNumber": 4, + "column": 11, + "message": "Cannot use await in class static initialization block" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-arrow-function-static-init-await-reference.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-arrow-function-static-init-await-reference.src.js new file mode 100644 index 00000000..232e82ce --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-arrow-function-static-init-await-reference.src.js @@ -0,0 +1,6 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/expressions/arrow-function/static-init-await-reference.js +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..15c2a662 --- /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": 182, + "lineNumber": 4, + "column": 12, + "message": "Cannot use await in class static initialization block" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-class-static-init-await-binding.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-class-static-init-await-binding.src.js new file mode 100644 index 00000000..c0e4b99a --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-class-static-init-await-binding.src.js @@ -0,0 +1,6 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/expressions/class/static-init-await-binding.js +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..e9f5207f --- /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": 158, + "lineNumber": 4, + "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..db3fb4c1 --- /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": 4, + "column": 0 + }, + "end": { + "line": 18, + "column": 43 + } + }, + "range": [ + 154, + 418 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 14 + } + }, + "range": [ + 154, + 168 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 158, + 167 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 158, + 163 + ], + "name": "await" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 166, + 167 + ], + "value": 0, + "raw": "0" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "range": [ + 169, + 193 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "range": [ + 173, + 182 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "range": [ + 173, + 182 + ], + "name": "fromParam" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 184, + 192 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 184, + 192 + ], + "name": "fromBody" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 15, + "column": 1 + } + }, + "range": [ + 195, + 323 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 7 + } + }, + "range": [ + 201, + 202 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 15, + "column": 1 + } + }, + "range": [ + 203, + 323 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 14, + "column": 3 + } + }, + "range": [ + 207, + 321 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 13, + "column": 7 + } + }, + "range": [ + 220, + 317 + ], + "expression": { + "type": "NewExpression", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 13, + "column": 6 + } + }, + "range": [ + 220, + 316 + ], + "callee": { + "type": "ClassExpression", + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 13, + "column": 5 + } + }, + "range": [ + 225, + 315 + ], + "id": null, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 9, + "column": 15 + }, + "end": { + "line": 13, + "column": 5 + } + }, + "range": [ + 231, + 315 + ], + "body": [ + { + "type": "MethodDefinition", + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "range": [ + 239, + 309 + ], + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 17 + } + }, + "range": [ + 239, + 250 + ], + "name": "constructor" + }, + "kind": "constructor", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 10, + "column": 17 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "range": [ + 250, + 309 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 39 + } + }, + "range": [ + 251, + 272 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 19 + } + }, + "range": [ + 251, + 252 + ], + "name": "x" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 10, + "column": 22 + }, + "end": { + "line": 10, + "column": 39 + } + }, + "range": [ + 255, + 272 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 22 + }, + "end": { + "line": 10, + "column": 31 + } + }, + "range": [ + 255, + 264 + ], + "name": "fromParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 34 + }, + "end": { + "line": 10, + "column": 39 + } + }, + "range": [ + 267, + 272 + ], + "name": "await" + } + } + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 10, + "column": 41 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "range": [ + 274, + 309 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 11, + "column": 8 + }, + "end": { + "line": 11, + "column": 25 + } + }, + "range": [ + 284, + 301 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 11, + "column": 8 + }, + "end": { + "line": 11, + "column": 24 + } + }, + "range": [ + 284, + 300 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 8 + }, + "end": { + "line": 11, + "column": 16 + } + }, + "range": [ + 284, + 292 + ], + "name": "fromBody" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 19 + }, + "end": { + "line": 11, + "column": 24 + } + }, + "range": [ + 295, + 300 + ], + "name": "await" + } + } + } + ] + } + } + } + ] + } + }, + "arguments": [] + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 49 + } + }, + "range": [ + 325, + 374 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 48 + } + }, + "range": [ + 325, + 373 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 325, + 341 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 6 + } + }, + "range": [ + 325, + 331 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 7 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 332, + 341 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 17 + }, + "end": { + "line": 17, + "column": 26 + } + }, + "range": [ + 342, + 351 + ], + "name": "fromParam" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 17, + "column": 28 + }, + "end": { + "line": 17, + "column": 29 + } + }, + "range": [ + 353, + 354 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 17, + "column": 31 + }, + "end": { + "line": 17, + "column": 47 + } + }, + "range": [ + 356, + 372 + ], + "value": "from parameter", + "raw": "'from parameter'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 43 + } + }, + "range": [ + 375, + 418 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 42 + } + }, + "range": [ + 375, + 417 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 16 + } + }, + "range": [ + 375, + 391 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 6 + } + }, + "range": [ + 375, + 381 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 7 + }, + "end": { + "line": 18, + "column": 16 + } + }, + "range": [ + 382, + 391 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 25 + } + }, + "range": [ + 392, + 400 + ], + "name": "fromBody" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 18, + "column": 27 + }, + "end": { + "line": 18, + "column": 28 + } + }, + "range": [ + 402, + 403 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 18, + "column": 30 + }, + "end": { + "line": 18, + "column": 41 + } + }, + "range": [ + 405, + 416 + ], + "value": "from body", + "raw": "'from body'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 154, + 157 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 158, + 163 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 4, + "column": 10 + }, + "end": { + "line": 4, + "column": 11 + } + }, + "range": [ + 164, + 165 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 166, + 167 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 14 + } + }, + "range": [ + 167, + 168 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 169, + 172 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "range": [ + 173, + 182 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 14 + } + }, + "range": [ + 182, + 183 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 184, + 192 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 23 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "range": [ + 192, + 193 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "range": [ + 195, + 200 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 7 + } + }, + "range": [ + 201, + 202 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 7, + "column": 9 + } + }, + "range": [ + 203, + 204 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 8 + } + }, + "range": [ + 207, + 213 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 8, + "column": 10 + } + }, + "range": [ + 214, + 215 + ] + }, + { + "type": "Keyword", + "value": "new", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 7 + } + }, + "range": [ + 220, + 223 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 9 + } + }, + "range": [ + 224, + 225 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 14 + } + }, + "range": [ + 225, + 230 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 9, + "column": 15 + }, + "end": { + "line": 9, + "column": 16 + } + }, + "range": [ + 231, + 232 + ] + }, + { + "type": "Identifier", + "value": "constructor", + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 17 + } + }, + "range": [ + 239, + 250 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 10, + "column": 17 + }, + "end": { + "line": 10, + "column": 18 + } + }, + "range": [ + 250, + 251 + ] + }, + { + "type": "Identifier", + "value": "x", + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 19 + } + }, + "range": [ + 251, + 252 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 10, + "column": 20 + }, + "end": { + "line": 10, + "column": 21 + } + }, + "range": [ + 253, + 254 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 10, + "column": 22 + }, + "end": { + "line": 10, + "column": 31 + } + }, + "range": [ + 255, + 264 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 10, + "column": 32 + }, + "end": { + "line": 10, + "column": 33 + } + }, + "range": [ + 265, + 266 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 10, + "column": 34 + }, + "end": { + "line": 10, + "column": 39 + } + }, + "range": [ + 267, + 272 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 10, + "column": 39 + }, + "end": { + "line": 10, + "column": 40 + } + }, + "range": [ + 272, + 273 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 10, + "column": 41 + }, + "end": { + "line": 10, + "column": 42 + } + }, + "range": [ + 274, + 275 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 11, + "column": 8 + }, + "end": { + "line": 11, + "column": 16 + } + }, + "range": [ + 284, + 292 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 11, + "column": 17 + }, + "end": { + "line": 11, + "column": 18 + } + }, + "range": [ + 293, + 294 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 11, + "column": 19 + }, + "end": { + "line": 11, + "column": 24 + } + }, + "range": [ + 295, + 300 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 11, + "column": 24 + }, + "end": { + "line": 11, + "column": 25 + } + }, + "range": [ + 300, + 301 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 12, + "column": 6 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "range": [ + 308, + 309 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 5 + } + }, + "range": [ + 314, + 315 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 13, + "column": 5 + }, + "end": { + "line": 13, + "column": 6 + } + }, + "range": [ + 315, + 316 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 13, + "column": 6 + }, + "end": { + "line": 13, + "column": 7 + } + }, + "range": [ + 316, + 317 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 14, + "column": 2 + }, + "end": { + "line": 14, + "column": 3 + } + }, + "range": [ + 320, + 321 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 1 + } + }, + "range": [ + 322, + 323 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 6 + } + }, + "range": [ + 325, + 331 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 17, + "column": 6 + }, + "end": { + "line": 17, + "column": 7 + } + }, + "range": [ + 331, + 332 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 17, + "column": 7 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 332, + 341 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 17, + "column": 16 + }, + "end": { + "line": 17, + "column": 17 + } + }, + "range": [ + 341, + 342 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 17, + "column": 17 + }, + "end": { + "line": 17, + "column": 26 + } + }, + "range": [ + 342, + 351 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 17, + "column": 26 + }, + "end": { + "line": 17, + "column": 27 + } + }, + "range": [ + 351, + 352 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 17, + "column": 28 + }, + "end": { + "line": 17, + "column": 29 + } + }, + "range": [ + 353, + 354 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 17, + "column": 29 + }, + "end": { + "line": 17, + "column": 30 + } + }, + "range": [ + 354, + 355 + ] + }, + { + "type": "String", + "value": "'from parameter'", + "loc": { + "start": { + "line": 17, + "column": 31 + }, + "end": { + "line": 17, + "column": 47 + } + }, + "range": [ + 356, + 372 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 17, + "column": 47 + }, + "end": { + "line": 17, + "column": 48 + } + }, + "range": [ + 372, + 373 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 17, + "column": 48 + }, + "end": { + "line": 17, + "column": 49 + } + }, + "range": [ + 373, + 374 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 6 + } + }, + "range": [ + 375, + 381 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 18, + "column": 6 + }, + "end": { + "line": 18, + "column": 7 + } + }, + "range": [ + 381, + 382 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 18, + "column": 7 + }, + "end": { + "line": 18, + "column": 16 + } + }, + "range": [ + 382, + 391 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 18, + "column": 16 + }, + "end": { + "line": 18, + "column": 17 + } + }, + "range": [ + 391, + 392 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 25 + } + }, + "range": [ + 392, + 400 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 18, + "column": 25 + }, + "end": { + "line": 18, + "column": 26 + } + }, + "range": [ + 400, + 401 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 18, + "column": 27 + }, + "end": { + "line": 18, + "column": 28 + } + }, + "range": [ + 402, + 403 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 18, + "column": 28 + }, + "end": { + "line": 18, + "column": 29 + } + }, + "range": [ + 403, + 404 + ] + }, + { + "type": "String", + "value": "'from body'", + "loc": { + "start": { + "line": 18, + "column": 30 + }, + "end": { + "line": 18, + "column": 41 + } + }, + "range": [ + 405, + 416 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 18, + "column": 41 + }, + "end": { + "line": 18, + "column": 42 + } + }, + "range": [ + 416, + 417 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 18, + "column": 42 + }, + "end": { + "line": 18, + "column": 43 + } + }, + "range": [ + 417, + 418 + ] + } + ] +}; \ 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..1f019f61 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-class-static-init-await-reference.src.js @@ -0,0 +1,18 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/expressions/class/static-init-await-reference.js + + +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..ff802651 --- /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": 190, + "lineNumber": 6, + "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..d7370f51 --- /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": 4, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 155, + 213 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 155, + 213 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 161, + 162 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 163, + 213 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 167, + 211 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 31 + } + }, + "range": [ + 180, + 207 + ], + "expression": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 29 + } + }, + "range": [ + 181, + 205 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 14 + }, + "end": { + "line": 6, + "column": 19 + } + }, + "range": [ + 190, + 195 + ], + "name": "await" + }, + "expression": false, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 20 + }, + "end": { + "line": 6, + "column": 25 + } + }, + "range": [ + 196, + 201 + ], + "name": "await" + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 6, + "column": 27 + }, + "end": { + "line": 6, + "column": 29 + } + }, + "range": [ + 203, + 205 + ], + "body": [] + } + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 155, + 160 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 161, + 162 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 163, + 164 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 8 + } + }, + "range": [ + 167, + 173 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 174, + 175 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 180, + 181 + ] + }, + { + "type": "Keyword", + "value": "function", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 13 + } + }, + "range": [ + 181, + 189 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 6, + "column": 14 + }, + "end": { + "line": 6, + "column": 19 + } + }, + "range": [ + 190, + 195 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 19 + }, + "end": { + "line": 6, + "column": 20 + } + }, + "range": [ + 195, + 196 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 6, + "column": 20 + }, + "end": { + "line": 6, + "column": 25 + } + }, + "range": [ + 196, + 201 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 25 + }, + "end": { + "line": 6, + "column": 26 + } + }, + "range": [ + 201, + 202 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 27 + }, + "end": { + "line": 6, + "column": 28 + } + }, + "range": [ + 203, + 204 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 28 + }, + "end": { + "line": 6, + "column": 29 + } + }, + "range": [ + 204, + 205 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 29 + }, + "end": { + "line": 6, + "column": 30 + } + }, + "range": [ + 205, + 206 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 30 + }, + "end": { + "line": 6, + "column": 31 + } + }, + "range": [ + 206, + 207 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 210, + 211 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 212, + 213 + ] + } + ] +}; \ 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..37cebb74 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-function-static-init-await-binding.src.js @@ -0,0 +1,8 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/expressions/function/static-init-await-binding.js + + +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..aa6c95e1 --- /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": 161, + "lineNumber": 4, + "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..3d78b54a --- /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": 4, + "column": 0 + }, + "end": { + "line": 16, + "column": 43 + } + }, + "range": [ + 157, + 393 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 14 + } + }, + "range": [ + 157, + 171 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 161, + 170 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 161, + 166 + ], + "name": "await" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 169, + 170 + ], + "value": 0, + "raw": "0" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "range": [ + 172, + 196 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "range": [ + 176, + 185 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "range": [ + 176, + 185 + ], + "name": "fromParam" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 187, + 195 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 187, + 195 + ], + "name": "fromBody" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 13, + "column": 1 + } + }, + "range": [ + 198, + 298 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 7 + } + }, + "range": [ + 204, + 205 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 13, + "column": 1 + } + }, + "range": [ + 206, + 298 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 12, + "column": 3 + } + }, + "range": [ + 210, + 296 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 11, + "column": 9 + } + }, + "range": [ + 223, + 292 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 11, + "column": 8 + } + }, + "range": [ + 223, + 291 + ], + "callee": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 9, + "column": 5 + }, + "end": { + "line": 11, + "column": 5 + } + }, + "range": [ + 224, + 288 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 9, + "column": 15 + }, + "end": { + "line": 9, + "column": 36 + } + }, + "range": [ + 234, + 255 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 15 + }, + "end": { + "line": 9, + "column": 16 + } + }, + "range": [ + 234, + 235 + ], + "name": "x" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 9, + "column": 19 + }, + "end": { + "line": 9, + "column": 36 + } + }, + "range": [ + 238, + 255 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 19 + }, + "end": { + "line": 9, + "column": 28 + } + }, + "range": [ + 238, + 247 + ], + "name": "fromParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 31 + }, + "end": { + "line": 9, + "column": 36 + } + }, + "range": [ + 250, + 255 + ], + "name": "await" + } + } + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 9, + "column": 38 + }, + "end": { + "line": 11, + "column": 5 + } + }, + "range": [ + 257, + 288 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 23 + } + }, + "range": [ + 265, + 282 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 22 + } + }, + "range": [ + 265, + 281 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 14 + } + }, + "range": [ + 265, + 273 + ], + "name": "fromBody" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 17 + }, + "end": { + "line": 10, + "column": 22 + } + }, + "range": [ + 276, + 281 + ], + "name": "await" + } + } + } + ] + } + }, + "arguments": [], + "optional": false + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 49 + } + }, + "range": [ + 300, + 349 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 48 + } + }, + "range": [ + 300, + 348 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 16 + } + }, + "range": [ + 300, + 316 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 6 + } + }, + "range": [ + 300, + 306 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 7 + }, + "end": { + "line": 15, + "column": 16 + } + }, + "range": [ + 307, + 316 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 17 + }, + "end": { + "line": 15, + "column": 26 + } + }, + "range": [ + 317, + 326 + ], + "name": "fromParam" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 15, + "column": 28 + }, + "end": { + "line": 15, + "column": 29 + } + }, + "range": [ + 328, + 329 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 15, + "column": 31 + }, + "end": { + "line": 15, + "column": 47 + } + }, + "range": [ + 331, + 347 + ], + "value": "from parameter", + "raw": "'from parameter'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 43 + } + }, + "range": [ + 350, + 393 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 42 + } + }, + "range": [ + 350, + 392 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 350, + 366 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 6 + } + }, + "range": [ + 350, + 356 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 7 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 357, + 366 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 17 + }, + "end": { + "line": 16, + "column": 25 + } + }, + "range": [ + 367, + 375 + ], + "name": "fromBody" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 16, + "column": 27 + }, + "end": { + "line": 16, + "column": 28 + } + }, + "range": [ + 377, + 378 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 16, + "column": 30 + }, + "end": { + "line": 16, + "column": 41 + } + }, + "range": [ + 380, + 391 + ], + "value": "from body", + "raw": "'from body'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 157, + 160 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 161, + 166 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 4, + "column": 10 + }, + "end": { + "line": 4, + "column": 11 + } + }, + "range": [ + 167, + 168 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 169, + 170 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 14 + } + }, + "range": [ + 170, + 171 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 172, + 175 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "range": [ + 176, + 185 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 14 + } + }, + "range": [ + 185, + 186 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 187, + 195 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 23 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "range": [ + 195, + 196 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "range": [ + 198, + 203 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 7 + } + }, + "range": [ + 204, + 205 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 7, + "column": 9 + } + }, + "range": [ + 206, + 207 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 8 + } + }, + "range": [ + 210, + 216 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 8, + "column": 10 + } + }, + "range": [ + 217, + 218 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 5 + } + }, + "range": [ + 223, + 224 + ] + }, + { + "type": "Keyword", + "value": "function", + "loc": { + "start": { + "line": 9, + "column": 5 + }, + "end": { + "line": 9, + "column": 13 + } + }, + "range": [ + 224, + 232 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 9, + "column": 14 + }, + "end": { + "line": 9, + "column": 15 + } + }, + "range": [ + 233, + 234 + ] + }, + { + "type": "Identifier", + "value": "x", + "loc": { + "start": { + "line": 9, + "column": 15 + }, + "end": { + "line": 9, + "column": 16 + } + }, + "range": [ + 234, + 235 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 9, + "column": 17 + }, + "end": { + "line": 9, + "column": 18 + } + }, + "range": [ + 236, + 237 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 9, + "column": 19 + }, + "end": { + "line": 9, + "column": 28 + } + }, + "range": [ + 238, + 247 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 9, + "column": 29 + }, + "end": { + "line": 9, + "column": 30 + } + }, + "range": [ + 248, + 249 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 9, + "column": 31 + }, + "end": { + "line": 9, + "column": 36 + } + }, + "range": [ + 250, + 255 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 9, + "column": 36 + }, + "end": { + "line": 9, + "column": 37 + } + }, + "range": [ + 255, + 256 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 9, + "column": 38 + }, + "end": { + "line": 9, + "column": 39 + } + }, + "range": [ + 257, + 258 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 14 + } + }, + "range": [ + 265, + 273 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 10, + "column": 15 + }, + "end": { + "line": 10, + "column": 16 + } + }, + "range": [ + 274, + 275 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 10, + "column": 17 + }, + "end": { + "line": 10, + "column": 22 + } + }, + "range": [ + 276, + 281 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 10, + "column": 22 + }, + "end": { + "line": 10, + "column": 23 + } + }, + "range": [ + 281, + 282 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 11, + "column": 4 + }, + "end": { + "line": 11, + "column": 5 + } + }, + "range": [ + 287, + 288 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 11, + "column": 5 + }, + "end": { + "line": 11, + "column": 6 + } + }, + "range": [ + 288, + 289 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 7 + } + }, + "range": [ + 289, + 290 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 11, + "column": 7 + }, + "end": { + "line": 11, + "column": 8 + } + }, + "range": [ + 290, + 291 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 11, + "column": 8 + }, + "end": { + "line": 11, + "column": 9 + } + }, + "range": [ + 291, + 292 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 12, + "column": 2 + }, + "end": { + "line": 12, + "column": 3 + } + }, + "range": [ + 295, + 296 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 1 + } + }, + "range": [ + 297, + 298 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 6 + } + }, + "range": [ + 300, + 306 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 15, + "column": 7 + } + }, + "range": [ + 306, + 307 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 15, + "column": 7 + }, + "end": { + "line": 15, + "column": 16 + } + }, + "range": [ + 307, + 316 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 15, + "column": 16 + }, + "end": { + "line": 15, + "column": 17 + } + }, + "range": [ + 316, + 317 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 15, + "column": 17 + }, + "end": { + "line": 15, + "column": 26 + } + }, + "range": [ + 317, + 326 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 15, + "column": 26 + }, + "end": { + "line": 15, + "column": 27 + } + }, + "range": [ + 326, + 327 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 15, + "column": 28 + }, + "end": { + "line": 15, + "column": 29 + } + }, + "range": [ + 328, + 329 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 15, + "column": 29 + }, + "end": { + "line": 15, + "column": 30 + } + }, + "range": [ + 329, + 330 + ] + }, + { + "type": "String", + "value": "'from parameter'", + "loc": { + "start": { + "line": 15, + "column": 31 + }, + "end": { + "line": 15, + "column": 47 + } + }, + "range": [ + 331, + 347 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 15, + "column": 47 + }, + "end": { + "line": 15, + "column": 48 + } + }, + "range": [ + 347, + 348 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 15, + "column": 48 + }, + "end": { + "line": 15, + "column": 49 + } + }, + "range": [ + 348, + 349 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 6 + } + }, + "range": [ + 350, + 356 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 16, + "column": 6 + }, + "end": { + "line": 16, + "column": 7 + } + }, + "range": [ + 356, + 357 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 16, + "column": 7 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 357, + 366 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 16, + "column": 16 + }, + "end": { + "line": 16, + "column": 17 + } + }, + "range": [ + 366, + 367 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 16, + "column": 17 + }, + "end": { + "line": 16, + "column": 25 + } + }, + "range": [ + 367, + 375 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 16, + "column": 25 + }, + "end": { + "line": 16, + "column": 26 + } + }, + "range": [ + 375, + 376 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 16, + "column": 27 + }, + "end": { + "line": 16, + "column": 28 + } + }, + "range": [ + 377, + 378 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 16, + "column": 28 + }, + "end": { + "line": 16, + "column": 29 + } + }, + "range": [ + 378, + 379 + ] + }, + { + "type": "String", + "value": "'from body'", + "loc": { + "start": { + "line": 16, + "column": 30 + }, + "end": { + "line": 16, + "column": 41 + } + }, + "range": [ + 380, + 391 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 16, + "column": 41 + }, + "end": { + "line": 16, + "column": 42 + } + }, + "range": [ + 391, + 392 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 16, + "column": 42 + }, + "end": { + "line": 16, + "column": 43 + } + }, + "range": [ + 392, + 393 + ] + } + ] +}; \ 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..13810a59 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-function-static-init-await-reference.src.js @@ -0,0 +1,16 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/expressions/function/static-init-await-reference.js + + +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..62098989 --- /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": 194, + "lineNumber": 6, + "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..693f436e --- /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": 4, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 157, + 218 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 157, + 218 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 163, + 164 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 165, + 218 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 169, + 216 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 34 + } + }, + "range": [ + 182, + 212 + ], + "expression": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 32 + } + }, + "range": [ + 183, + 210 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 16 + }, + "end": { + "line": 6, + "column": 21 + } + }, + "range": [ + 194, + 199 + ], + "name": "await" + }, + "expression": false, + "generator": true, + "async": false, + "params": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 23 + }, + "end": { + "line": 6, + "column": 28 + } + }, + "range": [ + 201, + 206 + ], + "name": "await" + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 6, + "column": 30 + }, + "end": { + "line": 6, + "column": 32 + } + }, + "range": [ + 208, + 210 + ], + "body": [] + } + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 157, + 162 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 163, + 164 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 165, + 166 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 8 + } + }, + "range": [ + 169, + 175 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 176, + 177 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 182, + 183 + ] + }, + { + "type": "Keyword", + "value": "function", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 13 + } + }, + "range": [ + 183, + 191 + ] + }, + { + "type": "Punctuator", + "value": "*", + "loc": { + "start": { + "line": 6, + "column": 14 + }, + "end": { + "line": 6, + "column": 15 + } + }, + "range": [ + 192, + 193 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 6, + "column": 16 + }, + "end": { + "line": 6, + "column": 21 + } + }, + "range": [ + 194, + 199 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 22 + }, + "end": { + "line": 6, + "column": 23 + } + }, + "range": [ + 200, + 201 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 6, + "column": 23 + }, + "end": { + "line": 6, + "column": 28 + } + }, + "range": [ + 201, + 206 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 28 + }, + "end": { + "line": 6, + "column": 29 + } + }, + "range": [ + 206, + 207 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 30 + }, + "end": { + "line": 6, + "column": 31 + } + }, + "range": [ + 208, + 209 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 31 + }, + "end": { + "line": 6, + "column": 32 + } + }, + "range": [ + 209, + 210 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 32 + }, + "end": { + "line": 6, + "column": 33 + } + }, + "range": [ + 210, + 211 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 33 + }, + "end": { + "line": 6, + "column": 34 + } + }, + "range": [ + 211, + 212 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 215, + 216 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 217, + 218 + ] + } + ] +}; \ 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..e6593042 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-generators-static-init-await-binding.src.js @@ -0,0 +1,8 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/expressions/generators/static-init-await-binding.js + + +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..592bf752 --- /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": 163, + "lineNumber": 4, + "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..c7f24dd9 --- /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": 4, + "column": 0 + }, + "end": { + "line": 16, + "column": 43 + } + }, + "range": [ + 159, + 404 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 14 + } + }, + "range": [ + 159, + 173 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 163, + 172 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 163, + 168 + ], + "name": "await" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 171, + 172 + ], + "value": 0, + "raw": "0" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "range": [ + 174, + 198 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "range": [ + 178, + 187 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "range": [ + 178, + 187 + ], + "name": "fromParam" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 189, + 197 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 189, + 197 + ], + "name": "fromBody" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 13, + "column": 1 + } + }, + "range": [ + 200, + 309 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 7 + } + }, + "range": [ + 206, + 207 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 13, + "column": 1 + } + }, + "range": [ + 208, + 309 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 12, + "column": 3 + } + }, + "range": [ + 212, + 307 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 11, + "column": 16 + } + }, + "range": [ + 225, + 303 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 11, + "column": 15 + } + }, + "range": [ + 225, + 302 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 11, + "column": 13 + } + }, + "range": [ + 225, + 300 + ], + "object": { + "type": "CallExpression", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 11, + "column": 8 + } + }, + "range": [ + 225, + 295 + ], + "callee": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 9, + "column": 5 + }, + "end": { + "line": 11, + "column": 5 + } + }, + "range": [ + 226, + 292 + ], + "id": null, + "expression": false, + "generator": true, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 9, + "column": 17 + }, + "end": { + "line": 9, + "column": 38 + } + }, + "range": [ + 238, + 259 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 17 + }, + "end": { + "line": 9, + "column": 18 + } + }, + "range": [ + 238, + 239 + ], + "name": "x" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 9, + "column": 21 + }, + "end": { + "line": 9, + "column": 38 + } + }, + "range": [ + 242, + 259 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 21 + }, + "end": { + "line": 9, + "column": 30 + } + }, + "range": [ + 242, + 251 + ], + "name": "fromParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 33 + }, + "end": { + "line": 9, + "column": 38 + } + }, + "range": [ + 254, + 259 + ], + "name": "await" + } + } + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 9, + "column": 40 + }, + "end": { + "line": 11, + "column": 5 + } + }, + "range": [ + 261, + 292 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 23 + } + }, + "range": [ + 269, + 286 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 22 + } + }, + "range": [ + 269, + 285 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 14 + } + }, + "range": [ + 269, + 277 + ], + "name": "fromBody" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 17 + }, + "end": { + "line": 10, + "column": 22 + } + }, + "range": [ + 280, + 285 + ], + "name": "await" + } + } + } + ] + } + }, + "arguments": [], + "optional": false + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 9 + }, + "end": { + "line": 11, + "column": 13 + } + }, + "range": [ + 296, + 300 + ], + "name": "next" + }, + "computed": false, + "optional": false + }, + "arguments": [], + "optional": false + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 49 + } + }, + "range": [ + 311, + 360 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 48 + } + }, + "range": [ + 311, + 359 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 16 + } + }, + "range": [ + 311, + 327 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 6 + } + }, + "range": [ + 311, + 317 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 7 + }, + "end": { + "line": 15, + "column": 16 + } + }, + "range": [ + 318, + 327 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 17 + }, + "end": { + "line": 15, + "column": 26 + } + }, + "range": [ + 328, + 337 + ], + "name": "fromParam" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 15, + "column": 28 + }, + "end": { + "line": 15, + "column": 29 + } + }, + "range": [ + 339, + 340 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 15, + "column": 31 + }, + "end": { + "line": 15, + "column": 47 + } + }, + "range": [ + 342, + 358 + ], + "value": "from parameter", + "raw": "'from parameter'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 43 + } + }, + "range": [ + 361, + 404 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 42 + } + }, + "range": [ + 361, + 403 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 361, + 377 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 6 + } + }, + "range": [ + 361, + 367 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 7 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 368, + 377 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 17 + }, + "end": { + "line": 16, + "column": 25 + } + }, + "range": [ + 378, + 386 + ], + "name": "fromBody" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 16, + "column": 27 + }, + "end": { + "line": 16, + "column": 28 + } + }, + "range": [ + 388, + 389 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 16, + "column": 30 + }, + "end": { + "line": 16, + "column": 41 + } + }, + "range": [ + 391, + 402 + ], + "value": "from body", + "raw": "'from body'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 159, + 162 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 163, + 168 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 4, + "column": 10 + }, + "end": { + "line": 4, + "column": 11 + } + }, + "range": [ + 169, + 170 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 171, + 172 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 14 + } + }, + "range": [ + 172, + 173 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 174, + 177 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "range": [ + 178, + 187 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 14 + } + }, + "range": [ + 187, + 188 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 189, + 197 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 23 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "range": [ + 197, + 198 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "range": [ + 200, + 205 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 7 + } + }, + "range": [ + 206, + 207 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 7, + "column": 9 + } + }, + "range": [ + 208, + 209 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 8 + } + }, + "range": [ + 212, + 218 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 8, + "column": 10 + } + }, + "range": [ + 219, + 220 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 5 + } + }, + "range": [ + 225, + 226 + ] + }, + { + "type": "Keyword", + "value": "function", + "loc": { + "start": { + "line": 9, + "column": 5 + }, + "end": { + "line": 9, + "column": 13 + } + }, + "range": [ + 226, + 234 + ] + }, + { + "type": "Punctuator", + "value": "*", + "loc": { + "start": { + "line": 9, + "column": 14 + }, + "end": { + "line": 9, + "column": 15 + } + }, + "range": [ + 235, + 236 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 9, + "column": 16 + }, + "end": { + "line": 9, + "column": 17 + } + }, + "range": [ + 237, + 238 + ] + }, + { + "type": "Identifier", + "value": "x", + "loc": { + "start": { + "line": 9, + "column": 17 + }, + "end": { + "line": 9, + "column": 18 + } + }, + "range": [ + 238, + 239 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 9, + "column": 19 + }, + "end": { + "line": 9, + "column": 20 + } + }, + "range": [ + 240, + 241 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 9, + "column": 21 + }, + "end": { + "line": 9, + "column": 30 + } + }, + "range": [ + 242, + 251 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 9, + "column": 31 + }, + "end": { + "line": 9, + "column": 32 + } + }, + "range": [ + 252, + 253 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 9, + "column": 33 + }, + "end": { + "line": 9, + "column": 38 + } + }, + "range": [ + 254, + 259 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 9, + "column": 38 + }, + "end": { + "line": 9, + "column": 39 + } + }, + "range": [ + 259, + 260 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 9, + "column": 40 + }, + "end": { + "line": 9, + "column": 41 + } + }, + "range": [ + 261, + 262 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 14 + } + }, + "range": [ + 269, + 277 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 10, + "column": 15 + }, + "end": { + "line": 10, + "column": 16 + } + }, + "range": [ + 278, + 279 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 10, + "column": 17 + }, + "end": { + "line": 10, + "column": 22 + } + }, + "range": [ + 280, + 285 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 10, + "column": 22 + }, + "end": { + "line": 10, + "column": 23 + } + }, + "range": [ + 285, + 286 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 11, + "column": 4 + }, + "end": { + "line": 11, + "column": 5 + } + }, + "range": [ + 291, + 292 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 11, + "column": 5 + }, + "end": { + "line": 11, + "column": 6 + } + }, + "range": [ + 292, + 293 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 7 + } + }, + "range": [ + 293, + 294 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 11, + "column": 7 + }, + "end": { + "line": 11, + "column": 8 + } + }, + "range": [ + 294, + 295 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 11, + "column": 8 + }, + "end": { + "line": 11, + "column": 9 + } + }, + "range": [ + 295, + 296 + ] + }, + { + "type": "Identifier", + "value": "next", + "loc": { + "start": { + "line": 11, + "column": 9 + }, + "end": { + "line": 11, + "column": 13 + } + }, + "range": [ + 296, + 300 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 11, + "column": 13 + }, + "end": { + "line": 11, + "column": 14 + } + }, + "range": [ + 300, + 301 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 11, + "column": 14 + }, + "end": { + "line": 11, + "column": 15 + } + }, + "range": [ + 301, + 302 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 11, + "column": 15 + }, + "end": { + "line": 11, + "column": 16 + } + }, + "range": [ + 302, + 303 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 12, + "column": 2 + }, + "end": { + "line": 12, + "column": 3 + } + }, + "range": [ + 306, + 307 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 1 + } + }, + "range": [ + 308, + 309 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 6 + } + }, + "range": [ + 311, + 317 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 15, + "column": 7 + } + }, + "range": [ + 317, + 318 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 15, + "column": 7 + }, + "end": { + "line": 15, + "column": 16 + } + }, + "range": [ + 318, + 327 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 15, + "column": 16 + }, + "end": { + "line": 15, + "column": 17 + } + }, + "range": [ + 327, + 328 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 15, + "column": 17 + }, + "end": { + "line": 15, + "column": 26 + } + }, + "range": [ + 328, + 337 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 15, + "column": 26 + }, + "end": { + "line": 15, + "column": 27 + } + }, + "range": [ + 337, + 338 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 15, + "column": 28 + }, + "end": { + "line": 15, + "column": 29 + } + }, + "range": [ + 339, + 340 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 15, + "column": 29 + }, + "end": { + "line": 15, + "column": 30 + } + }, + "range": [ + 340, + 341 + ] + }, + { + "type": "String", + "value": "'from parameter'", + "loc": { + "start": { + "line": 15, + "column": 31 + }, + "end": { + "line": 15, + "column": 47 + } + }, + "range": [ + 342, + 358 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 15, + "column": 47 + }, + "end": { + "line": 15, + "column": 48 + } + }, + "range": [ + 358, + 359 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 15, + "column": 48 + }, + "end": { + "line": 15, + "column": 49 + } + }, + "range": [ + 359, + 360 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 6 + } + }, + "range": [ + 361, + 367 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 16, + "column": 6 + }, + "end": { + "line": 16, + "column": 7 + } + }, + "range": [ + 367, + 368 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 16, + "column": 7 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 368, + 377 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 16, + "column": 16 + }, + "end": { + "line": 16, + "column": 17 + } + }, + "range": [ + 377, + 378 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 16, + "column": 17 + }, + "end": { + "line": 16, + "column": 25 + } + }, + "range": [ + 378, + 386 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 16, + "column": 25 + }, + "end": { + "line": 16, + "column": 26 + } + }, + "range": [ + 386, + 387 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 16, + "column": 27 + }, + "end": { + "line": 16, + "column": 28 + } + }, + "range": [ + 388, + 389 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 16, + "column": 28 + }, + "end": { + "line": 16, + "column": 29 + } + }, + "range": [ + 389, + 390 + ] + }, + { + "type": "String", + "value": "'from body'", + "loc": { + "start": { + "line": 16, + "column": 30 + }, + "end": { + "line": 16, + "column": 41 + } + }, + "range": [ + 391, + 402 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 16, + "column": 41 + }, + "end": { + "line": 16, + "column": 42 + } + }, + "range": [ + 402, + 403 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 16, + "column": 42 + }, + "end": { + "line": 16, + "column": 43 + } + }, + "range": [ + 403, + 404 + ] + } + ] +}; \ 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..8ea46bbc --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-generators-static-init-await-reference.src.js @@ -0,0 +1,16 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/expressions/generators/static-init-await-reference.js + + +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..addfdb4e --- /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": 4, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 174, + 220 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 174, + 220 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 180, + 181 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 182, + 220 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 186, + 218 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 19 + } + }, + "range": [ + 199, + 214 + ], + "expression": { + "type": "ObjectExpression", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 17 + } + }, + "range": [ + 200, + 212 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 6, + "column": 7 + }, + "end": { + "line": 6, + "column": 15 + } + }, + "range": [ + 202, + 210 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 7 + }, + "end": { + "line": 6, + "column": 12 + } + }, + "range": [ + 202, + 207 + ], + "name": "await" + }, + "value": { + "type": "Literal", + "loc": { + "start": { + "line": 6, + "column": 14 + }, + "end": { + "line": 6, + "column": 15 + } + }, + "range": [ + 209, + 210 + ], + "value": 0, + "raw": "0" + }, + "kind": "init" + } + ] + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 174, + 179 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 180, + 181 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 182, + 183 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 8 + } + }, + "range": [ + 186, + 192 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 193, + 194 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 199, + 200 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 6 + } + }, + "range": [ + 200, + 201 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 6, + "column": 7 + }, + "end": { + "line": 6, + "column": 12 + } + }, + "range": [ + 202, + 207 + ] + }, + { + "type": "Punctuator", + "value": ":", + "loc": { + "start": { + "line": 6, + "column": 12 + }, + "end": { + "line": 6, + "column": 13 + } + }, + "range": [ + 207, + 208 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 6, + "column": 14 + }, + "end": { + "line": 6, + "column": 15 + } + }, + "range": [ + 209, + 210 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 16 + }, + "end": { + "line": 6, + "column": 17 + } + }, + "range": [ + 211, + 212 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 17 + }, + "end": { + "line": 6, + "column": 18 + } + }, + "range": [ + 212, + 213 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 18 + }, + "end": { + "line": 6, + "column": 19 + } + }, + "range": [ + 213, + 214 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 217, + 218 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 219, + 220 + ] + } + ] +}; \ 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..ddd7c215 --- /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,9 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/expressions/object/ident-name-prop-name-literal-await-static-init.js + + +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..bc6fafbd --- /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": 200, + "lineNumber": 4, + "column": 8, + "message": "Cannot use await in class static initialization block" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-identifier-shorthand-static-init-await-invalid.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-identifier-shorthand-static-init-await-invalid.src.js new file mode 100644 index 00000000..3e3520b7 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-identifier-shorthand-static-init-await-invalid.src.js @@ -0,0 +1,7 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/expressions/object/identifier-shorthand-static-init-await-invalid.js +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..fe0e42d6 --- /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": 207, + "lineNumber": 6, + "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..1d3f5fd4 --- /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": 4, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 172, + 223 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 172, + 223 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 178, + 179 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 180, + 223 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 184, + 221 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 24 + } + }, + "range": [ + 197, + 217 + ], + "expression": { + "type": "ArrowFunctionExpression", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 22 + } + }, + "range": [ + 198, + 215 + ], + "id": null, + "expression": true, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "ObjectExpression", + "loc": { + "start": { + "line": 6, + "column": 12 + }, + "end": { + "line": 6, + "column": 21 + } + }, + "range": [ + 205, + 214 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 6, + "column": 14 + }, + "end": { + "line": 6, + "column": 19 + } + }, + "range": [ + 207, + 212 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 14 + }, + "end": { + "line": 6, + "column": 19 + } + }, + "range": [ + 207, + 212 + ], + "name": "await" + }, + "kind": "init", + "value": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 14 + }, + "end": { + "line": 6, + "column": 19 + } + }, + "range": [ + 207, + 212 + ], + "name": "await" + } + } + ] + } + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 172, + 177 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 178, + 179 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 180, + 181 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 8 + } + }, + "range": [ + 184, + 190 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 191, + 192 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 197, + 198 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 6 + } + }, + "range": [ + 198, + 199 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 199, + 200 + ] + }, + { + "type": "Punctuator", + "value": "=>", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 10 + } + }, + "range": [ + 201, + 203 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 11 + }, + "end": { + "line": 6, + "column": 12 + } + }, + "range": [ + 204, + 205 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 12 + }, + "end": { + "line": 6, + "column": 13 + } + }, + "range": [ + 205, + 206 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 6, + "column": 14 + }, + "end": { + "line": 6, + "column": 19 + } + }, + "range": [ + 207, + 212 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 20 + }, + "end": { + "line": 6, + "column": 21 + } + }, + "range": [ + 213, + 214 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 21 + }, + "end": { + "line": 6, + "column": 22 + } + }, + "range": [ + 214, + 215 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 22 + }, + "end": { + "line": 6, + "column": 23 + } + }, + "range": [ + 215, + 216 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 23 + }, + "end": { + "line": 6, + "column": 24 + } + }, + "range": [ + 216, + 217 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 220, + 221 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 222, + 223 + ] + } + ] +}; \ 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..6216844f --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/expressions-object-identifier-shorthand-static-init-await-valid.src.js @@ -0,0 +1,8 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/expressions/object/identifier-shorthand-static-init-await-valid.js + + +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..39178df6 --- /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": 220, + "lineNumber": 6, + "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..18c4176e --- /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": 4, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 180, + 238 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 180, + 238 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 186, + 187 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 188, + 238 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 192, + 236 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 31 + } + }, + "range": [ + 205, + 232 + ], + "expression": { + "type": "ObjectExpression", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 29 + } + }, + "range": [ + 206, + 230 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 28 + } + }, + "range": [ + 207, + 229 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 10 + }, + "end": { + "line": 6, + "column": 18 + } + }, + "range": [ + 211, + 219 + ], + "name": "accessor" + }, + "kind": "set", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 6, + "column": 18 + }, + "end": { + "line": 6, + "column": 28 + } + }, + "range": [ + 219, + 229 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 19 + }, + "end": { + "line": 6, + "column": 24 + } + }, + "range": [ + 220, + 225 + ], + "name": "await" + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 6, + "column": 26 + }, + "end": { + "line": 6, + "column": 28 + } + }, + "range": [ + 227, + 229 + ], + "body": [] + } + } + } + ] + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 180, + 185 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 186, + 187 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 188, + 189 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 8 + } + }, + "range": [ + 192, + 198 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 199, + 200 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 205, + 206 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 6 + } + }, + "range": [ + 206, + 207 + ] + }, + { + "type": "Identifier", + "value": "set", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 9 + } + }, + "range": [ + 207, + 210 + ] + }, + { + "type": "Identifier", + "value": "accessor", + "loc": { + "start": { + "line": 6, + "column": 10 + }, + "end": { + "line": 6, + "column": 18 + } + }, + "range": [ + 211, + 219 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 18 + }, + "end": { + "line": 6, + "column": 19 + } + }, + "range": [ + 219, + 220 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 6, + "column": 19 + }, + "end": { + "line": 6, + "column": 24 + } + }, + "range": [ + 220, + 225 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 24 + }, + "end": { + "line": 6, + "column": 25 + } + }, + "range": [ + 225, + 226 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 26 + }, + "end": { + "line": 6, + "column": 27 + } + }, + "range": [ + 227, + 228 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 27 + }, + "end": { + "line": 6, + "column": 28 + } + }, + "range": [ + 228, + 229 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 28 + }, + "end": { + "line": 6, + "column": 29 + } + }, + "range": [ + 229, + 230 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 29 + }, + "end": { + "line": 6, + "column": 30 + } + }, + "range": [ + 230, + 231 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 30 + }, + "end": { + "line": 6, + "column": 31 + } + }, + "range": [ + 231, + 232 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 235, + 236 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 237, + 238 + ] + } + ] +}; \ 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..e9114dc7 --- /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,8 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/expressions/object/method-definition/static-init-await-binding-accessor.js + + +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..45f73b74 --- /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": 216, + "lineNumber": 6, + "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..6e7d8c98 --- /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": 4, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 181, + 234 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 181, + 234 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 187, + 188 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 189, + 234 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 193, + 232 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 26 + } + }, + "range": [ + 206, + 228 + ], + "expression": { + "type": "ObjectExpression", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 24 + } + }, + "range": [ + 207, + 226 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 23 + } + }, + "range": [ + 208, + 225 + ], + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 7 + }, + "end": { + "line": 6, + "column": 13 + } + }, + "range": [ + 209, + 215 + ], + "name": "method" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 23 + } + }, + "range": [ + 215, + 225 + ], + "id": null, + "expression": false, + "generator": true, + "async": false, + "params": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 14 + }, + "end": { + "line": 6, + "column": 19 + } + }, + "range": [ + 216, + 221 + ], + "name": "await" + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 6, + "column": 21 + }, + "end": { + "line": 6, + "column": 23 + } + }, + "range": [ + 223, + 225 + ], + "body": [] + } + } + } + ] + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 181, + 186 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 187, + 188 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 189, + 190 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 8 + } + }, + "range": [ + 193, + 199 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 200, + 201 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 206, + 207 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 6 + } + }, + "range": [ + 207, + 208 + ] + }, + { + "type": "Punctuator", + "value": "*", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 208, + 209 + ] + }, + { + "type": "Identifier", + "value": "method", + "loc": { + "start": { + "line": 6, + "column": 7 + }, + "end": { + "line": 6, + "column": 13 + } + }, + "range": [ + 209, + 215 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 14 + } + }, + "range": [ + 215, + 216 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 6, + "column": 14 + }, + "end": { + "line": 6, + "column": 19 + } + }, + "range": [ + 216, + 221 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 19 + }, + "end": { + "line": 6, + "column": 20 + } + }, + "range": [ + 221, + 222 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 21 + }, + "end": { + "line": 6, + "column": 22 + } + }, + "range": [ + 223, + 224 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 22 + }, + "end": { + "line": 6, + "column": 23 + } + }, + "range": [ + 224, + 225 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 23 + }, + "end": { + "line": 6, + "column": 24 + } + }, + "range": [ + 225, + 226 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 24 + }, + "end": { + "line": 6, + "column": 25 + } + }, + "range": [ + 226, + 227 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 25 + }, + "end": { + "line": 6, + "column": 26 + } + }, + "range": [ + 227, + 228 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 231, + 232 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 233, + 234 + ] + } + ] +}; \ 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..175616ce --- /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,8 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/expressions/object/method-definition/static-init-await-binding-generator.js + + +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..ece804da --- /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": 212, + "lineNumber": 6, + "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..89d00a09 --- /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": 4, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 178, + 230 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 178, + 230 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 184, + 185 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 186, + 230 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 190, + 228 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 25 + } + }, + "range": [ + 203, + 224 + ], + "expression": { + "type": "ObjectExpression", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 23 + } + }, + "range": [ + 204, + 222 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 22 + } + }, + "range": [ + 205, + 221 + ], + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 12 + } + }, + "range": [ + 205, + 211 + ], + "name": "method" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 6, + "column": 12 + }, + "end": { + "line": 6, + "column": 22 + } + }, + "range": [ + 211, + 221 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 18 + } + }, + "range": [ + 212, + 217 + ], + "name": "await" + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 6, + "column": 20 + }, + "end": { + "line": 6, + "column": 22 + } + }, + "range": [ + 219, + 221 + ], + "body": [] + } + } + } + ] + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 178, + 183 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 184, + 185 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 186, + 187 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 8 + } + }, + "range": [ + 190, + 196 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 197, + 198 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 203, + 204 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 6 + } + }, + "range": [ + 204, + 205 + ] + }, + { + "type": "Identifier", + "value": "method", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 12 + } + }, + "range": [ + 205, + 211 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 12 + }, + "end": { + "line": 6, + "column": 13 + } + }, + "range": [ + 211, + 212 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 18 + } + }, + "range": [ + 212, + 217 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 18 + }, + "end": { + "line": 6, + "column": 19 + } + }, + "range": [ + 217, + 218 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 20 + }, + "end": { + "line": 6, + "column": 21 + } + }, + "range": [ + 219, + 220 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 21 + }, + "end": { + "line": 6, + "column": 22 + } + }, + "range": [ + 220, + 221 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 22 + }, + "end": { + "line": 6, + "column": 23 + } + }, + "range": [ + 221, + 222 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 23 + }, + "end": { + "line": 6, + "column": 24 + } + }, + "range": [ + 222, + 223 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 24 + }, + "end": { + "line": 6, + "column": 25 + } + }, + "range": [ + 223, + 224 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 227, + 228 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 229, + 230 + ] + } + ] +}; \ 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..dc1cad24 --- /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,8 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/expressions/object/method-definition/static-init-await-binding-normal.js + + +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..f832e5fa --- /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": 186, + "lineNumber": 4, + "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..6a468b80 --- /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": 4, + "column": 0 + }, + "end": { + "line": 18, + "column": 43 + } + }, + "range": [ + 182, + 458 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 14 + } + }, + "range": [ + 182, + 196 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 186, + 195 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 186, + 191 + ], + "name": "await" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 194, + 195 + ], + "value": 0, + "raw": "0" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "range": [ + 197, + 221 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "range": [ + 201, + 210 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "range": [ + 201, + 210 + ], + "name": "fromParam" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 212, + 220 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 212, + 220 + ], + "name": "fromBody" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 15, + "column": 1 + } + }, + "range": [ + 223, + 363 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 7 + } + }, + "range": [ + 229, + 230 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 15, + "column": 1 + } + }, + "range": [ + 231, + 363 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 14, + "column": 3 + } + }, + "range": [ + 235, + 361 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 13, + "column": 28 + } + }, + "range": [ + 248, + 357 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 13, + "column": 27 + } + }, + "range": [ + 248, + 356 + ], + "operator": "=", + "left": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 13, + "column": 15 + } + }, + "range": [ + 248, + 344 + ], + "object": { + "type": "ObjectExpression", + "loc": { + "start": { + "line": 9, + "column": 5 + }, + "end": { + "line": 13, + "column": 5 + } + }, + "range": [ + 249, + 334 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "range": [ + 257, + 328 + ], + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 10 + }, + "end": { + "line": 10, + "column": 18 + } + }, + "range": [ + 261, + 269 + ], + "name": "accessor" + }, + "kind": "set", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "range": [ + 269, + 328 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 40 + } + }, + "range": [ + 270, + 291 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 20 + } + }, + "range": [ + 270, + 271 + ], + "name": "x" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 10, + "column": 23 + }, + "end": { + "line": 10, + "column": 40 + } + }, + "range": [ + 274, + 291 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 23 + }, + "end": { + "line": 10, + "column": 32 + } + }, + "range": [ + 274, + 283 + ], + "name": "fromParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 35 + }, + "end": { + "line": 10, + "column": 40 + } + }, + "range": [ + 286, + 291 + ], + "name": "await" + } + } + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 10, + "column": 42 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "range": [ + 293, + 328 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 11, + "column": 8 + }, + "end": { + "line": 11, + "column": 25 + } + }, + "range": [ + 303, + 320 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 11, + "column": 8 + }, + "end": { + "line": 11, + "column": 24 + } + }, + "range": [ + 303, + 319 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 8 + }, + "end": { + "line": 11, + "column": 16 + } + }, + "range": [ + 303, + 311 + ], + "name": "fromBody" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 19 + }, + "end": { + "line": 11, + "column": 24 + } + }, + "range": [ + 314, + 319 + ], + "name": "await" + } + } + } + ] + } + } + } + ] + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 7 + }, + "end": { + "line": 13, + "column": 15 + } + }, + "range": [ + 336, + 344 + ], + "name": "accessor" + }, + "computed": false, + "optional": false + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 18 + }, + "end": { + "line": 13, + "column": 27 + } + }, + "range": [ + 347, + 356 + ], + "name": "undefined" + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 49 + } + }, + "range": [ + 365, + 414 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 48 + } + }, + "range": [ + 365, + 413 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 365, + 381 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 6 + } + }, + "range": [ + 365, + 371 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 7 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 372, + 381 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 17 + }, + "end": { + "line": 17, + "column": 26 + } + }, + "range": [ + 382, + 391 + ], + "name": "fromParam" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 17, + "column": 28 + }, + "end": { + "line": 17, + "column": 29 + } + }, + "range": [ + 393, + 394 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 17, + "column": 31 + }, + "end": { + "line": 17, + "column": 47 + } + }, + "range": [ + 396, + 412 + ], + "value": "from parameter", + "raw": "'from parameter'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 43 + } + }, + "range": [ + 415, + 458 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 42 + } + }, + "range": [ + 415, + 457 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 16 + } + }, + "range": [ + 415, + 431 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 6 + } + }, + "range": [ + 415, + 421 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 7 + }, + "end": { + "line": 18, + "column": 16 + } + }, + "range": [ + 422, + 431 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 25 + } + }, + "range": [ + 432, + 440 + ], + "name": "fromBody" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 18, + "column": 27 + }, + "end": { + "line": 18, + "column": 28 + } + }, + "range": [ + 442, + 443 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 18, + "column": 30 + }, + "end": { + "line": 18, + "column": 41 + } + }, + "range": [ + 445, + 456 + ], + "value": "from body", + "raw": "'from body'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 182, + 185 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 186, + 191 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 4, + "column": 10 + }, + "end": { + "line": 4, + "column": 11 + } + }, + "range": [ + 192, + 193 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 194, + 195 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 14 + } + }, + "range": [ + 195, + 196 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 197, + 200 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "range": [ + 201, + 210 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 14 + } + }, + "range": [ + 210, + 211 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 212, + 220 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 23 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "range": [ + 220, + 221 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "range": [ + 223, + 228 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 7 + } + }, + "range": [ + 229, + 230 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 7, + "column": 9 + } + }, + "range": [ + 231, + 232 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 8 + } + }, + "range": [ + 235, + 241 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 8, + "column": 10 + } + }, + "range": [ + 242, + 243 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 5 + } + }, + "range": [ + 248, + 249 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 9, + "column": 5 + }, + "end": { + "line": 9, + "column": 6 + } + }, + "range": [ + 249, + 250 + ] + }, + { + "type": "Identifier", + "value": "set", + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 9 + } + }, + "range": [ + 257, + 260 + ] + }, + { + "type": "Identifier", + "value": "accessor", + "loc": { + "start": { + "line": 10, + "column": 10 + }, + "end": { + "line": 10, + "column": 18 + } + }, + "range": [ + 261, + 269 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 19 + } + }, + "range": [ + 269, + 270 + ] + }, + { + "type": "Identifier", + "value": "x", + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 10, + "column": 20 + } + }, + "range": [ + 270, + 271 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 10, + "column": 21 + }, + "end": { + "line": 10, + "column": 22 + } + }, + "range": [ + 272, + 273 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 10, + "column": 23 + }, + "end": { + "line": 10, + "column": 32 + } + }, + "range": [ + 274, + 283 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 10, + "column": 33 + }, + "end": { + "line": 10, + "column": 34 + } + }, + "range": [ + 284, + 285 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 10, + "column": 35 + }, + "end": { + "line": 10, + "column": 40 + } + }, + "range": [ + 286, + 291 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 10, + "column": 40 + }, + "end": { + "line": 10, + "column": 41 + } + }, + "range": [ + 291, + 292 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 10, + "column": 42 + }, + "end": { + "line": 10, + "column": 43 + } + }, + "range": [ + 293, + 294 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 11, + "column": 8 + }, + "end": { + "line": 11, + "column": 16 + } + }, + "range": [ + 303, + 311 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 11, + "column": 17 + }, + "end": { + "line": 11, + "column": 18 + } + }, + "range": [ + 312, + 313 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 11, + "column": 19 + }, + "end": { + "line": 11, + "column": 24 + } + }, + "range": [ + 314, + 319 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 11, + "column": 24 + }, + "end": { + "line": 11, + "column": 25 + } + }, + "range": [ + 319, + 320 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 12, + "column": 6 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "range": [ + 327, + 328 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 5 + } + }, + "range": [ + 333, + 334 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 13, + "column": 5 + }, + "end": { + "line": 13, + "column": 6 + } + }, + "range": [ + 334, + 335 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 13, + "column": 6 + }, + "end": { + "line": 13, + "column": 7 + } + }, + "range": [ + 335, + 336 + ] + }, + { + "type": "Identifier", + "value": "accessor", + "loc": { + "start": { + "line": 13, + "column": 7 + }, + "end": { + "line": 13, + "column": 15 + } + }, + "range": [ + 336, + 344 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 13, + "column": 16 + }, + "end": { + "line": 13, + "column": 17 + } + }, + "range": [ + 345, + 346 + ] + }, + { + "type": "Identifier", + "value": "undefined", + "loc": { + "start": { + "line": 13, + "column": 18 + }, + "end": { + "line": 13, + "column": 27 + } + }, + "range": [ + 347, + 356 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 13, + "column": 27 + }, + "end": { + "line": 13, + "column": 28 + } + }, + "range": [ + 356, + 357 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 14, + "column": 2 + }, + "end": { + "line": 14, + "column": 3 + } + }, + "range": [ + 360, + 361 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 1 + } + }, + "range": [ + 362, + 363 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 6 + } + }, + "range": [ + 365, + 371 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 17, + "column": 6 + }, + "end": { + "line": 17, + "column": 7 + } + }, + "range": [ + 371, + 372 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 17, + "column": 7 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 372, + 381 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 17, + "column": 16 + }, + "end": { + "line": 17, + "column": 17 + } + }, + "range": [ + 381, + 382 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 17, + "column": 17 + }, + "end": { + "line": 17, + "column": 26 + } + }, + "range": [ + 382, + 391 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 17, + "column": 26 + }, + "end": { + "line": 17, + "column": 27 + } + }, + "range": [ + 391, + 392 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 17, + "column": 28 + }, + "end": { + "line": 17, + "column": 29 + } + }, + "range": [ + 393, + 394 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 17, + "column": 29 + }, + "end": { + "line": 17, + "column": 30 + } + }, + "range": [ + 394, + 395 + ] + }, + { + "type": "String", + "value": "'from parameter'", + "loc": { + "start": { + "line": 17, + "column": 31 + }, + "end": { + "line": 17, + "column": 47 + } + }, + "range": [ + 396, + 412 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 17, + "column": 47 + }, + "end": { + "line": 17, + "column": 48 + } + }, + "range": [ + 412, + 413 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 17, + "column": 48 + }, + "end": { + "line": 17, + "column": 49 + } + }, + "range": [ + 413, + 414 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 6 + } + }, + "range": [ + 415, + 421 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 18, + "column": 6 + }, + "end": { + "line": 18, + "column": 7 + } + }, + "range": [ + 421, + 422 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 18, + "column": 7 + }, + "end": { + "line": 18, + "column": 16 + } + }, + "range": [ + 422, + 431 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 18, + "column": 16 + }, + "end": { + "line": 18, + "column": 17 + } + }, + "range": [ + 431, + 432 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 25 + } + }, + "range": [ + 432, + 440 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 18, + "column": 25 + }, + "end": { + "line": 18, + "column": 26 + } + }, + "range": [ + 440, + 441 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 18, + "column": 27 + }, + "end": { + "line": 18, + "column": 28 + } + }, + "range": [ + 442, + 443 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 18, + "column": 28 + }, + "end": { + "line": 18, + "column": 29 + } + }, + "range": [ + 443, + 444 + ] + }, + { + "type": "String", + "value": "'from body'", + "loc": { + "start": { + "line": 18, + "column": 30 + }, + "end": { + "line": 18, + "column": 41 + } + }, + "range": [ + 445, + 456 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 18, + "column": 41 + }, + "end": { + "line": 18, + "column": 42 + } + }, + "range": [ + 456, + 457 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 18, + "column": 42 + }, + "end": { + "line": 18, + "column": 43 + } + }, + "range": [ + 457, + 458 + ] + } + ] +}; \ 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..80dbe4aa --- /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,18 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/expressions/object/method-definition/static-init-await-reference-accessor.js + + +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..20cc466c --- /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": 187, + "lineNumber": 4, + "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..e6b6b165 --- /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": 4, + "column": 0 + }, + "end": { + "line": 18, + "column": 43 + } + }, + "range": [ + 183, + 449 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 14 + } + }, + "range": [ + 183, + 197 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 187, + 196 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 187, + 192 + ], + "name": "await" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 195, + 196 + ], + "value": 0, + "raw": "0" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "range": [ + 198, + 222 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "range": [ + 202, + 211 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "range": [ + 202, + 211 + ], + "name": "fromParam" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 213, + 221 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 213, + 221 + ], + "name": "fromBody" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 15, + "column": 1 + } + }, + "range": [ + 224, + 354 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 7 + } + }, + "range": [ + 230, + 231 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 15, + "column": 1 + } + }, + "range": [ + 232, + 354 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 14, + "column": 3 + } + }, + "range": [ + 236, + 352 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 13, + "column": 23 + } + }, + "range": [ + 249, + 348 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 13, + "column": 22 + } + }, + "range": [ + 249, + 347 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 13, + "column": 20 + } + }, + "range": [ + 249, + 345 + ], + "object": { + "type": "CallExpression", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 13, + "column": 15 + } + }, + "range": [ + 249, + 340 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 13, + "column": 13 + } + }, + "range": [ + 249, + 338 + ], + "object": { + "type": "ObjectExpression", + "loc": { + "start": { + "line": 9, + "column": 5 + }, + "end": { + "line": 13, + "column": 5 + } + }, + "range": [ + 250, + 330 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "range": [ + 258, + 324 + ], + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 7 + }, + "end": { + "line": 10, + "column": 13 + } + }, + "range": [ + 259, + 265 + ], + "name": "method" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 10, + "column": 13 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "range": [ + 265, + 324 + ], + "id": null, + "expression": false, + "generator": true, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 10, + "column": 14 + }, + "end": { + "line": 10, + "column": 35 + } + }, + "range": [ + 266, + 287 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 14 + }, + "end": { + "line": 10, + "column": 15 + } + }, + "range": [ + 266, + 267 + ], + "name": "x" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 35 + } + }, + "range": [ + 270, + 287 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 27 + } + }, + "range": [ + 270, + 279 + ], + "name": "fromParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 30 + }, + "end": { + "line": 10, + "column": 35 + } + }, + "range": [ + 282, + 287 + ], + "name": "await" + } + } + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 10, + "column": 37 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "range": [ + 289, + 324 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 11, + "column": 8 + }, + "end": { + "line": 11, + "column": 25 + } + }, + "range": [ + 299, + 316 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 11, + "column": 8 + }, + "end": { + "line": 11, + "column": 24 + } + }, + "range": [ + 299, + 315 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 8 + }, + "end": { + "line": 11, + "column": 16 + } + }, + "range": [ + 299, + 307 + ], + "name": "fromBody" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 19 + }, + "end": { + "line": 11, + "column": 24 + } + }, + "range": [ + 310, + 315 + ], + "name": "await" + } + } + } + ] + } + } + } + ] + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 7 + }, + "end": { + "line": 13, + "column": 13 + } + }, + "range": [ + 332, + 338 + ], + "name": "method" + }, + "computed": false, + "optional": false + }, + "arguments": [], + "optional": false + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 16 + }, + "end": { + "line": 13, + "column": 20 + } + }, + "range": [ + 341, + 345 + ], + "name": "next" + }, + "computed": false, + "optional": false + }, + "arguments": [], + "optional": false + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 49 + } + }, + "range": [ + 356, + 405 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 48 + } + }, + "range": [ + 356, + 404 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 356, + 372 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 6 + } + }, + "range": [ + 356, + 362 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 7 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 363, + 372 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 17 + }, + "end": { + "line": 17, + "column": 26 + } + }, + "range": [ + 373, + 382 + ], + "name": "fromParam" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 17, + "column": 28 + }, + "end": { + "line": 17, + "column": 29 + } + }, + "range": [ + 384, + 385 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 17, + "column": 31 + }, + "end": { + "line": 17, + "column": 47 + } + }, + "range": [ + 387, + 403 + ], + "value": "from parameter", + "raw": "'from parameter'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 43 + } + }, + "range": [ + 406, + 449 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 42 + } + }, + "range": [ + 406, + 448 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 16 + } + }, + "range": [ + 406, + 422 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 6 + } + }, + "range": [ + 406, + 412 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 7 + }, + "end": { + "line": 18, + "column": 16 + } + }, + "range": [ + 413, + 422 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 25 + } + }, + "range": [ + 423, + 431 + ], + "name": "fromBody" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 18, + "column": 27 + }, + "end": { + "line": 18, + "column": 28 + } + }, + "range": [ + 433, + 434 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 18, + "column": 30 + }, + "end": { + "line": 18, + "column": 41 + } + }, + "range": [ + 436, + 447 + ], + "value": "from body", + "raw": "'from body'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 183, + 186 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 187, + 192 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 4, + "column": 10 + }, + "end": { + "line": 4, + "column": 11 + } + }, + "range": [ + 193, + 194 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 195, + 196 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 14 + } + }, + "range": [ + 196, + 197 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 198, + 201 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "range": [ + 202, + 211 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 14 + } + }, + "range": [ + 211, + 212 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 213, + 221 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 23 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "range": [ + 221, + 222 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "range": [ + 224, + 229 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 7 + } + }, + "range": [ + 230, + 231 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 7, + "column": 9 + } + }, + "range": [ + 232, + 233 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 8 + } + }, + "range": [ + 236, + 242 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 8, + "column": 10 + } + }, + "range": [ + 243, + 244 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 5 + } + }, + "range": [ + 249, + 250 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 9, + "column": 5 + }, + "end": { + "line": 9, + "column": 6 + } + }, + "range": [ + 250, + 251 + ] + }, + { + "type": "Punctuator", + "value": "*", + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 7 + } + }, + "range": [ + 258, + 259 + ] + }, + { + "type": "Identifier", + "value": "method", + "loc": { + "start": { + "line": 10, + "column": 7 + }, + "end": { + "line": 10, + "column": 13 + } + }, + "range": [ + 259, + 265 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 10, + "column": 13 + }, + "end": { + "line": 10, + "column": 14 + } + }, + "range": [ + 265, + 266 + ] + }, + { + "type": "Identifier", + "value": "x", + "loc": { + "start": { + "line": 10, + "column": 14 + }, + "end": { + "line": 10, + "column": 15 + } + }, + "range": [ + 266, + 267 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 10, + "column": 16 + }, + "end": { + "line": 10, + "column": 17 + } + }, + "range": [ + 268, + 269 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 27 + } + }, + "range": [ + 270, + 279 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 10, + "column": 28 + }, + "end": { + "line": 10, + "column": 29 + } + }, + "range": [ + 280, + 281 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 10, + "column": 30 + }, + "end": { + "line": 10, + "column": 35 + } + }, + "range": [ + 282, + 287 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 10, + "column": 35 + }, + "end": { + "line": 10, + "column": 36 + } + }, + "range": [ + 287, + 288 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 10, + "column": 37 + }, + "end": { + "line": 10, + "column": 38 + } + }, + "range": [ + 289, + 290 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 11, + "column": 8 + }, + "end": { + "line": 11, + "column": 16 + } + }, + "range": [ + 299, + 307 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 11, + "column": 17 + }, + "end": { + "line": 11, + "column": 18 + } + }, + "range": [ + 308, + 309 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 11, + "column": 19 + }, + "end": { + "line": 11, + "column": 24 + } + }, + "range": [ + 310, + 315 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 11, + "column": 24 + }, + "end": { + "line": 11, + "column": 25 + } + }, + "range": [ + 315, + 316 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 12, + "column": 6 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "range": [ + 323, + 324 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 5 + } + }, + "range": [ + 329, + 330 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 13, + "column": 5 + }, + "end": { + "line": 13, + "column": 6 + } + }, + "range": [ + 330, + 331 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 13, + "column": 6 + }, + "end": { + "line": 13, + "column": 7 + } + }, + "range": [ + 331, + 332 + ] + }, + { + "type": "Identifier", + "value": "method", + "loc": { + "start": { + "line": 13, + "column": 7 + }, + "end": { + "line": 13, + "column": 13 + } + }, + "range": [ + 332, + 338 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 13, + "column": 13 + }, + "end": { + "line": 13, + "column": 14 + } + }, + "range": [ + 338, + 339 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 13, + "column": 14 + }, + "end": { + "line": 13, + "column": 15 + } + }, + "range": [ + 339, + 340 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 13, + "column": 15 + }, + "end": { + "line": 13, + "column": 16 + } + }, + "range": [ + 340, + 341 + ] + }, + { + "type": "Identifier", + "value": "next", + "loc": { + "start": { + "line": 13, + "column": 16 + }, + "end": { + "line": 13, + "column": 20 + } + }, + "range": [ + 341, + 345 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 13, + "column": 20 + }, + "end": { + "line": 13, + "column": 21 + } + }, + "range": [ + 345, + 346 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 13, + "column": 21 + }, + "end": { + "line": 13, + "column": 22 + } + }, + "range": [ + 346, + 347 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 13, + "column": 22 + }, + "end": { + "line": 13, + "column": 23 + } + }, + "range": [ + 347, + 348 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 14, + "column": 2 + }, + "end": { + "line": 14, + "column": 3 + } + }, + "range": [ + 351, + 352 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 1 + } + }, + "range": [ + 353, + 354 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 6 + } + }, + "range": [ + 356, + 362 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 17, + "column": 6 + }, + "end": { + "line": 17, + "column": 7 + } + }, + "range": [ + 362, + 363 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 17, + "column": 7 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 363, + 372 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 17, + "column": 16 + }, + "end": { + "line": 17, + "column": 17 + } + }, + "range": [ + 372, + 373 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 17, + "column": 17 + }, + "end": { + "line": 17, + "column": 26 + } + }, + "range": [ + 373, + 382 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 17, + "column": 26 + }, + "end": { + "line": 17, + "column": 27 + } + }, + "range": [ + 382, + 383 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 17, + "column": 28 + }, + "end": { + "line": 17, + "column": 29 + } + }, + "range": [ + 384, + 385 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 17, + "column": 29 + }, + "end": { + "line": 17, + "column": 30 + } + }, + "range": [ + 385, + 386 + ] + }, + { + "type": "String", + "value": "'from parameter'", + "loc": { + "start": { + "line": 17, + "column": 31 + }, + "end": { + "line": 17, + "column": 47 + } + }, + "range": [ + 387, + 403 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 17, + "column": 47 + }, + "end": { + "line": 17, + "column": 48 + } + }, + "range": [ + 403, + 404 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 17, + "column": 48 + }, + "end": { + "line": 17, + "column": 49 + } + }, + "range": [ + 404, + 405 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 6 + } + }, + "range": [ + 406, + 412 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 18, + "column": 6 + }, + "end": { + "line": 18, + "column": 7 + } + }, + "range": [ + 412, + 413 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 18, + "column": 7 + }, + "end": { + "line": 18, + "column": 16 + } + }, + "range": [ + 413, + 422 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 18, + "column": 16 + }, + "end": { + "line": 18, + "column": 17 + } + }, + "range": [ + 422, + 423 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 25 + } + }, + "range": [ + 423, + 431 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 18, + "column": 25 + }, + "end": { + "line": 18, + "column": 26 + } + }, + "range": [ + 431, + 432 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 18, + "column": 27 + }, + "end": { + "line": 18, + "column": 28 + } + }, + "range": [ + 433, + 434 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 18, + "column": 28 + }, + "end": { + "line": 18, + "column": 29 + } + }, + "range": [ + 434, + 435 + ] + }, + { + "type": "String", + "value": "'from body'", + "loc": { + "start": { + "line": 18, + "column": 30 + }, + "end": { + "line": 18, + "column": 41 + } + }, + "range": [ + 436, + 447 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 18, + "column": 41 + }, + "end": { + "line": 18, + "column": 42 + } + }, + "range": [ + 447, + 448 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 18, + "column": 42 + }, + "end": { + "line": 18, + "column": 43 + } + }, + "range": [ + 448, + 449 + ] + } + ] +}; \ 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..19ee4104 --- /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,18 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/expressions/object/method-definition/static-init-await-reference-generator.js + + +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..e3cbf186 --- /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": 184, + "lineNumber": 4, + "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..dc81da1b --- /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": 4, + "column": 0 + }, + "end": { + "line": 18, + "column": 43 + } + }, + "range": [ + 180, + 438 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 14 + } + }, + "range": [ + 180, + 194 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 184, + 193 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 184, + 189 + ], + "name": "await" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 192, + 193 + ], + "value": 0, + "raw": "0" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "range": [ + 195, + 219 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "range": [ + 199, + 208 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "range": [ + 199, + 208 + ], + "name": "fromParam" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 210, + 218 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 210, + 218 + ], + "name": "fromBody" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 15, + "column": 1 + } + }, + "range": [ + 221, + 343 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 7 + } + }, + "range": [ + 227, + 228 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 15, + "column": 1 + } + }, + "range": [ + 229, + 343 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 14, + "column": 3 + } + }, + "range": [ + 233, + 341 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 13, + "column": 16 + } + }, + "range": [ + 246, + 337 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 13, + "column": 15 + } + }, + "range": [ + 246, + 336 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 13, + "column": 13 + } + }, + "range": [ + 246, + 334 + ], + "object": { + "type": "ObjectExpression", + "loc": { + "start": { + "line": 9, + "column": 5 + }, + "end": { + "line": 13, + "column": 5 + } + }, + "range": [ + 247, + 326 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "range": [ + 255, + 320 + ], + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 12 + } + }, + "range": [ + 255, + 261 + ], + "name": "method" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 10, + "column": 12 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "range": [ + 261, + 320 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 10, + "column": 13 + }, + "end": { + "line": 10, + "column": 34 + } + }, + "range": [ + 262, + 283 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 13 + }, + "end": { + "line": 10, + "column": 14 + } + }, + "range": [ + 262, + 263 + ], + "name": "x" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 10, + "column": 17 + }, + "end": { + "line": 10, + "column": 34 + } + }, + "range": [ + 266, + 283 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 17 + }, + "end": { + "line": 10, + "column": 26 + } + }, + "range": [ + 266, + 275 + ], + "name": "fromParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 29 + }, + "end": { + "line": 10, + "column": 34 + } + }, + "range": [ + 278, + 283 + ], + "name": "await" + } + } + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "range": [ + 285, + 320 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 11, + "column": 8 + }, + "end": { + "line": 11, + "column": 25 + } + }, + "range": [ + 295, + 312 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 11, + "column": 8 + }, + "end": { + "line": 11, + "column": 24 + } + }, + "range": [ + 295, + 311 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 8 + }, + "end": { + "line": 11, + "column": 16 + } + }, + "range": [ + 295, + 303 + ], + "name": "fromBody" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 19 + }, + "end": { + "line": 11, + "column": 24 + } + }, + "range": [ + 306, + 311 + ], + "name": "await" + } + } + } + ] + } + } + } + ] + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 7 + }, + "end": { + "line": 13, + "column": 13 + } + }, + "range": [ + 328, + 334 + ], + "name": "method" + }, + "computed": false, + "optional": false + }, + "arguments": [], + "optional": false + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 49 + } + }, + "range": [ + 345, + 394 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 48 + } + }, + "range": [ + 345, + 393 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 345, + 361 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 6 + } + }, + "range": [ + 345, + 351 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 7 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 352, + 361 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 17 + }, + "end": { + "line": 17, + "column": 26 + } + }, + "range": [ + 362, + 371 + ], + "name": "fromParam" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 17, + "column": 28 + }, + "end": { + "line": 17, + "column": 29 + } + }, + "range": [ + 373, + 374 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 17, + "column": 31 + }, + "end": { + "line": 17, + "column": 47 + } + }, + "range": [ + 376, + 392 + ], + "value": "from parameter", + "raw": "'from parameter'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 43 + } + }, + "range": [ + 395, + 438 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 42 + } + }, + "range": [ + 395, + 437 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 16 + } + }, + "range": [ + 395, + 411 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 6 + } + }, + "range": [ + 395, + 401 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 7 + }, + "end": { + "line": 18, + "column": 16 + } + }, + "range": [ + 402, + 411 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 25 + } + }, + "range": [ + 412, + 420 + ], + "name": "fromBody" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 18, + "column": 27 + }, + "end": { + "line": 18, + "column": 28 + } + }, + "range": [ + 422, + 423 + ], + "value": 0, + "raw": "0" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 18, + "column": 30 + }, + "end": { + "line": 18, + "column": 41 + } + }, + "range": [ + 425, + 436 + ], + "value": "from body", + "raw": "'from body'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 180, + 183 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 184, + 189 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 4, + "column": 10 + }, + "end": { + "line": 4, + "column": 11 + } + }, + "range": [ + 190, + 191 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 192, + 193 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 14 + } + }, + "range": [ + 193, + 194 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 195, + 198 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "range": [ + 199, + 208 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 14 + } + }, + "range": [ + 208, + 209 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 210, + 218 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 23 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "range": [ + 218, + 219 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "range": [ + 221, + 226 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 7 + } + }, + "range": [ + 227, + 228 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 7, + "column": 9 + } + }, + "range": [ + 229, + 230 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 8 + } + }, + "range": [ + 233, + 239 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 8, + "column": 10 + } + }, + "range": [ + 240, + 241 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 5 + } + }, + "range": [ + 246, + 247 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 9, + "column": 5 + }, + "end": { + "line": 9, + "column": 6 + } + }, + "range": [ + 247, + 248 + ] + }, + { + "type": "Identifier", + "value": "method", + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 12 + } + }, + "range": [ + 255, + 261 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 10, + "column": 12 + }, + "end": { + "line": 10, + "column": 13 + } + }, + "range": [ + 261, + 262 + ] + }, + { + "type": "Identifier", + "value": "x", + "loc": { + "start": { + "line": 10, + "column": 13 + }, + "end": { + "line": 10, + "column": 14 + } + }, + "range": [ + 262, + 263 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 10, + "column": 15 + }, + "end": { + "line": 10, + "column": 16 + } + }, + "range": [ + 264, + 265 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 10, + "column": 17 + }, + "end": { + "line": 10, + "column": 26 + } + }, + "range": [ + 266, + 275 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 10, + "column": 27 + }, + "end": { + "line": 10, + "column": 28 + } + }, + "range": [ + 276, + 277 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 10, + "column": 29 + }, + "end": { + "line": 10, + "column": 34 + } + }, + "range": [ + 278, + 283 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 10, + "column": 34 + }, + "end": { + "line": 10, + "column": 35 + } + }, + "range": [ + 283, + 284 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 10, + "column": 36 + }, + "end": { + "line": 10, + "column": 37 + } + }, + "range": [ + 285, + 286 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 11, + "column": 8 + }, + "end": { + "line": 11, + "column": 16 + } + }, + "range": [ + 295, + 303 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 11, + "column": 17 + }, + "end": { + "line": 11, + "column": 18 + } + }, + "range": [ + 304, + 305 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 11, + "column": 19 + }, + "end": { + "line": 11, + "column": 24 + } + }, + "range": [ + 306, + 311 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 11, + "column": 24 + }, + "end": { + "line": 11, + "column": 25 + } + }, + "range": [ + 311, + 312 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 12, + "column": 6 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "range": [ + 319, + 320 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 5 + } + }, + "range": [ + 325, + 326 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 13, + "column": 5 + }, + "end": { + "line": 13, + "column": 6 + } + }, + "range": [ + 326, + 327 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 13, + "column": 6 + }, + "end": { + "line": 13, + "column": 7 + } + }, + "range": [ + 327, + 328 + ] + }, + { + "type": "Identifier", + "value": "method", + "loc": { + "start": { + "line": 13, + "column": 7 + }, + "end": { + "line": 13, + "column": 13 + } + }, + "range": [ + 328, + 334 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 13, + "column": 13 + }, + "end": { + "line": 13, + "column": 14 + } + }, + "range": [ + 334, + 335 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 13, + "column": 14 + }, + "end": { + "line": 13, + "column": 15 + } + }, + "range": [ + 335, + 336 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 13, + "column": 15 + }, + "end": { + "line": 13, + "column": 16 + } + }, + "range": [ + 336, + 337 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 14, + "column": 2 + }, + "end": { + "line": 14, + "column": 3 + } + }, + "range": [ + 340, + 341 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 1 + } + }, + "range": [ + 342, + 343 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 6 + } + }, + "range": [ + 345, + 351 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 17, + "column": 6 + }, + "end": { + "line": 17, + "column": 7 + } + }, + "range": [ + 351, + 352 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 17, + "column": 7 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 352, + 361 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 17, + "column": 16 + }, + "end": { + "line": 17, + "column": 17 + } + }, + "range": [ + 361, + 362 + ] + }, + { + "type": "Identifier", + "value": "fromParam", + "loc": { + "start": { + "line": 17, + "column": 17 + }, + "end": { + "line": 17, + "column": 26 + } + }, + "range": [ + 362, + 371 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 17, + "column": 26 + }, + "end": { + "line": 17, + "column": 27 + } + }, + "range": [ + 371, + 372 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 17, + "column": 28 + }, + "end": { + "line": 17, + "column": 29 + } + }, + "range": [ + 373, + 374 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 17, + "column": 29 + }, + "end": { + "line": 17, + "column": 30 + } + }, + "range": [ + 374, + 375 + ] + }, + { + "type": "String", + "value": "'from parameter'", + "loc": { + "start": { + "line": 17, + "column": 31 + }, + "end": { + "line": 17, + "column": 47 + } + }, + "range": [ + 376, + 392 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 17, + "column": 47 + }, + "end": { + "line": 17, + "column": 48 + } + }, + "range": [ + 392, + 393 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 17, + "column": 48 + }, + "end": { + "line": 17, + "column": 49 + } + }, + "range": [ + 393, + 394 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 6 + } + }, + "range": [ + 395, + 401 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 18, + "column": 6 + }, + "end": { + "line": 18, + "column": 7 + } + }, + "range": [ + 401, + 402 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 18, + "column": 7 + }, + "end": { + "line": 18, + "column": 16 + } + }, + "range": [ + 402, + 411 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 18, + "column": 16 + }, + "end": { + "line": 18, + "column": 17 + } + }, + "range": [ + 411, + 412 + ] + }, + { + "type": "Identifier", + "value": "fromBody", + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 25 + } + }, + "range": [ + 412, + 420 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 18, + "column": 25 + }, + "end": { + "line": 18, + "column": 26 + } + }, + "range": [ + 420, + 421 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 18, + "column": 27 + }, + "end": { + "line": 18, + "column": 28 + } + }, + "range": [ + 422, + 423 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 18, + "column": 28 + }, + "end": { + "line": 18, + "column": 29 + } + }, + "range": [ + 423, + 424 + ] + }, + { + "type": "String", + "value": "'from body'", + "loc": { + "start": { + "line": 18, + "column": 30 + }, + "end": { + "line": 18, + "column": 41 + } + }, + "range": [ + 425, + 436 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 18, + "column": 41 + }, + "end": { + "line": 18, + "column": 42 + } + }, + "range": [ + 436, + 437 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 18, + "column": 42 + }, + "end": { + "line": 18, + "column": 43 + } + }, + "range": [ + 437, + 438 + ] + } + ] +}; \ 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..c49883c6 --- /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,18 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/expressions/object/method-definition/static-init-await-reference-normal.js + + +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..09a61cf5 --- /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": 179, + "lineNumber": 4, + "column": 5, + "message": "Cannot use await in class static initialization block" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/identifier-resolution-static-init-invalid-await.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/identifier-resolution-static-init-invalid-await.src.js new file mode 100644 index 00000000..d35f661d --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/identifier-resolution-static-init-invalid-await.src.js @@ -0,0 +1,6 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/identifier-resolution/static-init-invalid-await.js +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..0a1e160d --- /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": 202, + "lineNumber": 5, + "column": 7, + "message": "Unsyntactic break" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-break-static-init-without-label.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-break-static-init-without-label.src.js new file mode 100644 index 00000000..11e2eb3a --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-break-static-init-without-label.src.js @@ -0,0 +1,8 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/break/static-init-without-label.js +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..ea0dc9ce --- /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": 4, + "column": 0 + }, + "end": { + "line": 28, + "column": 61 + } + }, + "range": [ + 144, + 690 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 32 + } + }, + "range": [ + 144, + 176 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 31 + } + }, + "range": [ + 148, + 175 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 148, + 154 + ], + "name": "thrown" + }, + "init": { + "type": "NewExpression", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 31 + } + }, + "range": [ + 157, + 175 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 17 + }, + "end": { + "line": 4, + "column": 29 + } + }, + "range": [ + 161, + 173 + ], + "name": "Test262Error" + }, + "arguments": [] + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 11 + } + }, + "range": [ + 177, + 188 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 181, + 187 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 181, + 187 + ], + "name": "caught" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 22 + } + }, + "range": [ + 189, + 211 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 21 + } + }, + "range": [ + 193, + 210 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 13 + } + }, + "range": [ + 193, + 202 + ], + "name": "sameBlock" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 6, + "column": 16 + }, + "end": { + "line": 6, + "column": 21 + } + }, + "range": [ + 205, + 210 + ], + "value": false, + "raw": "false" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 28 + } + }, + "range": [ + 212, + 240 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 27 + } + }, + "range": [ + 216, + 239 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 19 + } + }, + "range": [ + 216, + 231 + ], + "name": "subsequentField" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 7, + "column": 22 + }, + "end": { + "line": 7, + "column": 27 + } + }, + "range": [ + 234, + 239 + ], + "value": false, + "raw": "false" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 28 + } + }, + "range": [ + 241, + 269 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 27 + } + }, + "range": [ + 245, + 268 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 19 + } + }, + "range": [ + 245, + 260 + ], + "name": "subsequentBlock" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 8, + "column": 22 + }, + "end": { + "line": 8, + "column": 27 + } + }, + "range": [ + 263, + 268 + ], + "value": false, + "raw": "false" + } + } + ], + "kind": "var" + }, + { + "type": "TryStatement", + "loc": { + "start": { + "line": 10, + "column": 0 + }, + "end": { + "line": 23, + "column": 1 + } + }, + "range": [ + 271, + 481 + ], + "block": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 21, + "column": 1 + } + }, + "range": [ + 275, + 445 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 20, + "column": 3 + } + }, + "range": [ + 279, + 443 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 8 + }, + "end": { + "line": 11, + "column": 9 + } + }, + "range": [ + 285, + 286 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 20, + "column": 3 + } + }, + "range": [ + 287, + 443 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 12, + "column": 4 + }, + "end": { + "line": 15, + "column": 5 + } + }, + "range": [ + 293, + 351 + ], + "body": [ + { + "type": "ThrowStatement", + "loc": { + "start": { + "line": 13, + "column": 6 + }, + "end": { + "line": 13, + "column": 19 + } + }, + "range": [ + 308, + 321 + ], + "argument": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 18 + } + }, + "range": [ + 314, + 320 + ], + "name": "thrown" + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 23 + } + }, + "range": [ + 328, + 345 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 22 + } + }, + "range": [ + 328, + 344 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 15 + } + }, + "range": [ + 328, + 337 + ], + "name": "sameBlock" + }, + "right": { + "type": "Literal", + "loc": { + "start": { + "line": 14, + "column": 18 + }, + "end": { + "line": 14, + "column": 22 + } + }, + "range": [ + 340, + 344 + ], + "value": true, + "raw": "true" + } + } + } + ] + }, + { + "type": "PropertyDefinition", + "loc": { + "start": { + "line": 16, + "column": 4 + }, + "end": { + "line": 16, + "column": 38 + } + }, + "range": [ + 356, + 390 + ], + "static": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 11 + }, + "end": { + "line": 16, + "column": 12 + } + }, + "range": [ + 363, + 364 + ], + "name": "x" + }, + "value": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 16, + "column": 15 + }, + "end": { + "line": 16, + "column": 37 + } + }, + "range": [ + 367, + 389 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 15 + }, + "end": { + "line": 16, + "column": 30 + } + }, + "range": [ + 367, + 382 + ], + "name": "subsequentField" + }, + "right": { + "type": "Literal", + "loc": { + "start": { + "line": 16, + "column": 33 + }, + "end": { + "line": 16, + "column": 37 + } + }, + "range": [ + 385, + 389 + ], + "value": true, + "raw": "true" + } + } + }, + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 17, + "column": 4 + }, + "end": { + "line": 19, + "column": 5 + } + }, + "range": [ + 395, + 439 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 18, + "column": 6 + }, + "end": { + "line": 18, + "column": 29 + } + }, + "range": [ + 410, + 433 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 18, + "column": 6 + }, + "end": { + "line": 18, + "column": 28 + } + }, + "range": [ + 410, + 432 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 6 + }, + "end": { + "line": 18, + "column": 21 + } + }, + "range": [ + 410, + 425 + ], + "name": "subsequentBlock" + }, + "right": { + "type": "Literal", + "loc": { + "start": { + "line": 18, + "column": 24 + }, + "end": { + "line": 18, + "column": 28 + } + }, + "range": [ + 428, + 432 + ], + "value": true, + "raw": "true" + } + } + } + ] + } + ] + } + } + ] + }, + "handler": { + "type": "CatchClause", + "loc": { + "start": { + "line": 21, + "column": 2 + }, + "end": { + "line": 23, + "column": 1 + } + }, + "range": [ + 446, + 481 + ], + "param": { + "type": "Identifier", + "loc": { + "start": { + "line": 21, + "column": 9 + }, + "end": { + "line": 21, + "column": 14 + } + }, + "range": [ + 453, + 458 + ], + "name": "error" + }, + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 21, + "column": 16 + }, + "end": { + "line": 23, + "column": 1 + } + }, + "range": [ + 460, + 481 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 22, + "column": 2 + }, + "end": { + "line": 22, + "column": 17 + } + }, + "range": [ + 464, + 479 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 22, + "column": 2 + }, + "end": { + "line": 22, + "column": 16 + } + }, + "range": [ + 464, + 478 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 22, + "column": 2 + }, + "end": { + "line": 22, + "column": 8 + } + }, + "range": [ + 464, + 470 + ], + "name": "caught" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 22, + "column": 11 + }, + "end": { + "line": 22, + "column": 16 + } + }, + "range": [ + 473, + 478 + ], + "name": "error" + } + } + } + ] + } + }, + "finalizer": null + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 25, + "column": 0 + }, + "end": { + "line": 25, + "column": 33 + } + }, + "range": [ + 483, + 516 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 25, + "column": 0 + }, + "end": { + "line": 25, + "column": 32 + } + }, + "range": [ + 483, + 515 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 25, + "column": 0 + }, + "end": { + "line": 25, + "column": 16 + } + }, + "range": [ + 483, + 499 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 25, + "column": 0 + }, + "end": { + "line": 25, + "column": 6 + } + }, + "range": [ + 483, + 489 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 25, + "column": 7 + }, + "end": { + "line": 25, + "column": 16 + } + }, + "range": [ + 490, + 499 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 25, + "column": 17 + }, + "end": { + "line": 25, + "column": 23 + } + }, + "range": [ + 500, + 506 + ], + "name": "caught" + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 25, + "column": 25 + }, + "end": { + "line": 25, + "column": 31 + } + }, + "range": [ + 508, + 514 + ], + "name": "thrown" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 26, + "column": 0 + }, + "end": { + "line": 26, + "column": 49 + } + }, + "range": [ + 517, + 566 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 26, + "column": 0 + }, + "end": { + "line": 26, + "column": 48 + } + }, + "range": [ + 517, + 565 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 26, + "column": 0 + }, + "end": { + "line": 26, + "column": 16 + } + }, + "range": [ + 517, + 533 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 26, + "column": 0 + }, + "end": { + "line": 26, + "column": 6 + } + }, + "range": [ + 517, + 523 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 26, + "column": 7 + }, + "end": { + "line": 26, + "column": 16 + } + }, + "range": [ + 524, + 533 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 26, + "column": 17 + }, + "end": { + "line": 26, + "column": 26 + } + }, + "range": [ + 534, + 543 + ], + "name": "sameBlock" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 26, + "column": 28 + }, + "end": { + "line": 26, + "column": 33 + } + }, + "range": [ + 545, + 550 + ], + "value": false, + "raw": "false" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 26, + "column": 35 + }, + "end": { + "line": 26, + "column": 47 + } + }, + "range": [ + 552, + 564 + ], + "value": "same block", + "raw": "'same block'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 27, + "column": 0 + }, + "end": { + "line": 27, + "column": 61 + } + }, + "range": [ + 567, + 628 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 27, + "column": 0 + }, + "end": { + "line": 27, + "column": 60 + } + }, + "range": [ + 567, + 627 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 27, + "column": 0 + }, + "end": { + "line": 27, + "column": 16 + } + }, + "range": [ + 567, + 583 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 27, + "column": 0 + }, + "end": { + "line": 27, + "column": 6 + } + }, + "range": [ + 567, + 573 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 27, + "column": 7 + }, + "end": { + "line": 27, + "column": 16 + } + }, + "range": [ + 574, + 583 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 27, + "column": 17 + }, + "end": { + "line": 27, + "column": 32 + } + }, + "range": [ + 584, + 599 + ], + "name": "subsequentField" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 27, + "column": 34 + }, + "end": { + "line": 27, + "column": 39 + } + }, + "range": [ + 601, + 606 + ], + "value": false, + "raw": "false" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 27, + "column": 41 + }, + "end": { + "line": 27, + "column": 59 + } + }, + "range": [ + 608, + 626 + ], + "value": "subsequent field", + "raw": "'subsequent field'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 28, + "column": 0 + }, + "end": { + "line": 28, + "column": 61 + } + }, + "range": [ + 629, + 690 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 28, + "column": 0 + }, + "end": { + "line": 28, + "column": 60 + } + }, + "range": [ + 629, + 689 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 28, + "column": 0 + }, + "end": { + "line": 28, + "column": 16 + } + }, + "range": [ + 629, + 645 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 28, + "column": 0 + }, + "end": { + "line": 28, + "column": 6 + } + }, + "range": [ + 629, + 635 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 28, + "column": 7 + }, + "end": { + "line": 28, + "column": 16 + } + }, + "range": [ + 636, + 645 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 28, + "column": 17 + }, + "end": { + "line": 28, + "column": 32 + } + }, + "range": [ + 646, + 661 + ], + "name": "subsequentBlock" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 28, + "column": 34 + }, + "end": { + "line": 28, + "column": 39 + } + }, + "range": [ + 663, + 668 + ], + "value": false, + "raw": "false" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 28, + "column": 41 + }, + "end": { + "line": 28, + "column": 59 + } + }, + "range": [ + 670, + 688 + ], + "value": "subsequent block", + "raw": "'subsequent block'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 144, + 147 + ] + }, + { + "type": "Identifier", + "value": "thrown", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 148, + 154 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 4, + "column": 11 + }, + "end": { + "line": 4, + "column": 12 + } + }, + "range": [ + 155, + 156 + ] + }, + { + "type": "Keyword", + "value": "new", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 16 + } + }, + "range": [ + 157, + 160 + ] + }, + { + "type": "Identifier", + "value": "Test262Error", + "loc": { + "start": { + "line": 4, + "column": 17 + }, + "end": { + "line": 4, + "column": 29 + } + }, + "range": [ + 161, + 173 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 29 + }, + "end": { + "line": 4, + "column": 30 + } + }, + "range": [ + 173, + 174 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 30 + }, + "end": { + "line": 4, + "column": 31 + } + }, + "range": [ + 174, + 175 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 31 + }, + "end": { + "line": 4, + "column": 32 + } + }, + "range": [ + 175, + 176 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 177, + 180 + ] + }, + { + "type": "Identifier", + "value": "caught", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 181, + 187 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 10 + }, + "end": { + "line": 5, + "column": 11 + } + }, + "range": [ + 187, + 188 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 189, + 192 + ] + }, + { + "type": "Identifier", + "value": "sameBlock", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 13 + } + }, + "range": [ + 193, + 202 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 6, + "column": 14 + }, + "end": { + "line": 6, + "column": 15 + } + }, + "range": [ + 203, + 204 + ] + }, + { + "type": "Boolean", + "value": "false", + "loc": { + "start": { + "line": 6, + "column": 16 + }, + "end": { + "line": 6, + "column": 21 + } + }, + "range": [ + 205, + 210 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 21 + }, + "end": { + "line": 6, + "column": 22 + } + }, + "range": [ + 210, + 211 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 212, + 215 + ] + }, + { + "type": "Identifier", + "value": "subsequentField", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 19 + } + }, + "range": [ + 216, + 231 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 7, + "column": 20 + }, + "end": { + "line": 7, + "column": 21 + } + }, + "range": [ + 232, + 233 + ] + }, + { + "type": "Boolean", + "value": "false", + "loc": { + "start": { + "line": 7, + "column": 22 + }, + "end": { + "line": 7, + "column": 27 + } + }, + "range": [ + 234, + 239 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 7, + "column": 27 + }, + "end": { + "line": 7, + "column": 28 + } + }, + "range": [ + 239, + 240 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 3 + } + }, + "range": [ + 241, + 244 + ] + }, + { + "type": "Identifier", + "value": "subsequentBlock", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 19 + } + }, + "range": [ + 245, + 260 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 8, + "column": 20 + }, + "end": { + "line": 8, + "column": 21 + } + }, + "range": [ + 261, + 262 + ] + }, + { + "type": "Boolean", + "value": "false", + "loc": { + "start": { + "line": 8, + "column": 22 + }, + "end": { + "line": 8, + "column": 27 + } + }, + "range": [ + 263, + 268 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 8, + "column": 27 + }, + "end": { + "line": 8, + "column": 28 + } + }, + "range": [ + 268, + 269 + ] + }, + { + "type": "Keyword", + "value": "try", + "loc": { + "start": { + "line": 10, + "column": 0 + }, + "end": { + "line": 10, + "column": 3 + } + }, + "range": [ + 271, + 274 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 5 + } + }, + "range": [ + 275, + 276 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 7 + } + }, + "range": [ + 279, + 284 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 11, + "column": 8 + }, + "end": { + "line": 11, + "column": 9 + } + }, + "range": [ + 285, + 286 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 11, + "column": 11 + } + }, + "range": [ + 287, + 288 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 12, + "column": 4 + }, + "end": { + "line": 12, + "column": 10 + } + }, + "range": [ + 293, + 299 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 12, + "column": 11 + }, + "end": { + "line": 12, + "column": 12 + } + }, + "range": [ + 300, + 301 + ] + }, + { + "type": "Keyword", + "value": "throw", + "loc": { + "start": { + "line": 13, + "column": 6 + }, + "end": { + "line": 13, + "column": 11 + } + }, + "range": [ + 308, + 313 + ] + }, + { + "type": "Identifier", + "value": "thrown", + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 18 + } + }, + "range": [ + 314, + 320 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 13, + "column": 18 + }, + "end": { + "line": 13, + "column": 19 + } + }, + "range": [ + 320, + 321 + ] + }, + { + "type": "Identifier", + "value": "sameBlock", + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 15 + } + }, + "range": [ + 328, + 337 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 14, + "column": 16 + }, + "end": { + "line": 14, + "column": 17 + } + }, + "range": [ + 338, + 339 + ] + }, + { + "type": "Boolean", + "value": "true", + "loc": { + "start": { + "line": 14, + "column": 18 + }, + "end": { + "line": 14, + "column": 22 + } + }, + "range": [ + 340, + 344 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 14, + "column": 22 + }, + "end": { + "line": 14, + "column": 23 + } + }, + "range": [ + 344, + 345 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 15, + "column": 4 + }, + "end": { + "line": 15, + "column": 5 + } + }, + "range": [ + 350, + 351 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 16, + "column": 4 + }, + "end": { + "line": 16, + "column": 10 + } + }, + "range": [ + 356, + 362 + ] + }, + { + "type": "Identifier", + "value": "x", + "loc": { + "start": { + "line": 16, + "column": 11 + }, + "end": { + "line": 16, + "column": 12 + } + }, + "range": [ + 363, + 364 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 16, + "column": 13 + }, + "end": { + "line": 16, + "column": 14 + } + }, + "range": [ + 365, + 366 + ] + }, + { + "type": "Identifier", + "value": "subsequentField", + "loc": { + "start": { + "line": 16, + "column": 15 + }, + "end": { + "line": 16, + "column": 30 + } + }, + "range": [ + 367, + 382 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 16, + "column": 31 + }, + "end": { + "line": 16, + "column": 32 + } + }, + "range": [ + 383, + 384 + ] + }, + { + "type": "Boolean", + "value": "true", + "loc": { + "start": { + "line": 16, + "column": 33 + }, + "end": { + "line": 16, + "column": 37 + } + }, + "range": [ + 385, + 389 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 16, + "column": 37 + }, + "end": { + "line": 16, + "column": 38 + } + }, + "range": [ + 389, + 390 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 17, + "column": 4 + }, + "end": { + "line": 17, + "column": 10 + } + }, + "range": [ + 395, + 401 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 17, + "column": 11 + }, + "end": { + "line": 17, + "column": 12 + } + }, + "range": [ + 402, + 403 + ] + }, + { + "type": "Identifier", + "value": "subsequentBlock", + "loc": { + "start": { + "line": 18, + "column": 6 + }, + "end": { + "line": 18, + "column": 21 + } + }, + "range": [ + 410, + 425 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 23 + } + }, + "range": [ + 426, + 427 + ] + }, + { + "type": "Boolean", + "value": "true", + "loc": { + "start": { + "line": 18, + "column": 24 + }, + "end": { + "line": 18, + "column": 28 + } + }, + "range": [ + 428, + 432 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 18, + "column": 28 + }, + "end": { + "line": 18, + "column": 29 + } + }, + "range": [ + 432, + 433 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 19, + "column": 4 + }, + "end": { + "line": 19, + "column": 5 + } + }, + "range": [ + 438, + 439 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 20, + "column": 2 + }, + "end": { + "line": 20, + "column": 3 + } + }, + "range": [ + 442, + 443 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 21, + "column": 0 + }, + "end": { + "line": 21, + "column": 1 + } + }, + "range": [ + 444, + 445 + ] + }, + { + "type": "Keyword", + "value": "catch", + "loc": { + "start": { + "line": 21, + "column": 2 + }, + "end": { + "line": 21, + "column": 7 + } + }, + "range": [ + 446, + 451 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 21, + "column": 8 + }, + "end": { + "line": 21, + "column": 9 + } + }, + "range": [ + 452, + 453 + ] + }, + { + "type": "Identifier", + "value": "error", + "loc": { + "start": { + "line": 21, + "column": 9 + }, + "end": { + "line": 21, + "column": 14 + } + }, + "range": [ + 453, + 458 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 21, + "column": 14 + }, + "end": { + "line": 21, + "column": 15 + } + }, + "range": [ + 458, + 459 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 21, + "column": 16 + }, + "end": { + "line": 21, + "column": 17 + } + }, + "range": [ + 460, + 461 + ] + }, + { + "type": "Identifier", + "value": "caught", + "loc": { + "start": { + "line": 22, + "column": 2 + }, + "end": { + "line": 22, + "column": 8 + } + }, + "range": [ + 464, + 470 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 22, + "column": 9 + }, + "end": { + "line": 22, + "column": 10 + } + }, + "range": [ + 471, + 472 + ] + }, + { + "type": "Identifier", + "value": "error", + "loc": { + "start": { + "line": 22, + "column": 11 + }, + "end": { + "line": 22, + "column": 16 + } + }, + "range": [ + 473, + 478 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 22, + "column": 16 + }, + "end": { + "line": 22, + "column": 17 + } + }, + "range": [ + 478, + 479 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 23, + "column": 0 + }, + "end": { + "line": 23, + "column": 1 + } + }, + "range": [ + 480, + 481 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 25, + "column": 0 + }, + "end": { + "line": 25, + "column": 6 + } + }, + "range": [ + 483, + 489 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 25, + "column": 6 + }, + "end": { + "line": 25, + "column": 7 + } + }, + "range": [ + 489, + 490 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 25, + "column": 7 + }, + "end": { + "line": 25, + "column": 16 + } + }, + "range": [ + 490, + 499 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 25, + "column": 16 + }, + "end": { + "line": 25, + "column": 17 + } + }, + "range": [ + 499, + 500 + ] + }, + { + "type": "Identifier", + "value": "caught", + "loc": { + "start": { + "line": 25, + "column": 17 + }, + "end": { + "line": 25, + "column": 23 + } + }, + "range": [ + 500, + 506 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 25, + "column": 23 + }, + "end": { + "line": 25, + "column": 24 + } + }, + "range": [ + 506, + 507 + ] + }, + { + "type": "Identifier", + "value": "thrown", + "loc": { + "start": { + "line": 25, + "column": 25 + }, + "end": { + "line": 25, + "column": 31 + } + }, + "range": [ + 508, + 514 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 25, + "column": 31 + }, + "end": { + "line": 25, + "column": 32 + } + }, + "range": [ + 514, + 515 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 25, + "column": 32 + }, + "end": { + "line": 25, + "column": 33 + } + }, + "range": [ + 515, + 516 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 26, + "column": 0 + }, + "end": { + "line": 26, + "column": 6 + } + }, + "range": [ + 517, + 523 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 26, + "column": 6 + }, + "end": { + "line": 26, + "column": 7 + } + }, + "range": [ + 523, + 524 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 26, + "column": 7 + }, + "end": { + "line": 26, + "column": 16 + } + }, + "range": [ + 524, + 533 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 26, + "column": 16 + }, + "end": { + "line": 26, + "column": 17 + } + }, + "range": [ + 533, + 534 + ] + }, + { + "type": "Identifier", + "value": "sameBlock", + "loc": { + "start": { + "line": 26, + "column": 17 + }, + "end": { + "line": 26, + "column": 26 + } + }, + "range": [ + 534, + 543 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 26, + "column": 26 + }, + "end": { + "line": 26, + "column": 27 + } + }, + "range": [ + 543, + 544 + ] + }, + { + "type": "Boolean", + "value": "false", + "loc": { + "start": { + "line": 26, + "column": 28 + }, + "end": { + "line": 26, + "column": 33 + } + }, + "range": [ + 545, + 550 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 26, + "column": 33 + }, + "end": { + "line": 26, + "column": 34 + } + }, + "range": [ + 550, + 551 + ] + }, + { + "type": "String", + "value": "'same block'", + "loc": { + "start": { + "line": 26, + "column": 35 + }, + "end": { + "line": 26, + "column": 47 + } + }, + "range": [ + 552, + 564 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 26, + "column": 47 + }, + "end": { + "line": 26, + "column": 48 + } + }, + "range": [ + 564, + 565 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 26, + "column": 48 + }, + "end": { + "line": 26, + "column": 49 + } + }, + "range": [ + 565, + 566 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 27, + "column": 0 + }, + "end": { + "line": 27, + "column": 6 + } + }, + "range": [ + 567, + 573 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 27, + "column": 6 + }, + "end": { + "line": 27, + "column": 7 + } + }, + "range": [ + 573, + 574 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 27, + "column": 7 + }, + "end": { + "line": 27, + "column": 16 + } + }, + "range": [ + 574, + 583 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 27, + "column": 16 + }, + "end": { + "line": 27, + "column": 17 + } + }, + "range": [ + 583, + 584 + ] + }, + { + "type": "Identifier", + "value": "subsequentField", + "loc": { + "start": { + "line": 27, + "column": 17 + }, + "end": { + "line": 27, + "column": 32 + } + }, + "range": [ + 584, + 599 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 27, + "column": 32 + }, + "end": { + "line": 27, + "column": 33 + } + }, + "range": [ + 599, + 600 + ] + }, + { + "type": "Boolean", + "value": "false", + "loc": { + "start": { + "line": 27, + "column": 34 + }, + "end": { + "line": 27, + "column": 39 + } + }, + "range": [ + 601, + 606 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 27, + "column": 39 + }, + "end": { + "line": 27, + "column": 40 + } + }, + "range": [ + 606, + 607 + ] + }, + { + "type": "String", + "value": "'subsequent field'", + "loc": { + "start": { + "line": 27, + "column": 41 + }, + "end": { + "line": 27, + "column": 59 + } + }, + "range": [ + 608, + 626 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 27, + "column": 59 + }, + "end": { + "line": 27, + "column": 60 + } + }, + "range": [ + 626, + 627 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 27, + "column": 60 + }, + "end": { + "line": 27, + "column": 61 + } + }, + "range": [ + 627, + 628 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 28, + "column": 0 + }, + "end": { + "line": 28, + "column": 6 + } + }, + "range": [ + 629, + 635 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 28, + "column": 6 + }, + "end": { + "line": 28, + "column": 7 + } + }, + "range": [ + 635, + 636 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 28, + "column": 7 + }, + "end": { + "line": 28, + "column": 16 + } + }, + "range": [ + 636, + 645 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 28, + "column": 16 + }, + "end": { + "line": 28, + "column": 17 + } + }, + "range": [ + 645, + 646 + ] + }, + { + "type": "Identifier", + "value": "subsequentBlock", + "loc": { + "start": { + "line": 28, + "column": 17 + }, + "end": { + "line": 28, + "column": 32 + } + }, + "range": [ + 646, + 661 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 28, + "column": 32 + }, + "end": { + "line": 28, + "column": 33 + } + }, + "range": [ + 661, + 662 + ] + }, + { + "type": "Boolean", + "value": "false", + "loc": { + "start": { + "line": 28, + "column": 34 + }, + "end": { + "line": 28, + "column": 39 + } + }, + "range": [ + 663, + 668 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 28, + "column": 39 + }, + "end": { + "line": 28, + "column": 40 + } + }, + "range": [ + 668, + 669 + ] + }, + { + "type": "String", + "value": "'subsequent block'", + "loc": { + "start": { + "line": 28, + "column": 41 + }, + "end": { + "line": 28, + "column": 59 + } + }, + "range": [ + 670, + 688 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 28, + "column": 59 + }, + "end": { + "line": 28, + "column": 60 + } + }, + "range": [ + 688, + 689 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 28, + "column": 60 + }, + "end": { + "line": 28, + "column": 61 + } + }, + "range": [ + 689, + 690 + ] + } + ] +}; \ 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..17ba4eda --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-abrupt.src.js @@ -0,0 +1,28 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/class/static-init-abrupt.js + + +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..c3646b90 --- /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": 4, + "column": 0 + }, + "end": { + "line": 29, + "column": 68 + } + }, + "range": [ + 157, + 930 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 16 + } + }, + "range": [ + 157, + 173 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 6 + } + }, + "range": [ + 161, + 163 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 6 + } + }, + "range": [ + 161, + 163 + ], + "name": "fn" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 15 + } + }, + "range": [ + 165, + 172 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 15 + } + }, + "range": [ + 165, + 172 + ], + "name": "fnParam" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 18 + } + }, + "range": [ + 174, + 192 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "range": [ + 178, + 181 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "range": [ + 178, + 181 + ], + "name": "gen" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 17 + } + }, + "range": [ + 183, + 191 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 17 + } + }, + "range": [ + 183, + 191 + ], + "name": "genParam" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 26 + } + }, + "range": [ + 193, + 219 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 11 + } + }, + "range": [ + 197, + 204 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 11 + } + }, + "range": [ + 197, + 204 + ], + "name": "asyncFn" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 25 + } + }, + "range": [ + 206, + 218 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 25 + } + }, + "range": [ + 206, + 218 + ], + "name": "asyncFnParam" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 22, + "column": 1 + } + }, + "range": [ + 221, + 567 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 6 + }, + "end": { + "line": 8, + "column": 7 + } + }, + "range": [ + 227, + 228 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 22, + "column": 1 + } + }, + "range": [ + 229, + 567 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 21, + "column": 3 + } + }, + "range": [ + 233, + 565 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 12, + "column": 19 + } + }, + "range": [ + 246, + 332 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 12, + "column": 18 + } + }, + "range": [ + 246, + 331 + ], + "callee": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 10, + "column": 5 + }, + "end": { + "line": 12, + "column": 5 + } + }, + "range": [ + 247, + 318 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [ + { + "type": "ObjectPattern", + "loc": { + "start": { + "line": 10, + "column": 14 + }, + "end": { + "line": 10, + "column": 45 + } + }, + "range": [ + 256, + 287 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 10, + "column": 15 + }, + "end": { + "line": 10, + "column": 44 + } + }, + "range": [ + 257, + 286 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 15 + }, + "end": { + "line": 10, + "column": 22 + } + }, + "range": [ + 257, + 264 + ], + "name": "test262" + }, + "kind": "init", + "value": { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 10, + "column": 15 + }, + "end": { + "line": 10, + "column": 44 + } + }, + "range": [ + 257, + 286 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 15 + }, + "end": { + "line": 10, + "column": 22 + } + }, + "range": [ + 257, + 264 + ], + "name": "test262" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 10, + "column": 25 + }, + "end": { + "line": 10, + "column": 44 + } + }, + "range": [ + 267, + 286 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 25 + }, + "end": { + "line": 10, + "column": 32 + } + }, + "range": [ + 267, + 274 + ], + "name": "fnParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 35 + }, + "end": { + "line": 10, + "column": 44 + } + }, + "range": [ + 277, + 286 + ], + "name": "arguments" + } + } + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 10, + "column": 47 + }, + "end": { + "line": 12, + "column": 5 + } + }, + "range": [ + 289, + 318 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 21 + } + }, + "range": [ + 297, + 312 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 20 + } + }, + "range": [ + 297, + 311 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 8 + } + }, + "range": [ + 297, + 299 + ], + "name": "fn" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 11 + }, + "end": { + "line": 11, + "column": 20 + } + }, + "range": [ + 302, + 311 + ], + "name": "arguments" + } + } + } + ] + } + }, + "arguments": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 17 + } + }, + "range": [ + 320, + 330 + ], + "value": "function", + "raw": "'function'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 16, + "column": 36 + } + }, + "range": [ + 338, + 446 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 16, + "column": 35 + } + }, + "range": [ + 338, + 445 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 16, + "column": 33 + } + }, + "range": [ + 338, + 443 + ], + "object": { + "type": "CallExpression", + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 16, + "column": 28 + } + }, + "range": [ + 338, + 438 + ], + "callee": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 14, + "column": 5 + }, + "end": { + "line": 16, + "column": 5 + } + }, + "range": [ + 339, + 415 + ], + "id": null, + "expression": false, + "generator": true, + "async": false, + "params": [ + { + "type": "ObjectPattern", + "loc": { + "start": { + "line": 14, + "column": 17 + }, + "end": { + "line": 14, + "column": 49 + } + }, + "range": [ + 351, + 383 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 14, + "column": 18 + }, + "end": { + "line": 14, + "column": 48 + } + }, + "range": [ + 352, + 382 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 18 + }, + "end": { + "line": 14, + "column": 25 + } + }, + "range": [ + 352, + 359 + ], + "name": "test262" + }, + "kind": "init", + "value": { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 14, + "column": 18 + }, + "end": { + "line": 14, + "column": 48 + } + }, + "range": [ + 352, + 382 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 18 + }, + "end": { + "line": 14, + "column": 25 + } + }, + "range": [ + 352, + 359 + ], + "name": "test262" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 14, + "column": 28 + }, + "end": { + "line": 14, + "column": 48 + } + }, + "range": [ + 362, + 382 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 28 + }, + "end": { + "line": 14, + "column": 36 + } + }, + "range": [ + 362, + 370 + ], + "name": "genParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 39 + }, + "end": { + "line": 14, + "column": 48 + } + }, + "range": [ + 373, + 382 + ], + "name": "arguments" + } + } + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 14, + "column": 51 + }, + "end": { + "line": 16, + "column": 5 + } + }, + "range": [ + 385, + 415 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 15, + "column": 22 + } + }, + "range": [ + 393, + 409 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 15, + "column": 21 + } + }, + "range": [ + 393, + 408 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 15, + "column": 9 + } + }, + "range": [ + 393, + 396 + ], + "name": "gen" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 12 + }, + "end": { + "line": 15, + "column": 21 + } + }, + "range": [ + 399, + 408 + ], + "name": "arguments" + } + } + } + ] + } + }, + "arguments": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 16, + "column": 7 + }, + "end": { + "line": 16, + "column": 27 + } + }, + "range": [ + 417, + 437 + ], + "value": "generator function", + "raw": "'generator function'" + } + ], + "optional": false + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 29 + }, + "end": { + "line": 16, + "column": 33 + } + }, + "range": [ + 439, + 443 + ], + "name": "next" + }, + "computed": false, + "optional": false + }, + "arguments": [], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 20, + "column": 25 + } + }, + "range": [ + 452, + 561 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 20, + "column": 24 + } + }, + "range": [ + 452, + 560 + ], + "callee": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 18, + "column": 5 + }, + "end": { + "line": 20, + "column": 5 + } + }, + "range": [ + 453, + 541 + ], + "id": null, + "expression": false, + "generator": false, + "async": true, + "params": [ + { + "type": "ObjectPattern", + "loc": { + "start": { + "line": 18, + "column": 21 + }, + "end": { + "line": 18, + "column": 57 + } + }, + "range": [ + 469, + 505 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 56 + } + }, + "range": [ + 470, + 504 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 29 + } + }, + "range": [ + 470, + 477 + ], + "name": "test262" + }, + "kind": "init", + "value": { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 56 + } + }, + "range": [ + 470, + 504 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 29 + } + }, + "range": [ + 470, + 477 + ], + "name": "test262" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 18, + "column": 32 + }, + "end": { + "line": 18, + "column": 56 + } + }, + "range": [ + 480, + 504 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 32 + }, + "end": { + "line": 18, + "column": 44 + } + }, + "range": [ + 480, + 492 + ], + "name": "asyncFnParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 47 + }, + "end": { + "line": 18, + "column": 56 + } + }, + "range": [ + 495, + 504 + ], + "name": "arguments" + } + } + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 18, + "column": 59 + }, + "end": { + "line": 20, + "column": 5 + } + }, + "range": [ + 507, + 541 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 19, + "column": 6 + }, + "end": { + "line": 19, + "column": 26 + } + }, + "range": [ + 515, + 535 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 19, + "column": 6 + }, + "end": { + "line": 19, + "column": 25 + } + }, + "range": [ + 515, + 534 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 19, + "column": 6 + }, + "end": { + "line": 19, + "column": 13 + } + }, + "range": [ + 515, + 522 + ], + "name": "asyncFn" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 19, + "column": 16 + }, + "end": { + "line": 19, + "column": 25 + } + }, + "range": [ + 525, + 534 + ], + "name": "arguments" + } + } + } + ] + } + }, + "arguments": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 20, + "column": 7 + }, + "end": { + "line": 20, + "column": 23 + } + }, + "range": [ + 543, + 559 + ], + "value": "async function", + "raw": "'async function'" + } + ], + "optional": false + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 24, + "column": 0 + }, + "end": { + "line": 24, + "column": 47 + } + }, + "range": [ + 569, + 616 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 24, + "column": 0 + }, + "end": { + "line": 24, + "column": 46 + } + }, + "range": [ + 569, + 615 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 24, + "column": 0 + }, + "end": { + "line": 24, + "column": 6 + } + }, + "range": [ + 569, + 575 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 24, + "column": 7 + }, + "end": { + "line": 24, + "column": 37 + } + }, + "range": [ + 576, + 606 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 24, + "column": 7 + }, + "end": { + "line": 24, + "column": 19 + } + }, + "range": [ + 576, + 588 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 24, + "column": 20 + }, + "end": { + "line": 24, + "column": 32 + } + }, + "range": [ + 589, + 601 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 24, + "column": 21 + }, + "end": { + "line": 24, + "column": 31 + } + }, + "range": [ + 590, + 600 + ], + "value": "function", + "raw": "'function'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 24, + "column": 34 + }, + "end": { + "line": 24, + "column": 36 + } + }, + "range": [ + 603, + 605 + ], + "name": "fn" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 24, + "column": 39 + }, + "end": { + "line": 24, + "column": 45 + } + }, + "range": [ + 608, + 614 + ], + "value": "body", + "raw": "'body'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 25, + "column": 0 + }, + "end": { + "line": 25, + "column": 57 + } + }, + "range": [ + 617, + 674 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 25, + "column": 0 + }, + "end": { + "line": 25, + "column": 56 + } + }, + "range": [ + 617, + 673 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 25, + "column": 0 + }, + "end": { + "line": 25, + "column": 6 + } + }, + "range": [ + 617, + 623 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 25, + "column": 7 + }, + "end": { + "line": 25, + "column": 42 + } + }, + "range": [ + 624, + 659 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 25, + "column": 7 + }, + "end": { + "line": 25, + "column": 19 + } + }, + "range": [ + 624, + 636 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 25, + "column": 20 + }, + "end": { + "line": 25, + "column": 32 + } + }, + "range": [ + 637, + 649 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 25, + "column": 21 + }, + "end": { + "line": 25, + "column": 31 + } + }, + "range": [ + 638, + 648 + ], + "value": "function", + "raw": "'function'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 25, + "column": 34 + }, + "end": { + "line": 25, + "column": 41 + } + }, + "range": [ + 651, + 658 + ], + "name": "fnParam" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 25, + "column": 44 + }, + "end": { + "line": 25, + "column": 55 + } + }, + "range": [ + 661, + 672 + ], + "value": "parameter", + "raw": "'parameter'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 26, + "column": 0 + }, + "end": { + "line": 26, + "column": 58 + } + }, + "range": [ + 675, + 733 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 26, + "column": 0 + }, + "end": { + "line": 26, + "column": 57 + } + }, + "range": [ + 675, + 732 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 26, + "column": 0 + }, + "end": { + "line": 26, + "column": 6 + } + }, + "range": [ + 675, + 681 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 26, + "column": 7 + }, + "end": { + "line": 26, + "column": 48 + } + }, + "range": [ + 682, + 723 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 26, + "column": 7 + }, + "end": { + "line": 26, + "column": 19 + } + }, + "range": [ + 682, + 694 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 26, + "column": 20 + }, + "end": { + "line": 26, + "column": 42 + } + }, + "range": [ + 695, + 717 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 26, + "column": 21 + }, + "end": { + "line": 26, + "column": 41 + } + }, + "range": [ + 696, + 716 + ], + "value": "generator function", + "raw": "'generator function'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 26, + "column": 44 + }, + "end": { + "line": 26, + "column": 47 + } + }, + "range": [ + 719, + 722 + ], + "name": "gen" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 26, + "column": 50 + }, + "end": { + "line": 26, + "column": 56 + } + }, + "range": [ + 725, + 731 + ], + "value": "body", + "raw": "'body'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 27, + "column": 0 + }, + "end": { + "line": 27, + "column": 68 + } + }, + "range": [ + 734, + 802 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 27, + "column": 0 + }, + "end": { + "line": 27, + "column": 67 + } + }, + "range": [ + 734, + 801 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 27, + "column": 0 + }, + "end": { + "line": 27, + "column": 6 + } + }, + "range": [ + 734, + 740 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 27, + "column": 7 + }, + "end": { + "line": 27, + "column": 53 + } + }, + "range": [ + 741, + 787 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 27, + "column": 7 + }, + "end": { + "line": 27, + "column": 19 + } + }, + "range": [ + 741, + 753 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 27, + "column": 20 + }, + "end": { + "line": 27, + "column": 42 + } + }, + "range": [ + 754, + 776 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 27, + "column": 21 + }, + "end": { + "line": 27, + "column": 41 + } + }, + "range": [ + 755, + 775 + ], + "value": "generator function", + "raw": "'generator function'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 27, + "column": 44 + }, + "end": { + "line": 27, + "column": 52 + } + }, + "range": [ + 778, + 786 + ], + "name": "genParam" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 27, + "column": 55 + }, + "end": { + "line": 27, + "column": 66 + } + }, + "range": [ + 789, + 800 + ], + "value": "parameter", + "raw": "'parameter'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 28, + "column": 0 + }, + "end": { + "line": 28, + "column": 58 + } + }, + "range": [ + 803, + 861 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 28, + "column": 0 + }, + "end": { + "line": 28, + "column": 57 + } + }, + "range": [ + 803, + 860 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 28, + "column": 0 + }, + "end": { + "line": 28, + "column": 6 + } + }, + "range": [ + 803, + 809 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 28, + "column": 7 + }, + "end": { + "line": 28, + "column": 48 + } + }, + "range": [ + 810, + 851 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 28, + "column": 7 + }, + "end": { + "line": 28, + "column": 19 + } + }, + "range": [ + 810, + 822 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 28, + "column": 20 + }, + "end": { + "line": 28, + "column": 38 + } + }, + "range": [ + 823, + 841 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 28, + "column": 21 + }, + "end": { + "line": 28, + "column": 37 + } + }, + "range": [ + 824, + 840 + ], + "value": "async function", + "raw": "'async function'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 28, + "column": 40 + }, + "end": { + "line": 28, + "column": 47 + } + }, + "range": [ + 843, + 850 + ], + "name": "asyncFn" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 28, + "column": 50 + }, + "end": { + "line": 28, + "column": 56 + } + }, + "range": [ + 853, + 859 + ], + "value": "body", + "raw": "'body'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 29, + "column": 0 + }, + "end": { + "line": 29, + "column": 68 + } + }, + "range": [ + 862, + 930 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 29, + "column": 0 + }, + "end": { + "line": 29, + "column": 67 + } + }, + "range": [ + 862, + 929 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 29, + "column": 0 + }, + "end": { + "line": 29, + "column": 6 + } + }, + "range": [ + 862, + 868 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 29, + "column": 7 + }, + "end": { + "line": 29, + "column": 53 + } + }, + "range": [ + 869, + 915 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 29, + "column": 7 + }, + "end": { + "line": 29, + "column": 19 + } + }, + "range": [ + 869, + 881 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 29, + "column": 20 + }, + "end": { + "line": 29, + "column": 38 + } + }, + "range": [ + 882, + 900 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 29, + "column": 21 + }, + "end": { + "line": 29, + "column": 37 + } + }, + "range": [ + 883, + 899 + ], + "value": "async function", + "raw": "'async function'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 29, + "column": 40 + }, + "end": { + "line": 29, + "column": 52 + } + }, + "range": [ + 902, + 914 + ], + "name": "asyncFnParam" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 29, + "column": 55 + }, + "end": { + "line": 29, + "column": 66 + } + }, + "range": [ + 917, + 928 + ], + "value": "parameter", + "raw": "'parameter'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 157, + 160 + ] + }, + { + "type": "Identifier", + "value": "fn", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 6 + } + }, + "range": [ + 161, + 163 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 163, + 164 + ] + }, + { + "type": "Identifier", + "value": "fnParam", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 15 + } + }, + "range": [ + 165, + 172 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 16 + } + }, + "range": [ + 172, + 173 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 174, + 177 + ] + }, + { + "type": "Identifier", + "value": "gen", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "range": [ + 178, + 181 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 5, + "column": 7 + }, + "end": { + "line": 5, + "column": 8 + } + }, + "range": [ + 181, + 182 + ] + }, + { + "type": "Identifier", + "value": "genParam", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 17 + } + }, + "range": [ + 183, + 191 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 17 + }, + "end": { + "line": 5, + "column": 18 + } + }, + "range": [ + 191, + 192 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 193, + 196 + ] + }, + { + "type": "Identifier", + "value": "asyncFn", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 11 + } + }, + "range": [ + 197, + 204 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 6, + "column": 11 + }, + "end": { + "line": 6, + "column": 12 + } + }, + "range": [ + 204, + 205 + ] + }, + { + "type": "Identifier", + "value": "asyncFnParam", + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 25 + } + }, + "range": [ + 206, + 218 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 25 + }, + "end": { + "line": 6, + "column": 26 + } + }, + "range": [ + 218, + 219 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 5 + } + }, + "range": [ + 221, + 226 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 8, + "column": 6 + }, + "end": { + "line": 8, + "column": 7 + } + }, + "range": [ + 227, + 228 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 9 + } + }, + "range": [ + 229, + 230 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 9, + "column": 8 + } + }, + "range": [ + 233, + 239 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 10 + } + }, + "range": [ + 240, + 241 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 5 + } + }, + "range": [ + 246, + 247 + ] + }, + { + "type": "Keyword", + "value": "function", + "loc": { + "start": { + "line": 10, + "column": 5 + }, + "end": { + "line": 10, + "column": 13 + } + }, + "range": [ + 247, + 255 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 10, + "column": 13 + }, + "end": { + "line": 10, + "column": 14 + } + }, + "range": [ + 255, + 256 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 10, + "column": 14 + }, + "end": { + "line": 10, + "column": 15 + } + }, + "range": [ + 256, + 257 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 10, + "column": 15 + }, + "end": { + "line": 10, + "column": 22 + } + }, + "range": [ + 257, + 264 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 10, + "column": 23 + }, + "end": { + "line": 10, + "column": 24 + } + }, + "range": [ + 265, + 266 + ] + }, + { + "type": "Identifier", + "value": "fnParam", + "loc": { + "start": { + "line": 10, + "column": 25 + }, + "end": { + "line": 10, + "column": 32 + } + }, + "range": [ + 267, + 274 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 10, + "column": 33 + }, + "end": { + "line": 10, + "column": 34 + } + }, + "range": [ + 275, + 276 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 10, + "column": 35 + }, + "end": { + "line": 10, + "column": 44 + } + }, + "range": [ + 277, + 286 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 10, + "column": 44 + }, + "end": { + "line": 10, + "column": 45 + } + }, + "range": [ + 286, + 287 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 10, + "column": 45 + }, + "end": { + "line": 10, + "column": 46 + } + }, + "range": [ + 287, + 288 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 10, + "column": 47 + }, + "end": { + "line": 10, + "column": 48 + } + }, + "range": [ + 289, + 290 + ] + }, + { + "type": "Identifier", + "value": "fn", + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 8 + } + }, + "range": [ + 297, + 299 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 11, + "column": 9 + }, + "end": { + "line": 11, + "column": 10 + } + }, + "range": [ + 300, + 301 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 11, + "column": 11 + }, + "end": { + "line": 11, + "column": 20 + } + }, + "range": [ + 302, + 311 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 11, + "column": 20 + }, + "end": { + "line": 11, + "column": 21 + } + }, + "range": [ + 311, + 312 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 12, + "column": 4 + }, + "end": { + "line": 12, + "column": 5 + } + }, + "range": [ + 317, + 318 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 12, + "column": 5 + }, + "end": { + "line": 12, + "column": 6 + } + }, + "range": [ + 318, + 319 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 12, + "column": 6 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "range": [ + 319, + 320 + ] + }, + { + "type": "String", + "value": "'function'", + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 17 + } + }, + "range": [ + 320, + 330 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 12, + "column": 17 + }, + "end": { + "line": 12, + "column": 18 + } + }, + "range": [ + 330, + 331 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 12, + "column": 18 + }, + "end": { + "line": 12, + "column": 19 + } + }, + "range": [ + 331, + 332 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 5 + } + }, + "range": [ + 338, + 339 + ] + }, + { + "type": "Keyword", + "value": "function", + "loc": { + "start": { + "line": 14, + "column": 5 + }, + "end": { + "line": 14, + "column": 13 + } + }, + "range": [ + 339, + 347 + ] + }, + { + "type": "Punctuator", + "value": "*", + "loc": { + "start": { + "line": 14, + "column": 14 + }, + "end": { + "line": 14, + "column": 15 + } + }, + "range": [ + 348, + 349 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 14, + "column": 16 + }, + "end": { + "line": 14, + "column": 17 + } + }, + "range": [ + 350, + 351 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 14, + "column": 17 + }, + "end": { + "line": 14, + "column": 18 + } + }, + "range": [ + 351, + 352 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 14, + "column": 18 + }, + "end": { + "line": 14, + "column": 25 + } + }, + "range": [ + 352, + 359 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 14, + "column": 26 + }, + "end": { + "line": 14, + "column": 27 + } + }, + "range": [ + 360, + 361 + ] + }, + { + "type": "Identifier", + "value": "genParam", + "loc": { + "start": { + "line": 14, + "column": 28 + }, + "end": { + "line": 14, + "column": 36 + } + }, + "range": [ + 362, + 370 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 14, + "column": 37 + }, + "end": { + "line": 14, + "column": 38 + } + }, + "range": [ + 371, + 372 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 14, + "column": 39 + }, + "end": { + "line": 14, + "column": 48 + } + }, + "range": [ + 373, + 382 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 14, + "column": 48 + }, + "end": { + "line": 14, + "column": 49 + } + }, + "range": [ + 382, + 383 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 14, + "column": 49 + }, + "end": { + "line": 14, + "column": 50 + } + }, + "range": [ + 383, + 384 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 14, + "column": 51 + }, + "end": { + "line": 14, + "column": 52 + } + }, + "range": [ + 385, + 386 + ] + }, + { + "type": "Identifier", + "value": "gen", + "loc": { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 15, + "column": 9 + } + }, + "range": [ + 393, + 396 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 15, + "column": 10 + }, + "end": { + "line": 15, + "column": 11 + } + }, + "range": [ + 397, + 398 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 15, + "column": 12 + }, + "end": { + "line": 15, + "column": 21 + } + }, + "range": [ + 399, + 408 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 15, + "column": 21 + }, + "end": { + "line": 15, + "column": 22 + } + }, + "range": [ + 408, + 409 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 16, + "column": 4 + }, + "end": { + "line": 16, + "column": 5 + } + }, + "range": [ + 414, + 415 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 16, + "column": 5 + }, + "end": { + "line": 16, + "column": 6 + } + }, + "range": [ + 415, + 416 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 16, + "column": 6 + }, + "end": { + "line": 16, + "column": 7 + } + }, + "range": [ + 416, + 417 + ] + }, + { + "type": "String", + "value": "'generator function'", + "loc": { + "start": { + "line": 16, + "column": 7 + }, + "end": { + "line": 16, + "column": 27 + } + }, + "range": [ + 417, + 437 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 16, + "column": 27 + }, + "end": { + "line": 16, + "column": 28 + } + }, + "range": [ + 437, + 438 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 16, + "column": 28 + }, + "end": { + "line": 16, + "column": 29 + } + }, + "range": [ + 438, + 439 + ] + }, + { + "type": "Identifier", + "value": "next", + "loc": { + "start": { + "line": 16, + "column": 29 + }, + "end": { + "line": 16, + "column": 33 + } + }, + "range": [ + 439, + 443 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 16, + "column": 33 + }, + "end": { + "line": 16, + "column": 34 + } + }, + "range": [ + 443, + 444 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 16, + "column": 34 + }, + "end": { + "line": 16, + "column": 35 + } + }, + "range": [ + 444, + 445 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 16, + "column": 35 + }, + "end": { + "line": 16, + "column": 36 + } + }, + "range": [ + 445, + 446 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 5 + } + }, + "range": [ + 452, + 453 + ] + }, + { + "type": "Identifier", + "value": "async", + "loc": { + "start": { + "line": 18, + "column": 5 + }, + "end": { + "line": 18, + "column": 10 + } + }, + "range": [ + 453, + 458 + ] + }, + { + "type": "Keyword", + "value": "function", + "loc": { + "start": { + "line": 18, + "column": 11 + }, + "end": { + "line": 18, + "column": 19 + } + }, + "range": [ + 459, + 467 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 18, + "column": 20 + }, + "end": { + "line": 18, + "column": 21 + } + }, + "range": [ + 468, + 469 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 18, + "column": 21 + }, + "end": { + "line": 18, + "column": 22 + } + }, + "range": [ + 469, + 470 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 29 + } + }, + "range": [ + 470, + 477 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 18, + "column": 30 + }, + "end": { + "line": 18, + "column": 31 + } + }, + "range": [ + 478, + 479 + ] + }, + { + "type": "Identifier", + "value": "asyncFnParam", + "loc": { + "start": { + "line": 18, + "column": 32 + }, + "end": { + "line": 18, + "column": 44 + } + }, + "range": [ + 480, + 492 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 18, + "column": 45 + }, + "end": { + "line": 18, + "column": 46 + } + }, + "range": [ + 493, + 494 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 18, + "column": 47 + }, + "end": { + "line": 18, + "column": 56 + } + }, + "range": [ + 495, + 504 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 18, + "column": 56 + }, + "end": { + "line": 18, + "column": 57 + } + }, + "range": [ + 504, + 505 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 18, + "column": 57 + }, + "end": { + "line": 18, + "column": 58 + } + }, + "range": [ + 505, + 506 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 18, + "column": 59 + }, + "end": { + "line": 18, + "column": 60 + } + }, + "range": [ + 507, + 508 + ] + }, + { + "type": "Identifier", + "value": "asyncFn", + "loc": { + "start": { + "line": 19, + "column": 6 + }, + "end": { + "line": 19, + "column": 13 + } + }, + "range": [ + 515, + 522 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 19, + "column": 14 + }, + "end": { + "line": 19, + "column": 15 + } + }, + "range": [ + 523, + 524 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 19, + "column": 16 + }, + "end": { + "line": 19, + "column": 25 + } + }, + "range": [ + 525, + 534 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 19, + "column": 25 + }, + "end": { + "line": 19, + "column": 26 + } + }, + "range": [ + 534, + 535 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 20, + "column": 4 + }, + "end": { + "line": 20, + "column": 5 + } + }, + "range": [ + 540, + 541 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 20, + "column": 5 + }, + "end": { + "line": 20, + "column": 6 + } + }, + "range": [ + 541, + 542 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 20, + "column": 6 + }, + "end": { + "line": 20, + "column": 7 + } + }, + "range": [ + 542, + 543 + ] + }, + { + "type": "String", + "value": "'async function'", + "loc": { + "start": { + "line": 20, + "column": 7 + }, + "end": { + "line": 20, + "column": 23 + } + }, + "range": [ + 543, + 559 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 20, + "column": 23 + }, + "end": { + "line": 20, + "column": 24 + } + }, + "range": [ + 559, + 560 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 20, + "column": 24 + }, + "end": { + "line": 20, + "column": 25 + } + }, + "range": [ + 560, + 561 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 21, + "column": 2 + }, + "end": { + "line": 21, + "column": 3 + } + }, + "range": [ + 564, + 565 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 22, + "column": 0 + }, + "end": { + "line": 22, + "column": 1 + } + }, + "range": [ + 566, + 567 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 24, + "column": 0 + }, + "end": { + "line": 24, + "column": 6 + } + }, + "range": [ + 569, + 575 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 24, + "column": 6 + }, + "end": { + "line": 24, + "column": 7 + } + }, + "range": [ + 575, + 576 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 24, + "column": 7 + }, + "end": { + "line": 24, + "column": 19 + } + }, + "range": [ + 576, + 588 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 24, + "column": 19 + }, + "end": { + "line": 24, + "column": 20 + } + }, + "range": [ + 588, + 589 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 24, + "column": 20 + }, + "end": { + "line": 24, + "column": 21 + } + }, + "range": [ + 589, + 590 + ] + }, + { + "type": "String", + "value": "'function'", + "loc": { + "start": { + "line": 24, + "column": 21 + }, + "end": { + "line": 24, + "column": 31 + } + }, + "range": [ + 590, + 600 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 24, + "column": 31 + }, + "end": { + "line": 24, + "column": 32 + } + }, + "range": [ + 600, + 601 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 24, + "column": 32 + }, + "end": { + "line": 24, + "column": 33 + } + }, + "range": [ + 601, + 602 + ] + }, + { + "type": "Identifier", + "value": "fn", + "loc": { + "start": { + "line": 24, + "column": 34 + }, + "end": { + "line": 24, + "column": 36 + } + }, + "range": [ + 603, + 605 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 24, + "column": 36 + }, + "end": { + "line": 24, + "column": 37 + } + }, + "range": [ + 605, + 606 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 24, + "column": 37 + }, + "end": { + "line": 24, + "column": 38 + } + }, + "range": [ + 606, + 607 + ] + }, + { + "type": "String", + "value": "'body'", + "loc": { + "start": { + "line": 24, + "column": 39 + }, + "end": { + "line": 24, + "column": 45 + } + }, + "range": [ + 608, + 614 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 24, + "column": 45 + }, + "end": { + "line": 24, + "column": 46 + } + }, + "range": [ + 614, + 615 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 24, + "column": 46 + }, + "end": { + "line": 24, + "column": 47 + } + }, + "range": [ + 615, + 616 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 25, + "column": 0 + }, + "end": { + "line": 25, + "column": 6 + } + }, + "range": [ + 617, + 623 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 25, + "column": 6 + }, + "end": { + "line": 25, + "column": 7 + } + }, + "range": [ + 623, + 624 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 25, + "column": 7 + }, + "end": { + "line": 25, + "column": 19 + } + }, + "range": [ + 624, + 636 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 25, + "column": 19 + }, + "end": { + "line": 25, + "column": 20 + } + }, + "range": [ + 636, + 637 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 25, + "column": 20 + }, + "end": { + "line": 25, + "column": 21 + } + }, + "range": [ + 637, + 638 + ] + }, + { + "type": "String", + "value": "'function'", + "loc": { + "start": { + "line": 25, + "column": 21 + }, + "end": { + "line": 25, + "column": 31 + } + }, + "range": [ + 638, + 648 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 25, + "column": 31 + }, + "end": { + "line": 25, + "column": 32 + } + }, + "range": [ + 648, + 649 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 25, + "column": 32 + }, + "end": { + "line": 25, + "column": 33 + } + }, + "range": [ + 649, + 650 + ] + }, + { + "type": "Identifier", + "value": "fnParam", + "loc": { + "start": { + "line": 25, + "column": 34 + }, + "end": { + "line": 25, + "column": 41 + } + }, + "range": [ + 651, + 658 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 25, + "column": 41 + }, + "end": { + "line": 25, + "column": 42 + } + }, + "range": [ + 658, + 659 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 25, + "column": 42 + }, + "end": { + "line": 25, + "column": 43 + } + }, + "range": [ + 659, + 660 + ] + }, + { + "type": "String", + "value": "'parameter'", + "loc": { + "start": { + "line": 25, + "column": 44 + }, + "end": { + "line": 25, + "column": 55 + } + }, + "range": [ + 661, + 672 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 25, + "column": 55 + }, + "end": { + "line": 25, + "column": 56 + } + }, + "range": [ + 672, + 673 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 25, + "column": 56 + }, + "end": { + "line": 25, + "column": 57 + } + }, + "range": [ + 673, + 674 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 26, + "column": 0 + }, + "end": { + "line": 26, + "column": 6 + } + }, + "range": [ + 675, + 681 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 26, + "column": 6 + }, + "end": { + "line": 26, + "column": 7 + } + }, + "range": [ + 681, + 682 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 26, + "column": 7 + }, + "end": { + "line": 26, + "column": 19 + } + }, + "range": [ + 682, + 694 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 26, + "column": 19 + }, + "end": { + "line": 26, + "column": 20 + } + }, + "range": [ + 694, + 695 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 26, + "column": 20 + }, + "end": { + "line": 26, + "column": 21 + } + }, + "range": [ + 695, + 696 + ] + }, + { + "type": "String", + "value": "'generator function'", + "loc": { + "start": { + "line": 26, + "column": 21 + }, + "end": { + "line": 26, + "column": 41 + } + }, + "range": [ + 696, + 716 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 26, + "column": 41 + }, + "end": { + "line": 26, + "column": 42 + } + }, + "range": [ + 716, + 717 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 26, + "column": 42 + }, + "end": { + "line": 26, + "column": 43 + } + }, + "range": [ + 717, + 718 + ] + }, + { + "type": "Identifier", + "value": "gen", + "loc": { + "start": { + "line": 26, + "column": 44 + }, + "end": { + "line": 26, + "column": 47 + } + }, + "range": [ + 719, + 722 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 26, + "column": 47 + }, + "end": { + "line": 26, + "column": 48 + } + }, + "range": [ + 722, + 723 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 26, + "column": 48 + }, + "end": { + "line": 26, + "column": 49 + } + }, + "range": [ + 723, + 724 + ] + }, + { + "type": "String", + "value": "'body'", + "loc": { + "start": { + "line": 26, + "column": 50 + }, + "end": { + "line": 26, + "column": 56 + } + }, + "range": [ + 725, + 731 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 26, + "column": 56 + }, + "end": { + "line": 26, + "column": 57 + } + }, + "range": [ + 731, + 732 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 26, + "column": 57 + }, + "end": { + "line": 26, + "column": 58 + } + }, + "range": [ + 732, + 733 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 27, + "column": 0 + }, + "end": { + "line": 27, + "column": 6 + } + }, + "range": [ + 734, + 740 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 27, + "column": 6 + }, + "end": { + "line": 27, + "column": 7 + } + }, + "range": [ + 740, + 741 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 27, + "column": 7 + }, + "end": { + "line": 27, + "column": 19 + } + }, + "range": [ + 741, + 753 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 27, + "column": 19 + }, + "end": { + "line": 27, + "column": 20 + } + }, + "range": [ + 753, + 754 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 27, + "column": 20 + }, + "end": { + "line": 27, + "column": 21 + } + }, + "range": [ + 754, + 755 + ] + }, + { + "type": "String", + "value": "'generator function'", + "loc": { + "start": { + "line": 27, + "column": 21 + }, + "end": { + "line": 27, + "column": 41 + } + }, + "range": [ + 755, + 775 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 27, + "column": 41 + }, + "end": { + "line": 27, + "column": 42 + } + }, + "range": [ + 775, + 776 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 27, + "column": 42 + }, + "end": { + "line": 27, + "column": 43 + } + }, + "range": [ + 776, + 777 + ] + }, + { + "type": "Identifier", + "value": "genParam", + "loc": { + "start": { + "line": 27, + "column": 44 + }, + "end": { + "line": 27, + "column": 52 + } + }, + "range": [ + 778, + 786 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 27, + "column": 52 + }, + "end": { + "line": 27, + "column": 53 + } + }, + "range": [ + 786, + 787 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 27, + "column": 53 + }, + "end": { + "line": 27, + "column": 54 + } + }, + "range": [ + 787, + 788 + ] + }, + { + "type": "String", + "value": "'parameter'", + "loc": { + "start": { + "line": 27, + "column": 55 + }, + "end": { + "line": 27, + "column": 66 + } + }, + "range": [ + 789, + 800 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 27, + "column": 66 + }, + "end": { + "line": 27, + "column": 67 + } + }, + "range": [ + 800, + 801 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 27, + "column": 67 + }, + "end": { + "line": 27, + "column": 68 + } + }, + "range": [ + 801, + 802 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 28, + "column": 0 + }, + "end": { + "line": 28, + "column": 6 + } + }, + "range": [ + 803, + 809 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 28, + "column": 6 + }, + "end": { + "line": 28, + "column": 7 + } + }, + "range": [ + 809, + 810 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 28, + "column": 7 + }, + "end": { + "line": 28, + "column": 19 + } + }, + "range": [ + 810, + 822 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 28, + "column": 19 + }, + "end": { + "line": 28, + "column": 20 + } + }, + "range": [ + 822, + 823 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 28, + "column": 20 + }, + "end": { + "line": 28, + "column": 21 + } + }, + "range": [ + 823, + 824 + ] + }, + { + "type": "String", + "value": "'async function'", + "loc": { + "start": { + "line": 28, + "column": 21 + }, + "end": { + "line": 28, + "column": 37 + } + }, + "range": [ + 824, + 840 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 28, + "column": 37 + }, + "end": { + "line": 28, + "column": 38 + } + }, + "range": [ + 840, + 841 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 28, + "column": 38 + }, + "end": { + "line": 28, + "column": 39 + } + }, + "range": [ + 841, + 842 + ] + }, + { + "type": "Identifier", + "value": "asyncFn", + "loc": { + "start": { + "line": 28, + "column": 40 + }, + "end": { + "line": 28, + "column": 47 + } + }, + "range": [ + 843, + 850 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 28, + "column": 47 + }, + "end": { + "line": 28, + "column": 48 + } + }, + "range": [ + 850, + 851 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 28, + "column": 48 + }, + "end": { + "line": 28, + "column": 49 + } + }, + "range": [ + 851, + 852 + ] + }, + { + "type": "String", + "value": "'body'", + "loc": { + "start": { + "line": 28, + "column": 50 + }, + "end": { + "line": 28, + "column": 56 + } + }, + "range": [ + 853, + 859 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 28, + "column": 56 + }, + "end": { + "line": 28, + "column": 57 + } + }, + "range": [ + 859, + 860 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 28, + "column": 57 + }, + "end": { + "line": 28, + "column": 58 + } + }, + "range": [ + 860, + 861 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 29, + "column": 0 + }, + "end": { + "line": 29, + "column": 6 + } + }, + "range": [ + 862, + 868 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 29, + "column": 6 + }, + "end": { + "line": 29, + "column": 7 + } + }, + "range": [ + 868, + 869 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 29, + "column": 7 + }, + "end": { + "line": 29, + "column": 19 + } + }, + "range": [ + 869, + 881 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 29, + "column": 19 + }, + "end": { + "line": 29, + "column": 20 + } + }, + "range": [ + 881, + 882 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 29, + "column": 20 + }, + "end": { + "line": 29, + "column": 21 + } + }, + "range": [ + 882, + 883 + ] + }, + { + "type": "String", + "value": "'async function'", + "loc": { + "start": { + "line": 29, + "column": 21 + }, + "end": { + "line": 29, + "column": 37 + } + }, + "range": [ + 883, + 899 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 29, + "column": 37 + }, + "end": { + "line": 29, + "column": 38 + } + }, + "range": [ + 899, + 900 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 29, + "column": 38 + }, + "end": { + "line": 29, + "column": 39 + } + }, + "range": [ + 900, + 901 + ] + }, + { + "type": "Identifier", + "value": "asyncFnParam", + "loc": { + "start": { + "line": 29, + "column": 40 + }, + "end": { + "line": 29, + "column": 52 + } + }, + "range": [ + 902, + 914 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 29, + "column": 52 + }, + "end": { + "line": 29, + "column": 53 + } + }, + "range": [ + 914, + 915 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 29, + "column": 53 + }, + "end": { + "line": 29, + "column": 54 + } + }, + "range": [ + 915, + 916 + ] + }, + { + "type": "String", + "value": "'parameter'", + "loc": { + "start": { + "line": 29, + "column": 55 + }, + "end": { + "line": 29, + "column": 66 + } + }, + "range": [ + 917, + 928 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 29, + "column": 66 + }, + "end": { + "line": 29, + "column": 67 + } + }, + "range": [ + 928, + 929 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 29, + "column": 67 + }, + "end": { + "line": 29, + "column": 68 + } + }, + "range": [ + 929, + 930 + ] + } + ] +}; \ 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..815281e2 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-arguments-functions.src.js @@ -0,0 +1,29 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/class/static-init-arguments-functions.js + + +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..0ab9b503 --- /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": 4, + "column": 0 + }, + "end": { + "line": 47, + "column": 70 + } + }, + "range": [ + 155, + 1477 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 155, + 168 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 12 + } + }, + "range": [ + 159, + 167 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 12 + } + }, + "range": [ + 159, + 167 + ], + "name": "instance" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "range": [ + 169, + 193 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 173, + 179 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 173, + 179 + ], + "name": "method" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 12 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 181, + 192 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 12 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 181, + 192 + ], + "name": "methodParam" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 11 + } + }, + "range": [ + 194, + 205 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 10 + } + }, + "range": [ + 198, + 204 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 10 + } + }, + "range": [ + 198, + 204 + ], + "name": "getter" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 24 + } + }, + "range": [ + 206, + 230 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 10 + } + }, + "range": [ + 210, + 216 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 10 + } + }, + "range": [ + 210, + 216 + ], + "name": "setter" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 7, + "column": 12 + }, + "end": { + "line": 7, + "column": 23 + } + }, + "range": [ + 218, + 229 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 12 + }, + "end": { + "line": 7, + "column": 23 + } + }, + "range": [ + 218, + 229 + ], + "name": "setterParam" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 30 + } + }, + "range": [ + 231, + 261 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 13 + } + }, + "range": [ + 235, + 244 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 13 + } + }, + "range": [ + 235, + 244 + ], + "name": "genMethod" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 8, + "column": 15 + }, + "end": { + "line": 8, + "column": 29 + } + }, + "range": [ + 246, + 260 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 15 + }, + "end": { + "line": 8, + "column": 29 + } + }, + "range": [ + 246, + 260 + ], + "name": "genMethodParam" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 9, + "column": 0 + }, + "end": { + "line": 9, + "column": 34 + } + }, + "range": [ + 262, + 296 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 15 + } + }, + "range": [ + 266, + 277 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 15 + } + }, + "range": [ + 266, + 277 + ], + "name": "asyncMethod" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 9, + "column": 17 + }, + "end": { + "line": 9, + "column": 33 + } + }, + "range": [ + 279, + 295 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 17 + }, + "end": { + "line": 9, + "column": 33 + } + }, + "range": [ + 279, + 295 + ], + "name": "asyncMethodParam" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 31, + "column": 1 + } + }, + "range": [ + 298, + 796 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 7 + } + }, + "range": [ + 304, + 305 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 11, + "column": 8 + }, + "end": { + "line": 31, + "column": 1 + } + }, + "range": [ + 306, + 796 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 12, + "column": 2 + }, + "end": { + "line": 30, + "column": 3 + } + }, + "range": [ + 310, + 794 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 29, + "column": 8 + } + }, + "range": [ + 323, + 790 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 29, + "column": 7 + } + }, + "range": [ + 323, + 789 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 12 + } + }, + "range": [ + 323, + 331 + ], + "name": "instance" + }, + "right": { + "type": "NewExpression", + "loc": { + "start": { + "line": 13, + "column": 15 + }, + "end": { + "line": 29, + "column": 7 + } + }, + "range": [ + 334, + 789 + ], + "callee": { + "type": "ClassExpression", + "loc": { + "start": { + "line": 13, + "column": 19 + }, + "end": { + "line": 29, + "column": 5 + } + }, + "range": [ + 338, + 787 + ], + "id": null, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 13, + "column": 25 + }, + "end": { + "line": 29, + "column": 5 + } + }, + "range": [ + 344, + 787 + ], + "body": [ + { + "type": "MethodDefinition", + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 16, + "column": 7 + } + }, + "range": [ + 352, + 433 + ], + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 12 + } + }, + "range": [ + 352, + 358 + ], + "name": "method" + }, + "kind": "method", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 14, + "column": 12 + }, + "end": { + "line": 16, + "column": 7 + } + }, + "range": [ + 358, + 433 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [ + { + "type": "ObjectPattern", + "loc": { + "start": { + "line": 14, + "column": 13 + }, + "end": { + "line": 14, + "column": 48 + } + }, + "range": [ + 359, + 394 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 14, + "column": 14 + }, + "end": { + "line": 14, + "column": 47 + } + }, + "range": [ + 360, + 393 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 14 + }, + "end": { + "line": 14, + "column": 21 + } + }, + "range": [ + 360, + 367 + ], + "name": "test262" + }, + "kind": "init", + "value": { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 14, + "column": 14 + }, + "end": { + "line": 14, + "column": 47 + } + }, + "range": [ + 360, + 393 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 14 + }, + "end": { + "line": 14, + "column": 21 + } + }, + "range": [ + 360, + 367 + ], + "name": "test262" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 14, + "column": 24 + }, + "end": { + "line": 14, + "column": 47 + } + }, + "range": [ + 370, + 393 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 24 + }, + "end": { + "line": 14, + "column": 35 + } + }, + "range": [ + 370, + 381 + ], + "name": "methodParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 38 + }, + "end": { + "line": 14, + "column": 47 + } + }, + "range": [ + 384, + 393 + ], + "name": "arguments" + } + } + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 14, + "column": 50 + }, + "end": { + "line": 16, + "column": 7 + } + }, + "range": [ + 396, + 433 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 15, + "column": 8 + }, + "end": { + "line": 15, + "column": 27 + } + }, + "range": [ + 406, + 425 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 15, + "column": 8 + }, + "end": { + "line": 15, + "column": 26 + } + }, + "range": [ + 406, + 424 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 8 + }, + "end": { + "line": 15, + "column": 14 + } + }, + "range": [ + 406, + 412 + ], + "name": "method" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 15, + "column": 17 + }, + "end": { + "line": 15, + "column": 26 + } + }, + "range": [ + 415, + 424 + ], + "name": "arguments" + } + } + } + ] + } + } + }, + { + "type": "MethodDefinition", + "loc": { + "start": { + "line": 17, + "column": 6 + }, + "end": { + "line": 19, + "column": 7 + } + }, + "range": [ + 440, + 492 + ], + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 10 + }, + "end": { + "line": 17, + "column": 18 + } + }, + "range": [ + 444, + 452 + ], + "name": "accessor" + }, + "kind": "get", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 17, + "column": 18 + }, + "end": { + "line": 19, + "column": 7 + } + }, + "range": [ + 452, + 492 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 17, + "column": 21 + }, + "end": { + "line": 19, + "column": 7 + } + }, + "range": [ + 455, + 492 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 18, + "column": 8 + }, + "end": { + "line": 18, + "column": 27 + } + }, + "range": [ + 465, + 484 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 18, + "column": 8 + }, + "end": { + "line": 18, + "column": 26 + } + }, + "range": [ + 465, + 483 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 8 + }, + "end": { + "line": 18, + "column": 14 + } + }, + "range": [ + 465, + 471 + ], + "name": "getter" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 26 + } + }, + "range": [ + 474, + 483 + ], + "name": "arguments" + } + } + } + ] + } + } + }, + { + "type": "MethodDefinition", + "loc": { + "start": { + "line": 20, + "column": 6 + }, + "end": { + "line": 22, + "column": 7 + } + }, + "range": [ + 499, + 586 + ], + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 20, + "column": 10 + }, + "end": { + "line": 20, + "column": 18 + } + }, + "range": [ + 503, + 511 + ], + "name": "accessor" + }, + "kind": "set", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 20, + "column": 18 + }, + "end": { + "line": 22, + "column": 7 + } + }, + "range": [ + 511, + 586 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [ + { + "type": "ObjectPattern", + "loc": { + "start": { + "line": 20, + "column": 19 + }, + "end": { + "line": 20, + "column": 54 + } + }, + "range": [ + 512, + 547 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 20, + "column": 20 + }, + "end": { + "line": 20, + "column": 53 + } + }, + "range": [ + 513, + 546 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 20, + "column": 20 + }, + "end": { + "line": 20, + "column": 27 + } + }, + "range": [ + 513, + 520 + ], + "name": "test262" + }, + "kind": "init", + "value": { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 20, + "column": 20 + }, + "end": { + "line": 20, + "column": 53 + } + }, + "range": [ + 513, + 546 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 20, + "column": 20 + }, + "end": { + "line": 20, + "column": 27 + } + }, + "range": [ + 513, + 520 + ], + "name": "test262" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 20, + "column": 30 + }, + "end": { + "line": 20, + "column": 53 + } + }, + "range": [ + 523, + 546 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 20, + "column": 30 + }, + "end": { + "line": 20, + "column": 41 + } + }, + "range": [ + 523, + 534 + ], + "name": "setterParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 20, + "column": 44 + }, + "end": { + "line": 20, + "column": 53 + } + }, + "range": [ + 537, + 546 + ], + "name": "arguments" + } + } + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 20, + "column": 56 + }, + "end": { + "line": 22, + "column": 7 + } + }, + "range": [ + 549, + 586 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 21, + "column": 8 + }, + "end": { + "line": 21, + "column": 27 + } + }, + "range": [ + 559, + 578 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 21, + "column": 8 + }, + "end": { + "line": 21, + "column": 26 + } + }, + "range": [ + 559, + 577 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 21, + "column": 8 + }, + "end": { + "line": 21, + "column": 14 + } + }, + "range": [ + 559, + 565 + ], + "name": "setter" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 21, + "column": 17 + }, + "end": { + "line": 21, + "column": 26 + } + }, + "range": [ + 568, + 577 + ], + "name": "arguments" + } + } + } + ] + } + } + }, + { + "type": "MethodDefinition", + "loc": { + "start": { + "line": 23, + "column": 6 + }, + "end": { + "line": 25, + "column": 7 + } + }, + "range": [ + 593, + 678 + ], + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 23, + "column": 7 + }, + "end": { + "line": 23, + "column": 10 + } + }, + "range": [ + 594, + 597 + ], + "name": "gen" + }, + "kind": "method", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 23, + "column": 10 + }, + "end": { + "line": 25, + "column": 7 + } + }, + "range": [ + 597, + 678 + ], + "id": null, + "expression": false, + "generator": true, + "async": false, + "params": [ + { + "type": "ObjectPattern", + "loc": { + "start": { + "line": 23, + "column": 11 + }, + "end": { + "line": 23, + "column": 49 + } + }, + "range": [ + 598, + 636 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 23, + "column": 12 + }, + "end": { + "line": 23, + "column": 48 + } + }, + "range": [ + 599, + 635 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 23, + "column": 12 + }, + "end": { + "line": 23, + "column": 19 + } + }, + "range": [ + 599, + 606 + ], + "name": "test262" + }, + "kind": "init", + "value": { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 23, + "column": 12 + }, + "end": { + "line": 23, + "column": 48 + } + }, + "range": [ + 599, + 635 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 23, + "column": 12 + }, + "end": { + "line": 23, + "column": 19 + } + }, + "range": [ + 599, + 606 + ], + "name": "test262" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 23, + "column": 22 + }, + "end": { + "line": 23, + "column": 48 + } + }, + "range": [ + 609, + 635 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 23, + "column": 22 + }, + "end": { + "line": 23, + "column": 36 + } + }, + "range": [ + 609, + 623 + ], + "name": "genMethodParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 23, + "column": 39 + }, + "end": { + "line": 23, + "column": 48 + } + }, + "range": [ + 626, + 635 + ], + "name": "arguments" + } + } + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 23, + "column": 51 + }, + "end": { + "line": 25, + "column": 7 + } + }, + "range": [ + 638, + 678 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 24, + "column": 8 + }, + "end": { + "line": 24, + "column": 30 + } + }, + "range": [ + 648, + 670 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 24, + "column": 8 + }, + "end": { + "line": 24, + "column": 29 + } + }, + "range": [ + 648, + 669 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 24, + "column": 8 + }, + "end": { + "line": 24, + "column": 17 + } + }, + "range": [ + 648, + 657 + ], + "name": "genMethod" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 24, + "column": 20 + }, + "end": { + "line": 24, + "column": 29 + } + }, + "range": [ + 660, + 669 + ], + "name": "arguments" + } + } + } + ] + } + } + }, + { + "type": "MethodDefinition", + "loc": { + "start": { + "line": 26, + "column": 6 + }, + "end": { + "line": 28, + "column": 7 + } + }, + "range": [ + 685, + 781 + ], + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 26, + "column": 12 + }, + "end": { + "line": 26, + "column": 17 + } + }, + "range": [ + 691, + 696 + ], + "name": "async" + }, + "kind": "method", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 26, + "column": 17 + }, + "end": { + "line": 28, + "column": 7 + } + }, + "range": [ + 696, + 781 + ], + "id": null, + "expression": false, + "generator": false, + "async": true, + "params": [ + { + "type": "ObjectPattern", + "loc": { + "start": { + "line": 26, + "column": 18 + }, + "end": { + "line": 26, + "column": 58 + } + }, + "range": [ + 697, + 737 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 26, + "column": 19 + }, + "end": { + "line": 26, + "column": 57 + } + }, + "range": [ + 698, + 736 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 26, + "column": 19 + }, + "end": { + "line": 26, + "column": 26 + } + }, + "range": [ + 698, + 705 + ], + "name": "test262" + }, + "kind": "init", + "value": { + "type": "AssignmentPattern", + "loc": { + "start": { + "line": 26, + "column": 19 + }, + "end": { + "line": 26, + "column": 57 + } + }, + "range": [ + 698, + 736 + ], + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 26, + "column": 19 + }, + "end": { + "line": 26, + "column": 26 + } + }, + "range": [ + 698, + 705 + ], + "name": "test262" + }, + "right": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 26, + "column": 29 + }, + "end": { + "line": 26, + "column": 57 + } + }, + "range": [ + 708, + 736 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 26, + "column": 29 + }, + "end": { + "line": 26, + "column": 45 + } + }, + "range": [ + 708, + 724 + ], + "name": "asyncMethodParam" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 26, + "column": 48 + }, + "end": { + "line": 26, + "column": 57 + } + }, + "range": [ + 727, + 736 + ], + "name": "arguments" + } + } + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 26, + "column": 60 + }, + "end": { + "line": 28, + "column": 7 + } + }, + "range": [ + 739, + 781 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 27, + "column": 8 + }, + "end": { + "line": 27, + "column": 32 + } + }, + "range": [ + 749, + 773 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 27, + "column": 8 + }, + "end": { + "line": 27, + "column": 31 + } + }, + "range": [ + 749, + 772 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 27, + "column": 8 + }, + "end": { + "line": 27, + "column": 19 + } + }, + "range": [ + 749, + 760 + ], + "name": "asyncMethod" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 27, + "column": 22 + }, + "end": { + "line": 27, + "column": 31 + } + }, + "range": [ + 763, + 772 + ], + "name": "arguments" + } + } + } + ] + } + } + } + ] + } + }, + "arguments": [] + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 33, + "column": 0 + }, + "end": { + "line": 33, + "column": 26 + } + }, + "range": [ + 798, + 824 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 33, + "column": 0 + }, + "end": { + "line": 33, + "column": 25 + } + }, + "range": [ + 798, + 823 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 33, + "column": 0 + }, + "end": { + "line": 33, + "column": 15 + } + }, + "range": [ + 798, + 813 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 33, + "column": 0 + }, + "end": { + "line": 33, + "column": 8 + } + }, + "range": [ + 798, + 806 + ], + "name": "instance" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 33, + "column": 9 + }, + "end": { + "line": 33, + "column": 15 + } + }, + "range": [ + 807, + 813 + ], + "name": "method" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 33, + "column": 16 + }, + "end": { + "line": 33, + "column": 24 + } + }, + "range": [ + 814, + 822 + ], + "value": "method", + "raw": "'method'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 34, + "column": 0 + }, + "end": { + "line": 34, + "column": 18 + } + }, + "range": [ + 825, + 843 + ], + "expression": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 34, + "column": 0 + }, + "end": { + "line": 34, + "column": 17 + } + }, + "range": [ + 825, + 842 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 34, + "column": 0 + }, + "end": { + "line": 34, + "column": 8 + } + }, + "range": [ + 825, + 833 + ], + "name": "instance" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 34, + "column": 9 + }, + "end": { + "line": 34, + "column": 17 + } + }, + "range": [ + 834, + 842 + ], + "name": "accessor" + }, + "computed": false, + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 35, + "column": 0 + }, + "end": { + "line": 35, + "column": 29 + } + }, + "range": [ + 844, + 873 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 35, + "column": 0 + }, + "end": { + "line": 35, + "column": 28 + } + }, + "range": [ + 844, + 872 + ], + "operator": "=", + "left": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 35, + "column": 0 + }, + "end": { + "line": 35, + "column": 17 + } + }, + "range": [ + 844, + 861 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 35, + "column": 0 + }, + "end": { + "line": 35, + "column": 8 + } + }, + "range": [ + 844, + 852 + ], + "name": "instance" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 35, + "column": 9 + }, + "end": { + "line": 35, + "column": 17 + } + }, + "range": [ + 853, + 861 + ], + "name": "accessor" + }, + "computed": false, + "optional": false + }, + "right": { + "type": "Literal", + "loc": { + "start": { + "line": 35, + "column": 20 + }, + "end": { + "line": 35, + "column": 28 + } + }, + "range": [ + 864, + 872 + ], + "value": "setter", + "raw": "'setter'" + } + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 36, + "column": 0 + }, + "end": { + "line": 36, + "column": 40 + } + }, + "range": [ + 874, + 914 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 36, + "column": 0 + }, + "end": { + "line": 36, + "column": 39 + } + }, + "range": [ + 874, + 913 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 36, + "column": 0 + }, + "end": { + "line": 36, + "column": 37 + } + }, + "range": [ + 874, + 911 + ], + "object": { + "type": "CallExpression", + "loc": { + "start": { + "line": 36, + "column": 0 + }, + "end": { + "line": 36, + "column": 32 + } + }, + "range": [ + 874, + 906 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 36, + "column": 0 + }, + "end": { + "line": 36, + "column": 12 + } + }, + "range": [ + 874, + 886 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 36, + "column": 0 + }, + "end": { + "line": 36, + "column": 8 + } + }, + "range": [ + 874, + 882 + ], + "name": "instance" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 36, + "column": 9 + }, + "end": { + "line": 36, + "column": 12 + } + }, + "range": [ + 883, + 886 + ], + "name": "gen" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 36, + "column": 13 + }, + "end": { + "line": 36, + "column": 31 + } + }, + "range": [ + 887, + 905 + ], + "value": "generator method", + "raw": "'generator method'" + } + ], + "optional": false + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 36, + "column": 33 + }, + "end": { + "line": 36, + "column": 37 + } + }, + "range": [ + 907, + 911 + ], + "name": "next" + }, + "computed": false, + "optional": false + }, + "arguments": [], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 37, + "column": 0 + }, + "end": { + "line": 37, + "column": 31 + } + }, + "range": [ + 915, + 946 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 37, + "column": 0 + }, + "end": { + "line": 37, + "column": 30 + } + }, + "range": [ + 915, + 945 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 37, + "column": 0 + }, + "end": { + "line": 37, + "column": 14 + } + }, + "range": [ + 915, + 929 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 37, + "column": 0 + }, + "end": { + "line": 37, + "column": 8 + } + }, + "range": [ + 915, + 923 + ], + "name": "instance" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 37, + "column": 9 + }, + "end": { + "line": 37, + "column": 14 + } + }, + "range": [ + 924, + 929 + ], + "name": "async" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 37, + "column": 15 + }, + "end": { + "line": 37, + "column": 29 + } + }, + "range": [ + 930, + 944 + ], + "value": "async method", + "raw": "'async method'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 39, + "column": 0 + }, + "end": { + "line": 39, + "column": 49 + } + }, + "range": [ + 948, + 997 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 39, + "column": 0 + }, + "end": { + "line": 39, + "column": 48 + } + }, + "range": [ + 948, + 996 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 39, + "column": 0 + }, + "end": { + "line": 39, + "column": 6 + } + }, + "range": [ + 948, + 954 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 39, + "column": 7 + }, + "end": { + "line": 39, + "column": 39 + } + }, + "range": [ + 955, + 987 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 39, + "column": 7 + }, + "end": { + "line": 39, + "column": 19 + } + }, + "range": [ + 955, + 967 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 39, + "column": 20 + }, + "end": { + "line": 39, + "column": 30 + } + }, + "range": [ + 968, + 978 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 39, + "column": 21 + }, + "end": { + "line": 39, + "column": 29 + } + }, + "range": [ + 969, + 977 + ], + "value": "method", + "raw": "'method'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 39, + "column": 32 + }, + "end": { + "line": 39, + "column": 38 + } + }, + "range": [ + 980, + 986 + ], + "name": "method" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 39, + "column": 41 + }, + "end": { + "line": 39, + "column": 47 + } + }, + "range": [ + 989, + 995 + ], + "value": "body", + "raw": "'body'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 40, + "column": 0 + }, + "end": { + "line": 40, + "column": 59 + } + }, + "range": [ + 998, + 1057 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 40, + "column": 0 + }, + "end": { + "line": 40, + "column": 58 + } + }, + "range": [ + 998, + 1056 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 40, + "column": 0 + }, + "end": { + "line": 40, + "column": 6 + } + }, + "range": [ + 998, + 1004 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 40, + "column": 7 + }, + "end": { + "line": 40, + "column": 44 + } + }, + "range": [ + 1005, + 1042 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 40, + "column": 7 + }, + "end": { + "line": 40, + "column": 19 + } + }, + "range": [ + 1005, + 1017 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 40, + "column": 20 + }, + "end": { + "line": 40, + "column": 30 + } + }, + "range": [ + 1018, + 1028 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 40, + "column": 21 + }, + "end": { + "line": 40, + "column": 29 + } + }, + "range": [ + 1019, + 1027 + ], + "value": "method", + "raw": "'method'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 40, + "column": 32 + }, + "end": { + "line": 40, + "column": 43 + } + }, + "range": [ + 1030, + 1041 + ], + "name": "methodParam" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 40, + "column": 46 + }, + "end": { + "line": 40, + "column": 57 + } + }, + "range": [ + 1044, + 1055 + ], + "value": "parameter", + "raw": "'parameter'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 41, + "column": 0 + }, + "end": { + "line": 41, + "column": 41 + } + }, + "range": [ + 1058, + 1099 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 41, + "column": 0 + }, + "end": { + "line": 41, + "column": 40 + } + }, + "range": [ + 1058, + 1098 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 41, + "column": 0 + }, + "end": { + "line": 41, + "column": 6 + } + }, + "range": [ + 1058, + 1064 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 41, + "column": 7 + }, + "end": { + "line": 41, + "column": 31 + } + }, + "range": [ + 1065, + 1089 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 41, + "column": 7 + }, + "end": { + "line": 41, + "column": 19 + } + }, + "range": [ + 1065, + 1077 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 41, + "column": 20 + }, + "end": { + "line": 41, + "column": 22 + } + }, + "range": [ + 1078, + 1080 + ], + "elements": [] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 41, + "column": 24 + }, + "end": { + "line": 41, + "column": 30 + } + }, + "range": [ + 1082, + 1088 + ], + "name": "getter" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 41, + "column": 33 + }, + "end": { + "line": 41, + "column": 39 + } + }, + "range": [ + 1091, + 1097 + ], + "value": "body", + "raw": "'body'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 42, + "column": 0 + }, + "end": { + "line": 42, + "column": 49 + } + }, + "range": [ + 1100, + 1149 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 42, + "column": 0 + }, + "end": { + "line": 42, + "column": 48 + } + }, + "range": [ + 1100, + 1148 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 42, + "column": 0 + }, + "end": { + "line": 42, + "column": 6 + } + }, + "range": [ + 1100, + 1106 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 42, + "column": 7 + }, + "end": { + "line": 42, + "column": 39 + } + }, + "range": [ + 1107, + 1139 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 42, + "column": 7 + }, + "end": { + "line": 42, + "column": 19 + } + }, + "range": [ + 1107, + 1119 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 42, + "column": 20 + }, + "end": { + "line": 42, + "column": 30 + } + }, + "range": [ + 1120, + 1130 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 42, + "column": 21 + }, + "end": { + "line": 42, + "column": 29 + } + }, + "range": [ + 1121, + 1129 + ], + "value": "setter", + "raw": "'setter'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 42, + "column": 32 + }, + "end": { + "line": 42, + "column": 38 + } + }, + "range": [ + 1132, + 1138 + ], + "name": "setter" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 42, + "column": 41 + }, + "end": { + "line": 42, + "column": 47 + } + }, + "range": [ + 1141, + 1147 + ], + "value": "body", + "raw": "'body'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 43, + "column": 0 + }, + "end": { + "line": 43, + "column": 59 + } + }, + "range": [ + 1150, + 1209 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 43, + "column": 0 + }, + "end": { + "line": 43, + "column": 58 + } + }, + "range": [ + 1150, + 1208 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 43, + "column": 0 + }, + "end": { + "line": 43, + "column": 6 + } + }, + "range": [ + 1150, + 1156 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 43, + "column": 7 + }, + "end": { + "line": 43, + "column": 44 + } + }, + "range": [ + 1157, + 1194 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 43, + "column": 7 + }, + "end": { + "line": 43, + "column": 19 + } + }, + "range": [ + 1157, + 1169 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 43, + "column": 20 + }, + "end": { + "line": 43, + "column": 30 + } + }, + "range": [ + 1170, + 1180 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 43, + "column": 21 + }, + "end": { + "line": 43, + "column": 29 + } + }, + "range": [ + 1171, + 1179 + ], + "value": "setter", + "raw": "'setter'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 43, + "column": 32 + }, + "end": { + "line": 43, + "column": 43 + } + }, + "range": [ + 1182, + 1193 + ], + "name": "setterParam" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 43, + "column": 46 + }, + "end": { + "line": 43, + "column": 57 + } + }, + "range": [ + 1196, + 1207 + ], + "value": "parameter", + "raw": "'parameter'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 44, + "column": 0 + }, + "end": { + "line": 44, + "column": 62 + } + }, + "range": [ + 1210, + 1272 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 44, + "column": 0 + }, + "end": { + "line": 44, + "column": 61 + } + }, + "range": [ + 1210, + 1271 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 44, + "column": 0 + }, + "end": { + "line": 44, + "column": 6 + } + }, + "range": [ + 1210, + 1216 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 44, + "column": 7 + }, + "end": { + "line": 44, + "column": 52 + } + }, + "range": [ + 1217, + 1262 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 44, + "column": 7 + }, + "end": { + "line": 44, + "column": 19 + } + }, + "range": [ + 1217, + 1229 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 44, + "column": 20 + }, + "end": { + "line": 44, + "column": 40 + } + }, + "range": [ + 1230, + 1250 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 44, + "column": 21 + }, + "end": { + "line": 44, + "column": 39 + } + }, + "range": [ + 1231, + 1249 + ], + "value": "generator method", + "raw": "'generator method'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 44, + "column": 42 + }, + "end": { + "line": 44, + "column": 51 + } + }, + "range": [ + 1252, + 1261 + ], + "name": "genMethod" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 44, + "column": 54 + }, + "end": { + "line": 44, + "column": 60 + } + }, + "range": [ + 1264, + 1270 + ], + "value": "body", + "raw": "'body'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 45, + "column": 0 + }, + "end": { + "line": 45, + "column": 72 + } + }, + "range": [ + 1273, + 1345 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 45, + "column": 0 + }, + "end": { + "line": 45, + "column": 71 + } + }, + "range": [ + 1273, + 1344 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 45, + "column": 0 + }, + "end": { + "line": 45, + "column": 6 + } + }, + "range": [ + 1273, + 1279 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 45, + "column": 7 + }, + "end": { + "line": 45, + "column": 57 + } + }, + "range": [ + 1280, + 1330 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 45, + "column": 7 + }, + "end": { + "line": 45, + "column": 19 + } + }, + "range": [ + 1280, + 1292 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 45, + "column": 20 + }, + "end": { + "line": 45, + "column": 40 + } + }, + "range": [ + 1293, + 1313 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 45, + "column": 21 + }, + "end": { + "line": 45, + "column": 39 + } + }, + "range": [ + 1294, + 1312 + ], + "value": "generator method", + "raw": "'generator method'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 45, + "column": 42 + }, + "end": { + "line": 45, + "column": 56 + } + }, + "range": [ + 1315, + 1329 + ], + "name": "genMethodParam" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 45, + "column": 59 + }, + "end": { + "line": 45, + "column": 70 + } + }, + "range": [ + 1332, + 1343 + ], + "value": "parameter", + "raw": "'parameter'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 46, + "column": 0 + }, + "end": { + "line": 46, + "column": 60 + } + }, + "range": [ + 1346, + 1406 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 46, + "column": 0 + }, + "end": { + "line": 46, + "column": 59 + } + }, + "range": [ + 1346, + 1405 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 46, + "column": 0 + }, + "end": { + "line": 46, + "column": 6 + } + }, + "range": [ + 1346, + 1352 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 46, + "column": 7 + }, + "end": { + "line": 46, + "column": 50 + } + }, + "range": [ + 1353, + 1396 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 46, + "column": 7 + }, + "end": { + "line": 46, + "column": 19 + } + }, + "range": [ + 1353, + 1365 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 46, + "column": 20 + }, + "end": { + "line": 46, + "column": 36 + } + }, + "range": [ + 1366, + 1382 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 46, + "column": 21 + }, + "end": { + "line": 46, + "column": 35 + } + }, + "range": [ + 1367, + 1381 + ], + "value": "async method", + "raw": "'async method'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 46, + "column": 38 + }, + "end": { + "line": 46, + "column": 49 + } + }, + "range": [ + 1384, + 1395 + ], + "name": "asyncMethod" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 46, + "column": 52 + }, + "end": { + "line": 46, + "column": 58 + } + }, + "range": [ + 1398, + 1404 + ], + "value": "body", + "raw": "'body'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 47, + "column": 0 + }, + "end": { + "line": 47, + "column": 70 + } + }, + "range": [ + 1407, + 1477 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 47, + "column": 0 + }, + "end": { + "line": 47, + "column": 69 + } + }, + "range": [ + 1407, + 1476 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 47, + "column": 0 + }, + "end": { + "line": 47, + "column": 6 + } + }, + "range": [ + 1407, + 1413 + ], + "name": "assert" + }, + "arguments": [ + { + "type": "CallExpression", + "loc": { + "start": { + "line": 47, + "column": 7 + }, + "end": { + "line": 47, + "column": 55 + } + }, + "range": [ + 1414, + 1462 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 47, + "column": 7 + }, + "end": { + "line": 47, + "column": 19 + } + }, + "range": [ + 1414, + 1426 + ], + "name": "compareArray" + }, + "arguments": [ + { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 47, + "column": 20 + }, + "end": { + "line": 47, + "column": 36 + } + }, + "range": [ + 1427, + 1443 + ], + "elements": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 47, + "column": 21 + }, + "end": { + "line": 47, + "column": 35 + } + }, + "range": [ + 1428, + 1442 + ], + "value": "async method", + "raw": "'async method'" + } + ] + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 47, + "column": 38 + }, + "end": { + "line": 47, + "column": 54 + } + }, + "range": [ + 1445, + 1461 + ], + "name": "asyncMethodParam" + } + ], + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 47, + "column": 57 + }, + "end": { + "line": 47, + "column": 68 + } + }, + "range": [ + 1464, + 1475 + ], + "value": "parameter", + "raw": "'parameter'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 155, + 158 + ] + }, + { + "type": "Identifier", + "value": "instance", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 12 + } + }, + "range": [ + 159, + 167 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 167, + 168 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 169, + 172 + ] + }, + { + "type": "Identifier", + "value": "method", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 173, + 179 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 5, + "column": 10 + }, + "end": { + "line": 5, + "column": 11 + } + }, + "range": [ + 179, + 180 + ] + }, + { + "type": "Identifier", + "value": "methodParam", + "loc": { + "start": { + "line": 5, + "column": 12 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "range": [ + 181, + 192 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 23 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "range": [ + 192, + 193 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 194, + 197 + ] + }, + { + "type": "Identifier", + "value": "getter", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 10 + } + }, + "range": [ + 198, + 204 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 10 + }, + "end": { + "line": 6, + "column": 11 + } + }, + "range": [ + 204, + 205 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 206, + 209 + ] + }, + { + "type": "Identifier", + "value": "setter", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 10 + } + }, + "range": [ + 210, + 216 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 7, + "column": 10 + }, + "end": { + "line": 7, + "column": 11 + } + }, + "range": [ + 216, + 217 + ] + }, + { + "type": "Identifier", + "value": "setterParam", + "loc": { + "start": { + "line": 7, + "column": 12 + }, + "end": { + "line": 7, + "column": 23 + } + }, + "range": [ + 218, + 229 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 7, + "column": 23 + }, + "end": { + "line": 7, + "column": 24 + } + }, + "range": [ + 229, + 230 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 3 + } + }, + "range": [ + 231, + 234 + ] + }, + { + "type": "Identifier", + "value": "genMethod", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 13 + } + }, + "range": [ + 235, + 244 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 8, + "column": 13 + }, + "end": { + "line": 8, + "column": 14 + } + }, + "range": [ + 244, + 245 + ] + }, + { + "type": "Identifier", + "value": "genMethodParam", + "loc": { + "start": { + "line": 8, + "column": 15 + }, + "end": { + "line": 8, + "column": 29 + } + }, + "range": [ + 246, + 260 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 8, + "column": 29 + }, + "end": { + "line": 8, + "column": 30 + } + }, + "range": [ + 260, + 261 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 9, + "column": 0 + }, + "end": { + "line": 9, + "column": 3 + } + }, + "range": [ + 262, + 265 + ] + }, + { + "type": "Identifier", + "value": "asyncMethod", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 15 + } + }, + "range": [ + 266, + 277 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 9, + "column": 15 + }, + "end": { + "line": 9, + "column": 16 + } + }, + "range": [ + 277, + 278 + ] + }, + { + "type": "Identifier", + "value": "asyncMethodParam", + "loc": { + "start": { + "line": 9, + "column": 17 + }, + "end": { + "line": 9, + "column": 33 + } + }, + "range": [ + 279, + 295 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 9, + "column": 33 + }, + "end": { + "line": 9, + "column": 34 + } + }, + "range": [ + 295, + 296 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 5 + } + }, + "range": [ + 298, + 303 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 7 + } + }, + "range": [ + 304, + 305 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 11, + "column": 8 + }, + "end": { + "line": 11, + "column": 9 + } + }, + "range": [ + 306, + 307 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 12, + "column": 2 + }, + "end": { + "line": 12, + "column": 8 + } + }, + "range": [ + 310, + 316 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 12, + "column": 10 + } + }, + "range": [ + 317, + 318 + ] + }, + { + "type": "Identifier", + "value": "instance", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 12 + } + }, + "range": [ + 323, + 331 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 13, + "column": 13 + }, + "end": { + "line": 13, + "column": 14 + } + }, + "range": [ + 332, + 333 + ] + }, + { + "type": "Keyword", + "value": "new", + "loc": { + "start": { + "line": 13, + "column": 15 + }, + "end": { + "line": 13, + "column": 18 + } + }, + "range": [ + 334, + 337 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 13, + "column": 19 + }, + "end": { + "line": 13, + "column": 24 + } + }, + "range": [ + 338, + 343 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 13, + "column": 25 + }, + "end": { + "line": 13, + "column": 26 + } + }, + "range": [ + 344, + 345 + ] + }, + { + "type": "Identifier", + "value": "method", + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 12 + } + }, + "range": [ + 352, + 358 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 14, + "column": 12 + }, + "end": { + "line": 14, + "column": 13 + } + }, + "range": [ + 358, + 359 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 14, + "column": 13 + }, + "end": { + "line": 14, + "column": 14 + } + }, + "range": [ + 359, + 360 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 14, + "column": 14 + }, + "end": { + "line": 14, + "column": 21 + } + }, + "range": [ + 360, + 367 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 14, + "column": 22 + }, + "end": { + "line": 14, + "column": 23 + } + }, + "range": [ + 368, + 369 + ] + }, + { + "type": "Identifier", + "value": "methodParam", + "loc": { + "start": { + "line": 14, + "column": 24 + }, + "end": { + "line": 14, + "column": 35 + } + }, + "range": [ + 370, + 381 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 14, + "column": 36 + }, + "end": { + "line": 14, + "column": 37 + } + }, + "range": [ + 382, + 383 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 14, + "column": 38 + }, + "end": { + "line": 14, + "column": 47 + } + }, + "range": [ + 384, + 393 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 14, + "column": 47 + }, + "end": { + "line": 14, + "column": 48 + } + }, + "range": [ + 393, + 394 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 14, + "column": 48 + }, + "end": { + "line": 14, + "column": 49 + } + }, + "range": [ + 394, + 395 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 14, + "column": 50 + }, + "end": { + "line": 14, + "column": 51 + } + }, + "range": [ + 396, + 397 + ] + }, + { + "type": "Identifier", + "value": "method", + "loc": { + "start": { + "line": 15, + "column": 8 + }, + "end": { + "line": 15, + "column": 14 + } + }, + "range": [ + 406, + 412 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 15, + "column": 15 + }, + "end": { + "line": 15, + "column": 16 + } + }, + "range": [ + 413, + 414 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 15, + "column": 17 + }, + "end": { + "line": 15, + "column": 26 + } + }, + "range": [ + 415, + 424 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 15, + "column": 26 + }, + "end": { + "line": 15, + "column": 27 + } + }, + "range": [ + 424, + 425 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 16, + "column": 6 + }, + "end": { + "line": 16, + "column": 7 + } + }, + "range": [ + 432, + 433 + ] + }, + { + "type": "Identifier", + "value": "get", + "loc": { + "start": { + "line": 17, + "column": 6 + }, + "end": { + "line": 17, + "column": 9 + } + }, + "range": [ + 440, + 443 + ] + }, + { + "type": "Identifier", + "value": "accessor", + "loc": { + "start": { + "line": 17, + "column": 10 + }, + "end": { + "line": 17, + "column": 18 + } + }, + "range": [ + 444, + 452 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 17, + "column": 18 + }, + "end": { + "line": 17, + "column": 19 + } + }, + "range": [ + 452, + 453 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 17, + "column": 19 + }, + "end": { + "line": 17, + "column": 20 + } + }, + "range": [ + 453, + 454 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 17, + "column": 21 + }, + "end": { + "line": 17, + "column": 22 + } + }, + "range": [ + 455, + 456 + ] + }, + { + "type": "Identifier", + "value": "getter", + "loc": { + "start": { + "line": 18, + "column": 8 + }, + "end": { + "line": 18, + "column": 14 + } + }, + "range": [ + 465, + 471 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 18, + "column": 15 + }, + "end": { + "line": 18, + "column": 16 + } + }, + "range": [ + 472, + 473 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 26 + } + }, + "range": [ + 474, + 483 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 18, + "column": 26 + }, + "end": { + "line": 18, + "column": 27 + } + }, + "range": [ + 483, + 484 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 19, + "column": 6 + }, + "end": { + "line": 19, + "column": 7 + } + }, + "range": [ + 491, + 492 + ] + }, + { + "type": "Identifier", + "value": "set", + "loc": { + "start": { + "line": 20, + "column": 6 + }, + "end": { + "line": 20, + "column": 9 + } + }, + "range": [ + 499, + 502 + ] + }, + { + "type": "Identifier", + "value": "accessor", + "loc": { + "start": { + "line": 20, + "column": 10 + }, + "end": { + "line": 20, + "column": 18 + } + }, + "range": [ + 503, + 511 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 20, + "column": 18 + }, + "end": { + "line": 20, + "column": 19 + } + }, + "range": [ + 511, + 512 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 20, + "column": 19 + }, + "end": { + "line": 20, + "column": 20 + } + }, + "range": [ + 512, + 513 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 20, + "column": 20 + }, + "end": { + "line": 20, + "column": 27 + } + }, + "range": [ + 513, + 520 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 20, + "column": 28 + }, + "end": { + "line": 20, + "column": 29 + } + }, + "range": [ + 521, + 522 + ] + }, + { + "type": "Identifier", + "value": "setterParam", + "loc": { + "start": { + "line": 20, + "column": 30 + }, + "end": { + "line": 20, + "column": 41 + } + }, + "range": [ + 523, + 534 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 20, + "column": 42 + }, + "end": { + "line": 20, + "column": 43 + } + }, + "range": [ + 535, + 536 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 20, + "column": 44 + }, + "end": { + "line": 20, + "column": 53 + } + }, + "range": [ + 537, + 546 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 20, + "column": 53 + }, + "end": { + "line": 20, + "column": 54 + } + }, + "range": [ + 546, + 547 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 20, + "column": 54 + }, + "end": { + "line": 20, + "column": 55 + } + }, + "range": [ + 547, + 548 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 20, + "column": 56 + }, + "end": { + "line": 20, + "column": 57 + } + }, + "range": [ + 549, + 550 + ] + }, + { + "type": "Identifier", + "value": "setter", + "loc": { + "start": { + "line": 21, + "column": 8 + }, + "end": { + "line": 21, + "column": 14 + } + }, + "range": [ + 559, + 565 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 21, + "column": 15 + }, + "end": { + "line": 21, + "column": 16 + } + }, + "range": [ + 566, + 567 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 21, + "column": 17 + }, + "end": { + "line": 21, + "column": 26 + } + }, + "range": [ + 568, + 577 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 21, + "column": 26 + }, + "end": { + "line": 21, + "column": 27 + } + }, + "range": [ + 577, + 578 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 22, + "column": 6 + }, + "end": { + "line": 22, + "column": 7 + } + }, + "range": [ + 585, + 586 + ] + }, + { + "type": "Punctuator", + "value": "*", + "loc": { + "start": { + "line": 23, + "column": 6 + }, + "end": { + "line": 23, + "column": 7 + } + }, + "range": [ + 593, + 594 + ] + }, + { + "type": "Identifier", + "value": "gen", + "loc": { + "start": { + "line": 23, + "column": 7 + }, + "end": { + "line": 23, + "column": 10 + } + }, + "range": [ + 594, + 597 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 23, + "column": 10 + }, + "end": { + "line": 23, + "column": 11 + } + }, + "range": [ + 597, + 598 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 23, + "column": 11 + }, + "end": { + "line": 23, + "column": 12 + } + }, + "range": [ + 598, + 599 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 23, + "column": 12 + }, + "end": { + "line": 23, + "column": 19 + } + }, + "range": [ + 599, + 606 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 23, + "column": 20 + }, + "end": { + "line": 23, + "column": 21 + } + }, + "range": [ + 607, + 608 + ] + }, + { + "type": "Identifier", + "value": "genMethodParam", + "loc": { + "start": { + "line": 23, + "column": 22 + }, + "end": { + "line": 23, + "column": 36 + } + }, + "range": [ + 609, + 623 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 23, + "column": 37 + }, + "end": { + "line": 23, + "column": 38 + } + }, + "range": [ + 624, + 625 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 23, + "column": 39 + }, + "end": { + "line": 23, + "column": 48 + } + }, + "range": [ + 626, + 635 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 23, + "column": 48 + }, + "end": { + "line": 23, + "column": 49 + } + }, + "range": [ + 635, + 636 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 23, + "column": 49 + }, + "end": { + "line": 23, + "column": 50 + } + }, + "range": [ + 636, + 637 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 23, + "column": 51 + }, + "end": { + "line": 23, + "column": 52 + } + }, + "range": [ + 638, + 639 + ] + }, + { + "type": "Identifier", + "value": "genMethod", + "loc": { + "start": { + "line": 24, + "column": 8 + }, + "end": { + "line": 24, + "column": 17 + } + }, + "range": [ + 648, + 657 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 24, + "column": 18 + }, + "end": { + "line": 24, + "column": 19 + } + }, + "range": [ + 658, + 659 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 24, + "column": 20 + }, + "end": { + "line": 24, + "column": 29 + } + }, + "range": [ + 660, + 669 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 24, + "column": 29 + }, + "end": { + "line": 24, + "column": 30 + } + }, + "range": [ + 669, + 670 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 25, + "column": 6 + }, + "end": { + "line": 25, + "column": 7 + } + }, + "range": [ + 677, + 678 + ] + }, + { + "type": "Identifier", + "value": "async", + "loc": { + "start": { + "line": 26, + "column": 6 + }, + "end": { + "line": 26, + "column": 11 + } + }, + "range": [ + 685, + 690 + ] + }, + { + "type": "Identifier", + "value": "async", + "loc": { + "start": { + "line": 26, + "column": 12 + }, + "end": { + "line": 26, + "column": 17 + } + }, + "range": [ + 691, + 696 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 26, + "column": 17 + }, + "end": { + "line": 26, + "column": 18 + } + }, + "range": [ + 696, + 697 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 26, + "column": 18 + }, + "end": { + "line": 26, + "column": 19 + } + }, + "range": [ + 697, + 698 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 26, + "column": 19 + }, + "end": { + "line": 26, + "column": 26 + } + }, + "range": [ + 698, + 705 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 26, + "column": 27 + }, + "end": { + "line": 26, + "column": 28 + } + }, + "range": [ + 706, + 707 + ] + }, + { + "type": "Identifier", + "value": "asyncMethodParam", + "loc": { + "start": { + "line": 26, + "column": 29 + }, + "end": { + "line": 26, + "column": 45 + } + }, + "range": [ + 708, + 724 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 26, + "column": 46 + }, + "end": { + "line": 26, + "column": 47 + } + }, + "range": [ + 725, + 726 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 26, + "column": 48 + }, + "end": { + "line": 26, + "column": 57 + } + }, + "range": [ + 727, + 736 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 26, + "column": 57 + }, + "end": { + "line": 26, + "column": 58 + } + }, + "range": [ + 736, + 737 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 26, + "column": 58 + }, + "end": { + "line": 26, + "column": 59 + } + }, + "range": [ + 737, + 738 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 26, + "column": 60 + }, + "end": { + "line": 26, + "column": 61 + } + }, + "range": [ + 739, + 740 + ] + }, + { + "type": "Identifier", + "value": "asyncMethod", + "loc": { + "start": { + "line": 27, + "column": 8 + }, + "end": { + "line": 27, + "column": 19 + } + }, + "range": [ + 749, + 760 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 27, + "column": 20 + }, + "end": { + "line": 27, + "column": 21 + } + }, + "range": [ + 761, + 762 + ] + }, + { + "type": "Identifier", + "value": "arguments", + "loc": { + "start": { + "line": 27, + "column": 22 + }, + "end": { + "line": 27, + "column": 31 + } + }, + "range": [ + 763, + 772 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 27, + "column": 31 + }, + "end": { + "line": 27, + "column": 32 + } + }, + "range": [ + 772, + 773 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 28, + "column": 6 + }, + "end": { + "line": 28, + "column": 7 + } + }, + "range": [ + 780, + 781 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 29, + "column": 4 + }, + "end": { + "line": 29, + "column": 5 + } + }, + "range": [ + 786, + 787 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 29, + "column": 5 + }, + "end": { + "line": 29, + "column": 6 + } + }, + "range": [ + 787, + 788 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 29, + "column": 6 + }, + "end": { + "line": 29, + "column": 7 + } + }, + "range": [ + 788, + 789 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 29, + "column": 7 + }, + "end": { + "line": 29, + "column": 8 + } + }, + "range": [ + 789, + 790 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 30, + "column": 2 + }, + "end": { + "line": 30, + "column": 3 + } + }, + "range": [ + 793, + 794 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 31, + "column": 0 + }, + "end": { + "line": 31, + "column": 1 + } + }, + "range": [ + 795, + 796 + ] + }, + { + "type": "Identifier", + "value": "instance", + "loc": { + "start": { + "line": 33, + "column": 0 + }, + "end": { + "line": 33, + "column": 8 + } + }, + "range": [ + 798, + 806 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 33, + "column": 8 + }, + "end": { + "line": 33, + "column": 9 + } + }, + "range": [ + 806, + 807 + ] + }, + { + "type": "Identifier", + "value": "method", + "loc": { + "start": { + "line": 33, + "column": 9 + }, + "end": { + "line": 33, + "column": 15 + } + }, + "range": [ + 807, + 813 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 33, + "column": 15 + }, + "end": { + "line": 33, + "column": 16 + } + }, + "range": [ + 813, + 814 + ] + }, + { + "type": "String", + "value": "'method'", + "loc": { + "start": { + "line": 33, + "column": 16 + }, + "end": { + "line": 33, + "column": 24 + } + }, + "range": [ + 814, + 822 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 33, + "column": 24 + }, + "end": { + "line": 33, + "column": 25 + } + }, + "range": [ + 822, + 823 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 33, + "column": 25 + }, + "end": { + "line": 33, + "column": 26 + } + }, + "range": [ + 823, + 824 + ] + }, + { + "type": "Identifier", + "value": "instance", + "loc": { + "start": { + "line": 34, + "column": 0 + }, + "end": { + "line": 34, + "column": 8 + } + }, + "range": [ + 825, + 833 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 34, + "column": 8 + }, + "end": { + "line": 34, + "column": 9 + } + }, + "range": [ + 833, + 834 + ] + }, + { + "type": "Identifier", + "value": "accessor", + "loc": { + "start": { + "line": 34, + "column": 9 + }, + "end": { + "line": 34, + "column": 17 + } + }, + "range": [ + 834, + 842 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 34, + "column": 17 + }, + "end": { + "line": 34, + "column": 18 + } + }, + "range": [ + 842, + 843 + ] + }, + { + "type": "Identifier", + "value": "instance", + "loc": { + "start": { + "line": 35, + "column": 0 + }, + "end": { + "line": 35, + "column": 8 + } + }, + "range": [ + 844, + 852 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 35, + "column": 8 + }, + "end": { + "line": 35, + "column": 9 + } + }, + "range": [ + 852, + 853 + ] + }, + { + "type": "Identifier", + "value": "accessor", + "loc": { + "start": { + "line": 35, + "column": 9 + }, + "end": { + "line": 35, + "column": 17 + } + }, + "range": [ + 853, + 861 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 35, + "column": 18 + }, + "end": { + "line": 35, + "column": 19 + } + }, + "range": [ + 862, + 863 + ] + }, + { + "type": "String", + "value": "'setter'", + "loc": { + "start": { + "line": 35, + "column": 20 + }, + "end": { + "line": 35, + "column": 28 + } + }, + "range": [ + 864, + 872 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 35, + "column": 28 + }, + "end": { + "line": 35, + "column": 29 + } + }, + "range": [ + 872, + 873 + ] + }, + { + "type": "Identifier", + "value": "instance", + "loc": { + "start": { + "line": 36, + "column": 0 + }, + "end": { + "line": 36, + "column": 8 + } + }, + "range": [ + 874, + 882 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 36, + "column": 8 + }, + "end": { + "line": 36, + "column": 9 + } + }, + "range": [ + 882, + 883 + ] + }, + { + "type": "Identifier", + "value": "gen", + "loc": { + "start": { + "line": 36, + "column": 9 + }, + "end": { + "line": 36, + "column": 12 + } + }, + "range": [ + 883, + 886 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 36, + "column": 12 + }, + "end": { + "line": 36, + "column": 13 + } + }, + "range": [ + 886, + 887 + ] + }, + { + "type": "String", + "value": "'generator method'", + "loc": { + "start": { + "line": 36, + "column": 13 + }, + "end": { + "line": 36, + "column": 31 + } + }, + "range": [ + 887, + 905 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 36, + "column": 31 + }, + "end": { + "line": 36, + "column": 32 + } + }, + "range": [ + 905, + 906 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 36, + "column": 32 + }, + "end": { + "line": 36, + "column": 33 + } + }, + "range": [ + 906, + 907 + ] + }, + { + "type": "Identifier", + "value": "next", + "loc": { + "start": { + "line": 36, + "column": 33 + }, + "end": { + "line": 36, + "column": 37 + } + }, + "range": [ + 907, + 911 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 36, + "column": 37 + }, + "end": { + "line": 36, + "column": 38 + } + }, + "range": [ + 911, + 912 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 36, + "column": 38 + }, + "end": { + "line": 36, + "column": 39 + } + }, + "range": [ + 912, + 913 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 36, + "column": 39 + }, + "end": { + "line": 36, + "column": 40 + } + }, + "range": [ + 913, + 914 + ] + }, + { + "type": "Identifier", + "value": "instance", + "loc": { + "start": { + "line": 37, + "column": 0 + }, + "end": { + "line": 37, + "column": 8 + } + }, + "range": [ + 915, + 923 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 37, + "column": 8 + }, + "end": { + "line": 37, + "column": 9 + } + }, + "range": [ + 923, + 924 + ] + }, + { + "type": "Identifier", + "value": "async", + "loc": { + "start": { + "line": 37, + "column": 9 + }, + "end": { + "line": 37, + "column": 14 + } + }, + "range": [ + 924, + 929 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 37, + "column": 14 + }, + "end": { + "line": 37, + "column": 15 + } + }, + "range": [ + 929, + 930 + ] + }, + { + "type": "String", + "value": "'async method'", + "loc": { + "start": { + "line": 37, + "column": 15 + }, + "end": { + "line": 37, + "column": 29 + } + }, + "range": [ + 930, + 944 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 37, + "column": 29 + }, + "end": { + "line": 37, + "column": 30 + } + }, + "range": [ + 944, + 945 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 37, + "column": 30 + }, + "end": { + "line": 37, + "column": 31 + } + }, + "range": [ + 945, + 946 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 39, + "column": 0 + }, + "end": { + "line": 39, + "column": 6 + } + }, + "range": [ + 948, + 954 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 39, + "column": 6 + }, + "end": { + "line": 39, + "column": 7 + } + }, + "range": [ + 954, + 955 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 39, + "column": 7 + }, + "end": { + "line": 39, + "column": 19 + } + }, + "range": [ + 955, + 967 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 39, + "column": 19 + }, + "end": { + "line": 39, + "column": 20 + } + }, + "range": [ + 967, + 968 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 39, + "column": 20 + }, + "end": { + "line": 39, + "column": 21 + } + }, + "range": [ + 968, + 969 + ] + }, + { + "type": "String", + "value": "'method'", + "loc": { + "start": { + "line": 39, + "column": 21 + }, + "end": { + "line": 39, + "column": 29 + } + }, + "range": [ + 969, + 977 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 39, + "column": 29 + }, + "end": { + "line": 39, + "column": 30 + } + }, + "range": [ + 977, + 978 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 39, + "column": 30 + }, + "end": { + "line": 39, + "column": 31 + } + }, + "range": [ + 978, + 979 + ] + }, + { + "type": "Identifier", + "value": "method", + "loc": { + "start": { + "line": 39, + "column": 32 + }, + "end": { + "line": 39, + "column": 38 + } + }, + "range": [ + 980, + 986 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 39, + "column": 38 + }, + "end": { + "line": 39, + "column": 39 + } + }, + "range": [ + 986, + 987 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 39, + "column": 39 + }, + "end": { + "line": 39, + "column": 40 + } + }, + "range": [ + 987, + 988 + ] + }, + { + "type": "String", + "value": "'body'", + "loc": { + "start": { + "line": 39, + "column": 41 + }, + "end": { + "line": 39, + "column": 47 + } + }, + "range": [ + 989, + 995 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 39, + "column": 47 + }, + "end": { + "line": 39, + "column": 48 + } + }, + "range": [ + 995, + 996 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 39, + "column": 48 + }, + "end": { + "line": 39, + "column": 49 + } + }, + "range": [ + 996, + 997 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 40, + "column": 0 + }, + "end": { + "line": 40, + "column": 6 + } + }, + "range": [ + 998, + 1004 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 40, + "column": 6 + }, + "end": { + "line": 40, + "column": 7 + } + }, + "range": [ + 1004, + 1005 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 40, + "column": 7 + }, + "end": { + "line": 40, + "column": 19 + } + }, + "range": [ + 1005, + 1017 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 40, + "column": 19 + }, + "end": { + "line": 40, + "column": 20 + } + }, + "range": [ + 1017, + 1018 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 40, + "column": 20 + }, + "end": { + "line": 40, + "column": 21 + } + }, + "range": [ + 1018, + 1019 + ] + }, + { + "type": "String", + "value": "'method'", + "loc": { + "start": { + "line": 40, + "column": 21 + }, + "end": { + "line": 40, + "column": 29 + } + }, + "range": [ + 1019, + 1027 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 40, + "column": 29 + }, + "end": { + "line": 40, + "column": 30 + } + }, + "range": [ + 1027, + 1028 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 40, + "column": 30 + }, + "end": { + "line": 40, + "column": 31 + } + }, + "range": [ + 1028, + 1029 + ] + }, + { + "type": "Identifier", + "value": "methodParam", + "loc": { + "start": { + "line": 40, + "column": 32 + }, + "end": { + "line": 40, + "column": 43 + } + }, + "range": [ + 1030, + 1041 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 40, + "column": 43 + }, + "end": { + "line": 40, + "column": 44 + } + }, + "range": [ + 1041, + 1042 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 40, + "column": 44 + }, + "end": { + "line": 40, + "column": 45 + } + }, + "range": [ + 1042, + 1043 + ] + }, + { + "type": "String", + "value": "'parameter'", + "loc": { + "start": { + "line": 40, + "column": 46 + }, + "end": { + "line": 40, + "column": 57 + } + }, + "range": [ + 1044, + 1055 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 40, + "column": 57 + }, + "end": { + "line": 40, + "column": 58 + } + }, + "range": [ + 1055, + 1056 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 40, + "column": 58 + }, + "end": { + "line": 40, + "column": 59 + } + }, + "range": [ + 1056, + 1057 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 41, + "column": 0 + }, + "end": { + "line": 41, + "column": 6 + } + }, + "range": [ + 1058, + 1064 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 41, + "column": 6 + }, + "end": { + "line": 41, + "column": 7 + } + }, + "range": [ + 1064, + 1065 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 41, + "column": 7 + }, + "end": { + "line": 41, + "column": 19 + } + }, + "range": [ + 1065, + 1077 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 41, + "column": 19 + }, + "end": { + "line": 41, + "column": 20 + } + }, + "range": [ + 1077, + 1078 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 41, + "column": 20 + }, + "end": { + "line": 41, + "column": 21 + } + }, + "range": [ + 1078, + 1079 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 41, + "column": 21 + }, + "end": { + "line": 41, + "column": 22 + } + }, + "range": [ + 1079, + 1080 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 41, + "column": 22 + }, + "end": { + "line": 41, + "column": 23 + } + }, + "range": [ + 1080, + 1081 + ] + }, + { + "type": "Identifier", + "value": "getter", + "loc": { + "start": { + "line": 41, + "column": 24 + }, + "end": { + "line": 41, + "column": 30 + } + }, + "range": [ + 1082, + 1088 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 41, + "column": 30 + }, + "end": { + "line": 41, + "column": 31 + } + }, + "range": [ + 1088, + 1089 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 41, + "column": 31 + }, + "end": { + "line": 41, + "column": 32 + } + }, + "range": [ + 1089, + 1090 + ] + }, + { + "type": "String", + "value": "'body'", + "loc": { + "start": { + "line": 41, + "column": 33 + }, + "end": { + "line": 41, + "column": 39 + } + }, + "range": [ + 1091, + 1097 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 41, + "column": 39 + }, + "end": { + "line": 41, + "column": 40 + } + }, + "range": [ + 1097, + 1098 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 41, + "column": 40 + }, + "end": { + "line": 41, + "column": 41 + } + }, + "range": [ + 1098, + 1099 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 42, + "column": 0 + }, + "end": { + "line": 42, + "column": 6 + } + }, + "range": [ + 1100, + 1106 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 42, + "column": 6 + }, + "end": { + "line": 42, + "column": 7 + } + }, + "range": [ + 1106, + 1107 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 42, + "column": 7 + }, + "end": { + "line": 42, + "column": 19 + } + }, + "range": [ + 1107, + 1119 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 42, + "column": 19 + }, + "end": { + "line": 42, + "column": 20 + } + }, + "range": [ + 1119, + 1120 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 42, + "column": 20 + }, + "end": { + "line": 42, + "column": 21 + } + }, + "range": [ + 1120, + 1121 + ] + }, + { + "type": "String", + "value": "'setter'", + "loc": { + "start": { + "line": 42, + "column": 21 + }, + "end": { + "line": 42, + "column": 29 + } + }, + "range": [ + 1121, + 1129 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 42, + "column": 29 + }, + "end": { + "line": 42, + "column": 30 + } + }, + "range": [ + 1129, + 1130 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 42, + "column": 30 + }, + "end": { + "line": 42, + "column": 31 + } + }, + "range": [ + 1130, + 1131 + ] + }, + { + "type": "Identifier", + "value": "setter", + "loc": { + "start": { + "line": 42, + "column": 32 + }, + "end": { + "line": 42, + "column": 38 + } + }, + "range": [ + 1132, + 1138 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 42, + "column": 38 + }, + "end": { + "line": 42, + "column": 39 + } + }, + "range": [ + 1138, + 1139 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 42, + "column": 39 + }, + "end": { + "line": 42, + "column": 40 + } + }, + "range": [ + 1139, + 1140 + ] + }, + { + "type": "String", + "value": "'body'", + "loc": { + "start": { + "line": 42, + "column": 41 + }, + "end": { + "line": 42, + "column": 47 + } + }, + "range": [ + 1141, + 1147 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 42, + "column": 47 + }, + "end": { + "line": 42, + "column": 48 + } + }, + "range": [ + 1147, + 1148 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 42, + "column": 48 + }, + "end": { + "line": 42, + "column": 49 + } + }, + "range": [ + 1148, + 1149 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 43, + "column": 0 + }, + "end": { + "line": 43, + "column": 6 + } + }, + "range": [ + 1150, + 1156 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 43, + "column": 6 + }, + "end": { + "line": 43, + "column": 7 + } + }, + "range": [ + 1156, + 1157 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 43, + "column": 7 + }, + "end": { + "line": 43, + "column": 19 + } + }, + "range": [ + 1157, + 1169 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 43, + "column": 19 + }, + "end": { + "line": 43, + "column": 20 + } + }, + "range": [ + 1169, + 1170 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 43, + "column": 20 + }, + "end": { + "line": 43, + "column": 21 + } + }, + "range": [ + 1170, + 1171 + ] + }, + { + "type": "String", + "value": "'setter'", + "loc": { + "start": { + "line": 43, + "column": 21 + }, + "end": { + "line": 43, + "column": 29 + } + }, + "range": [ + 1171, + 1179 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 43, + "column": 29 + }, + "end": { + "line": 43, + "column": 30 + } + }, + "range": [ + 1179, + 1180 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 43, + "column": 30 + }, + "end": { + "line": 43, + "column": 31 + } + }, + "range": [ + 1180, + 1181 + ] + }, + { + "type": "Identifier", + "value": "setterParam", + "loc": { + "start": { + "line": 43, + "column": 32 + }, + "end": { + "line": 43, + "column": 43 + } + }, + "range": [ + 1182, + 1193 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 43, + "column": 43 + }, + "end": { + "line": 43, + "column": 44 + } + }, + "range": [ + 1193, + 1194 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 43, + "column": 44 + }, + "end": { + "line": 43, + "column": 45 + } + }, + "range": [ + 1194, + 1195 + ] + }, + { + "type": "String", + "value": "'parameter'", + "loc": { + "start": { + "line": 43, + "column": 46 + }, + "end": { + "line": 43, + "column": 57 + } + }, + "range": [ + 1196, + 1207 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 43, + "column": 57 + }, + "end": { + "line": 43, + "column": 58 + } + }, + "range": [ + 1207, + 1208 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 43, + "column": 58 + }, + "end": { + "line": 43, + "column": 59 + } + }, + "range": [ + 1208, + 1209 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 44, + "column": 0 + }, + "end": { + "line": 44, + "column": 6 + } + }, + "range": [ + 1210, + 1216 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 44, + "column": 6 + }, + "end": { + "line": 44, + "column": 7 + } + }, + "range": [ + 1216, + 1217 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 44, + "column": 7 + }, + "end": { + "line": 44, + "column": 19 + } + }, + "range": [ + 1217, + 1229 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 44, + "column": 19 + }, + "end": { + "line": 44, + "column": 20 + } + }, + "range": [ + 1229, + 1230 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 44, + "column": 20 + }, + "end": { + "line": 44, + "column": 21 + } + }, + "range": [ + 1230, + 1231 + ] + }, + { + "type": "String", + "value": "'generator method'", + "loc": { + "start": { + "line": 44, + "column": 21 + }, + "end": { + "line": 44, + "column": 39 + } + }, + "range": [ + 1231, + 1249 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 44, + "column": 39 + }, + "end": { + "line": 44, + "column": 40 + } + }, + "range": [ + 1249, + 1250 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 44, + "column": 40 + }, + "end": { + "line": 44, + "column": 41 + } + }, + "range": [ + 1250, + 1251 + ] + }, + { + "type": "Identifier", + "value": "genMethod", + "loc": { + "start": { + "line": 44, + "column": 42 + }, + "end": { + "line": 44, + "column": 51 + } + }, + "range": [ + 1252, + 1261 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 44, + "column": 51 + }, + "end": { + "line": 44, + "column": 52 + } + }, + "range": [ + 1261, + 1262 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 44, + "column": 52 + }, + "end": { + "line": 44, + "column": 53 + } + }, + "range": [ + 1262, + 1263 + ] + }, + { + "type": "String", + "value": "'body'", + "loc": { + "start": { + "line": 44, + "column": 54 + }, + "end": { + "line": 44, + "column": 60 + } + }, + "range": [ + 1264, + 1270 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 44, + "column": 60 + }, + "end": { + "line": 44, + "column": 61 + } + }, + "range": [ + 1270, + 1271 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 44, + "column": 61 + }, + "end": { + "line": 44, + "column": 62 + } + }, + "range": [ + 1271, + 1272 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 45, + "column": 0 + }, + "end": { + "line": 45, + "column": 6 + } + }, + "range": [ + 1273, + 1279 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 45, + "column": 6 + }, + "end": { + "line": 45, + "column": 7 + } + }, + "range": [ + 1279, + 1280 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 45, + "column": 7 + }, + "end": { + "line": 45, + "column": 19 + } + }, + "range": [ + 1280, + 1292 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 45, + "column": 19 + }, + "end": { + "line": 45, + "column": 20 + } + }, + "range": [ + 1292, + 1293 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 45, + "column": 20 + }, + "end": { + "line": 45, + "column": 21 + } + }, + "range": [ + 1293, + 1294 + ] + }, + { + "type": "String", + "value": "'generator method'", + "loc": { + "start": { + "line": 45, + "column": 21 + }, + "end": { + "line": 45, + "column": 39 + } + }, + "range": [ + 1294, + 1312 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 45, + "column": 39 + }, + "end": { + "line": 45, + "column": 40 + } + }, + "range": [ + 1312, + 1313 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 45, + "column": 40 + }, + "end": { + "line": 45, + "column": 41 + } + }, + "range": [ + 1313, + 1314 + ] + }, + { + "type": "Identifier", + "value": "genMethodParam", + "loc": { + "start": { + "line": 45, + "column": 42 + }, + "end": { + "line": 45, + "column": 56 + } + }, + "range": [ + 1315, + 1329 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 45, + "column": 56 + }, + "end": { + "line": 45, + "column": 57 + } + }, + "range": [ + 1329, + 1330 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 45, + "column": 57 + }, + "end": { + "line": 45, + "column": 58 + } + }, + "range": [ + 1330, + 1331 + ] + }, + { + "type": "String", + "value": "'parameter'", + "loc": { + "start": { + "line": 45, + "column": 59 + }, + "end": { + "line": 45, + "column": 70 + } + }, + "range": [ + 1332, + 1343 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 45, + "column": 70 + }, + "end": { + "line": 45, + "column": 71 + } + }, + "range": [ + 1343, + 1344 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 45, + "column": 71 + }, + "end": { + "line": 45, + "column": 72 + } + }, + "range": [ + 1344, + 1345 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 46, + "column": 0 + }, + "end": { + "line": 46, + "column": 6 + } + }, + "range": [ + 1346, + 1352 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 46, + "column": 6 + }, + "end": { + "line": 46, + "column": 7 + } + }, + "range": [ + 1352, + 1353 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 46, + "column": 7 + }, + "end": { + "line": 46, + "column": 19 + } + }, + "range": [ + 1353, + 1365 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 46, + "column": 19 + }, + "end": { + "line": 46, + "column": 20 + } + }, + "range": [ + 1365, + 1366 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 46, + "column": 20 + }, + "end": { + "line": 46, + "column": 21 + } + }, + "range": [ + 1366, + 1367 + ] + }, + { + "type": "String", + "value": "'async method'", + "loc": { + "start": { + "line": 46, + "column": 21 + }, + "end": { + "line": 46, + "column": 35 + } + }, + "range": [ + 1367, + 1381 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 46, + "column": 35 + }, + "end": { + "line": 46, + "column": 36 + } + }, + "range": [ + 1381, + 1382 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 46, + "column": 36 + }, + "end": { + "line": 46, + "column": 37 + } + }, + "range": [ + 1382, + 1383 + ] + }, + { + "type": "Identifier", + "value": "asyncMethod", + "loc": { + "start": { + "line": 46, + "column": 38 + }, + "end": { + "line": 46, + "column": 49 + } + }, + "range": [ + 1384, + 1395 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 46, + "column": 49 + }, + "end": { + "line": 46, + "column": 50 + } + }, + "range": [ + 1395, + 1396 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 46, + "column": 50 + }, + "end": { + "line": 46, + "column": 51 + } + }, + "range": [ + 1396, + 1397 + ] + }, + { + "type": "String", + "value": "'body'", + "loc": { + "start": { + "line": 46, + "column": 52 + }, + "end": { + "line": 46, + "column": 58 + } + }, + "range": [ + 1398, + 1404 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 46, + "column": 58 + }, + "end": { + "line": 46, + "column": 59 + } + }, + "range": [ + 1404, + 1405 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 46, + "column": 59 + }, + "end": { + "line": 46, + "column": 60 + } + }, + "range": [ + 1405, + 1406 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 47, + "column": 0 + }, + "end": { + "line": 47, + "column": 6 + } + }, + "range": [ + 1407, + 1413 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 47, + "column": 6 + }, + "end": { + "line": 47, + "column": 7 + } + }, + "range": [ + 1413, + 1414 + ] + }, + { + "type": "Identifier", + "value": "compareArray", + "loc": { + "start": { + "line": 47, + "column": 7 + }, + "end": { + "line": 47, + "column": 19 + } + }, + "range": [ + 1414, + 1426 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 47, + "column": 19 + }, + "end": { + "line": 47, + "column": 20 + } + }, + "range": [ + 1426, + 1427 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 47, + "column": 20 + }, + "end": { + "line": 47, + "column": 21 + } + }, + "range": [ + 1427, + 1428 + ] + }, + { + "type": "String", + "value": "'async method'", + "loc": { + "start": { + "line": 47, + "column": 21 + }, + "end": { + "line": 47, + "column": 35 + } + }, + "range": [ + 1428, + 1442 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 47, + "column": 35 + }, + "end": { + "line": 47, + "column": 36 + } + }, + "range": [ + 1442, + 1443 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 47, + "column": 36 + }, + "end": { + "line": 47, + "column": 37 + } + }, + "range": [ + 1443, + 1444 + ] + }, + { + "type": "Identifier", + "value": "asyncMethodParam", + "loc": { + "start": { + "line": 47, + "column": 38 + }, + "end": { + "line": 47, + "column": 54 + } + }, + "range": [ + 1445, + 1461 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 47, + "column": 54 + }, + "end": { + "line": 47, + "column": 55 + } + }, + "range": [ + 1461, + 1462 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 47, + "column": 55 + }, + "end": { + "line": 47, + "column": 56 + } + }, + "range": [ + 1462, + 1463 + ] + }, + { + "type": "String", + "value": "'parameter'", + "loc": { + "start": { + "line": 47, + "column": 57 + }, + "end": { + "line": 47, + "column": 68 + } + }, + "range": [ + 1464, + 1475 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 47, + "column": 68 + }, + "end": { + "line": 47, + "column": 69 + } + }, + "range": [ + 1475, + 1476 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 47, + "column": 69 + }, + "end": { + "line": 47, + "column": 70 + } + }, + "range": [ + 1476, + 1477 + ] + } + ] +}; \ 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..92608630 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-arguments-methods.src.js @@ -0,0 +1,47 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/class/static-init-arguments-methods.js + + +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..2420ff34 --- /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": 188, + "lineNumber": 4, + "column": 11, + "message": "Cannot use await in class static initialization block" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-await-binding-invalid.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-await-binding-invalid.src.js new file mode 100644 index 00000000..522e7499 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-await-binding-invalid.src.js @@ -0,0 +1,6 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/class/static-init-await-binding-invalid.js +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..6473d839 --- /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": 197, + "lineNumber": 6, + "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..79e7096c --- /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": 4, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 157, + 215 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 157, + 215 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 163, + 164 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 165, + 215 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 169, + 213 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 31 + } + }, + "range": [ + 182, + 209 + ], + "expression": { + "type": "ArrowFunctionExpression", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 29 + } + }, + "range": [ + 183, + 207 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 6, + "column": 11 + }, + "end": { + "line": 6, + "column": 29 + } + }, + "range": [ + 189, + 207 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 27 + } + }, + "range": [ + 191, + 205 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 19 + }, + "end": { + "line": 6, + "column": 24 + } + }, + "range": [ + 197, + 202 + ], + "name": "await" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 6, + "column": 25 + }, + "end": { + "line": 6, + "column": 27 + } + }, + "range": [ + 203, + 205 + ], + "body": [] + } + } + ] + } + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 157, + 162 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 163, + 164 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 165, + 166 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 8 + } + }, + "range": [ + 169, + 175 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 176, + 177 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 182, + 183 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 6 + } + }, + "range": [ + 183, + 184 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 184, + 185 + ] + }, + { + "type": "Punctuator", + "value": "=>", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 10 + } + }, + "range": [ + 186, + 188 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 11 + }, + "end": { + "line": 6, + "column": 12 + } + }, + "range": [ + 189, + 190 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 18 + } + }, + "range": [ + 191, + 196 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 6, + "column": 19 + }, + "end": { + "line": 6, + "column": 24 + } + }, + "range": [ + 197, + 202 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 25 + }, + "end": { + "line": 6, + "column": 26 + } + }, + "range": [ + 203, + 204 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 26 + }, + "end": { + "line": 6, + "column": 27 + } + }, + "range": [ + 204, + 205 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 28 + }, + "end": { + "line": 6, + "column": 29 + } + }, + "range": [ + 206, + 207 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 29 + }, + "end": { + "line": 6, + "column": 30 + } + }, + "range": [ + 207, + 208 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 30 + }, + "end": { + "line": 6, + "column": 31 + } + }, + "range": [ + 208, + 209 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 212, + 213 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 214, + 215 + ] + } + ] +}; \ 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..ba11a6ad --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-await-binding-valid.src.js @@ -0,0 +1,8 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/class/static-init-await-binding-valid.js + + +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..c6cc7792 --- /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": 4, + "column": 0 + }, + "end": { + "line": 12, + "column": 35 + } + }, + "range": [ + 153, + 259 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 17 + } + }, + "range": [ + 153, + 170 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 16 + } + }, + "range": [ + 157, + 169 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 157, + 162 + ], + "name": "value" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 16 + } + }, + "range": [ + 165, + 169 + ], + "value": null, + "raw": "null" + } + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 10, + "column": 1 + } + }, + "range": [ + 172, + 222 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 178, + 179 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 10, + "column": 1 + } + }, + "range": [ + 180, + 222 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 9, + "column": 3 + } + }, + "range": [ + 184, + 220 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 23 + } + }, + "range": [ + 197, + 216 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 22 + } + }, + "range": [ + 197, + 215 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 9 + } + }, + "range": [ + 197, + 202 + ], + "name": "value" + }, + "right": { + "type": "MetaProperty", + "loc": { + "start": { + "line": 8, + "column": 12 + }, + "end": { + "line": 8, + "column": 22 + } + }, + "range": [ + 205, + 215 + ], + "meta": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 12 + }, + "end": { + "line": 8, + "column": 15 + } + }, + "range": [ + 205, + 208 + ], + "name": "new" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 16 + }, + "end": { + "line": 8, + "column": 22 + } + }, + "range": [ + 209, + 215 + ], + "name": "target" + } + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 35 + } + }, + "range": [ + 224, + 259 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 34 + } + }, + "range": [ + 224, + 258 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 16 + } + }, + "range": [ + 224, + 240 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 6 + } + }, + "range": [ + 224, + 230 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 16 + } + }, + "range": [ + 231, + 240 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 17 + }, + "end": { + "line": 12, + "column": 22 + } + }, + "range": [ + 241, + 246 + ], + "name": "value" + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 24 + }, + "end": { + "line": 12, + "column": 33 + } + }, + "range": [ + 248, + 257 + ], + "name": "undefined" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 153, + 156 + ] + }, + { + "type": "Identifier", + "value": "value", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 157, + 162 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 4, + "column": 10 + }, + "end": { + "line": 4, + "column": 11 + } + }, + "range": [ + 163, + 164 + ] + }, + { + "type": "Null", + "value": "null", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 16 + } + }, + "range": [ + 165, + 169 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 16 + }, + "end": { + "line": 4, + "column": 17 + } + }, + "range": [ + 169, + 170 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 172, + 177 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 178, + 179 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 9 + } + }, + "range": [ + 180, + 181 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 8 + } + }, + "range": [ + 184, + 190 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 10 + } + }, + "range": [ + 191, + 192 + ] + }, + { + "type": "Identifier", + "value": "value", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 9 + } + }, + "range": [ + 197, + 202 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 11 + } + }, + "range": [ + 203, + 204 + ] + }, + { + "type": "Keyword", + "value": "new", + "loc": { + "start": { + "line": 8, + "column": 12 + }, + "end": { + "line": 8, + "column": 15 + } + }, + "range": [ + 205, + 208 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 8, + "column": 15 + }, + "end": { + "line": 8, + "column": 16 + } + }, + "range": [ + 208, + 209 + ] + }, + { + "type": "Identifier", + "value": "target", + "loc": { + "start": { + "line": 8, + "column": 16 + }, + "end": { + "line": 8, + "column": 22 + } + }, + "range": [ + 209, + 215 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 8, + "column": 22 + }, + "end": { + "line": 8, + "column": 23 + } + }, + "range": [ + 215, + 216 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 9, + "column": 3 + } + }, + "range": [ + 219, + 220 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 10, + "column": 0 + }, + "end": { + "line": 10, + "column": 1 + } + }, + "range": [ + 221, + 222 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 6 + } + }, + "range": [ + 224, + 230 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 12, + "column": 6 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "range": [ + 230, + 231 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 16 + } + }, + "range": [ + 231, + 240 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 12, + "column": 16 + }, + "end": { + "line": 12, + "column": 17 + } + }, + "range": [ + 240, + 241 + ] + }, + { + "type": "Identifier", + "value": "value", + "loc": { + "start": { + "line": 12, + "column": 17 + }, + "end": { + "line": 12, + "column": 22 + } + }, + "range": [ + 241, + 246 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 12, + "column": 22 + }, + "end": { + "line": 12, + "column": 23 + } + }, + "range": [ + 246, + 247 + ] + }, + { + "type": "Identifier", + "value": "undefined", + "loc": { + "start": { + "line": 12, + "column": 24 + }, + "end": { + "line": 12, + "column": 33 + } + }, + "range": [ + 248, + 257 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 12, + "column": 33 + }, + "end": { + "line": 12, + "column": 34 + } + }, + "range": [ + 257, + 258 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 12, + "column": 34 + }, + "end": { + "line": 12, + "column": 35 + } + }, + "range": [ + 258, + 259 + ] + } + ] +}; \ 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..33c19827 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-expr-new-target.src.js @@ -0,0 +1,12 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/class/static-init-expr-new-target.js + + +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..b3d9e011 --- /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": 4, + "column": 0 + }, + "end": { + "line": 12, + "column": 27 + } + }, + "range": [ + 147, + 232 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 147, + 157 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 151, + 156 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 151, + 156 + ], + "name": "value" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 10, + "column": 1 + } + }, + "range": [ + 159, + 203 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 165, + 166 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 10, + "column": 1 + } + }, + "range": [ + 167, + 203 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 9, + "column": 3 + } + }, + "range": [ + 171, + 201 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 17 + } + }, + "range": [ + 184, + 197 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 16 + } + }, + "range": [ + 184, + 196 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 9 + } + }, + "range": [ + 184, + 189 + ], + "name": "value" + }, + "right": { + "type": "ThisExpression", + "loc": { + "start": { + "line": 8, + "column": 12 + }, + "end": { + "line": 8, + "column": 16 + } + }, + "range": [ + 192, + 196 + ] + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 27 + } + }, + "range": [ + 205, + 232 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 26 + } + }, + "range": [ + 205, + 231 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 16 + } + }, + "range": [ + 205, + 221 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 6 + } + }, + "range": [ + 205, + 211 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 16 + } + }, + "range": [ + 212, + 221 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 17 + }, + "end": { + "line": 12, + "column": 22 + } + }, + "range": [ + 222, + 227 + ], + "name": "value" + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 24 + }, + "end": { + "line": 12, + "column": 25 + } + }, + "range": [ + 229, + 230 + ], + "name": "C" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 147, + 150 + ] + }, + { + "type": "Identifier", + "value": "value", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 151, + 156 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 156, + 157 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 159, + 164 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 165, + 166 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 9 + } + }, + "range": [ + 167, + 168 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 8 + } + }, + "range": [ + 171, + 177 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 10 + } + }, + "range": [ + 178, + 179 + ] + }, + { + "type": "Identifier", + "value": "value", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 9 + } + }, + "range": [ + 184, + 189 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 11 + } + }, + "range": [ + 190, + 191 + ] + }, + { + "type": "Keyword", + "value": "this", + "loc": { + "start": { + "line": 8, + "column": 12 + }, + "end": { + "line": 8, + "column": 16 + } + }, + "range": [ + 192, + 196 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 8, + "column": 16 + }, + "end": { + "line": 8, + "column": 17 + } + }, + "range": [ + 196, + 197 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 9, + "column": 3 + } + }, + "range": [ + 200, + 201 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 10, + "column": 0 + }, + "end": { + "line": 10, + "column": 1 + } + }, + "range": [ + 202, + 203 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 6 + } + }, + "range": [ + 205, + 211 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 12, + "column": 6 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "range": [ + 211, + 212 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 16 + } + }, + "range": [ + 212, + 221 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 12, + "column": 16 + }, + "end": { + "line": 12, + "column": 17 + } + }, + "range": [ + 221, + 222 + ] + }, + { + "type": "Identifier", + "value": "value", + "loc": { + "start": { + "line": 12, + "column": 17 + }, + "end": { + "line": 12, + "column": 22 + } + }, + "range": [ + 222, + 227 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 12, + "column": 22 + }, + "end": { + "line": 12, + "column": 23 + } + }, + "range": [ + 227, + 228 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 12, + "column": 24 + }, + "end": { + "line": 12, + "column": 25 + } + }, + "range": [ + 229, + 230 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 12, + "column": 25 + }, + "end": { + "line": 12, + "column": 26 + } + }, + "range": [ + 230, + 231 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 12, + "column": 26 + }, + "end": { + "line": 12, + "column": 27 + } + }, + "range": [ + 231, + 232 + ] + } + ] +}; \ 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..ba4320a5 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-expr-this.src.js @@ -0,0 +1,12 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/class/static-init-expr-this.js + + +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..970ae1bd --- /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": 188, + "lineNumber": 4, + "column": 15, + "message": "Cannot use arguments in class static initialization block" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-arguments.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-arguments.src.js new file mode 100644 index 00000000..e64e0107 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-arguments.src.js @@ -0,0 +1,6 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/class/static-init-invalid-arguments.js +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..a7bff432 --- /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": 201, + "lineNumber": 5, + "column": 7, + "message": "Cannot use await in class static initialization block" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-await.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-await.src.js new file mode 100644 index 00000000..611d249d --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-await.src.js @@ -0,0 +1,8 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/class/static-init-invalid-await.js +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..0674e2bb --- /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": 181, + "lineNumber": 4, + "column": 8, + "message": "Label 'x' is already declared" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-label-dup.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-label-dup.src.js new file mode 100644 index 00000000..b3d547f0 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-label-dup.src.js @@ -0,0 +1,7 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/class/static-init-invalid-label-dup.js +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..13fa87e6 --- /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": 191, + "lineNumber": 5, + "column": 9, + "message": "Identifier 'x' has already been declared" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-lex-dup.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-lex-dup.src.js new file mode 100644 index 00000000..0b9b2804 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-lex-dup.src.js @@ -0,0 +1,7 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/class/static-init-invalid-lex-dup.js +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..13fa87e6 --- /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": 191, + "lineNumber": 5, + "column": 9, + "message": "Identifier 'x' has already been declared" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-lex-var.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-lex-var.src.js new file mode 100644 index 00000000..262cd271 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-lex-var.src.js @@ -0,0 +1,7 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/class/static-init-invalid-lex-var.js +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..85f951a2 --- /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": 196, + "lineNumber": 5, + "column": 7, + "message": "'return' outside of function" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-return.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-return.src.js new file mode 100644 index 00000000..9c5ee123 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-return.src.js @@ -0,0 +1,8 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/class/static-init-invalid-return.js +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..56ded2de --- /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": 179, + "lineNumber": 4, + "column": 5, + "message": "super() call outside constructor of a subclass" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-super-call.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-super-call.src.js new file mode 100644 index 00000000..cca5f9e5 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-super-call.src.js @@ -0,0 +1,6 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/class/static-init-invalid-super-call.js +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..47382cff --- /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": 216, + "lineNumber": 5, + "column": 7, + "message": "Unsyntactic break" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-undefined-break-target.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-undefined-break-target.src.js new file mode 100644 index 00000000..e1e41a92 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-undefined-break-target.src.js @@ -0,0 +1,8 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/class/static-init-invalid-undefined-break-target.js +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..d69f6d85 --- /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": 219, + "lineNumber": 5, + "column": 7, + "message": "Unsyntactic continue" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-undefined-continue-target.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-undefined-continue-target.src.js new file mode 100644 index 00000000..5178d75d --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-undefined-continue-target.src.js @@ -0,0 +1,8 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/class/static-init-invalid-undefined-continue-target.js +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..2037a32b --- /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": 197, + "lineNumber": 5, + "column": 7, + "message": "The keyword 'yield' is reserved" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-yield.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-yield.src.js new file mode 100644 index 00000000..c88869cc --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-invalid-yield.src.js @@ -0,0 +1,8 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/class/static-init-invalid-yield.js +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..6ef7a8d8 --- /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": 4, + "column": 0 + }, + "end": { + "line": 16, + "column": 39 + } + }, + "range": [ + 153, + 330 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 28 + } + }, + "range": [ + 153, + 181 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 27 + } + }, + "range": [ + 157, + 180 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 11 + } + }, + "range": [ + 157, + 164 + ], + "name": "test262" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 4, + "column": 14 + }, + "end": { + "line": 4, + "column": 27 + } + }, + "range": [ + 167, + 180 + ], + "value": "outer scope", + "raw": "'outer scope'" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 182, + 192 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 9 + } + }, + "range": [ + 186, + 191 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 9 + } + }, + "range": [ + 186, + 191 + ], + "name": "probe" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 14, + "column": 1 + } + }, + "range": [ + 194, + 289 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 7 + } + }, + "range": [ + 200, + 201 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 14, + "column": 1 + } + }, + "range": [ + 202, + 289 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 10, + "column": 3 + } + }, + "range": [ + 206, + 251 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 32 + } + }, + "range": [ + 219, + 247 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 31 + } + }, + "range": [ + 223, + 246 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + }, + "range": [ + 223, + 230 + ], + "name": "test262" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 31 + } + }, + "range": [ + 233, + 246 + ], + "value": "first block", + "raw": "'first block'" + } + } + ], + "kind": "let" + } + ] + }, + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 13, + "column": 3 + } + }, + "range": [ + 254, + 287 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 12, + "column": 4 + }, + "end": { + "line": 12, + "column": 20 + } + }, + "range": [ + 267, + 283 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 12, + "column": 4 + }, + "end": { + "line": 12, + "column": 19 + } + }, + "range": [ + 267, + 282 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 4 + }, + "end": { + "line": 12, + "column": 9 + } + }, + "range": [ + 267, + 272 + ], + "name": "probe" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 12 + }, + "end": { + "line": 12, + "column": 19 + } + }, + "range": [ + 275, + 282 + ], + "name": "test262" + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 39 + } + }, + "range": [ + 291, + 330 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 38 + } + }, + "range": [ + 291, + 329 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 291, + 307 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 6 + } + }, + "range": [ + 291, + 297 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 7 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 298, + 307 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 17 + }, + "end": { + "line": 16, + "column": 22 + } + }, + "range": [ + 308, + 313 + ], + "name": "probe" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 16, + "column": 24 + }, + "end": { + "line": 16, + "column": 37 + } + }, + "range": [ + 315, + 328 + ], + "value": "outer scope", + "raw": "'outer scope'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 153, + 156 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 11 + } + }, + "range": [ + 157, + 164 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 165, + 166 + ] + }, + { + "type": "String", + "value": "'outer scope'", + "loc": { + "start": { + "line": 4, + "column": 14 + }, + "end": { + "line": 4, + "column": 27 + } + }, + "range": [ + 167, + 180 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 27 + }, + "end": { + "line": 4, + "column": 28 + } + }, + "range": [ + 180, + 181 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 182, + 185 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 9 + } + }, + "range": [ + 186, + 191 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 191, + 192 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "range": [ + 194, + 199 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 7 + } + }, + "range": [ + 200, + 201 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 7, + "column": 9 + } + }, + "range": [ + 202, + 203 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 8 + } + }, + "range": [ + 206, + 212 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 8, + "column": 10 + } + }, + "range": [ + 213, + 214 + ] + }, + { + "type": "Keyword", + "value": "let", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 7 + } + }, + "range": [ + 219, + 222 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + }, + "range": [ + 223, + 230 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 9, + "column": 16 + }, + "end": { + "line": 9, + "column": 17 + } + }, + "range": [ + 231, + 232 + ] + }, + { + "type": "String", + "value": "'first block'", + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 31 + } + }, + "range": [ + 233, + 246 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 9, + "column": 31 + }, + "end": { + "line": 9, + "column": 32 + } + }, + "range": [ + 246, + 247 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 10, + "column": 2 + }, + "end": { + "line": 10, + "column": 3 + } + }, + "range": [ + 250, + 251 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 8 + } + }, + "range": [ + 254, + 260 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 11, + "column": 9 + }, + "end": { + "line": 11, + "column": 10 + } + }, + "range": [ + 261, + 262 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 12, + "column": 4 + }, + "end": { + "line": 12, + "column": 9 + } + }, + "range": [ + 267, + 272 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 12, + "column": 10 + }, + "end": { + "line": 12, + "column": 11 + } + }, + "range": [ + 273, + 274 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 12, + "column": 12 + }, + "end": { + "line": 12, + "column": 19 + } + }, + "range": [ + 275, + 282 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 12, + "column": 19 + }, + "end": { + "line": 12, + "column": 20 + } + }, + "range": [ + 282, + 283 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 13, + "column": 2 + }, + "end": { + "line": 13, + "column": 3 + } + }, + "range": [ + 286, + 287 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 1 + } + }, + "range": [ + 288, + 289 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 6 + } + }, + "range": [ + 291, + 297 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 16, + "column": 6 + }, + "end": { + "line": 16, + "column": 7 + } + }, + "range": [ + 297, + 298 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 16, + "column": 7 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 298, + 307 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 16, + "column": 16 + }, + "end": { + "line": 16, + "column": 17 + } + }, + "range": [ + 307, + 308 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 16, + "column": 17 + }, + "end": { + "line": 16, + "column": 22 + } + }, + "range": [ + 308, + 313 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 16, + "column": 22 + }, + "end": { + "line": 16, + "column": 23 + } + }, + "range": [ + 313, + 314 + ] + }, + { + "type": "String", + "value": "'outer scope'", + "loc": { + "start": { + "line": 16, + "column": 24 + }, + "end": { + "line": 16, + "column": 37 + } + }, + "range": [ + 315, + 328 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 16, + "column": 37 + }, + "end": { + "line": 16, + "column": 38 + } + }, + "range": [ + 328, + 329 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 16, + "column": 38 + }, + "end": { + "line": 16, + "column": 39 + } + }, + "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-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..159ba67d --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-lex-close.src.js @@ -0,0 +1,16 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/class/static-init-scope-lex-close.js + + +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..380fd186 --- /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": 4, + "column": 0 + }, + "end": { + "line": 12, + "column": 27 + } + }, + "range": [ + 155, + 237 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 155, + 165 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 159, + 164 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 159, + 164 + ], + "name": "probe" + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 10, + "column": 1 + } + }, + "range": [ + 167, + 208 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 173, + 174 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 10, + "column": 1 + } + }, + "range": [ + 175, + 208 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 9, + "column": 3 + } + }, + "range": [ + 179, + 206 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 14 + } + }, + "range": [ + 192, + 202 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 13 + } + }, + "range": [ + 192, + 201 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 9 + } + }, + "range": [ + 192, + 197 + ], + "name": "probe" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 12 + }, + "end": { + "line": 8, + "column": 13 + } + }, + "range": [ + 200, + 201 + ], + "name": "C" + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 27 + } + }, + "range": [ + 210, + 237 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 26 + } + }, + "range": [ + 210, + 236 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 16 + } + }, + "range": [ + 210, + 226 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 6 + } + }, + "range": [ + 210, + 216 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 16 + } + }, + "range": [ + 217, + 226 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 17 + }, + "end": { + "line": 12, + "column": 22 + } + }, + "range": [ + 227, + 232 + ], + "name": "probe" + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 24 + }, + "end": { + "line": 12, + "column": 25 + } + }, + "range": [ + 234, + 235 + ], + "name": "C" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "let", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 155, + 158 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 159, + 164 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 164, + 165 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 167, + 172 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 173, + 174 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 9 + } + }, + "range": [ + 175, + 176 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 8 + } + }, + "range": [ + 179, + 185 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 10 + } + }, + "range": [ + 186, + 187 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 9 + } + }, + "range": [ + 192, + 197 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 11 + } + }, + "range": [ + 198, + 199 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 8, + "column": 12 + }, + "end": { + "line": 8, + "column": 13 + } + }, + "range": [ + 200, + 201 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 8, + "column": 13 + }, + "end": { + "line": 8, + "column": 14 + } + }, + "range": [ + 201, + 202 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 9, + "column": 3 + } + }, + "range": [ + 205, + 206 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 10, + "column": 0 + }, + "end": { + "line": 10, + "column": 1 + } + }, + "range": [ + 207, + 208 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 6 + } + }, + "range": [ + 210, + 216 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 12, + "column": 6 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "range": [ + 216, + 217 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 16 + } + }, + "range": [ + 217, + 226 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 12, + "column": 16 + }, + "end": { + "line": 12, + "column": 17 + } + }, + "range": [ + 226, + 227 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 12, + "column": 17 + }, + "end": { + "line": 12, + "column": 22 + } + }, + "range": [ + 227, + 232 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 12, + "column": 22 + }, + "end": { + "line": 12, + "column": 23 + } + }, + "range": [ + 232, + 233 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 12, + "column": 24 + }, + "end": { + "line": 12, + "column": 25 + } + }, + "range": [ + 234, + 235 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 12, + "column": 25 + }, + "end": { + "line": 12, + "column": 26 + } + }, + "range": [ + 235, + 236 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 12, + "column": 26 + }, + "end": { + "line": 12, + "column": 27 + } + }, + "range": [ + 236, + 237 + ] + } + ] +}; \ 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..f6f16c74 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-lex-derived.src.js @@ -0,0 +1,12 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/class/static-init-scope-lex-derived.js + + +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..443dcebe --- /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": 4, + "column": 0 + }, + "end": { + "line": 20, + "column": 41 + } + }, + "range": [ + 152, + 480 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 28 + } + }, + "range": [ + 152, + 180 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 27 + } + }, + "range": [ + 156, + 179 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 11 + } + }, + "range": [ + 156, + 163 + ], + "name": "test262" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 4, + "column": 14 + }, + "end": { + "line": 4, + "column": 27 + } + }, + "range": [ + 166, + 179 + ], + "value": "outer scope", + "raw": "'outer scope'" + } + } + ], + "kind": "let" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 19 + } + }, + "range": [ + 181, + 200 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 185, + 191 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 185, + 191 + ], + "name": "probe1" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 12 + }, + "end": { + "line": 5, + "column": 18 + } + }, + "range": [ + 193, + 199 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 12 + }, + "end": { + "line": 5, + "column": 18 + } + }, + "range": [ + 193, + 199 + ], + "name": "probe2" + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 16, + "column": 1 + } + }, + "range": [ + 202, + 354 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 7 + } + }, + "range": [ + 208, + 209 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 16, + "column": 1 + } + }, + "range": [ + 210, + 354 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 11, + "column": 3 + } + }, + "range": [ + 214, + 281 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 32 + } + }, + "range": [ + 227, + 255 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 31 + } + }, + "range": [ + 231, + 254 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + }, + "range": [ + 231, + 238 + ], + "name": "test262" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 31 + } + }, + "range": [ + 241, + 254 + ], + "value": "first block", + "raw": "'first block'" + } + } + ], + "kind": "let" + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 21 + } + }, + "range": [ + 260, + 277 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 20 + } + }, + "range": [ + 260, + 276 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 10 + } + }, + "range": [ + 260, + 266 + ], + "name": "probe1" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 13 + }, + "end": { + "line": 10, + "column": 20 + } + }, + "range": [ + 269, + 276 + ], + "name": "test262" + } + } + } + ] + }, + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 12, + "column": 2 + }, + "end": { + "line": 15, + "column": 3 + } + }, + "range": [ + 284, + 352 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 33 + } + }, + "range": [ + 297, + 326 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 13, + "column": 8 + }, + "end": { + "line": 13, + "column": 32 + } + }, + "range": [ + 301, + 325 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 8 + }, + "end": { + "line": 13, + "column": 15 + } + }, + "range": [ + 301, + 308 + ], + "name": "test262" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 13, + "column": 18 + }, + "end": { + "line": 13, + "column": 32 + } + }, + "range": [ + 311, + 325 + ], + "value": "second block", + "raw": "'second block'" + } + } + ], + "kind": "let" + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 21 + } + }, + "range": [ + 331, + 348 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 20 + } + }, + "range": [ + 331, + 347 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 10 + } + }, + "range": [ + 331, + 337 + ], + "name": "probe2" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 13 + }, + "end": { + "line": 14, + "column": 20 + } + }, + "range": [ + 340, + 347 + ], + "name": "test262" + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 41 + } + }, + "range": [ + 356, + 397 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 40 + } + }, + "range": [ + 356, + 396 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 16 + } + }, + "range": [ + 356, + 372 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 6 + } + }, + "range": [ + 356, + 362 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 7 + }, + "end": { + "line": 18, + "column": 16 + } + }, + "range": [ + 363, + 372 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 24 + } + }, + "range": [ + 373, + 380 + ], + "name": "test262" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 18, + "column": 26 + }, + "end": { + "line": 18, + "column": 39 + } + }, + "range": [ + 382, + 395 + ], + "value": "outer scope", + "raw": "'outer scope'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 40 + } + }, + "range": [ + 398, + 438 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 39 + } + }, + "range": [ + 398, + 437 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 16 + } + }, + "range": [ + 398, + 414 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 6 + } + }, + "range": [ + 398, + 404 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 19, + "column": 7 + }, + "end": { + "line": 19, + "column": 16 + } + }, + "range": [ + 405, + 414 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 19, + "column": 17 + }, + "end": { + "line": 19, + "column": 23 + } + }, + "range": [ + 415, + 421 + ], + "name": "probe1" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 19, + "column": 25 + }, + "end": { + "line": 19, + "column": 38 + } + }, + "range": [ + 423, + 436 + ], + "value": "first block", + "raw": "'first block'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 20, + "column": 0 + }, + "end": { + "line": 20, + "column": 41 + } + }, + "range": [ + 439, + 480 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 20, + "column": 0 + }, + "end": { + "line": 20, + "column": 40 + } + }, + "range": [ + 439, + 479 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 20, + "column": 0 + }, + "end": { + "line": 20, + "column": 16 + } + }, + "range": [ + 439, + 455 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 20, + "column": 0 + }, + "end": { + "line": 20, + "column": 6 + } + }, + "range": [ + 439, + 445 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 20, + "column": 7 + }, + "end": { + "line": 20, + "column": 16 + } + }, + "range": [ + 446, + 455 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 20, + "column": 17 + }, + "end": { + "line": 20, + "column": 23 + } + }, + "range": [ + 456, + 462 + ], + "name": "probe2" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 20, + "column": 25 + }, + "end": { + "line": 20, + "column": 39 + } + }, + "range": [ + 464, + 478 + ], + "value": "second block", + "raw": "'second block'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "let", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 152, + 155 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 11 + } + }, + "range": [ + 156, + 163 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 164, + 165 + ] + }, + { + "type": "String", + "value": "'outer scope'", + "loc": { + "start": { + "line": 4, + "column": 14 + }, + "end": { + "line": 4, + "column": 27 + } + }, + "range": [ + 166, + 179 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 27 + }, + "end": { + "line": 4, + "column": 28 + } + }, + "range": [ + 179, + 180 + ] + }, + { + "type": "Keyword", + "value": "let", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 181, + 184 + ] + }, + { + "type": "Identifier", + "value": "probe1", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 185, + 191 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 5, + "column": 10 + }, + "end": { + "line": 5, + "column": 11 + } + }, + "range": [ + 191, + 192 + ] + }, + { + "type": "Identifier", + "value": "probe2", + "loc": { + "start": { + "line": 5, + "column": 12 + }, + "end": { + "line": 5, + "column": 18 + } + }, + "range": [ + 193, + 199 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 18 + }, + "end": { + "line": 5, + "column": 19 + } + }, + "range": [ + 199, + 200 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "range": [ + 202, + 207 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 7 + } + }, + "range": [ + 208, + 209 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 7, + "column": 9 + } + }, + "range": [ + 210, + 211 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 8 + } + }, + "range": [ + 214, + 220 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 8, + "column": 10 + } + }, + "range": [ + 221, + 222 + ] + }, + { + "type": "Keyword", + "value": "let", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 7 + } + }, + "range": [ + 227, + 230 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + }, + "range": [ + 231, + 238 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 9, + "column": 16 + }, + "end": { + "line": 9, + "column": 17 + } + }, + "range": [ + 239, + 240 + ] + }, + { + "type": "String", + "value": "'first block'", + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 31 + } + }, + "range": [ + 241, + 254 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 9, + "column": 31 + }, + "end": { + "line": 9, + "column": 32 + } + }, + "range": [ + 254, + 255 + ] + }, + { + "type": "Identifier", + "value": "probe1", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 10 + } + }, + "range": [ + 260, + 266 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 10, + "column": 11 + }, + "end": { + "line": 10, + "column": 12 + } + }, + "range": [ + 267, + 268 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 10, + "column": 13 + }, + "end": { + "line": 10, + "column": 20 + } + }, + "range": [ + 269, + 276 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 10, + "column": 20 + }, + "end": { + "line": 10, + "column": 21 + } + }, + "range": [ + 276, + 277 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 3 + } + }, + "range": [ + 280, + 281 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 12, + "column": 2 + }, + "end": { + "line": 12, + "column": 8 + } + }, + "range": [ + 284, + 290 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 12, + "column": 10 + } + }, + "range": [ + 291, + 292 + ] + }, + { + "type": "Keyword", + "value": "let", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 7 + } + }, + "range": [ + 297, + 300 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 13, + "column": 8 + }, + "end": { + "line": 13, + "column": 15 + } + }, + "range": [ + 301, + 308 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 13, + "column": 16 + }, + "end": { + "line": 13, + "column": 17 + } + }, + "range": [ + 309, + 310 + ] + }, + { + "type": "String", + "value": "'second block'", + "loc": { + "start": { + "line": 13, + "column": 18 + }, + "end": { + "line": 13, + "column": 32 + } + }, + "range": [ + 311, + 325 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 13, + "column": 32 + }, + "end": { + "line": 13, + "column": 33 + } + }, + "range": [ + 325, + 326 + ] + }, + { + "type": "Identifier", + "value": "probe2", + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 10 + } + }, + "range": [ + 331, + 337 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 14, + "column": 11 + }, + "end": { + "line": 14, + "column": 12 + } + }, + "range": [ + 338, + 339 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 14, + "column": 13 + }, + "end": { + "line": 14, + "column": 20 + } + }, + "range": [ + 340, + 347 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 14, + "column": 20 + }, + "end": { + "line": 14, + "column": 21 + } + }, + "range": [ + 347, + 348 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 15, + "column": 2 + }, + "end": { + "line": 15, + "column": 3 + } + }, + "range": [ + 351, + 352 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 1 + } + }, + "range": [ + 353, + 354 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 6 + } + }, + "range": [ + 356, + 362 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 18, + "column": 6 + }, + "end": { + "line": 18, + "column": 7 + } + }, + "range": [ + 362, + 363 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 18, + "column": 7 + }, + "end": { + "line": 18, + "column": 16 + } + }, + "range": [ + 363, + 372 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 18, + "column": 16 + }, + "end": { + "line": 18, + "column": 17 + } + }, + "range": [ + 372, + 373 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 24 + } + }, + "range": [ + 373, + 380 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 18, + "column": 24 + }, + "end": { + "line": 18, + "column": 25 + } + }, + "range": [ + 380, + 381 + ] + }, + { + "type": "String", + "value": "'outer scope'", + "loc": { + "start": { + "line": 18, + "column": 26 + }, + "end": { + "line": 18, + "column": 39 + } + }, + "range": [ + 382, + 395 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 18, + "column": 39 + }, + "end": { + "line": 18, + "column": 40 + } + }, + "range": [ + 395, + 396 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 18, + "column": 40 + }, + "end": { + "line": 18, + "column": 41 + } + }, + "range": [ + 396, + 397 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 6 + } + }, + "range": [ + 398, + 404 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 19, + "column": 6 + }, + "end": { + "line": 19, + "column": 7 + } + }, + "range": [ + 404, + 405 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 19, + "column": 7 + }, + "end": { + "line": 19, + "column": 16 + } + }, + "range": [ + 405, + 414 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 19, + "column": 16 + }, + "end": { + "line": 19, + "column": 17 + } + }, + "range": [ + 414, + 415 + ] + }, + { + "type": "Identifier", + "value": "probe1", + "loc": { + "start": { + "line": 19, + "column": 17 + }, + "end": { + "line": 19, + "column": 23 + } + }, + "range": [ + 415, + 421 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 19, + "column": 23 + }, + "end": { + "line": 19, + "column": 24 + } + }, + "range": [ + 421, + 422 + ] + }, + { + "type": "String", + "value": "'first block'", + "loc": { + "start": { + "line": 19, + "column": 25 + }, + "end": { + "line": 19, + "column": 38 + } + }, + "range": [ + 423, + 436 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 19, + "column": 38 + }, + "end": { + "line": 19, + "column": 39 + } + }, + "range": [ + 436, + 437 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 19, + "column": 39 + }, + "end": { + "line": 19, + "column": 40 + } + }, + "range": [ + 437, + 438 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 20, + "column": 0 + }, + "end": { + "line": 20, + "column": 6 + } + }, + "range": [ + 439, + 445 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 20, + "column": 6 + }, + "end": { + "line": 20, + "column": 7 + } + }, + "range": [ + 445, + 446 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 20, + "column": 7 + }, + "end": { + "line": 20, + "column": 16 + } + }, + "range": [ + 446, + 455 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 20, + "column": 16 + }, + "end": { + "line": 20, + "column": 17 + } + }, + "range": [ + 455, + 456 + ] + }, + { + "type": "Identifier", + "value": "probe2", + "loc": { + "start": { + "line": 20, + "column": 17 + }, + "end": { + "line": 20, + "column": 23 + } + }, + "range": [ + 456, + 462 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 20, + "column": 23 + }, + "end": { + "line": 20, + "column": 24 + } + }, + "range": [ + 462, + 463 + ] + }, + { + "type": "String", + "value": "'second block'", + "loc": { + "start": { + "line": 20, + "column": 25 + }, + "end": { + "line": 20, + "column": 39 + } + }, + "range": [ + 464, + 478 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 20, + "column": 39 + }, + "end": { + "line": 20, + "column": 40 + } + }, + "range": [ + 478, + 479 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 20, + "column": 40 + }, + "end": { + "line": 20, + "column": 41 + } + }, + "range": [ + 479, + 480 + ] + } + ] +}; \ 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..be9bede8 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-lex-open.src.js @@ -0,0 +1,20 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/class/static-init-scope-lex-open.js + + +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..ac282f37 --- /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": 4, + "column": 0 + }, + "end": { + "line": 14, + "column": 35 + } + }, + "range": [ + 151, + 282 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 151, + 161 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 155, + 160 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 155, + 160 + ], + "name": "probe" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 12, + "column": 1 + } + }, + "range": [ + 163, + 245 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 169, + 170 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 12, + "column": 1 + } + }, + "range": [ + 171, + 245 + ], + "body": [ + { + "type": "PropertyDefinition", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 30 + } + }, + "range": [ + 175, + 203 + ], + "static": true, + "computed": false, + "key": { + "type": "PrivateIdentifier", + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 17 + } + }, + "range": [ + 182, + 190 + ], + "name": "test262" + }, + "value": { + "type": "Literal", + "loc": { + "start": { + "line": 7, + "column": 20 + }, + "end": { + "line": 7, + "column": 29 + } + }, + "range": [ + 193, + 202 + ], + "value": "private", + "raw": "'private'" + } + }, + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 11, + "column": 3 + } + }, + "range": [ + 207, + 243 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 23 + } + }, + "range": [ + 220, + 239 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 22 + } + }, + "range": [ + 220, + 238 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 9 + } + }, + "range": [ + 220, + 225 + ], + "name": "probe" + }, + "right": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 10, + "column": 12 + }, + "end": { + "line": 10, + "column": 22 + } + }, + "range": [ + 228, + 238 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 12 + }, + "end": { + "line": 10, + "column": 13 + } + }, + "range": [ + 228, + 229 + ], + "name": "C" + }, + "property": { + "type": "PrivateIdentifier", + "loc": { + "start": { + "line": 10, + "column": 14 + }, + "end": { + "line": 10, + "column": 22 + } + }, + "range": [ + 230, + 238 + ], + "name": "test262" + }, + "computed": false, + "optional": false + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 35 + } + }, + "range": [ + 247, + 282 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 34 + } + }, + "range": [ + 247, + 281 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 16 + } + }, + "range": [ + 247, + 263 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 6 + } + }, + "range": [ + 247, + 253 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 7 + }, + "end": { + "line": 14, + "column": 16 + } + }, + "range": [ + 254, + 263 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 17 + }, + "end": { + "line": 14, + "column": 22 + } + }, + "range": [ + 264, + 269 + ], + "name": "probe" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 14, + "column": 24 + }, + "end": { + "line": 14, + "column": 33 + } + }, + "range": [ + 271, + 280 + ], + "value": "private", + "raw": "'private'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 151, + 154 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 155, + 160 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "range": [ + 160, + 161 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 163, + 168 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 169, + 170 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 9 + } + }, + "range": [ + 171, + 172 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 8 + } + }, + "range": [ + 175, + 181 + ] + }, + { + "type": "PrivateIdentifier", + "value": "test262", + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 17 + } + }, + "range": [ + 182, + 190 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 7, + "column": 18 + }, + "end": { + "line": 7, + "column": 19 + } + }, + "range": [ + 191, + 192 + ] + }, + { + "type": "String", + "value": "'private'", + "loc": { + "start": { + "line": 7, + "column": 20 + }, + "end": { + "line": 7, + "column": 29 + } + }, + "range": [ + 193, + 202 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 7, + "column": 29 + }, + "end": { + "line": 7, + "column": 30 + } + }, + "range": [ + 202, + 203 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 9, + "column": 8 + } + }, + "range": [ + 207, + 213 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 10 + } + }, + "range": [ + 214, + 215 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 9 + } + }, + "range": [ + 220, + 225 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 10, + "column": 10 + }, + "end": { + "line": 10, + "column": 11 + } + }, + "range": [ + 226, + 227 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 10, + "column": 12 + }, + "end": { + "line": 10, + "column": 13 + } + }, + "range": [ + 228, + 229 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 10, + "column": 13 + }, + "end": { + "line": 10, + "column": 14 + } + }, + "range": [ + 229, + 230 + ] + }, + { + "type": "PrivateIdentifier", + "value": "test262", + "loc": { + "start": { + "line": 10, + "column": 14 + }, + "end": { + "line": 10, + "column": 22 + } + }, + "range": [ + 230, + 238 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 10, + "column": 22 + }, + "end": { + "line": 10, + "column": 23 + } + }, + "range": [ + 238, + 239 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 3 + } + }, + "range": [ + 242, + 243 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 1 + } + }, + "range": [ + 244, + 245 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 6 + } + }, + "range": [ + 247, + 253 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 7 + } + }, + "range": [ + 253, + 254 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 14, + "column": 7 + }, + "end": { + "line": 14, + "column": 16 + } + }, + "range": [ + 254, + 263 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 14, + "column": 16 + }, + "end": { + "line": 14, + "column": 17 + } + }, + "range": [ + 263, + 264 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 14, + "column": 17 + }, + "end": { + "line": 14, + "column": 22 + } + }, + "range": [ + 264, + 269 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 14, + "column": 22 + }, + "end": { + "line": 14, + "column": 23 + } + }, + "range": [ + 269, + 270 + ] + }, + { + "type": "String", + "value": "'private'", + "loc": { + "start": { + "line": 14, + "column": 24 + }, + "end": { + "line": 14, + "column": 33 + } + }, + "range": [ + 271, + 280 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 14, + "column": 33 + }, + "end": { + "line": 14, + "column": 34 + } + }, + "range": [ + 280, + 281 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 14, + "column": 34 + }, + "end": { + "line": 14, + "column": 35 + } + }, + "range": [ + 281, + 282 + ] + } + ] +}; \ 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..a9ead93a --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-private.src.js @@ -0,0 +1,14 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/class/static-init-scope-private.js + + +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..b5307383 --- /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": 4, + "column": 0 + }, + "end": { + "line": 16, + "column": 39 + } + }, + "range": [ + 153, + 330 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 28 + } + }, + "range": [ + 153, + 181 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 27 + } + }, + "range": [ + 157, + 180 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 11 + } + }, + "range": [ + 157, + 164 + ], + "name": "test262" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 4, + "column": 14 + }, + "end": { + "line": 4, + "column": 27 + } + }, + "range": [ + 167, + 180 + ], + "value": "outer scope", + "raw": "'outer scope'" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 182, + 192 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 9 + } + }, + "range": [ + 186, + 191 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 9 + } + }, + "range": [ + 186, + 191 + ], + "name": "probe" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 14, + "column": 1 + } + }, + "range": [ + 194, + 289 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 7 + } + }, + "range": [ + 200, + 201 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 14, + "column": 1 + } + }, + "range": [ + 202, + 289 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 10, + "column": 3 + } + }, + "range": [ + 206, + 251 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 32 + } + }, + "range": [ + 219, + 247 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 31 + } + }, + "range": [ + 223, + 246 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + }, + "range": [ + 223, + 230 + ], + "name": "test262" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 31 + } + }, + "range": [ + 233, + 246 + ], + "value": "first block", + "raw": "'first block'" + } + } + ], + "kind": "var" + } + ] + }, + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 13, + "column": 3 + } + }, + "range": [ + 254, + 287 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 12, + "column": 4 + }, + "end": { + "line": 12, + "column": 20 + } + }, + "range": [ + 267, + 283 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 12, + "column": 4 + }, + "end": { + "line": 12, + "column": 19 + } + }, + "range": [ + 267, + 282 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 4 + }, + "end": { + "line": 12, + "column": 9 + } + }, + "range": [ + 267, + 272 + ], + "name": "probe" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 12 + }, + "end": { + "line": 12, + "column": 19 + } + }, + "range": [ + 275, + 282 + ], + "name": "test262" + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 39 + } + }, + "range": [ + 291, + 330 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 38 + } + }, + "range": [ + 291, + 329 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 291, + 307 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 6 + } + }, + "range": [ + 291, + 297 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 7 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 298, + 307 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 16, + "column": 17 + }, + "end": { + "line": 16, + "column": 22 + } + }, + "range": [ + 308, + 313 + ], + "name": "probe" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 16, + "column": 24 + }, + "end": { + "line": 16, + "column": 37 + } + }, + "range": [ + 315, + 328 + ], + "value": "outer scope", + "raw": "'outer scope'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 153, + 156 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 11 + } + }, + "range": [ + 157, + 164 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 165, + 166 + ] + }, + { + "type": "String", + "value": "'outer scope'", + "loc": { + "start": { + "line": 4, + "column": 14 + }, + "end": { + "line": 4, + "column": 27 + } + }, + "range": [ + 167, + 180 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 27 + }, + "end": { + "line": 4, + "column": 28 + } + }, + "range": [ + 180, + 181 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 182, + 185 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 9 + } + }, + "range": [ + 186, + 191 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 191, + 192 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "range": [ + 194, + 199 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 7 + } + }, + "range": [ + 200, + 201 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 7, + "column": 9 + } + }, + "range": [ + 202, + 203 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 8 + } + }, + "range": [ + 206, + 212 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 8, + "column": 10 + } + }, + "range": [ + 213, + 214 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 7 + } + }, + "range": [ + 219, + 222 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + }, + "range": [ + 223, + 230 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 9, + "column": 16 + }, + "end": { + "line": 9, + "column": 17 + } + }, + "range": [ + 231, + 232 + ] + }, + { + "type": "String", + "value": "'first block'", + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 31 + } + }, + "range": [ + 233, + 246 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 9, + "column": 31 + }, + "end": { + "line": 9, + "column": 32 + } + }, + "range": [ + 246, + 247 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 10, + "column": 2 + }, + "end": { + "line": 10, + "column": 3 + } + }, + "range": [ + 250, + 251 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 8 + } + }, + "range": [ + 254, + 260 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 11, + "column": 9 + }, + "end": { + "line": 11, + "column": 10 + } + }, + "range": [ + 261, + 262 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 12, + "column": 4 + }, + "end": { + "line": 12, + "column": 9 + } + }, + "range": [ + 267, + 272 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 12, + "column": 10 + }, + "end": { + "line": 12, + "column": 11 + } + }, + "range": [ + 273, + 274 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 12, + "column": 12 + }, + "end": { + "line": 12, + "column": 19 + } + }, + "range": [ + 275, + 282 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 12, + "column": 19 + }, + "end": { + "line": 12, + "column": 20 + } + }, + "range": [ + 282, + 283 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 13, + "column": 2 + }, + "end": { + "line": 13, + "column": 3 + } + }, + "range": [ + 286, + 287 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 1 + } + }, + "range": [ + 288, + 289 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 6 + } + }, + "range": [ + 291, + 297 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 16, + "column": 6 + }, + "end": { + "line": 16, + "column": 7 + } + }, + "range": [ + 297, + 298 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 16, + "column": 7 + }, + "end": { + "line": 16, + "column": 16 + } + }, + "range": [ + 298, + 307 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 16, + "column": 16 + }, + "end": { + "line": 16, + "column": 17 + } + }, + "range": [ + 307, + 308 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 16, + "column": 17 + }, + "end": { + "line": 16, + "column": 22 + } + }, + "range": [ + 308, + 313 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 16, + "column": 22 + }, + "end": { + "line": 16, + "column": 23 + } + }, + "range": [ + 313, + 314 + ] + }, + { + "type": "String", + "value": "'outer scope'", + "loc": { + "start": { + "line": 16, + "column": 24 + }, + "end": { + "line": 16, + "column": 37 + } + }, + "range": [ + 315, + 328 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 16, + "column": 37 + }, + "end": { + "line": 16, + "column": 38 + } + }, + "range": [ + 328, + 329 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 16, + "column": 38 + }, + "end": { + "line": 16, + "column": 39 + } + }, + "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-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..209fd5ea --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-var-close.src.js @@ -0,0 +1,16 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/class/static-init-scope-var-close.js + + +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..f1329ea5 --- /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": 4, + "column": 0 + }, + "end": { + "line": 13, + "column": 39 + } + }, + "range": [ + 155, + 284 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 28 + } + }, + "range": [ + 155, + 183 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 27 + } + }, + "range": [ + 159, + 182 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 11 + } + }, + "range": [ + 159, + 166 + ], + "name": "test262" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 4, + "column": 14 + }, + "end": { + "line": 4, + "column": 27 + } + }, + "range": [ + 169, + 182 + ], + "value": "outer scope", + "raw": "'outer scope'" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 184, + 194 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 9 + } + }, + "range": [ + 188, + 193 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 9 + } + }, + "range": [ + 188, + 193 + ], + "name": "probe" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 11, + "column": 1 + } + }, + "range": [ + 196, + 243 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 7 + } + }, + "range": [ + 202, + 203 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 11, + "column": 1 + } + }, + "range": [ + 204, + 243 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 10, + "column": 3 + } + }, + "range": [ + 208, + 241 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 20 + } + }, + "range": [ + 221, + 237 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 19 + } + }, + "range": [ + 221, + 236 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 9 + } + }, + "range": [ + 221, + 226 + ], + "name": "probe" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 12 + }, + "end": { + "line": 9, + "column": 19 + } + }, + "range": [ + 229, + 236 + ], + "name": "test262" + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 39 + } + }, + "range": [ + 245, + 284 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 38 + } + }, + "range": [ + 245, + 283 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 16 + } + }, + "range": [ + 245, + 261 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 6 + } + }, + "range": [ + 245, + 251 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 7 + }, + "end": { + "line": 13, + "column": 16 + } + }, + "range": [ + 252, + 261 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 17 + }, + "end": { + "line": 13, + "column": 22 + } + }, + "range": [ + 262, + 267 + ], + "name": "probe" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 13, + "column": 24 + }, + "end": { + "line": 13, + "column": 37 + } + }, + "range": [ + 269, + 282 + ], + "value": "outer scope", + "raw": "'outer scope'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 155, + 158 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 11 + } + }, + "range": [ + 159, + 166 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 167, + 168 + ] + }, + { + "type": "String", + "value": "'outer scope'", + "loc": { + "start": { + "line": 4, + "column": 14 + }, + "end": { + "line": 4, + "column": 27 + } + }, + "range": [ + 169, + 182 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 27 + }, + "end": { + "line": 4, + "column": 28 + } + }, + "range": [ + 182, + 183 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 184, + 187 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 9 + } + }, + "range": [ + 188, + 193 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 193, + 194 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "range": [ + 196, + 201 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 7 + } + }, + "range": [ + 202, + 203 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 7, + "column": 9 + } + }, + "range": [ + 204, + 205 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 8 + } + }, + "range": [ + 208, + 214 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 8, + "column": 10 + } + }, + "range": [ + 215, + 216 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 9 + } + }, + "range": [ + 221, + 226 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 9, + "column": 10 + }, + "end": { + "line": 9, + "column": 11 + } + }, + "range": [ + 227, + 228 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 9, + "column": 12 + }, + "end": { + "line": 9, + "column": 19 + } + }, + "range": [ + 229, + 236 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 9, + "column": 19 + }, + "end": { + "line": 9, + "column": 20 + } + }, + "range": [ + 236, + 237 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 10, + "column": 2 + }, + "end": { + "line": 10, + "column": 3 + } + }, + "range": [ + 240, + 241 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 1 + } + }, + "range": [ + 242, + 243 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 6 + } + }, + "range": [ + 245, + 251 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 13, + "column": 6 + }, + "end": { + "line": 13, + "column": 7 + } + }, + "range": [ + 251, + 252 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 13, + "column": 7 + }, + "end": { + "line": 13, + "column": 16 + } + }, + "range": [ + 252, + 261 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 13, + "column": 16 + }, + "end": { + "line": 13, + "column": 17 + } + }, + "range": [ + 261, + 262 + ] + }, + { + "type": "Identifier", + "value": "probe", + "loc": { + "start": { + "line": 13, + "column": 17 + }, + "end": { + "line": 13, + "column": 22 + } + }, + "range": [ + 262, + 267 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 13, + "column": 22 + }, + "end": { + "line": 13, + "column": 23 + } + }, + "range": [ + 267, + 268 + ] + }, + { + "type": "String", + "value": "'outer scope'", + "loc": { + "start": { + "line": 13, + "column": 24 + }, + "end": { + "line": 13, + "column": 37 + } + }, + "range": [ + 269, + 282 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 13, + "column": 37 + }, + "end": { + "line": 13, + "column": 38 + } + }, + "range": [ + 282, + 283 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 13, + "column": 38 + }, + "end": { + "line": 13, + "column": 39 + } + }, + "range": [ + 283, + 284 + ] + } + ] +}; \ 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..dddd20d4 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-var-derived.src.js @@ -0,0 +1,13 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/class/static-init-scope-var-derived.js + + +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..bc06c0ca --- /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": 4, + "column": 0 + }, + "end": { + "line": 20, + "column": 41 + } + }, + "range": [ + 152, + 480 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 28 + } + }, + "range": [ + 152, + 180 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 27 + } + }, + "range": [ + 156, + 179 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 11 + } + }, + "range": [ + 156, + 163 + ], + "name": "test262" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 4, + "column": 14 + }, + "end": { + "line": 4, + "column": 27 + } + }, + "range": [ + 166, + 179 + ], + "value": "outer scope", + "raw": "'outer scope'" + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 19 + } + }, + "range": [ + 181, + 200 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 185, + 191 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 185, + 191 + ], + "name": "probe1" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 12 + }, + "end": { + "line": 5, + "column": 18 + } + }, + "range": [ + 193, + 199 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 12 + }, + "end": { + "line": 5, + "column": 18 + } + }, + "range": [ + 193, + 199 + ], + "name": "probe2" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 16, + "column": 1 + } + }, + "range": [ + 202, + 354 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 7 + } + }, + "range": [ + 208, + 209 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 16, + "column": 1 + } + }, + "range": [ + 210, + 354 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 11, + "column": 3 + } + }, + "range": [ + 214, + 281 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 32 + } + }, + "range": [ + 227, + 255 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 31 + } + }, + "range": [ + 231, + 254 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + }, + "range": [ + 231, + 238 + ], + "name": "test262" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 31 + } + }, + "range": [ + 241, + 254 + ], + "value": "first block", + "raw": "'first block'" + } + } + ], + "kind": "var" + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 21 + } + }, + "range": [ + 260, + 277 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 20 + } + }, + "range": [ + 260, + 276 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 10 + } + }, + "range": [ + 260, + 266 + ], + "name": "probe1" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 13 + }, + "end": { + "line": 10, + "column": 20 + } + }, + "range": [ + 269, + 276 + ], + "name": "test262" + } + } + } + ] + }, + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 12, + "column": 2 + }, + "end": { + "line": 15, + "column": 3 + } + }, + "range": [ + 284, + 352 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 33 + } + }, + "range": [ + 297, + 326 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 13, + "column": 8 + }, + "end": { + "line": 13, + "column": 32 + } + }, + "range": [ + 301, + 325 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 8 + }, + "end": { + "line": 13, + "column": 15 + } + }, + "range": [ + 301, + 308 + ], + "name": "test262" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 13, + "column": 18 + }, + "end": { + "line": 13, + "column": 32 + } + }, + "range": [ + 311, + 325 + ], + "value": "second block", + "raw": "'second block'" + } + } + ], + "kind": "var" + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 21 + } + }, + "range": [ + 331, + 348 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 20 + } + }, + "range": [ + 331, + 347 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 10 + } + }, + "range": [ + 331, + 337 + ], + "name": "probe2" + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 13 + }, + "end": { + "line": 14, + "column": 20 + } + }, + "range": [ + 340, + 347 + ], + "name": "test262" + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 41 + } + }, + "range": [ + 356, + 397 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 40 + } + }, + "range": [ + 356, + 396 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 16 + } + }, + "range": [ + 356, + 372 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 6 + } + }, + "range": [ + 356, + 362 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 7 + }, + "end": { + "line": 18, + "column": 16 + } + }, + "range": [ + 363, + 372 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 24 + } + }, + "range": [ + 373, + 380 + ], + "name": "test262" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 18, + "column": 26 + }, + "end": { + "line": 18, + "column": 39 + } + }, + "range": [ + 382, + 395 + ], + "value": "outer scope", + "raw": "'outer scope'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 40 + } + }, + "range": [ + 398, + 438 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 39 + } + }, + "range": [ + 398, + 437 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 16 + } + }, + "range": [ + 398, + 414 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 6 + } + }, + "range": [ + 398, + 404 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 19, + "column": 7 + }, + "end": { + "line": 19, + "column": 16 + } + }, + "range": [ + 405, + 414 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 19, + "column": 17 + }, + "end": { + "line": 19, + "column": 23 + } + }, + "range": [ + 415, + 421 + ], + "name": "probe1" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 19, + "column": 25 + }, + "end": { + "line": 19, + "column": 38 + } + }, + "range": [ + 423, + 436 + ], + "value": "first block", + "raw": "'first block'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 20, + "column": 0 + }, + "end": { + "line": 20, + "column": 41 + } + }, + "range": [ + 439, + 480 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 20, + "column": 0 + }, + "end": { + "line": 20, + "column": 40 + } + }, + "range": [ + 439, + 479 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 20, + "column": 0 + }, + "end": { + "line": 20, + "column": 16 + } + }, + "range": [ + 439, + 455 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 20, + "column": 0 + }, + "end": { + "line": 20, + "column": 6 + } + }, + "range": [ + 439, + 445 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 20, + "column": 7 + }, + "end": { + "line": 20, + "column": 16 + } + }, + "range": [ + 446, + 455 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 20, + "column": 17 + }, + "end": { + "line": 20, + "column": 23 + } + }, + "range": [ + 456, + 462 + ], + "name": "probe2" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 20, + "column": 25 + }, + "end": { + "line": 20, + "column": 39 + } + }, + "range": [ + 464, + 478 + ], + "value": "second block", + "raw": "'second block'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 152, + 155 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 11 + } + }, + "range": [ + 156, + 163 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 164, + 165 + ] + }, + { + "type": "String", + "value": "'outer scope'", + "loc": { + "start": { + "line": 4, + "column": 14 + }, + "end": { + "line": 4, + "column": 27 + } + }, + "range": [ + 166, + 179 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 27 + }, + "end": { + "line": 4, + "column": 28 + } + }, + "range": [ + 179, + 180 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 181, + 184 + ] + }, + { + "type": "Identifier", + "value": "probe1", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 185, + 191 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 5, + "column": 10 + }, + "end": { + "line": 5, + "column": 11 + } + }, + "range": [ + 191, + 192 + ] + }, + { + "type": "Identifier", + "value": "probe2", + "loc": { + "start": { + "line": 5, + "column": 12 + }, + "end": { + "line": 5, + "column": 18 + } + }, + "range": [ + 193, + 199 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 18 + }, + "end": { + "line": 5, + "column": 19 + } + }, + "range": [ + 199, + 200 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 5 + } + }, + "range": [ + 202, + 207 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 7 + } + }, + "range": [ + 208, + 209 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 7, + "column": 9 + } + }, + "range": [ + 210, + 211 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 8 + } + }, + "range": [ + 214, + 220 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 8, + "column": 10 + } + }, + "range": [ + 221, + 222 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 7 + } + }, + "range": [ + 227, + 230 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 15 + } + }, + "range": [ + 231, + 238 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 9, + "column": 16 + }, + "end": { + "line": 9, + "column": 17 + } + }, + "range": [ + 239, + 240 + ] + }, + { + "type": "String", + "value": "'first block'", + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 31 + } + }, + "range": [ + 241, + 254 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 9, + "column": 31 + }, + "end": { + "line": 9, + "column": 32 + } + }, + "range": [ + 254, + 255 + ] + }, + { + "type": "Identifier", + "value": "probe1", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 10 + } + }, + "range": [ + 260, + 266 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 10, + "column": 11 + }, + "end": { + "line": 10, + "column": 12 + } + }, + "range": [ + 267, + 268 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 10, + "column": 13 + }, + "end": { + "line": 10, + "column": 20 + } + }, + "range": [ + 269, + 276 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 10, + "column": 20 + }, + "end": { + "line": 10, + "column": 21 + } + }, + "range": [ + 276, + 277 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 3 + } + }, + "range": [ + 280, + 281 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 12, + "column": 2 + }, + "end": { + "line": 12, + "column": 8 + } + }, + "range": [ + 284, + 290 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 12, + "column": 10 + } + }, + "range": [ + 291, + 292 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 7 + } + }, + "range": [ + 297, + 300 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 13, + "column": 8 + }, + "end": { + "line": 13, + "column": 15 + } + }, + "range": [ + 301, + 308 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 13, + "column": 16 + }, + "end": { + "line": 13, + "column": 17 + } + }, + "range": [ + 309, + 310 + ] + }, + { + "type": "String", + "value": "'second block'", + "loc": { + "start": { + "line": 13, + "column": 18 + }, + "end": { + "line": 13, + "column": 32 + } + }, + "range": [ + 311, + 325 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 13, + "column": 32 + }, + "end": { + "line": 13, + "column": 33 + } + }, + "range": [ + 325, + 326 + ] + }, + { + "type": "Identifier", + "value": "probe2", + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 14, + "column": 10 + } + }, + "range": [ + 331, + 337 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 14, + "column": 11 + }, + "end": { + "line": 14, + "column": 12 + } + }, + "range": [ + 338, + 339 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 14, + "column": 13 + }, + "end": { + "line": 14, + "column": 20 + } + }, + "range": [ + 340, + 347 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 14, + "column": 20 + }, + "end": { + "line": 14, + "column": 21 + } + }, + "range": [ + 347, + 348 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 15, + "column": 2 + }, + "end": { + "line": 15, + "column": 3 + } + }, + "range": [ + 351, + 352 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 16, + "column": 0 + }, + "end": { + "line": 16, + "column": 1 + } + }, + "range": [ + 353, + 354 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 6 + } + }, + "range": [ + 356, + 362 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 18, + "column": 6 + }, + "end": { + "line": 18, + "column": 7 + } + }, + "range": [ + 362, + 363 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 18, + "column": 7 + }, + "end": { + "line": 18, + "column": 16 + } + }, + "range": [ + 363, + 372 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 18, + "column": 16 + }, + "end": { + "line": 18, + "column": 17 + } + }, + "range": [ + 372, + 373 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 24 + } + }, + "range": [ + 373, + 380 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 18, + "column": 24 + }, + "end": { + "line": 18, + "column": 25 + } + }, + "range": [ + 380, + 381 + ] + }, + { + "type": "String", + "value": "'outer scope'", + "loc": { + "start": { + "line": 18, + "column": 26 + }, + "end": { + "line": 18, + "column": 39 + } + }, + "range": [ + 382, + 395 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 18, + "column": 39 + }, + "end": { + "line": 18, + "column": 40 + } + }, + "range": [ + 395, + 396 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 18, + "column": 40 + }, + "end": { + "line": 18, + "column": 41 + } + }, + "range": [ + 396, + 397 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 6 + } + }, + "range": [ + 398, + 404 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 19, + "column": 6 + }, + "end": { + "line": 19, + "column": 7 + } + }, + "range": [ + 404, + 405 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 19, + "column": 7 + }, + "end": { + "line": 19, + "column": 16 + } + }, + "range": [ + 405, + 414 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 19, + "column": 16 + }, + "end": { + "line": 19, + "column": 17 + } + }, + "range": [ + 414, + 415 + ] + }, + { + "type": "Identifier", + "value": "probe1", + "loc": { + "start": { + "line": 19, + "column": 17 + }, + "end": { + "line": 19, + "column": 23 + } + }, + "range": [ + 415, + 421 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 19, + "column": 23 + }, + "end": { + "line": 19, + "column": 24 + } + }, + "range": [ + 421, + 422 + ] + }, + { + "type": "String", + "value": "'first block'", + "loc": { + "start": { + "line": 19, + "column": 25 + }, + "end": { + "line": 19, + "column": 38 + } + }, + "range": [ + 423, + 436 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 19, + "column": 38 + }, + "end": { + "line": 19, + "column": 39 + } + }, + "range": [ + 436, + 437 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 19, + "column": 39 + }, + "end": { + "line": 19, + "column": 40 + } + }, + "range": [ + 437, + 438 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 20, + "column": 0 + }, + "end": { + "line": 20, + "column": 6 + } + }, + "range": [ + 439, + 445 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 20, + "column": 6 + }, + "end": { + "line": 20, + "column": 7 + } + }, + "range": [ + 445, + 446 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 20, + "column": 7 + }, + "end": { + "line": 20, + "column": 16 + } + }, + "range": [ + 446, + 455 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 20, + "column": 16 + }, + "end": { + "line": 20, + "column": 17 + } + }, + "range": [ + 455, + 456 + ] + }, + { + "type": "Identifier", + "value": "probe2", + "loc": { + "start": { + "line": 20, + "column": 17 + }, + "end": { + "line": 20, + "column": 23 + } + }, + "range": [ + 456, + 462 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 20, + "column": 23 + }, + "end": { + "line": 20, + "column": 24 + } + }, + "range": [ + 462, + 463 + ] + }, + { + "type": "String", + "value": "'second block'", + "loc": { + "start": { + "line": 20, + "column": 25 + }, + "end": { + "line": 20, + "column": 39 + } + }, + "range": [ + 464, + 478 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 20, + "column": 39 + }, + "end": { + "line": 20, + "column": 40 + } + }, + "range": [ + 478, + 479 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 20, + "column": 40 + }, + "end": { + "line": 20, + "column": 41 + } + }, + "range": [ + 479, + 480 + ] + } + ] +}; \ 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..672b72ec --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-scope-var-open.src.js @@ -0,0 +1,20 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/class/static-init-scope-var-open.js + + +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..cfad1ad5 --- /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": 4, + "column": 0 + }, + "end": { + "line": 20, + "column": 46 + } + }, + "range": [ + 146, + 550 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 18 + } + }, + "range": [ + 146, + 164 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 17 + } + }, + "range": [ + 150, + 163 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 12 + } + }, + "range": [ + 150, + 158 + ], + "name": "sequence" + }, + "init": { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 17 + } + }, + "range": [ + 161, + 163 + ], + "elements": [] + } + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 15, + "column": 1 + } + }, + "range": [ + 166, + 363 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 172, + 173 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 15, + "column": 1 + } + }, + "range": [ + 174, + 363 + ], + "body": [ + { + "type": "PropertyDefinition", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 42 + } + }, + "range": [ + 178, + 218 + ], + "static": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 10 + } + }, + "range": [ + 185, + 186 + ], + "name": "x" + }, + "value": { + "type": "CallExpression", + "loc": { + "start": { + "line": 7, + "column": 13 + }, + "end": { + "line": 7, + "column": 41 + } + }, + "range": [ + 189, + 217 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 7, + "column": 13 + }, + "end": { + "line": 7, + "column": 26 + } + }, + "range": [ + 189, + 202 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 13 + }, + "end": { + "line": 7, + "column": 21 + } + }, + "range": [ + 189, + 197 + ], + "name": "sequence" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 22 + }, + "end": { + "line": 7, + "column": 26 + } + }, + "range": [ + 198, + 202 + ], + "name": "push" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 7, + "column": 27 + }, + "end": { + "line": 7, + "column": 40 + } + }, + "range": [ + 203, + 216 + ], + "value": "first field", + "raw": "'first field'" + } + ], + "optional": false + } + }, + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 10, + "column": 3 + } + }, + "range": [ + 221, + 267 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 33 + } + }, + "range": [ + 234, + 263 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 32 + } + }, + "range": [ + 234, + 262 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 17 + } + }, + "range": [ + 234, + 247 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 12 + } + }, + "range": [ + 234, + 242 + ], + "name": "sequence" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 13 + }, + "end": { + "line": 9, + "column": 17 + } + }, + "range": [ + 243, + 247 + ], + "name": "push" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 31 + } + }, + "range": [ + 248, + 261 + ], + "value": "first block", + "raw": "'first block'" + } + ], + "optional": false + } + } + ] + }, + { + "type": "PropertyDefinition", + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 43 + } + }, + "range": [ + 270, + 311 + ], + "static": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 9 + }, + "end": { + "line": 11, + "column": 10 + } + }, + "range": [ + 277, + 278 + ], + "name": "x" + }, + "value": { + "type": "CallExpression", + "loc": { + "start": { + "line": 11, + "column": 13 + }, + "end": { + "line": 11, + "column": 42 + } + }, + "range": [ + 281, + 310 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 11, + "column": 13 + }, + "end": { + "line": 11, + "column": 26 + } + }, + "range": [ + 281, + 294 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 13 + }, + "end": { + "line": 11, + "column": 21 + } + }, + "range": [ + 281, + 289 + ], + "name": "sequence" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 22 + }, + "end": { + "line": 11, + "column": 26 + } + }, + "range": [ + 290, + 294 + ], + "name": "push" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 11, + "column": 27 + }, + "end": { + "line": 11, + "column": 41 + } + }, + "range": [ + 295, + 309 + ], + "value": "second field", + "raw": "'second field'" + } + ], + "optional": false + } + }, + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 12, + "column": 2 + }, + "end": { + "line": 14, + "column": 3 + } + }, + "range": [ + 314, + 361 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 34 + } + }, + "range": [ + 327, + 357 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 33 + } + }, + "range": [ + 327, + 356 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 17 + } + }, + "range": [ + 327, + 340 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 12 + } + }, + "range": [ + 327, + 335 + ], + "name": "sequence" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 13, + "column": 13 + }, + "end": { + "line": 13, + "column": 17 + } + }, + "range": [ + 336, + 340 + ], + "name": "push" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Literal", + "loc": { + "start": { + "line": 13, + "column": 18 + }, + "end": { + "line": 13, + "column": 32 + } + }, + "range": [ + 341, + 355 + ], + "value": "second block", + "raw": "'second block'" + } + ], + "optional": false + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 45 + } + }, + "range": [ + 365, + 410 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 44 + } + }, + "range": [ + 365, + 409 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 365, + 381 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 6 + } + }, + "range": [ + 365, + 371 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 7 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 372, + 381 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "MemberExpression", + "loc": { + "start": { + "line": 17, + "column": 17 + }, + "end": { + "line": 17, + "column": 28 + } + }, + "range": [ + 382, + 393 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 17, + "column": 17 + }, + "end": { + "line": 17, + "column": 25 + } + }, + "range": [ + 382, + 390 + ], + "name": "sequence" + }, + "property": { + "type": "Literal", + "loc": { + "start": { + "line": 17, + "column": 26 + }, + "end": { + "line": 17, + "column": 27 + } + }, + "range": [ + 391, + 392 + ], + "value": 0, + "raw": "0" + }, + "computed": true, + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 17, + "column": 30 + }, + "end": { + "line": 17, + "column": 43 + } + }, + "range": [ + 395, + 408 + ], + "value": "first field", + "raw": "'first field'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 45 + } + }, + "range": [ + 411, + 456 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 44 + } + }, + "range": [ + 411, + 455 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 16 + } + }, + "range": [ + 411, + 427 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 6 + } + }, + "range": [ + 411, + 417 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 7 + }, + "end": { + "line": 18, + "column": 16 + } + }, + "range": [ + 418, + 427 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "MemberExpression", + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 28 + } + }, + "range": [ + 428, + 439 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 25 + } + }, + "range": [ + 428, + 436 + ], + "name": "sequence" + }, + "property": { + "type": "Literal", + "loc": { + "start": { + "line": 18, + "column": 26 + }, + "end": { + "line": 18, + "column": 27 + } + }, + "range": [ + 437, + 438 + ], + "value": 1, + "raw": "1" + }, + "computed": true, + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 18, + "column": 30 + }, + "end": { + "line": 18, + "column": 43 + } + }, + "range": [ + 441, + 454 + ], + "value": "first block", + "raw": "'first block'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 46 + } + }, + "range": [ + 457, + 503 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 45 + } + }, + "range": [ + 457, + 502 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 16 + } + }, + "range": [ + 457, + 473 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 6 + } + }, + "range": [ + 457, + 463 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 19, + "column": 7 + }, + "end": { + "line": 19, + "column": 16 + } + }, + "range": [ + 464, + 473 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "MemberExpression", + "loc": { + "start": { + "line": 19, + "column": 17 + }, + "end": { + "line": 19, + "column": 28 + } + }, + "range": [ + 474, + 485 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 19, + "column": 17 + }, + "end": { + "line": 19, + "column": 25 + } + }, + "range": [ + 474, + 482 + ], + "name": "sequence" + }, + "property": { + "type": "Literal", + "loc": { + "start": { + "line": 19, + "column": 26 + }, + "end": { + "line": 19, + "column": 27 + } + }, + "range": [ + 483, + 484 + ], + "value": 2, + "raw": "2" + }, + "computed": true, + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 19, + "column": 30 + }, + "end": { + "line": 19, + "column": 44 + } + }, + "range": [ + 487, + 501 + ], + "value": "second field", + "raw": "'second field'" + } + ], + "optional": false + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 20, + "column": 0 + }, + "end": { + "line": 20, + "column": 46 + } + }, + "range": [ + 504, + 550 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 20, + "column": 0 + }, + "end": { + "line": 20, + "column": 45 + } + }, + "range": [ + 504, + 549 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 20, + "column": 0 + }, + "end": { + "line": 20, + "column": 16 + } + }, + "range": [ + 504, + 520 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 20, + "column": 0 + }, + "end": { + "line": 20, + "column": 6 + } + }, + "range": [ + 504, + 510 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 20, + "column": 7 + }, + "end": { + "line": 20, + "column": 16 + } + }, + "range": [ + 511, + 520 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "MemberExpression", + "loc": { + "start": { + "line": 20, + "column": 17 + }, + "end": { + "line": 20, + "column": 28 + } + }, + "range": [ + 521, + 532 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 20, + "column": 17 + }, + "end": { + "line": 20, + "column": 25 + } + }, + "range": [ + 521, + 529 + ], + "name": "sequence" + }, + "property": { + "type": "Literal", + "loc": { + "start": { + "line": 20, + "column": 26 + }, + "end": { + "line": 20, + "column": 27 + } + }, + "range": [ + 530, + 531 + ], + "value": 3, + "raw": "3" + }, + "computed": true, + "optional": false + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 20, + "column": 30 + }, + "end": { + "line": 20, + "column": 44 + } + }, + "range": [ + 534, + 548 + ], + "value": "second block", + "raw": "'second block'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "range": [ + 146, + 149 + ] + }, + { + "type": "Identifier", + "value": "sequence", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 12 + } + }, + "range": [ + 150, + 158 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 14 + } + }, + "range": [ + 159, + 160 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 16 + } + }, + "range": [ + 161, + 162 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 4, + "column": 16 + }, + "end": { + "line": 4, + "column": 17 + } + }, + "range": [ + 162, + 163 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 17 + }, + "end": { + "line": 4, + "column": 18 + } + }, + "range": [ + 163, + 164 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 166, + 171 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 172, + 173 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 9 + } + }, + "range": [ + 174, + 175 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 8 + } + }, + "range": [ + 178, + 184 + ] + }, + { + "type": "Identifier", + "value": "x", + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 10 + } + }, + "range": [ + 185, + 186 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 7, + "column": 11 + }, + "end": { + "line": 7, + "column": 12 + } + }, + "range": [ + 187, + 188 + ] + }, + { + "type": "Identifier", + "value": "sequence", + "loc": { + "start": { + "line": 7, + "column": 13 + }, + "end": { + "line": 7, + "column": 21 + } + }, + "range": [ + 189, + 197 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 7, + "column": 21 + }, + "end": { + "line": 7, + "column": 22 + } + }, + "range": [ + 197, + 198 + ] + }, + { + "type": "Identifier", + "value": "push", + "loc": { + "start": { + "line": 7, + "column": 22 + }, + "end": { + "line": 7, + "column": 26 + } + }, + "range": [ + 198, + 202 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 7, + "column": 26 + }, + "end": { + "line": 7, + "column": 27 + } + }, + "range": [ + 202, + 203 + ] + }, + { + "type": "String", + "value": "'first field'", + "loc": { + "start": { + "line": 7, + "column": 27 + }, + "end": { + "line": 7, + "column": 40 + } + }, + "range": [ + 203, + 216 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 7, + "column": 40 + }, + "end": { + "line": 7, + "column": 41 + } + }, + "range": [ + 216, + 217 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 7, + "column": 41 + }, + "end": { + "line": 7, + "column": 42 + } + }, + "range": [ + 217, + 218 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 8 + } + }, + "range": [ + 221, + 227 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 8, + "column": 10 + } + }, + "range": [ + 228, + 229 + ] + }, + { + "type": "Identifier", + "value": "sequence", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 12 + } + }, + "range": [ + 234, + 242 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 9, + "column": 12 + }, + "end": { + "line": 9, + "column": 13 + } + }, + "range": [ + 242, + 243 + ] + }, + { + "type": "Identifier", + "value": "push", + "loc": { + "start": { + "line": 9, + "column": 13 + }, + "end": { + "line": 9, + "column": 17 + } + }, + "range": [ + 243, + 247 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 9, + "column": 17 + }, + "end": { + "line": 9, + "column": 18 + } + }, + "range": [ + 247, + 248 + ] + }, + { + "type": "String", + "value": "'first block'", + "loc": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 31 + } + }, + "range": [ + 248, + 261 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 9, + "column": 31 + }, + "end": { + "line": 9, + "column": 32 + } + }, + "range": [ + 261, + 262 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 9, + "column": 32 + }, + "end": { + "line": 9, + "column": 33 + } + }, + "range": [ + 262, + 263 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 10, + "column": 2 + }, + "end": { + "line": 10, + "column": 3 + } + }, + "range": [ + 266, + 267 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 8 + } + }, + "range": [ + 270, + 276 + ] + }, + { + "type": "Identifier", + "value": "x", + "loc": { + "start": { + "line": 11, + "column": 9 + }, + "end": { + "line": 11, + "column": 10 + } + }, + "range": [ + 277, + 278 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 11, + "column": 11 + }, + "end": { + "line": 11, + "column": 12 + } + }, + "range": [ + 279, + 280 + ] + }, + { + "type": "Identifier", + "value": "sequence", + "loc": { + "start": { + "line": 11, + "column": 13 + }, + "end": { + "line": 11, + "column": 21 + } + }, + "range": [ + 281, + 289 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 11, + "column": 21 + }, + "end": { + "line": 11, + "column": 22 + } + }, + "range": [ + 289, + 290 + ] + }, + { + "type": "Identifier", + "value": "push", + "loc": { + "start": { + "line": 11, + "column": 22 + }, + "end": { + "line": 11, + "column": 26 + } + }, + "range": [ + 290, + 294 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 11, + "column": 26 + }, + "end": { + "line": 11, + "column": 27 + } + }, + "range": [ + 294, + 295 + ] + }, + { + "type": "String", + "value": "'second field'", + "loc": { + "start": { + "line": 11, + "column": 27 + }, + "end": { + "line": 11, + "column": 41 + } + }, + "range": [ + 295, + 309 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 11, + "column": 41 + }, + "end": { + "line": 11, + "column": 42 + } + }, + "range": [ + 309, + 310 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 11, + "column": 42 + }, + "end": { + "line": 11, + "column": 43 + } + }, + "range": [ + 310, + 311 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 12, + "column": 2 + }, + "end": { + "line": 12, + "column": 8 + } + }, + "range": [ + 314, + 320 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 12, + "column": 10 + } + }, + "range": [ + 321, + 322 + ] + }, + { + "type": "Identifier", + "value": "sequence", + "loc": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 12 + } + }, + "range": [ + 327, + 335 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 13 + } + }, + "range": [ + 335, + 336 + ] + }, + { + "type": "Identifier", + "value": "push", + "loc": { + "start": { + "line": 13, + "column": 13 + }, + "end": { + "line": 13, + "column": 17 + } + }, + "range": [ + 336, + 340 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 13, + "column": 17 + }, + "end": { + "line": 13, + "column": 18 + } + }, + "range": [ + 340, + 341 + ] + }, + { + "type": "String", + "value": "'second block'", + "loc": { + "start": { + "line": 13, + "column": 18 + }, + "end": { + "line": 13, + "column": 32 + } + }, + "range": [ + 341, + 355 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 13, + "column": 32 + }, + "end": { + "line": 13, + "column": 33 + } + }, + "range": [ + 355, + 356 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 13, + "column": 33 + }, + "end": { + "line": 13, + "column": 34 + } + }, + "range": [ + 356, + 357 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 14, + "column": 2 + }, + "end": { + "line": 14, + "column": 3 + } + }, + "range": [ + 360, + 361 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 1 + } + }, + "range": [ + 362, + 363 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 17, + "column": 0 + }, + "end": { + "line": 17, + "column": 6 + } + }, + "range": [ + 365, + 371 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 17, + "column": 6 + }, + "end": { + "line": 17, + "column": 7 + } + }, + "range": [ + 371, + 372 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 17, + "column": 7 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "range": [ + 372, + 381 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 17, + "column": 16 + }, + "end": { + "line": 17, + "column": 17 + } + }, + "range": [ + 381, + 382 + ] + }, + { + "type": "Identifier", + "value": "sequence", + "loc": { + "start": { + "line": 17, + "column": 17 + }, + "end": { + "line": 17, + "column": 25 + } + }, + "range": [ + 382, + 390 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 17, + "column": 25 + }, + "end": { + "line": 17, + "column": 26 + } + }, + "range": [ + 390, + 391 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 17, + "column": 26 + }, + "end": { + "line": 17, + "column": 27 + } + }, + "range": [ + 391, + 392 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 17, + "column": 27 + }, + "end": { + "line": 17, + "column": 28 + } + }, + "range": [ + 392, + 393 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 17, + "column": 28 + }, + "end": { + "line": 17, + "column": 29 + } + }, + "range": [ + 393, + 394 + ] + }, + { + "type": "String", + "value": "'first field'", + "loc": { + "start": { + "line": 17, + "column": 30 + }, + "end": { + "line": 17, + "column": 43 + } + }, + "range": [ + 395, + 408 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 17, + "column": 43 + }, + "end": { + "line": 17, + "column": 44 + } + }, + "range": [ + 408, + 409 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 17, + "column": 44 + }, + "end": { + "line": 17, + "column": 45 + } + }, + "range": [ + 409, + 410 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 18, + "column": 6 + } + }, + "range": [ + 411, + 417 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 18, + "column": 6 + }, + "end": { + "line": 18, + "column": 7 + } + }, + "range": [ + 417, + 418 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 18, + "column": 7 + }, + "end": { + "line": 18, + "column": 16 + } + }, + "range": [ + 418, + 427 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 18, + "column": 16 + }, + "end": { + "line": 18, + "column": 17 + } + }, + "range": [ + 427, + 428 + ] + }, + { + "type": "Identifier", + "value": "sequence", + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 18, + "column": 25 + } + }, + "range": [ + 428, + 436 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 18, + "column": 25 + }, + "end": { + "line": 18, + "column": 26 + } + }, + "range": [ + 436, + 437 + ] + }, + { + "type": "Numeric", + "value": "1", + "loc": { + "start": { + "line": 18, + "column": 26 + }, + "end": { + "line": 18, + "column": 27 + } + }, + "range": [ + 437, + 438 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 18, + "column": 27 + }, + "end": { + "line": 18, + "column": 28 + } + }, + "range": [ + 438, + 439 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 18, + "column": 28 + }, + "end": { + "line": 18, + "column": 29 + } + }, + "range": [ + 439, + 440 + ] + }, + { + "type": "String", + "value": "'first block'", + "loc": { + "start": { + "line": 18, + "column": 30 + }, + "end": { + "line": 18, + "column": 43 + } + }, + "range": [ + 441, + 454 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 18, + "column": 43 + }, + "end": { + "line": 18, + "column": 44 + } + }, + "range": [ + 454, + 455 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 18, + "column": 44 + }, + "end": { + "line": 18, + "column": 45 + } + }, + "range": [ + 455, + 456 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 19, + "column": 0 + }, + "end": { + "line": 19, + "column": 6 + } + }, + "range": [ + 457, + 463 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 19, + "column": 6 + }, + "end": { + "line": 19, + "column": 7 + } + }, + "range": [ + 463, + 464 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 19, + "column": 7 + }, + "end": { + "line": 19, + "column": 16 + } + }, + "range": [ + 464, + 473 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 19, + "column": 16 + }, + "end": { + "line": 19, + "column": 17 + } + }, + "range": [ + 473, + 474 + ] + }, + { + "type": "Identifier", + "value": "sequence", + "loc": { + "start": { + "line": 19, + "column": 17 + }, + "end": { + "line": 19, + "column": 25 + } + }, + "range": [ + 474, + 482 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 19, + "column": 25 + }, + "end": { + "line": 19, + "column": 26 + } + }, + "range": [ + 482, + 483 + ] + }, + { + "type": "Numeric", + "value": "2", + "loc": { + "start": { + "line": 19, + "column": 26 + }, + "end": { + "line": 19, + "column": 27 + } + }, + "range": [ + 483, + 484 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 19, + "column": 27 + }, + "end": { + "line": 19, + "column": 28 + } + }, + "range": [ + 484, + 485 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 19, + "column": 28 + }, + "end": { + "line": 19, + "column": 29 + } + }, + "range": [ + 485, + 486 + ] + }, + { + "type": "String", + "value": "'second field'", + "loc": { + "start": { + "line": 19, + "column": 30 + }, + "end": { + "line": 19, + "column": 44 + } + }, + "range": [ + 487, + 501 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 19, + "column": 44 + }, + "end": { + "line": 19, + "column": 45 + } + }, + "range": [ + 501, + 502 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 19, + "column": 45 + }, + "end": { + "line": 19, + "column": 46 + } + }, + "range": [ + 502, + 503 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 20, + "column": 0 + }, + "end": { + "line": 20, + "column": 6 + } + }, + "range": [ + 504, + 510 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 20, + "column": 6 + }, + "end": { + "line": 20, + "column": 7 + } + }, + "range": [ + 510, + 511 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 20, + "column": 7 + }, + "end": { + "line": 20, + "column": 16 + } + }, + "range": [ + 511, + 520 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 20, + "column": 16 + }, + "end": { + "line": 20, + "column": 17 + } + }, + "range": [ + 520, + 521 + ] + }, + { + "type": "Identifier", + "value": "sequence", + "loc": { + "start": { + "line": 20, + "column": 17 + }, + "end": { + "line": 20, + "column": 25 + } + }, + "range": [ + 521, + 529 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 20, + "column": 25 + }, + "end": { + "line": 20, + "column": 26 + } + }, + "range": [ + 529, + 530 + ] + }, + { + "type": "Numeric", + "value": "3", + "loc": { + "start": { + "line": 20, + "column": 26 + }, + "end": { + "line": 20, + "column": 27 + } + }, + "range": [ + 530, + 531 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 20, + "column": 27 + }, + "end": { + "line": 20, + "column": 28 + } + }, + "range": [ + 531, + 532 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 20, + "column": 28 + }, + "end": { + "line": 20, + "column": 29 + } + }, + "range": [ + 532, + 533 + ] + }, + { + "type": "String", + "value": "'second block'", + "loc": { + "start": { + "line": 20, + "column": 30 + }, + "end": { + "line": 20, + "column": 44 + } + }, + "range": [ + 534, + 548 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 20, + "column": 44 + }, + "end": { + "line": 20, + "column": 45 + } + }, + "range": [ + 548, + 549 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 20, + "column": 45 + }, + "end": { + "line": 20, + "column": 46 + } + }, + "range": [ + 549, + 550 + ] + } + ] +}; \ 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..d7abcd49 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-sequence.src.js @@ -0,0 +1,20 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/class/static-init-sequence.js + + +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..209f5dbb --- /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": 4, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 161, + 184 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 161, + 184 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 167, + 168 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 169, + 184 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 11 + } + }, + "range": [ + 173, + 182 + ], + "body": [] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 161, + 166 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 167, + 168 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 169, + 170 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 8 + } + }, + "range": [ + 173, + 179 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 180, + 181 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 10 + }, + "end": { + "line": 5, + "column": 11 + } + }, + "range": [ + 181, + 182 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "range": [ + 183, + 184 + ] + } + ] +}; \ 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..940e05b3 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-statement-list-optional.src.js @@ -0,0 +1,6 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/class/static-init-statement-list-optional.js + + +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..3a8a3324 --- /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": 4, + "column": 0 + }, + "end": { + "line": 14, + "column": 35 + } + }, + "range": [ + 152, + 318 + ], + "body": [ + { + "type": "FunctionDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 20 + } + }, + "range": [ + 152, + 172 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 15 + } + }, + "range": [ + 161, + 167 + ], + "name": "Parent" + }, + "expression": false, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 4, + "column": 18 + }, + "end": { + "line": 4, + "column": 20 + } + }, + "range": [ + 170, + 172 + ], + "body": [] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 27 + } + }, + "range": [ + 173, + 200 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 26 + } + }, + "range": [ + 173, + 199 + ], + "operator": "=", + "left": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 14 + } + }, + "range": [ + 173, + 187 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 6 + } + }, + "range": [ + 173, + 179 + ], + "name": "Parent" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 7 + }, + "end": { + "line": 5, + "column": 14 + } + }, + "range": [ + 180, + 187 + ], + "name": "test262" + }, + "computed": false, + "optional": false + }, + "right": { + "type": "Literal", + "loc": { + "start": { + "line": 5, + "column": 17 + }, + "end": { + "line": 5, + "column": 26 + } + }, + "range": [ + 190, + 199 + ], + "value": "test262", + "raw": "'test262'" + } + } + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 10 + } + }, + "range": [ + 201, + 211 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 9 + } + }, + "range": [ + 205, + 210 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 9 + } + }, + "range": [ + 205, + 210 + ], + "name": "value" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 12, + "column": 1 + } + }, + "range": [ + 213, + 281 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 6 + }, + "end": { + "line": 8, + "column": 7 + } + }, + "range": [ + 219, + 220 + ], + "name": "C" + }, + "superClass": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 16 + }, + "end": { + "line": 8, + "column": 22 + } + }, + "range": [ + 229, + 235 + ], + "name": "Parent" + }, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 8, + "column": 23 + }, + "end": { + "line": 12, + "column": 1 + } + }, + "range": [ + 236, + 281 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 11, + "column": 3 + } + }, + "range": [ + 240, + 279 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 26 + } + }, + "range": [ + 253, + 275 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 25 + } + }, + "range": [ + 253, + 274 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 9 + } + }, + "range": [ + 253, + 258 + ], + "name": "value" + }, + "right": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 10, + "column": 12 + }, + "end": { + "line": 10, + "column": 25 + } + }, + "range": [ + 261, + 274 + ], + "object": { + "type": "Super", + "loc": { + "start": { + "line": 10, + "column": 12 + }, + "end": { + "line": 10, + "column": 17 + } + }, + "range": [ + 261, + 266 + ] + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 25 + } + }, + "range": [ + 267, + 274 + ], + "name": "test262" + }, + "computed": false, + "optional": false + } + } + } + ] + } + ] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 35 + } + }, + "range": [ + 283, + 318 + ], + "expression": { + "type": "CallExpression", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 34 + } + }, + "range": [ + 283, + 317 + ], + "callee": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 16 + } + }, + "range": [ + 283, + 299 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 6 + } + }, + "range": [ + 283, + 289 + ], + "name": "assert" + }, + "property": { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 7 + }, + "end": { + "line": 14, + "column": 16 + } + }, + "range": [ + 290, + 299 + ], + "name": "sameValue" + }, + "computed": false, + "optional": false + }, + "arguments": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 14, + "column": 17 + }, + "end": { + "line": 14, + "column": 22 + } + }, + "range": [ + 300, + 305 + ], + "name": "value" + }, + { + "type": "Literal", + "loc": { + "start": { + "line": 14, + "column": 24 + }, + "end": { + "line": 14, + "column": 33 + } + }, + "range": [ + 307, + 316 + ], + "value": "test262", + "raw": "'test262'" + } + ], + "optional": false + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "function", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 8 + } + }, + "range": [ + 152, + 160 + ] + }, + { + "type": "Identifier", + "value": "Parent", + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 15 + } + }, + "range": [ + 161, + 167 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 16 + } + }, + "range": [ + 167, + 168 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 16 + }, + "end": { + "line": 4, + "column": 17 + } + }, + "range": [ + 168, + 169 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 18 + }, + "end": { + "line": 4, + "column": 19 + } + }, + "range": [ + 170, + 171 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 4, + "column": 19 + }, + "end": { + "line": 4, + "column": 20 + } + }, + "range": [ + 171, + 172 + ] + }, + { + "type": "Identifier", + "value": "Parent", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 6 + } + }, + "range": [ + 173, + 179 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 7 + } + }, + "range": [ + 179, + 180 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 5, + "column": 7 + }, + "end": { + "line": 5, + "column": 14 + } + }, + "range": [ + 180, + 187 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 16 + } + }, + "range": [ + 188, + 189 + ] + }, + { + "type": "String", + "value": "'test262'", + "loc": { + "start": { + "line": 5, + "column": 17 + }, + "end": { + "line": 5, + "column": 26 + } + }, + "range": [ + 190, + 199 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 5, + "column": 26 + }, + "end": { + "line": 5, + "column": 27 + } + }, + "range": [ + 199, + 200 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "range": [ + 201, + 204 + ] + }, + { + "type": "Identifier", + "value": "value", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 9 + } + }, + "range": [ + 205, + 210 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 9 + }, + "end": { + "line": 6, + "column": 10 + } + }, + "range": [ + 210, + 211 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 5 + } + }, + "range": [ + 213, + 218 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 8, + "column": 6 + }, + "end": { + "line": 8, + "column": 7 + } + }, + "range": [ + 219, + 220 + ] + }, + { + "type": "Keyword", + "value": "extends", + "loc": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 8, + "column": 15 + } + }, + "range": [ + 221, + 228 + ] + }, + { + "type": "Identifier", + "value": "Parent", + "loc": { + "start": { + "line": 8, + "column": 16 + }, + "end": { + "line": 8, + "column": 22 + } + }, + "range": [ + 229, + 235 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 8, + "column": 23 + }, + "end": { + "line": 8, + "column": 24 + } + }, + "range": [ + 236, + 237 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 9, + "column": 8 + } + }, + "range": [ + 240, + 246 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 10 + } + }, + "range": [ + 247, + 248 + ] + }, + { + "type": "Identifier", + "value": "value", + "loc": { + "start": { + "line": 10, + "column": 4 + }, + "end": { + "line": 10, + "column": 9 + } + }, + "range": [ + 253, + 258 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 10, + "column": 10 + }, + "end": { + "line": 10, + "column": 11 + } + }, + "range": [ + 259, + 260 + ] + }, + { + "type": "Keyword", + "value": "super", + "loc": { + "start": { + "line": 10, + "column": 12 + }, + "end": { + "line": 10, + "column": 17 + } + }, + "range": [ + 261, + 266 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 10, + "column": 17 + }, + "end": { + "line": 10, + "column": 18 + } + }, + "range": [ + 266, + 267 + ] + }, + { + "type": "Identifier", + "value": "test262", + "loc": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 25 + } + }, + "range": [ + 267, + 274 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 10, + "column": 25 + }, + "end": { + "line": 10, + "column": 26 + } + }, + "range": [ + 274, + 275 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 3 + } + }, + "range": [ + 278, + 279 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 1 + } + }, + "range": [ + 280, + 281 + ] + }, + { + "type": "Identifier", + "value": "assert", + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 6 + } + }, + "range": [ + 283, + 289 + ] + }, + { + "type": "Punctuator", + "value": ".", + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 7 + } + }, + "range": [ + 289, + 290 + ] + }, + { + "type": "Identifier", + "value": "sameValue", + "loc": { + "start": { + "line": 14, + "column": 7 + }, + "end": { + "line": 14, + "column": 16 + } + }, + "range": [ + 290, + 299 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 14, + "column": 16 + }, + "end": { + "line": 14, + "column": 17 + } + }, + "range": [ + 299, + 300 + ] + }, + { + "type": "Identifier", + "value": "value", + "loc": { + "start": { + "line": 14, + "column": 17 + }, + "end": { + "line": 14, + "column": 22 + } + }, + "range": [ + 300, + 305 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 14, + "column": 22 + }, + "end": { + "line": 14, + "column": 23 + } + }, + "range": [ + 305, + 306 + ] + }, + { + "type": "String", + "value": "'test262'", + "loc": { + "start": { + "line": 14, + "column": 24 + }, + "end": { + "line": 14, + "column": 33 + } + }, + "range": [ + 307, + 316 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 14, + "column": 33 + }, + "end": { + "line": 14, + "column": 34 + } + }, + "range": [ + 316, + 317 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 14, + "column": 34 + }, + "end": { + "line": 14, + "column": 35 + } + }, + "range": [ + 317, + 318 + ] + } + ] +}; \ 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..693cc788 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-class-static-init-super-property.src.js @@ -0,0 +1,14 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/class/static-init-super-property.js + + +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..2420ff34 --- /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": 188, + "lineNumber": 4, + "column": 11, + "message": "Cannot use await in class static initialization block" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-const-static-init-await-binding-invalid.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-const-static-init-await-binding-invalid.src.js new file mode 100644 index 00000000..4b85adf5 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-const-static-init-await-binding-invalid.src.js @@ -0,0 +1,6 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/const/static-init-await-binding-invalid.js +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..6473d839 --- /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": 197, + "lineNumber": 6, + "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..4ea0b063 --- /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": 4, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 157, + 217 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 157, + 217 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 163, + 164 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 165, + 217 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 169, + 215 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 33 + } + }, + "range": [ + 182, + 211 + ], + "expression": { + "type": "ArrowFunctionExpression", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 31 + } + }, + "range": [ + 183, + 209 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 6, + "column": 11 + }, + "end": { + "line": 6, + "column": 31 + } + }, + "range": [ + 189, + 209 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 29 + } + }, + "range": [ + 191, + 207 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 6, + "column": 19 + }, + "end": { + "line": 6, + "column": 28 + } + }, + "range": [ + 197, + 206 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 19 + }, + "end": { + "line": 6, + "column": 24 + } + }, + "range": [ + 197, + 202 + ], + "name": "await" + }, + "init": { + "type": "Literal", + "loc": { + "start": { + "line": 6, + "column": 27 + }, + "end": { + "line": 6, + "column": 28 + } + }, + "range": [ + 205, + 206 + ], + "value": 0, + "raw": "0" + } + } + ], + "kind": "const" + } + ] + } + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 157, + 162 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 163, + 164 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 165, + 166 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 8 + } + }, + "range": [ + 169, + 175 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 176, + 177 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 182, + 183 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 6 + } + }, + "range": [ + 183, + 184 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 184, + 185 + ] + }, + { + "type": "Punctuator", + "value": "=>", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 10 + } + }, + "range": [ + 186, + 188 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 11 + }, + "end": { + "line": 6, + "column": 12 + } + }, + "range": [ + 189, + 190 + ] + }, + { + "type": "Keyword", + "value": "const", + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 18 + } + }, + "range": [ + 191, + 196 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 6, + "column": 19 + }, + "end": { + "line": 6, + "column": 24 + } + }, + "range": [ + 197, + 202 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 6, + "column": 25 + }, + "end": { + "line": 6, + "column": 26 + } + }, + "range": [ + 203, + 204 + ] + }, + { + "type": "Numeric", + "value": "0", + "loc": { + "start": { + "line": 6, + "column": 27 + }, + "end": { + "line": 6, + "column": 28 + } + }, + "range": [ + 205, + 206 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 28 + }, + "end": { + "line": 6, + "column": 29 + } + }, + "range": [ + 206, + 207 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 30 + }, + "end": { + "line": 6, + "column": 31 + } + }, + "range": [ + 208, + 209 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 31 + }, + "end": { + "line": 6, + "column": 32 + } + }, + "range": [ + 209, + 210 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 32 + }, + "end": { + "line": 6, + "column": 33 + } + }, + "range": [ + 210, + 211 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 214, + 215 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 216, + 217 + ] + } + ] +}; \ 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..0654dd8e --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-const-static-init-await-binding-valid.src.js @@ -0,0 +1,8 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/const/static-init-await-binding-valid.js + + +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..73be3d7d --- /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": 202, + "lineNumber": 5, + "column": 7, + "message": "Unsyntactic continue" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-continue-static-init-with-label.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-continue-static-init-with-label.src.js new file mode 100644 index 00000000..4f6655eb --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-continue-static-init-with-label.src.js @@ -0,0 +1,8 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/continue/static-init-with-label.js +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..9659873a --- /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": 205, + "lineNumber": 5, + "column": 7, + "message": "Unsyntactic continue" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-continue-static-init-without-label.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-continue-static-init-without-label.src.js new file mode 100644 index 00000000..5e97bfac --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-continue-static-init-without-label.src.js @@ -0,0 +1,8 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/continue/static-init-without-label.js +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..ea09e336 --- /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": 194, + "lineNumber": 4, + "column": 14, + "message": "Cannot use await in class static initialization block" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-function-static-init-await-binding-invalid.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-function-static-init-await-binding-invalid.src.js new file mode 100644 index 00000000..661c2a36 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-function-static-init-await-binding-invalid.src.js @@ -0,0 +1,7 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/function/static-init-await-binding-invalid.js +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..72a6f1f8 --- /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": 203, + "lineNumber": 6, + "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..16257746 --- /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": 4, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 160, + 223 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 160, + 223 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 166, + 167 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 168, + 223 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 172, + 221 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 36 + } + }, + "range": [ + 185, + 217 + ], + "expression": { + "type": "ArrowFunctionExpression", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 34 + } + }, + "range": [ + 186, + 215 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 6, + "column": 11 + }, + "end": { + "line": 6, + "column": 34 + } + }, + "range": [ + 192, + 215 + ], + "body": [ + { + "type": "FunctionDeclaration", + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 32 + } + }, + "range": [ + 194, + 213 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 22 + }, + "end": { + "line": 6, + "column": 27 + } + }, + "range": [ + 203, + 208 + ], + "name": "await" + }, + "expression": false, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 6, + "column": 30 + }, + "end": { + "line": 6, + "column": 32 + } + }, + "range": [ + 211, + 213 + ], + "body": [] + } + } + ] + } + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 160, + 165 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 166, + 167 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 168, + 169 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 8 + } + }, + "range": [ + 172, + 178 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 179, + 180 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 185, + 186 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 6 + } + }, + "range": [ + 186, + 187 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 187, + 188 + ] + }, + { + "type": "Punctuator", + "value": "=>", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 10 + } + }, + "range": [ + 189, + 191 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 11 + }, + "end": { + "line": 6, + "column": 12 + } + }, + "range": [ + 192, + 193 + ] + }, + { + "type": "Keyword", + "value": "function", + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 21 + } + }, + "range": [ + 194, + 202 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 6, + "column": 22 + }, + "end": { + "line": 6, + "column": 27 + } + }, + "range": [ + 203, + 208 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 27 + }, + "end": { + "line": 6, + "column": 28 + } + }, + "range": [ + 208, + 209 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 28 + }, + "end": { + "line": 6, + "column": 29 + } + }, + "range": [ + 209, + 210 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 30 + }, + "end": { + "line": 6, + "column": 31 + } + }, + "range": [ + 211, + 212 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 31 + }, + "end": { + "line": 6, + "column": 32 + } + }, + "range": [ + 212, + 213 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 33 + }, + "end": { + "line": 6, + "column": 34 + } + }, + "range": [ + 214, + 215 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 34 + }, + "end": { + "line": 6, + "column": 35 + } + }, + "range": [ + 215, + 216 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 35 + }, + "end": { + "line": 6, + "column": 36 + } + }, + "range": [ + 216, + 217 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 220, + 221 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 222, + 223 + ] + } + ] +}; \ 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..cbb4b944 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-function-static-init-await-binding-valid.src.js @@ -0,0 +1,8 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/function/static-init-await-binding-valid.js + + +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..7441d614 --- /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": 176, + "lineNumber": 4, + "column": 5, + "message": "Cannot use await in class static initialization block" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-labeled-static-init-invalid-await.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-labeled-static-init-invalid-await.src.js new file mode 100644 index 00000000..f8342332 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-labeled-static-init-invalid-await.src.js @@ -0,0 +1,6 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/labeled/static-init-invalid-await.js +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..a538bd66 --- /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": 184, + "lineNumber": 4, + "column": 9, + "message": "Cannot use await in class static initialization block" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-let-static-init-await-binding-invalid.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-let-static-init-await-binding-invalid.src.js new file mode 100644 index 00000000..333a4666 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-let-static-init-await-binding-invalid.src.js @@ -0,0 +1,6 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/let/static-init-await-binding-invalid.js +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..47e29748 --- /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": 193, + "lineNumber": 6, + "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..c79b6c7a --- /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": 4, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 155, + 209 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 155, + 209 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 161, + 162 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 163, + 209 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 167, + 207 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 27 + } + }, + "range": [ + 180, + 203 + ], + "expression": { + "type": "ArrowFunctionExpression", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 25 + } + }, + "range": [ + 181, + 201 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 6, + "column": 11 + }, + "end": { + "line": 6, + "column": 25 + } + }, + "range": [ + 187, + 201 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 23 + } + }, + "range": [ + 189, + 199 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 6, + "column": 17 + }, + "end": { + "line": 6, + "column": 22 + } + }, + "range": [ + 193, + 198 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 17 + }, + "end": { + "line": 6, + "column": 22 + } + }, + "range": [ + 193, + 198 + ], + "name": "await" + }, + "init": null + } + ], + "kind": "let" + } + ] + } + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 155, + 160 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 161, + 162 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 163, + 164 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 8 + } + }, + "range": [ + 167, + 173 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 174, + 175 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 180, + 181 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 6 + } + }, + "range": [ + 181, + 182 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 182, + 183 + ] + }, + { + "type": "Punctuator", + "value": "=>", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 10 + } + }, + "range": [ + 184, + 186 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 11 + }, + "end": { + "line": 6, + "column": 12 + } + }, + "range": [ + 187, + 188 + ] + }, + { + "type": "Keyword", + "value": "let", + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 16 + } + }, + "range": [ + 189, + 192 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 6, + "column": 17 + }, + "end": { + "line": 6, + "column": 22 + } + }, + "range": [ + 193, + 198 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 22 + }, + "end": { + "line": 6, + "column": 23 + } + }, + "range": [ + 198, + 199 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 24 + }, + "end": { + "line": 6, + "column": 25 + } + }, + "range": [ + 200, + 201 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 25 + }, + "end": { + "line": 6, + "column": 26 + } + }, + "range": [ + 201, + 202 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 26 + }, + "end": { + "line": 6, + "column": 27 + } + }, + "range": [ + 202, + 203 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 206, + 207 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 208, + 209 + ] + } + ] +}; \ 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..b08ebc75 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-let-static-init-await-binding-valid.src.js @@ -0,0 +1,8 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/let/static-init-await-binding-valid.js + + +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..af944177 --- /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": 194, + "lineNumber": 4, + "column": 19, + "message": "Cannot use await in class static initialization block" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-try-static-init-await-binding-invalid.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-try-static-init-await-binding-invalid.src.js new file mode 100644 index 00000000..2c9c2013 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-try-static-init-await-binding-invalid.src.js @@ -0,0 +1,6 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/try/static-init-await-binding-invalid.js +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..c8470c62 --- /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": 203, + "lineNumber": 6, + "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..9b260e5e --- /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": 4, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 155, + 222 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 155, + 222 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 161, + 162 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 163, + 222 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 167, + 220 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 40 + } + }, + "range": [ + 180, + 216 + ], + "expression": { + "type": "ArrowFunctionExpression", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 38 + } + }, + "range": [ + 181, + 214 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 6, + "column": 11 + }, + "end": { + "line": 6, + "column": 38 + } + }, + "range": [ + 187, + 214 + ], + "body": [ + { + "type": "TryStatement", + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 36 + } + }, + "range": [ + 189, + 212 + ], + "block": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 6, + "column": 17 + }, + "end": { + "line": 6, + "column": 19 + } + }, + "range": [ + 193, + 195 + ], + "body": [] + }, + "handler": { + "type": "CatchClause", + "loc": { + "start": { + "line": 6, + "column": 20 + }, + "end": { + "line": 6, + "column": 36 + } + }, + "range": [ + 196, + 212 + ], + "param": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 27 + }, + "end": { + "line": 6, + "column": 32 + } + }, + "range": [ + 203, + 208 + ], + "name": "await" + }, + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 6, + "column": 34 + }, + "end": { + "line": 6, + "column": 36 + } + }, + "range": [ + 210, + 212 + ], + "body": [] + } + }, + "finalizer": null + } + ] + } + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 155, + 160 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 161, + 162 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 163, + 164 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 8 + } + }, + "range": [ + 167, + 173 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 174, + 175 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 180, + 181 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 6 + } + }, + "range": [ + 181, + 182 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 182, + 183 + ] + }, + { + "type": "Punctuator", + "value": "=>", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 10 + } + }, + "range": [ + 184, + 186 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 11 + }, + "end": { + "line": 6, + "column": 12 + } + }, + "range": [ + 187, + 188 + ] + }, + { + "type": "Keyword", + "value": "try", + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 16 + } + }, + "range": [ + 189, + 192 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 17 + }, + "end": { + "line": 6, + "column": 18 + } + }, + "range": [ + 193, + 194 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 18 + }, + "end": { + "line": 6, + "column": 19 + } + }, + "range": [ + 194, + 195 + ] + }, + { + "type": "Keyword", + "value": "catch", + "loc": { + "start": { + "line": 6, + "column": 20 + }, + "end": { + "line": 6, + "column": 25 + } + }, + "range": [ + 196, + 201 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 26 + }, + "end": { + "line": 6, + "column": 27 + } + }, + "range": [ + 202, + 203 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 6, + "column": 27 + }, + "end": { + "line": 6, + "column": 32 + } + }, + "range": [ + 203, + 208 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 32 + }, + "end": { + "line": 6, + "column": 33 + } + }, + "range": [ + 208, + 209 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 34 + }, + "end": { + "line": 6, + "column": 35 + } + }, + "range": [ + 210, + 211 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 35 + }, + "end": { + "line": 6, + "column": 36 + } + }, + "range": [ + 211, + 212 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 37 + }, + "end": { + "line": 6, + "column": 38 + } + }, + "range": [ + 213, + 214 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 38 + }, + "end": { + "line": 6, + "column": 39 + } + }, + "range": [ + 214, + 215 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 39 + }, + "end": { + "line": 6, + "column": 40 + } + }, + "range": [ + 215, + 216 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 219, + 220 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 221, + 222 + ] + } + ] +}; \ 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..d8842bd4 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-try-static-init-await-binding-valid.src.js @@ -0,0 +1,8 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/try/static-init-await-binding-valid.js + + +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..1ceb3bb5 --- /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": 204, + "lineNumber": 4, + "column": 10, + "message": "Cannot use await in class static initialization block" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-ary-ptrn-elem-id-static-init-await-invalid.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-ary-ptrn-elem-id-static-init-await-invalid.src.js new file mode 100644 index 00000000..f0b6d596 --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-ary-ptrn-elem-id-static-init-await-invalid.src.js @@ -0,0 +1,6 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/variable/dstr/ary-ptrn-elem-id-static-init-await-invalid.js +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..86a6c1eb --- /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": 213, + "lineNumber": 6, + "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..44f62da8 --- /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": 4, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 174, + 235 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 174, + 235 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 180, + 181 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 182, + 235 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 186, + 233 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 34 + } + }, + "range": [ + 199, + 229 + ], + "expression": { + "type": "ArrowFunctionExpression", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 32 + } + }, + "range": [ + 200, + 227 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 6, + "column": 11 + }, + "end": { + "line": 6, + "column": 32 + } + }, + "range": [ + 206, + 227 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 30 + } + }, + "range": [ + 208, + 225 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 6, + "column": 17 + }, + "end": { + "line": 6, + "column": 29 + } + }, + "range": [ + 212, + 224 + ], + "id": { + "type": "ArrayPattern", + "loc": { + "start": { + "line": 6, + "column": 17 + }, + "end": { + "line": 6, + "column": 24 + } + }, + "range": [ + 212, + 219 + ], + "elements": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 18 + }, + "end": { + "line": 6, + "column": 23 + } + }, + "range": [ + 213, + 218 + ], + "name": "await" + } + ] + }, + "init": { + "type": "ArrayExpression", + "loc": { + "start": { + "line": 6, + "column": 27 + }, + "end": { + "line": 6, + "column": 29 + } + }, + "range": [ + 222, + 224 + ], + "elements": [] + } + } + ], + "kind": "var" + } + ] + } + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 174, + 179 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 180, + 181 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 182, + 183 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 8 + } + }, + "range": [ + 186, + 192 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 193, + 194 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 199, + 200 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 6 + } + }, + "range": [ + 200, + 201 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 201, + 202 + ] + }, + { + "type": "Punctuator", + "value": "=>", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 10 + } + }, + "range": [ + 203, + 205 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 11 + }, + "end": { + "line": 6, + "column": 12 + } + }, + "range": [ + 206, + 207 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 16 + } + }, + "range": [ + 208, + 211 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 6, + "column": 17 + }, + "end": { + "line": 6, + "column": 18 + } + }, + "range": [ + 212, + 213 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 6, + "column": 18 + }, + "end": { + "line": 6, + "column": 23 + } + }, + "range": [ + 213, + 218 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 6, + "column": 23 + }, + "end": { + "line": 6, + "column": 24 + } + }, + "range": [ + 218, + 219 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 6, + "column": 25 + }, + "end": { + "line": 6, + "column": 26 + } + }, + "range": [ + 220, + 221 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 6, + "column": 27 + }, + "end": { + "line": 6, + "column": 28 + } + }, + "range": [ + 222, + 223 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 6, + "column": 28 + }, + "end": { + "line": 6, + "column": 29 + } + }, + "range": [ + 223, + 224 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 29 + }, + "end": { + "line": 6, + "column": 30 + } + }, + "range": [ + 224, + 225 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 31 + }, + "end": { + "line": 6, + "column": 32 + } + }, + "range": [ + 226, + 227 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 32 + }, + "end": { + "line": 6, + "column": 33 + } + }, + "range": [ + 227, + 228 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 33 + }, + "end": { + "line": 6, + "column": 34 + } + }, + "range": [ + 228, + 229 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 232, + 233 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 234, + 235 + ] + } + ] +}; \ 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..527015b0 --- /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,8 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/variable/dstr/ary-ptrn-elem-id-static-init-await-valid.js + + +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..1ceb3bb5 --- /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": 204, + "lineNumber": 4, + "column": 10, + "message": "Cannot use await in class static initialization block" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-obj-ptrn-elem-id-static-init-await-invalid.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-obj-ptrn-elem-id-static-init-await-invalid.src.js new file mode 100644 index 00000000..59e2815e --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-dstr-obj-ptrn-elem-id-static-init-await-invalid.src.js @@ -0,0 +1,6 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/variable/dstr/obj-ptrn-elem-id-static-init-await-invalid.js +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..86a6c1eb --- /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": 213, + "lineNumber": 6, + "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..40914946 --- /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": 4, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 174, + 235 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 174, + 235 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 180, + 181 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 182, + 235 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 186, + 233 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 34 + } + }, + "range": [ + 199, + 229 + ], + "expression": { + "type": "ArrowFunctionExpression", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 32 + } + }, + "range": [ + 200, + 227 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 6, + "column": 11 + }, + "end": { + "line": 6, + "column": 32 + } + }, + "range": [ + 206, + 227 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 30 + } + }, + "range": [ + 208, + 225 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 6, + "column": 17 + }, + "end": { + "line": 6, + "column": 29 + } + }, + "range": [ + 212, + 224 + ], + "id": { + "type": "ObjectPattern", + "loc": { + "start": { + "line": 6, + "column": 17 + }, + "end": { + "line": 6, + "column": 24 + } + }, + "range": [ + 212, + 219 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 6, + "column": 18 + }, + "end": { + "line": 6, + "column": 23 + } + }, + "range": [ + 213, + 218 + ], + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 18 + }, + "end": { + "line": 6, + "column": 23 + } + }, + "range": [ + 213, + 218 + ], + "name": "await" + }, + "kind": "init", + "value": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 18 + }, + "end": { + "line": 6, + "column": 23 + } + }, + "range": [ + 213, + 218 + ], + "name": "await" + } + } + ] + }, + "init": { + "type": "ObjectExpression", + "loc": { + "start": { + "line": 6, + "column": 27 + }, + "end": { + "line": 6, + "column": 29 + } + }, + "range": [ + 222, + 224 + ], + "properties": [] + } + } + ], + "kind": "var" + } + ] + } + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 174, + 179 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 180, + 181 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 182, + 183 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 8 + } + }, + "range": [ + 186, + 192 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 193, + 194 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 199, + 200 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 6 + } + }, + "range": [ + 200, + 201 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 201, + 202 + ] + }, + { + "type": "Punctuator", + "value": "=>", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 10 + } + }, + "range": [ + 203, + 205 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 11 + }, + "end": { + "line": 6, + "column": 12 + } + }, + "range": [ + 206, + 207 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 16 + } + }, + "range": [ + 208, + 211 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 17 + }, + "end": { + "line": 6, + "column": 18 + } + }, + "range": [ + 212, + 213 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 6, + "column": 18 + }, + "end": { + "line": 6, + "column": 23 + } + }, + "range": [ + 213, + 218 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 23 + }, + "end": { + "line": 6, + "column": 24 + } + }, + "range": [ + 218, + 219 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 6, + "column": 25 + }, + "end": { + "line": 6, + "column": 26 + } + }, + "range": [ + 220, + 221 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 27 + }, + "end": { + "line": 6, + "column": 28 + } + }, + "range": [ + 222, + 223 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 28 + }, + "end": { + "line": 6, + "column": 29 + } + }, + "range": [ + 223, + 224 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 29 + }, + "end": { + "line": 6, + "column": 30 + } + }, + "range": [ + 224, + 225 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 31 + }, + "end": { + "line": 6, + "column": 32 + } + }, + "range": [ + 226, + 227 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 32 + }, + "end": { + "line": 6, + "column": 33 + } + }, + "range": [ + 227, + 228 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 33 + }, + "end": { + "line": 6, + "column": 34 + } + }, + "range": [ + 228, + 229 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 232, + 233 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 234, + 235 + ] + } + ] +}; \ 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..e34fb1bb --- /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,8 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/variable/dstr/obj-ptrn-elem-id-static-init-await-valid.js + + +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..f024ea29 --- /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": 189, + "lineNumber": 4, + "column": 9, + "message": "Cannot use await in class static initialization block" +}; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-static-init-await-binding-invalid.src.js b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-static-init-await-binding-invalid.src.js new file mode 100644 index 00000000..b69c1a6f --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-static-init-await-binding-invalid.src.js @@ -0,0 +1,6 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/variable/static-init-await-binding-invalid.js +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..5ce8623a --- /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": 198, + "lineNumber": 6, + "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..bb5c1e2a --- /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": 4, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 160, + 214 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 160, + 214 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 166, + 167 + ], + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 168, + 214 + ], + "body": [ + { + "type": "StaticBlock", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 172, + 212 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 27 + } + }, + "range": [ + 185, + 208 + ], + "expression": { + "type": "ArrowFunctionExpression", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 25 + } + }, + "range": [ + 186, + 206 + ], + "id": null, + "expression": false, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 6, + "column": 11 + }, + "end": { + "line": 6, + "column": 25 + } + }, + "range": [ + 192, + 206 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 23 + } + }, + "range": [ + 194, + 204 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 6, + "column": 17 + }, + "end": { + "line": 6, + "column": 22 + } + }, + "range": [ + 198, + 203 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 17 + }, + "end": { + "line": 6, + "column": 22 + } + }, + "range": [ + 198, + 203 + ], + "name": "await" + }, + "init": null + } + ], + "kind": "var" + } + ] + } + } + } + ] + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 160, + 165 + ] + }, + { + "type": "Identifier", + "value": "C", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 166, + 167 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "range": [ + 168, + 169 + ] + }, + { + "type": "Keyword", + "value": "static", + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 8 + } + }, + "range": [ + 172, + 178 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 179, + 180 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 185, + 186 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 6 + } + }, + "range": [ + 186, + 187 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "range": [ + 187, + 188 + ] + }, + { + "type": "Punctuator", + "value": "=>", + "loc": { + "start": { + "line": 6, + "column": 8 + }, + "end": { + "line": 6, + "column": 10 + } + }, + "range": [ + 189, + 191 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 11 + }, + "end": { + "line": 6, + "column": 12 + } + }, + "range": [ + 192, + 193 + ] + }, + { + "type": "Keyword", + "value": "var", + "loc": { + "start": { + "line": 6, + "column": 13 + }, + "end": { + "line": 6, + "column": 16 + } + }, + "range": [ + 194, + 197 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 6, + "column": 17 + }, + "end": { + "line": 6, + "column": 22 + } + }, + "range": [ + 198, + 203 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 22 + }, + "end": { + "line": 6, + "column": 23 + } + }, + "range": [ + 203, + 204 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 6, + "column": 24 + }, + "end": { + "line": 6, + "column": 25 + } + }, + "range": [ + 205, + 206 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 25 + }, + "end": { + "line": 6, + "column": 26 + } + }, + "range": [ + 206, + 207 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 6, + "column": 26 + }, + "end": { + "line": 6, + "column": 27 + } + }, + "range": [ + 207, + 208 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "range": [ + 211, + 212 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 213, + 214 + ] + } + ] +}; \ 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..a2f860eb --- /dev/null +++ b/tests/fixtures/ecma-version/13/class-static-blocks/statements-variable-static-init-await-binding-valid.src.js @@ -0,0 +1,8 @@ +// refs: https://github.com/tc39/test262/commit/afe217b318df5f197e64b30a8b5a4b391c777359/test/language/statements/variable/static-init-await-binding-valid.js + + +class C { + static { + (() => { var await; }); + } +}