From d57a0081c6453b0b53fcd8d4320becb25c31f7f4 Mon Sep 17 00:00:00 2001 From: ota-meshi Date: Sun, 28 May 2023 15:56:58 +0900 Subject: [PATCH 1/2] chore: skip test262 which is not yet resolved --- test262/run_test262.ts | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/test262/run_test262.ts b/test262/run_test262.ts index 8177ace..6b6e2a7 100644 --- a/test262/run_test262.ts +++ b/test262/run_test262.ts @@ -9,9 +9,27 @@ const UNSUPPORTED_FEATURES: string[] = [ "regexp-v-flag", "regexp-duplicate-named-groups", "import-assertions", + "decorators", ]; -const WHITELIST: string[] = []; +const SKIP_FILES: string[] = [ + // `1 < 2 > 3;` cannot be parsed well. + // This is because `< 2 >` is judged as TypeArguments. + // See https://github.com/TyrealHu/acorn-typescript/issues/21 + "test/language/punctuators/S7.7_A1.js", +]; + + +// Some keywords still don't throw an error. +// See https://github.com/TyrealHu/acorn-typescript/issues/23 +const WHITELIST: string[] = [ + // `this` variable name. e.g. `var this = 42` + "language/identifiers/val-this.js", + "language/identifiers/val-this-via-escape-hex.js", + "language/identifiers/val-this-via-escape-hex4.js", + // escaped `static`. e.g. `class { st\u0061tic m() {} }` + "language/statements/class/syntax/escaped-static.js", +].flatMap((s) => [s + " (default)", s + " (strict mode)"]); run( (content, { sourceType }) => { @@ -25,8 +43,9 @@ run( testsDirectory: path.dirname(require.resolve("test262/package.json")), skip: (test) => { return ( - test.attrs.features && - UNSUPPORTED_FEATURES.some((f) => test.attrs.features.includes(f)) + (test.attrs.features && + UNSUPPORTED_FEATURES.some((f) => test.attrs.features.includes(f))) || + SKIP_FILES.includes(test.file) ); }, whitelist: WHITELIST.map((filename) => From 2e0f60d33735b182f8348d71000096d386707aa2 Mon Sep 17 00:00:00 2001 From: ota-meshi Date: Sun, 28 May 2023 18:47:09 +0900 Subject: [PATCH 2/2] chore: fix whitelist --- test262/run_test262.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/test262/run_test262.ts b/test262/run_test262.ts index 6b6e2a7..2af5d5d 100644 --- a/test262/run_test262.ts +++ b/test262/run_test262.ts @@ -27,8 +27,6 @@ const WHITELIST: string[] = [ "language/identifiers/val-this.js", "language/identifiers/val-this-via-escape-hex.js", "language/identifiers/val-this-via-escape-hex4.js", - // escaped `static`. e.g. `class { st\u0061tic m() {} }` - "language/statements/class/syntax/escaped-static.js", ].flatMap((s) => [s + " (default)", s + " (strict mode)"]); run(