From 1786d16c1886ee71b199db2363ed814b8748c69c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=AF=E7=84=B6?= Date: Fri, 29 Dec 2023 11:47:31 +0800 Subject: [PATCH] chore: update es13 tests --- ...lass-static-init-expr-new-target.result.js | 889 +----------------- .../top-level-await/top-await.result.js | 2 +- 2 files changed, 2 insertions(+), 889 deletions(-) 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 index ff4e2037..77ce9dfc 100644 --- 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 @@ -1,890 +1,3 @@ export default { - "type": "Program", - "loc": { - "start": { - "line": 15, - "column": 0 - }, - "end": { - "line": 23, - "column": 35 - } - }, - "range": [ - 527, - 633 - ], - "body": [ - { - "type": "VariableDeclaration", - "loc": { - "start": { - "line": 15, - "column": 0 - }, - "end": { - "line": 15, - "column": 17 - } - }, - "range": [ - 527, - 544 - ], - "declarations": [ - { - "type": "VariableDeclarator", - "loc": { - "start": { - "line": 15, - "column": 4 - }, - "end": { - "line": 15, - "column": 16 - } - }, - "range": [ - 531, - 543 - ], - "id": { - "type": "Identifier", - "loc": { - "start": { - "line": 15, - "column": 4 - }, - "end": { - "line": 15, - "column": 9 - } - }, - "range": [ - 531, - 536 - ], - "name": "value" - }, - "init": { - "type": "Literal", - "loc": { - "start": { - "line": 15, - "column": 12 - }, - "end": { - "line": 15, - "column": 16 - } - }, - "range": [ - 539, - 543 - ], - "value": null, - "raw": "null" - } - } - ], - "kind": "var" - }, - { - "type": "ClassDeclaration", - "loc": { - "start": { - "line": 17, - "column": 0 - }, - "end": { - "line": 21, - "column": 1 - } - }, - "range": [ - 546, - 596 - ], - "id": { - "type": "Identifier", - "loc": { - "start": { - "line": 17, - "column": 6 - }, - "end": { - "line": 17, - "column": 7 - } - }, - "range": [ - 552, - 553 - ], - "name": "C" - }, - "superClass": null, - "body": { - "type": "ClassBody", - "loc": { - "start": { - "line": 17, - "column": 8 - }, - "end": { - "line": 21, - "column": 1 - } - }, - "range": [ - 554, - 596 - ], - "body": [ - { - "type": "StaticBlock", - "loc": { - "start": { - "line": 18, - "column": 2 - }, - "end": { - "line": 20, - "column": 3 - } - }, - "range": [ - 558, - 594 - ], - "body": [ - { - "type": "ExpressionStatement", - "loc": { - "start": { - "line": 19, - "column": 4 - }, - "end": { - "line": 19, - "column": 23 - } - }, - "range": [ - 571, - 590 - ], - "expression": { - "type": "AssignmentExpression", - "loc": { - "start": { - "line": 19, - "column": 4 - }, - "end": { - "line": 19, - "column": 22 - } - }, - "range": [ - 571, - 589 - ], - "operator": "=", - "left": { - "type": "Identifier", - "loc": { - "start": { - "line": 19, - "column": 4 - }, - "end": { - "line": 19, - "column": 9 - } - }, - "range": [ - 571, - 576 - ], - "name": "value" - }, - "right": { - "type": "MetaProperty", - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 19, - "column": 22 - } - }, - "range": [ - 579, - 589 - ], - "meta": { - "type": "Identifier", - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 19, - "column": 15 - } - }, - "range": [ - 579, - 582 - ], - "name": "new" - }, - "property": { - "type": "Identifier", - "loc": { - "start": { - "line": 19, - "column": 16 - }, - "end": { - "line": 19, - "column": 22 - } - }, - "range": [ - 583, - 589 - ], - "name": "target" - } - } - } - } - ] - } - ] - } - }, - { - "type": "ExpressionStatement", - "loc": { - "start": { - "line": 23, - "column": 0 - }, - "end": { - "line": 23, - "column": 35 - } - }, - "range": [ - 598, - 633 - ], - "expression": { - "type": "CallExpression", - "loc": { - "start": { - "line": 23, - "column": 0 - }, - "end": { - "line": 23, - "column": 34 - } - }, - "range": [ - 598, - 632 - ], - "callee": { - "type": "MemberExpression", - "loc": { - "start": { - "line": 23, - "column": 0 - }, - "end": { - "line": 23, - "column": 16 - } - }, - "range": [ - 598, - 614 - ], - "object": { - "type": "Identifier", - "loc": { - "start": { - "line": 23, - "column": 0 - }, - "end": { - "line": 23, - "column": 6 - } - }, - "range": [ - 598, - 604 - ], - "name": "assert" - }, - "property": { - "type": "Identifier", - "loc": { - "start": { - "line": 23, - "column": 7 - }, - "end": { - "line": 23, - "column": 16 - } - }, - "range": [ - 605, - 614 - ], - "name": "sameValue" - }, - "computed": false, - "optional": false - }, - "arguments": [ - { - "type": "Identifier", - "loc": { - "start": { - "line": 23, - "column": 17 - }, - "end": { - "line": 23, - "column": 22 - } - }, - "range": [ - 615, - 620 - ], - "name": "value" - }, - { - "type": "Identifier", - "loc": { - "start": { - "line": 23, - "column": 24 - }, - "end": { - "line": 23, - "column": 33 - } - }, - "range": [ - 622, - 631 - ], - "name": "undefined" - } - ], - "optional": false - } - } - ], - "sourceType": "script", - "tokens": [ - { - "type": "Keyword", - "value": "var", - "loc": { - "start": { - "line": 15, - "column": 0 - }, - "end": { - "line": 15, - "column": 3 - } - }, - "range": [ - 527, - 530 - ] - }, - { - "type": "Identifier", - "value": "value", - "loc": { - "start": { - "line": 15, - "column": 4 - }, - "end": { - "line": 15, - "column": 9 - } - }, - "range": [ - 531, - 536 - ] - }, - { - "type": "Punctuator", - "value": "=", - "loc": { - "start": { - "line": 15, - "column": 10 - }, - "end": { - "line": 15, - "column": 11 - } - }, - "range": [ - 537, - 538 - ] - }, - { - "type": "Null", - "value": "null", - "loc": { - "start": { - "line": 15, - "column": 12 - }, - "end": { - "line": 15, - "column": 16 - } - }, - "range": [ - 539, - 543 - ] - }, - { - "type": "Punctuator", - "value": ";", - "loc": { - "start": { - "line": 15, - "column": 16 - }, - "end": { - "line": 15, - "column": 17 - } - }, - "range": [ - 543, - 544 - ] - }, - { - "type": "Keyword", - "value": "class", - "loc": { - "start": { - "line": 17, - "column": 0 - }, - "end": { - "line": 17, - "column": 5 - } - }, - "range": [ - 546, - 551 - ] - }, - { - "type": "Identifier", - "value": "C", - "loc": { - "start": { - "line": 17, - "column": 6 - }, - "end": { - "line": 17, - "column": 7 - } - }, - "range": [ - 552, - 553 - ] - }, - { - "type": "Punctuator", - "value": "{", - "loc": { - "start": { - "line": 17, - "column": 8 - }, - "end": { - "line": 17, - "column": 9 - } - }, - "range": [ - 554, - 555 - ] - }, - { - "type": "Keyword", - "value": "static", - "loc": { - "start": { - "line": 18, - "column": 2 - }, - "end": { - "line": 18, - "column": 8 - } - }, - "range": [ - 558, - 564 - ] - }, - { - "type": "Punctuator", - "value": "{", - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 10 - } - }, - "range": [ - 565, - 566 - ] - }, - { - "type": "Identifier", - "value": "value", - "loc": { - "start": { - "line": 19, - "column": 4 - }, - "end": { - "line": 19, - "column": 9 - } - }, - "range": [ - 571, - 576 - ] - }, - { - "type": "Punctuator", - "value": "=", - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 11 - } - }, - "range": [ - 577, - 578 - ] - }, - { - "type": "Keyword", - "value": "new", - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 19, - "column": 15 - } - }, - "range": [ - 579, - 582 - ] - }, - { - "type": "Punctuator", - "value": ".", - "loc": { - "start": { - "line": 19, - "column": 15 - }, - "end": { - "line": 19, - "column": 16 - } - }, - "range": [ - 582, - 583 - ] - }, - { - "type": "Identifier", - "value": "target", - "loc": { - "start": { - "line": 19, - "column": 16 - }, - "end": { - "line": 19, - "column": 22 - } - }, - "range": [ - 583, - 589 - ] - }, - { - "type": "Punctuator", - "value": ";", - "loc": { - "start": { - "line": 19, - "column": 22 - }, - "end": { - "line": 19, - "column": 23 - } - }, - "range": [ - 589, - 590 - ] - }, - { - "type": "Punctuator", - "value": "}", - "loc": { - "start": { - "line": 20, - "column": 2 - }, - "end": { - "line": 20, - "column": 3 - } - }, - "range": [ - 593, - 594 - ] - }, - { - "type": "Punctuator", - "value": "}", - "loc": { - "start": { - "line": 21, - "column": 0 - }, - "end": { - "line": 21, - "column": 1 - } - }, - "range": [ - 595, - 596 - ] - }, - { - "type": "Identifier", - "value": "assert", - "loc": { - "start": { - "line": 23, - "column": 0 - }, - "end": { - "line": 23, - "column": 6 - } - }, - "range": [ - 598, - 604 - ] - }, - { - "type": "Punctuator", - "value": ".", - "loc": { - "start": { - "line": 23, - "column": 6 - }, - "end": { - "line": 23, - "column": 7 - } - }, - "range": [ - 604, - 605 - ] - }, - { - "type": "Identifier", - "value": "sameValue", - "loc": { - "start": { - "line": 23, - "column": 7 - }, - "end": { - "line": 23, - "column": 16 - } - }, - "range": [ - 605, - 614 - ] - }, - { - "type": "Punctuator", - "value": "(", - "loc": { - "start": { - "line": 23, - "column": 16 - }, - "end": { - "line": 23, - "column": 17 - } - }, - "range": [ - 614, - 615 - ] - }, - { - "type": "Identifier", - "value": "value", - "loc": { - "start": { - "line": 23, - "column": 17 - }, - "end": { - "line": 23, - "column": 22 - } - }, - "range": [ - 615, - 620 - ] - }, - { - "type": "Punctuator", - "value": ",", - "loc": { - "start": { - "line": 23, - "column": 22 - }, - "end": { - "line": 23, - "column": 23 - } - }, - "range": [ - 620, - 621 - ] - }, - { - "type": "Identifier", - "value": "undefined", - "loc": { - "start": { - "line": 23, - "column": 24 - }, - "end": { - "line": 23, - "column": 33 - } - }, - "range": [ - 622, - 631 - ] - }, - { - "type": "Punctuator", - "value": ")", - "loc": { - "start": { - "line": 23, - "column": 33 - }, - "end": { - "line": 23, - "column": 34 - } - }, - "range": [ - 631, - 632 - ] - }, - { - "type": "Punctuator", - "value": ";", - "loc": { - "start": { - "line": 23, - "column": 34 - }, - "end": { - "line": 23, - "column": 35 - } - }, - "range": [ - 632, - 633 - ] - } - ] + "message": "AST cannot have undefined as a property value.\nProperty name is 'start'" }; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/modules/top-level-await/top-await.result.js b/tests/fixtures/ecma-version/13/modules/top-level-await/top-await.result.js index d7b70cf0..b2bef7ab 100644 --- a/tests/fixtures/ecma-version/13/modules/top-level-await/top-await.result.js +++ b/tests/fixtures/ecma-version/13/modules/top-level-await/top-await.result.js @@ -87,7 +87,7 @@ export default { } } ], - "sourceType": "script", + "sourceType": "module", "tokens": [ { "type": "Identifier",