From 64554beb757cef2cc49c2fca13def9efae04ec14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=AF=E7=84=B6?= Date: Fri, 29 Dec 2023 10:44:32 +0800 Subject: [PATCH] chore: update es13 tests --- ...lass-static-init-expr-new-target.result.js | 889 +----------------- ...d-lone-surrogate-export-exported.result.js | 6 +- ...d-lone-surrogate-import-imported.result.js | 6 +- .../top-level-await/top-await.result.js | 2 +- .../regexp-match-indices.result.js | 12 +- 5 files changed, 12 insertions(+), 903 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/arbitrary-module-namespace-names/invalid-lone-surrogate-export-exported.result.js b/tests/fixtures/ecma-version/13/modules/arbitrary-module-namespace-names/invalid-lone-surrogate-export-exported.result.js index 514b310e..88e6aadc 100644 --- a/tests/fixtures/ecma-version/13/modules/arbitrary-module-namespace-names/invalid-lone-surrogate-export-exported.result.js +++ b/tests/fixtures/ecma-version/13/modules/arbitrary-module-namespace-names/invalid-lone-surrogate-export-exported.result.js @@ -1,6 +1,6 @@ export default { - "message": "An export name cannot include a lone surrogate.", - "column": 17, "index": 25, - "lineNumber": 2 + "lineNumber": 2, + "column": 17, + "message": "An export name cannot include a lone surrogate." }; \ No newline at end of file diff --git a/tests/fixtures/ecma-version/13/modules/arbitrary-module-namespace-names/invalid-lone-surrogate-import-imported.result.js b/tests/fixtures/ecma-version/13/modules/arbitrary-module-namespace-names/invalid-lone-surrogate-import-imported.result.js index 49a55fa3..4900078b 100644 --- a/tests/fixtures/ecma-version/13/modules/arbitrary-module-namespace-names/invalid-lone-surrogate-import-imported.result.js +++ b/tests/fixtures/ecma-version/13/modules/arbitrary-module-namespace-names/invalid-lone-surrogate-import-imported.result.js @@ -1,6 +1,6 @@ export default { - "message": "An export name cannot include a lone surrogate.", - "column": 10, "index": 9, - "lineNumber": 1 + "lineNumber": 1, + "column": 10, + "message": "An export name cannot include a lone surrogate." }; \ 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", diff --git a/tests/fixtures/ecma-version/13/regexp-match-indices/regexp-match-indices.result.js b/tests/fixtures/ecma-version/13/regexp-match-indices/regexp-match-indices.result.js index d30ace1d..52e140ac 100644 --- a/tests/fixtures/ecma-version/13/regexp-match-indices/regexp-match-indices.result.js +++ b/tests/fixtures/ecma-version/13/regexp-match-indices/regexp-match-indices.result.js @@ -1,5 +1,3 @@ -import conditionalRegex from "../../../../lib/conditional-regex-value.js"; - export default { "type": "Program", "loc": { @@ -68,7 +66,7 @@ export default { ], "name": "re1" }, - "init": conditionalRegex({ + "init": { "type": "Literal", "loc": { "start": { @@ -84,15 +82,13 @@ export default { 12, 24 ], - - // /d flag no supported in Node.js 12 or 14 yet - "value": null, + "value": /a+(z)?/d, "raw": "/a+(z)?/d", "regex": { "pattern": "a+(z)?", "flags": "d" } - }) + } } ], "kind": "const" @@ -195,4 +191,4 @@ export default { ] } ] -}; +}; \ No newline at end of file