Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update test262 tests #12204

Merged
merged 1 commit into from Oct 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
@@ -1,5 +1,5 @@
FLOW_COMMIT = a1f9a4c709dcebb27a5084acf47755fbae699c25
TEST262_COMMIT = 058adfed86b1d4129996faaf50a85ea55379a66a
TEST262_COMMIT = d9740c172652d36194ceae3ed3d0484e9968ebc3
TYPESCRIPT_COMMIT = da8633212023517630de5f3620a23736b63234b1

FORCE_PUBLISH = -f @babel/runtime -f @babel/runtime-corejs2 -f @babel/runtime-corejs3 -f @babel/standalone
Expand Down
5 changes: 4 additions & 1 deletion scripts/parser-tests/test262/allowlist.txt
@@ -1 +1,4 @@

language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-await-expression.js(default)
language/expressions/class/cpn-class-expr-fields-methods-computed-property-name-from-await-expression.js(strict mode)
language/statements/class/cpn-class-decl-fields-methods-computed-property-name-from-await-expression.js(default)
language/statements/class/cpn-class-decl-fields-methods-computed-property-name-from-await-expression.js(strict mode)
Copy link
Contributor Author

@JLHwung JLHwung Oct 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is indeed a bug of @babel/parser

class C { [await 9] = () => {} }

should not throw

Can not use 'await' as identifier inside an async function (2:3)

when sourceType is "module" and "topLevelAwait" is enabled.

32 changes: 24 additions & 8 deletions scripts/parser-tests/test262/index.js
Expand Up @@ -3,17 +3,25 @@ const TestStream = require("test262-stream");
const TestRunner = require("../utils/parser-test-runner");

const ignoredFeatures = [
"__getter__",
"__setter__",
"AggregateError",
"Array.prototype.flat",
"Array.prototype.flatMap",
"Array.prototype.item",
"Array.prototype.values",
"ArrayBuffer",
"align-detached-buffer-semantics-with-web-reality",
"async-functions",
"async-iteration",
"arrow-function",
"Atomics",
"Atomics.waitAsync",
"BigInt",
"caller",
"class",
"cleanupSome",
"coalesce-expression",
"computed-property-names",
"const",
"cross-realm",
Expand All @@ -29,7 +37,11 @@ const ignoredFeatures = [
"default-parameters",
"destructuring-assignment",
"destructuring-binding",
"dynamic-import",
"export-star-as-namespace-from-module",
"FinalizationGroup",
"FinalizationRegistry",
"FinalizationRegistry.prototype.cleanupSome",
"Float32Array",
"Float64Array",
"for-in-order",
Expand All @@ -39,6 +51,7 @@ const ignoredFeatures = [
"hashbang",
"host-gc-required",
"Int8Array",
"Int16Array",
"Int32Array",
"Intl.DateTimeFormat-datetimestyle",
"Intl.DateTimeFormat-dayPeriod",
Expand All @@ -51,16 +64,23 @@ const ignoredFeatures = [
"Intl.RelativeTimeFormat",
"Intl.Segmenter",
"IsHTMLDDA",
"import.meta",
"json-superset",
"legacy-regexp",
"let",
"logical-assignment-operators",
"Map",
"new.target",
"numeric-separator-literal",
"Object.fromEntries",
"Object.is",
"object-rest",
"object-spread",
"optional-catch-binding",
"optional-chaining",
"Promise",
"Promise.allSettled",
"Promise.any",
"Promise.prototype.finally",
"Proxy",
"proxy-missing-checks",
Expand All @@ -78,6 +98,7 @@ const ignoredFeatures = [
"String.fromCodePoint",
"String.prototype.endsWith",
"String.prototype.includes",
"String.prototype.item",
"String.prototype.matchAll",
"String.prototype.replaceAll",
"String.prototype.trimEnd",
Expand All @@ -102,10 +123,12 @@ const ignoredFeatures = [
"tail-call-optimization",
"template",
"TypedArray",
"TypedArray.prototype.item",
"u180e",
"Uint8Array",
"Uint8ClampedArray",
"Uint16Array",
"Uint32Array",
"WeakMap",
"WeakSet",
"WeakRef",
Expand All @@ -115,20 +138,13 @@ const ignoredFeatures = [
const ignoredTests = ["built-ins/RegExp/", "language/literals/regexp/"];

const featuresToPlugins = {
BigInt: "bigInt",
"arbitrary-module-namespace-names": "moduleStringNames",
"class-fields-private": "classPrivateProperties",
"class-fields-public": "classProperties",
"class-methods-private": "classPrivateMethods",
"class-static-fields-public": "classProperties",
"class-static-fields-private": "classPrivateProperties",
"class-static-methods-private": "classPrivateMethods",
"coalesce-expression": "nullishCoalescingOperator",
"dynamic-import": "dynamicImport",
"export-star-as-namespace-from-module": "exportNamespaceFrom",
"import.meta": "importMeta",
"logical-assignment-operators": "logicalAssignment",
"numeric-separator-literal": "numericSeparator",
"optional-chaining": "optionalChaining",
"top-level-await": "topLevelAwait",
};

Expand Down