From 7ec95bc6fb3a1f272984ee50e08bc6851b76162f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 7 Aug 2025 12:18:03 +0000 Subject: [PATCH 1/3] Initial plan From 442260f79990cd203d12425f7c5877613fd1a6ba Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 7 Aug 2025 12:30:35 +0000 Subject: [PATCH 2/3] Update deprecated @babel/plugin-proposal-explicit-resource-management to @babel/plugin-transform-explicit-resource-management Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com> --- .../proposals/explicit_resource_management.rs | 4 +- pnpm-lock.yaml | 35 ++++++++-------- tasks/transform_conformance/package.json | 2 +- .../snapshots/babel.snap.md | 41 +------------------ .../snapshots/oxc.snap.md | 21 +--------- tasks/transform_conformance/src/constants.rs | 2 +- 6 files changed, 23 insertions(+), 82 deletions(-) diff --git a/crates/oxc_transformer/src/proposals/explicit_resource_management.rs b/crates/oxc_transformer/src/proposals/explicit_resource_management.rs index 8f117db73e1cb..c8cc205522000 100644 --- a/crates/oxc_transformer/src/proposals/explicit_resource_management.rs +++ b/crates/oxc_transformer/src/proposals/explicit_resource_management.rs @@ -27,10 +27,10 @@ //! //! ## Implementation //! -//! Implementation based on [@babel/plugin-proposal-explicit-resource-management](https://babeljs.io/docs/babel-plugin-proposal-explicit-resource-management). +//! Implementation based on [@babel/plugin-transform-explicit-resource-management](https://babeljs.io/docs/babel-plugin-transform-explicit-resource-management). //! //! ## References: -//! * Babel plugin implementation: +//! * Babel plugin implementation: //! * Explicit Resource Management TC39 proposal: use std::mem; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c2080a916d371..5a768171167c3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -173,9 +173,6 @@ importers: '@babel/plugin-proposal-decorators': specifier: ^7.25.9 version: 7.28.0(@babel/core@7.28.0) - '@babel/plugin-proposal-explicit-resource-management': - specifier: ^7.25.9 - version: 7.27.4(@babel/core@7.28.0) '@babel/plugin-transform-arrow-functions': specifier: ^7.25.9 version: 7.27.1(@babel/core@7.28.0) @@ -188,6 +185,9 @@ importers: '@babel/plugin-transform-class-static-block': specifier: ^7.26.0 version: 7.27.1(@babel/core@7.28.0) + '@babel/plugin-transform-explicit-resource-management': + specifier: ^7.25.9 + version: 7.28.0(@babel/core@7.28.0) '@babel/plugin-transform-exponentiation-operator': specifier: ^7.25.9 version: 7.27.1(@babel/core@7.28.0) @@ -375,13 +375,6 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-proposal-explicit-resource-management@7.27.4': - resolution: {integrity: sha512-1SwtCDdZWQvUU1i7wt/ihP7W38WjC3CSTOHAl+Xnbze8+bbMNjRvRQydnj0k9J1jPqCAZctBFp6NHJXkrVVmEA==} - engines: {node: '>=6.9.0'} - deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-explicit-resource-management instead. - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-decorators@7.27.1': resolution: {integrity: sha512-YMq8Z87Lhl8EGkmb0MwYkt36QnxC+fzCgrl66ereamPlYToRpIk5nUjKUY3QKLWq8mwUB1BgbeXcTJhZOCDg5A==} engines: {node: '>=6.9.0'} @@ -424,6 +417,12 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-transform-explicit-resource-management@7.28.0': + resolution: {integrity: sha512-K8nhUcn3f6iB+P3gwCv/no7OdzOZQcKchW6N389V6PD8NUWKZHzndOd9sPDVbMoBsbmjMqlB4L9fm+fEFNVlwQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-transform-exponentiation-operator@7.27.1': resolution: {integrity: sha512-uspvXnhHvGKf2r4VVtBpeFnuDWsJLQ6MF6lGJLC89jBR1uoVeqM416AZtTuhTezOfgHicpJQmoD5YUakO/YmXQ==} engines: {node: '>=6.9.0'} @@ -3953,14 +3952,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/plugin-proposal-explicit-resource-management@7.27.4(@babel/core@7.28.0)': - dependencies: - '@babel/core': 7.28.0 - '@babel/helper-plugin-utils': 7.27.1 - '@babel/plugin-transform-destructuring': 7.28.0(@babel/core@7.28.0) - transitivePeerDependencies: - - supports-color - '@babel/plugin-syntax-decorators@7.27.1(@babel/core@7.28.0)': dependencies: '@babel/core': 7.28.0 @@ -4009,6 +4000,14 @@ snapshots: transitivePeerDependencies: - supports-color + '@babel/plugin-transform-explicit-resource-management@7.28.0(@babel/core@7.28.0)': + dependencies: + '@babel/core': 7.28.0 + '@babel/helper-plugin-utils': 7.27.1 + '@babel/plugin-transform-destructuring': 7.28.0(@babel/core@7.28.0) + transitivePeerDependencies: + - supports-color + '@babel/plugin-transform-exponentiation-operator@7.27.1(@babel/core@7.28.0)': dependencies: '@babel/core': 7.28.0 diff --git a/tasks/transform_conformance/package.json b/tasks/transform_conformance/package.json index 3cac9459b5433..17c23b2399252 100644 --- a/tasks/transform_conformance/package.json +++ b/tasks/transform_conformance/package.json @@ -15,7 +15,7 @@ "@babel/plugin-transform-class-static-block": "^7.26.0", "@babel/plugin-transform-exponentiation-operator": "^7.25.9", "@babel/plugin-transform-logical-assignment-operators": "^7.25.9", - "@babel/plugin-proposal-explicit-resource-management": "^7.25.9", + "@babel/plugin-transform-explicit-resource-management": "^7.25.9", "@babel/plugin-transform-optional-chaining": "^7.25.9", "@babel/plugin-transform-private-methods": "^7.25.9", "@babel/plugin-transform-private-property-in-object": "^7.25.9", diff --git a/tasks/transform_conformance/snapshots/babel.snap.md b/tasks/transform_conformance/snapshots/babel.snap.md index e11bdee05df79..3a91c12bfebb3 100644 --- a/tasks/transform_conformance/snapshots/babel.snap.md +++ b/tasks/transform_conformance/snapshots/babel.snap.md @@ -1,6 +1,6 @@ commit: 1d4546bc -Passed: 711/1200 +Passed: 691/1173 # All Passed: * babel-plugin-transform-logical-assignment-operators @@ -2818,42 +2818,3 @@ transform-react-jsx: unknown field `autoImport`, expected one of `runtime`, `dev x Output mismatch -# babel-plugin-proposal-explicit-resource-management (20/27) -* integration/commonjs-transform/input.js -x Output mismatch - -* transform-sync/function-body/input.js -Bindings mismatch: -after transform: ScopeId(1): ["_usingCtx", "x"] -rebuilt : ScopeId(1): ["_usingCtx"] -Bindings mismatch: -after transform: ScopeId(2): [] -rebuilt : ScopeId(2): ["x"] -Symbol scope ID mismatch for "x": -after transform: SymbolId(1): ScopeId(1) -rebuilt : SymbolId(2): ScopeId(2) - -* transform-sync/multiple-nested/input.js -Bindings mismatch: -after transform: ScopeId(3): ["_usingCtx3", "z"] -rebuilt : ScopeId(3): ["_usingCtx3"] -Bindings mismatch: -after transform: ScopeId(10): [] -rebuilt : ScopeId(4): ["z"] -Symbol scope ID mismatch for "z": -after transform: SymbolId(2): ScopeId(3) -rebuilt : SymbolId(5): ScopeId(4) - -* transform-sync/named-evaluation/input.js -x Output mismatch - -* transform-top-level/hoisting/input.mjs -x Output mismatch - -* transform-top-level/hoisting-default-class/input.mjs -x Output mismatch - -* transform-top-level/hoisting-mutate-outer-class-binding/input.js -x Output mismatch - - diff --git a/tasks/transform_conformance/snapshots/oxc.snap.md b/tasks/transform_conformance/snapshots/oxc.snap.md index 68ac6157d77e6..ef0c09f4a7838 100644 --- a/tasks/transform_conformance/snapshots/oxc.snap.md +++ b/tasks/transform_conformance/snapshots/oxc.snap.md @@ -1,6 +1,6 @@ commit: 1d4546bc -Passed: 182/302 +Passed: 180/298 # All Passed: * babel-plugin-transform-class-static-block @@ -520,25 +520,6 @@ x Output mismatch x Output mismatch -# babel-plugin-proposal-explicit-resource-management (2/4) -* export-class-name/input.js -x Output mismatch - -* function-with-scopes-in-params/input.js -Bindings mismatch: -after transform: ScopeId(1): ["_usingCtx", "a", "b", "x", "y"] -rebuilt : ScopeId(1): ["_usingCtx", "a", "b"] -Bindings mismatch: -after transform: ScopeId(5): [] -rebuilt : ScopeId(4): ["x", "y"] -Symbol scope ID mismatch for "x": -after transform: SymbolId(3): ScopeId(1) -rebuilt : SymbolId(4): ScopeId(4) -Symbol scope ID mismatch for "y": -after transform: SymbolId(4): ScopeId(1) -rebuilt : SymbolId(5): ScopeId(4) - - # legacy-decorators (6/79) * oxc/metadata/abstract-class/input.ts Symbol reference IDs mismatch for "Dependency": diff --git a/tasks/transform_conformance/src/constants.rs b/tasks/transform_conformance/src/constants.rs index e634f71414b17..4bdc7a49e3960 100644 --- a/tasks/transform_conformance/src/constants.rs +++ b/tasks/transform_conformance/src/constants.rs @@ -56,7 +56,7 @@ pub const PLUGINS: &[&str] = &[ "babel-plugin-transform-react-jsx-development", // // Proposal // "babel-plugin-proposal-decorators", - "babel-plugin-proposal-explicit-resource-management", + "babel-plugin-transform-explicit-resource-management", // RegExp tests ported from esbuild + a few additions "regexp", // Legacy decorators, tests almost ported from TypeScript From 8738e3c8aabcc0c03e96ad9ede083f3950046747 Mon Sep 17 00:00:00 2001 From: Boshen Date: Thu, 7 Aug 2025 23:18:04 +0800 Subject: [PATCH 3/3] update --- .github/actions/clone-submodules/action.yml | 2 +- .../src/options/babel/plugins.rs | 2 +- justfile | 2 +- tasks/coverage/snapshots/codegen_babel.snap | 6 +- tasks/coverage/snapshots/minifier_babel.snap | 6 +- tasks/coverage/snapshots/parser_babel.snap | 631 +++++++++++++++++- tasks/coverage/snapshots/semantic_babel.snap | 130 +++- .../coverage/snapshots/transformer_babel.snap | 6 +- .../snapshots/babel.snap.md | 103 ++- .../snapshots/babel_exec.snap.md | 12 +- .../snapshots/oxc.snap.md | 2 +- .../snapshots/oxc_exec.snap.md | 2 +- tasks/transform_conformance/src/constants.rs | 27 +- .../fixtures/export-class-name/options.json | 2 +- .../fixtures/for-of-no-block/options.json | 2 +- .../options.json | 2 +- .../test/fixtures/try-catch/options.json | 2 +- .../transform_conformance/update_fixtures.mjs | 2 +- 18 files changed, 887 insertions(+), 54 deletions(-) diff --git a/.github/actions/clone-submodules/action.yml b/.github/actions/clone-submodules/action.yml index 4f5dc45009d2f..b28f2f56b6430 100644 --- a/.github/actions/clone-submodules/action.yml +++ b/.github/actions/clone-submodules/action.yml @@ -52,7 +52,7 @@ runs: persist-credentials: false repository: babel/babel path: tasks/coverage/babel - ref: 1d4546bcb80009303aab386b59f4df1fd335c1d5 + ref: 98d18aa4f66ce300a6a863bad223ab67b3fdf282 - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 if: ${{ inputs.typescript == 'true' }} diff --git a/crates/oxc_transformer/src/options/babel/plugins.rs b/crates/oxc_transformer/src/options/babel/plugins.rs index 0cd0f5b255d65..ca8d0ec25e61c 100644 --- a/crates/oxc_transformer/src/options/babel/plugins.rs +++ b/crates/oxc_transformer/src/options/babel/plugins.rs @@ -163,7 +163,7 @@ impl TryFrom for BabelPlugins { p.legacy_decorator = entry.value::().map_err(|err| p.errors.push(err)).ok(); } - "proposal-explicit-resource-management" => p.explicit_resource_management = true, + "transform-explicit-resource-management" => p.explicit_resource_management = true, "styled-components" => { p.styled_components = entry .value::() diff --git a/justfile b/justfile index b986f03a282cf..aed2058947537 100755 --- a/justfile +++ b/justfile @@ -37,7 +37,7 @@ ready: # Make sure to update `.github/actions/clone-submodules/action.yml` too submodules: just clone-submodule tasks/coverage/test262 https://github.com/tc39/test262.git 4b5d36ab6ef2f59d0a8902cd383762547a3a74c4 - just clone-submodule tasks/coverage/babel https://github.com/babel/babel.git 1d4546bcb80009303aab386b59f4df1fd335c1d5 + just clone-submodule tasks/coverage/babel https://github.com/babel/babel.git 98d18aa4f66ce300a6a863bad223ab67b3fdf282 just clone-submodule tasks/coverage/typescript https://github.com/microsoft/TypeScript.git 81c951894e93bdc37c6916f18adcd80de76679bc just clone-submodule tasks/prettier_conformance/prettier https://github.com/prettier/prettier.git 7584432401a47a26943dd7a9ca9a8e032ead7285 just clone-submodule tasks/coverage/acorn-test262 https://github.com/oxc-project/acorn-test262 d9ba02ddea22800a285c7ad24e3fbfbb00ccbb02 diff --git a/tasks/coverage/snapshots/codegen_babel.snap b/tasks/coverage/snapshots/codegen_babel.snap index 223f6df55e6a4..c80c878ddd401 100644 --- a/tasks/coverage/snapshots/codegen_babel.snap +++ b/tasks/coverage/snapshots/codegen_babel.snap @@ -1,8 +1,8 @@ -commit: 1d4546bc +commit: 98d18aa4 codegen_babel Summary: -AST Parsed : 2362/2362 (100.00%) -Positive Passed: 2360/2362 (99.92%) +AST Parsed : 2419/2419 (100.00%) +Positive Passed: 2417/2419 (99.92%) Normal: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/uncategorised/47/input.js Normal: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/uncategorised/48/input.js diff --git a/tasks/coverage/snapshots/minifier_babel.snap b/tasks/coverage/snapshots/minifier_babel.snap index 76d31dc9b0e75..acc914e52436c 100644 --- a/tasks/coverage/snapshots/minifier_babel.snap +++ b/tasks/coverage/snapshots/minifier_babel.snap @@ -1,8 +1,8 @@ -commit: 1d4546bc +commit: 98d18aa4 minifier_babel Summary: -AST Parsed : 1762/1762 (100.00%) -Positive Passed: 1760/1762 (99.89%) +AST Parsed : 1816/1816 (100.00%) +Positive Passed: 1814/1816 (99.89%) Compress: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/uncategorised/47/input.js Compress: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/uncategorised/48/input.js diff --git a/tasks/coverage/snapshots/parser_babel.snap b/tasks/coverage/snapshots/parser_babel.snap index 04415feaa1d8a..f77d365e65d9b 100644 --- a/tasks/coverage/snapshots/parser_babel.snap +++ b/tasks/coverage/snapshots/parser_babel.snap @@ -1,15 +1,25 @@ -commit: 1d4546bc +commit: 98d18aa4 parser_babel Summary: -AST Parsed : 2351/2362 (99.53%) -Positive Passed: 2332/2362 (98.73%) -Negative Passed: 1600/1698 (94.23%) +AST Parsed : 2403/2419 (99.34%) +Positive Passed: 2381/2419 (98.43%) +Negative Passed: 1640/1756 (93.39%) Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/categorized/invalid-startindex-and-startline-specified-without-startcolumn/input.js Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/categorized/startline-and-startcolumn-specified/input.js Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/categorized/startline-specified/input.js +Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/sourcetype-commonjs/invalid-allowAwaitOutsideFunction-false/input.js + +Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/sourcetype-commonjs/invalid-allowNewTargetOutsideFunction-false/input.js + +Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/sourcetype-commonjs/invalid-allowNewTargetOutsideFunction-true/input.js + +Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/sourcetype-commonjs/invalid-allowReturnOutsideFunction-false/input.js + +Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/sourcetype-commonjs/invalid-allowReturnOutsideFunction-true/input.js + Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-in-object-method/input.js Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2015/destructuring/error-operator-for-default/input.js @@ -30,6 +40,30 @@ Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2022/private-in/invalid-private-followed-by-in-2/input.js +Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/invalid-in-single-statement-context-async/input.js + +Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/invalid-in-single-statement-context-sync/input.js + +Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/invalid-module-bare-case-await-using-binding/input.js + +Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/invalid-script-bare-case-await-using-binding/input.js + +Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/invalid-script-top-level-labeled-using-binding/input.js + +Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/invalid-script-top-level-using-binding/input.js + +Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/invalid-in-single-statement-context/input.js + +Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/invalid-labeled-using-binding/input.js + +Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/invalid-module-bare-case-using-binding/input.js + +Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/invalid-script-bare-case-using-binding/input.js + +Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/invalid-script-top-level-labeled-using-binding/input.js + +Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/invalid-script-top-level-using-binding/input.js + Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-parameter-binding-property-reserved/input.js Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/estree/class-private-property/typescript-invalid-abstract/input.ts @@ -76,6 +110,8 @@ Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/ty Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-abstract/input.ts +Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/declare/invalid-namespace-var/input.ts + Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/declare/module-class/input.ts Expect Syntax Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/declare/module-function/input.ts @@ -218,6 +254,32 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/o ╰──── help: new.target is only allowed in constructors and functions invoked using thew `new` operator +Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/sourcetype-commonjs/top-level-new-target/input.js + + × Unexpected new.target expression + ╭─[babel/packages/babel-parser/test/fixtures/core/sourcetype-commonjs/top-level-new-target/input.js:1:1] + 1 │ new.target; + · ────────── + ╰──── + help: new.target is only allowed in constructors and functions invoked using thew `new` operator + +Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/sourcetype-commonjs/top-level-return/input.js + + × TS(1108): A 'return' statement can only be used within a function body. + ╭─[babel/packages/babel-parser/test/fixtures/core/sourcetype-commonjs/top-level-return/input.js:1:1] + 1 │ return {} / 2 + · ────── + ╰──── + +Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/sourcetype-commonjs/top-level-return-asi/input.js + + × TS(1108): A 'return' statement can only be used within a function body. + ╭─[babel/packages/babel-parser/test/fixtures/core/sourcetype-commonjs/top-level-return-asi/input.js:1:1] + 1 │ return + · ────── + 2 │ {} + ╰──── + Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-key/input.js × 'arguments' is not allowed in class field initializer @@ -325,6 +387,66 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2022 2 │ ╰──── +Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/valid-module-block-top-level-using-binding/input.js + + × Expected a semicolon or an implicit semicolon after a statement, but found none + ╭─[babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/valid-module-block-top-level-using-binding/input.js:1:17] + 1 │ const m = module { + · ▲ + 2 │ await using foo = bar(); + ╰──── + help: Try insert a semicolon here + +Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/valid-for-await-using-binding-escaped-of-of/input.mjs + + × Keywords cannot contain escape characters + ╭─[babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/valid-for-await-using-binding-escaped-of-of/input.mjs:1:18] + 1 │ for await (using \u006ff of of); + · ─────── + ╰──── + + × Expected `)` but found `of` + ╭─[babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/valid-for-await-using-binding-escaped-of-of/input.mjs:1:29] + 1 │ for await (using \u006ff of of); + · ─┬ + · ╰── `)` expected + ╰──── + +Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/valid-for-using-binding-escaped-of-of/input.js + + × Keywords cannot contain escape characters + ╭─[babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/valid-for-using-binding-escaped-of-of/input.js:1:12] + 1 │ for (using o\u0066 of of); + · ─────── + ╰──── + + × Expected `)` but found `of` + ╭─[babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/valid-for-using-binding-escaped-of-of/input.js:1:23] + 1 │ for (using o\u0066 of of); + · ─┬ + · ╰── `)` expected + ╰──── + +Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/valid-for-using-declaration-binding-of/input.js + + × Unexpected token + ╭─[babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/valid-for-using-declaration-binding-of/input.js:2:17] + 1 │ { + 2 │ for (using of = reader();;); + · ─ + 3 │ } + ╰──── + +Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/valid-module-block-top-level-using-binding/input.js + + × Expected a semicolon or an implicit semicolon after a statement, but found none + ╭─[babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/valid-module-block-top-level-using-binding/input.js:1:7] + 1 │ module { + · ▲ + 2 │ using foo = bar(); + ╰──── + help: Try insert a semicolon here + Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/arrow-function/generic-tsx-babel-7/input.ts × Unexpected token. Did you mean `{'>'}` or `>`? @@ -1157,6 +1279,14 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc ╰──── help: new.target is only allowed in constructors and functions invoked using thew `new` operator + × TS(1108): A 'return' statement can only be used within a function body. + ╭─[babel/packages/babel-parser/test/fixtures/core/opts/allowReturnOutsideFunction-true-invalid-in-static-block/input.js:3:5] + 2 │ static { + 3 │ return 0; + · ────── + 4 │ } + ╰──── + × A 'yield' expression is only allowed in a generator body. ╭─[babel/packages/babel-parser/test/fixtures/core/opts/allowYieldOutsideFunction-false/input.js:1:1] 1 │ yield 1; @@ -1507,6 +1637,18 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc ╰──── help: In strict mode code, functions can only be declared at top level or inside a block + × `await` is only allowed within async functions and at the top levels of modules + ╭─[babel/packages/babel-parser/test/fixtures/core/sourcetype-commonjs/invalid-top-level-await/input.js:1:1] + 1 │ await Promise.resolve(); + · ───── + ╰──── + + × A 'yield' expression is only allowed in a generator body. + ╭─[babel/packages/babel-parser/test/fixtures/core/sourcetype-commonjs/invalid-top-level-yield/input.js:1:1] + 1 │ yield 0; + · ───── + ╰──── + × Expected a semicolon or an implicit semicolon after a statement, but found none ╭─[babel/packages/babel-parser/test/fixtures/core/uncategorised/108/input.js:1:17] 1 │ var x = /[P QR]/\u0067 @@ -5931,24 +6073,48 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc · ─ ╰──── + × Invalid characters after number + ╭─[babel/packages/babel-parser/test/fixtures/es2020/bigint/invalid-decimal-babel-7/input.js:1:4] + 1 │ 1.0n + · ─ + ╰──── + × Invalid characters after number ╭─[babel/packages/babel-parser/test/fixtures/es2020/bigint/invalid-e/input.js:1:4] 1 │ 2e9n · ─ ╰──── + × Invalid characters after number + ╭─[babel/packages/babel-parser/test/fixtures/es2020/bigint/invalid-e-babel-7/input.js:1:4] + 1 │ 2e9n + · ─ + ╰──── + × Invalid characters after number ╭─[babel/packages/babel-parser/test/fixtures/es2020/bigint/invalid-non-octal-decimal-int/input.js:1:4] 1 │ 089n · ─ ╰──── + × Invalid characters after number + ╭─[babel/packages/babel-parser/test/fixtures/es2020/bigint/invalid-non-octal-decimal-int-babel-7/input.js:1:4] + 1 │ 089n + · ─ + ╰──── + × Invalid characters after number ╭─[babel/packages/babel-parser/test/fixtures/es2020/bigint/invalid-octal-legacy/input.js:1:7] 1 │ 016432n · ─ ╰──── + × Invalid characters after number + ╭─[babel/packages/babel-parser/test/fixtures/es2020/bigint/invalid-octal-legacy-babel-7/input.js:1:7] + 1 │ 016432n + · ─ + ╰──── + × The only valid meta property for import is import.meta ╭─[babel/packages/babel-parser/test/fixtures/es2020/dynamic-import/direct-calls-only/input.js:2:10] 1 │ function failsParse() { @@ -7233,6 +7399,12 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc · ─ ╰──── + × Invalid characters after number + ╭─[babel/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-non-octal-decimal-int-babel-7/input.js:1:3] + 1 │ 08_0n + · ─ + ╰──── + × Invalid escape sequence ╭─[babel/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-unicode/input.js:1:2] 1 │ "\u{1F_639}" @@ -8682,6 +8854,381 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc · ──── ╰──── + × Identifier `f` has already been declared + ╭─[babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/invalid-duplicate-using-bindings/input.js:3:17] + 2 │ { + 3 │ await using f = foo(), f = foo(); + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + 4 │ } + ╰──── + + × Identifier `g` has already been declared + ╭─[babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/invalid-duplicate-using-bindings/input.js:6:17] + 5 │ { + 6 │ await using g = foo(); + · ┬ + · ╰── `g` has already been declared here + 7 │ await using g = foo(); + · ┬ + · ╰── It can not be redeclared here + 8 │ } + ╰──── + + × Unexpected token + ╭─[babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/invalid-export-await-using/input.js:1:8] + 1 │ export await using basic = reader(); + · ───── + ╰──── + + × Expected a semicolon or an implicit semicolon after a statement, but found none + ╭─[babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/invalid-export-default-await-using/input.js:1:27] + 1 │ export default await using basic = reader(); + · ▲ + ╰──── + help: Try insert a semicolon here + + × Expected `;` but found `Identifier` + ╭─[babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/invalid-for-of-await-linebreak-using/input.js:3:11] + 2 │ for (await + 3 │ using basic of []); + · ──┬── + · ╰── `;` expected + 4 │ } + ╰──── + + × Expected `;` but found `Identifier` + ╭─[babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/invalid-for-of-await-using-linebreak/input.js:3:5] + 2 │ for (await using + 3 │ basic of []); + · ──┬── + · ╰── `;` expected + 4 │ } + ╰──── + + × Cannot assign to this expression + ╭─[babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/invalid-using-array-pattern/input.js:2:3] + 1 │ async function f() { + 2 │ await using [ foo ] = f(); + · ─────────────────── + 3 │ } + ╰──── + + × Cannot use `await` as an identifier in an async context + ╭─[babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/invalid-using-binding-await-module/input.js:2:15] + 1 │ async function f () { + 2 │ await using await = h(); + · ───── + 3 │ } + ╰──── + + × Cannot use `await` as an identifier in an async context + ╭─[babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/invalid-using-binding-await-module/input.js:5:15] + 4 │ async function g () { + 5 │ await using \u0061wait = h(); + · ────────── + 6 │ } + ╰──── + + × Cannot use `await` as an identifier in an async context + ╭─[babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/invalid-using-binding-await-module/input.js:8:24] + 7 │ async function h () { + 8 │ await using x = h(), await = h(); + · ───── + 9 │ } + ╰──── + + × Cannot use `await` as an identifier in an async context + ╭─[babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/invalid-using-binding-await-module/input.js:11:20] + 10 │ async function i () { + 11 │ for (await using await of []); + · ───── + 12 │ } + ╰──── + + × The keyword 'await' is reserved + ╭─[babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/invalid-using-binding-await-module/input.js:2:15] + 1 │ async function f () { + 2 │ await using await = h(); + · ───── + 3 │ } + ╰──── + + × The keyword 'await' is reserved + ╭─[babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/invalid-using-binding-await-module/input.js:5:15] + 4 │ async function g () { + 5 │ await using \u0061wait = h(); + · ────────── + 6 │ } + ╰──── + + × The keyword 'await' is reserved + ╭─[babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/invalid-using-binding-await-module/input.js:8:24] + 7 │ async function h () { + 8 │ await using x = h(), await = h(); + · ───── + 9 │ } + ╰──── + + × The keyword 'await' is reserved + ╭─[babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/invalid-using-binding-await-module/input.js:11:20] + 10 │ async function i () { + 11 │ for (await using await of []); + · ───── + 12 │ } + ╰──── + + × Cannot use `await` as an identifier in an async context + ╭─[babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/invalid-using-binding-await-script/input.js:2:15] + 1 │ async function f() { + 2 │ await using await = h(); + · ───── + 3 │ } + ╰──── + + × Cannot use `await` as an identifier in an async context + ╭─[babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/invalid-using-binding-await-script/input.js:5:15] + 4 │ async function f() { + 5 │ await using \u0061wait = h(); + · ────────── + 6 │ } + ╰──── + + × Cannot use `await` as an identifier in an async context + ╭─[babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/invalid-using-binding-await-script/input.js:8:24] + 7 │ async function f() { + 8 │ await using x = h(), await = h(); + · ───── + 9 │ } + ╰──── + + × Cannot use `await` as an identifier in an async context + ╭─[babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/invalid-using-binding-await-script/input.js:11:20] + 10 │ async function f() { + 11 │ for (await using await of []); + · ───── + 12 │ } + ╰──── + + × `let` cannot be declared as a variable name inside of a `await using` declaration + ╭─[babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/invalid-using-binding-let/input.js:2:15] + 1 │ async function f() { + 2 │ await using let = h(); + · ─── + 3 │ } + ╰──── + + × Expected a semicolon or an implicit semicolon after a statement, but found none + ╭─[babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/invalid-using-decl-as-expr/input.js:2:16] + 1 │ async function f() { + 2 │ 0,await using basic = getReader(); + · ▲ + 3 │ } + ╰──── + help: Try insert a semicolon here + + × Using declarations must have an initializer. + ╭─[babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/invalid-using-no-initializer/input.js:2:15] + 1 │ async function f() { + 2 │ await using f; + · ─ + 3 │ } + ╰──── + + × Expected a semicolon or an implicit semicolon after a statement, but found none + ╭─[babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/invalid-using-object-pattern/input.js:2:14] + 1 │ async function f() { + 2 │ await using { foo } = f(); + · ▲ + 3 │ } + ╰──── + help: Try insert a semicolon here + + × Using declarations may not have binding patterns. + ╭─[babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/disallow-destructuring/input.js:1:17] + 1 │ using x = null, {} = null; + · ── + 2 │ using y = null, [] = null; + ╰──── + + × Using declarations may not have binding patterns. + ╭─[babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/disallow-destructuring/input.js:2:17] + 1 │ using x = null, {} = null; + 2 │ using y = null, [] = null; + · ── + 3 │ using {} = null; + ╰──── + + × Using declarations may not have binding patterns. + ╭─[babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/disallow-destructuring/input.js:3:7] + 2 │ using y = null, [] = null; + 3 │ using {} = null; + · ── + ╰──── + + × Identifier `f` has already been declared + ╭─[babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/invalid-duplicate-using-bindings/input.js:2:9] + 1 │ { + 2 │ using f = foo(), f = foo(); + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + 3 │ } + ╰──── + + × Identifier `g` has already been declared + ╭─[babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/invalid-duplicate-using-bindings/input.js:5:9] + 4 │ { + 5 │ using g = foo(); + · ┬ + · ╰── `g` has already been declared here + 6 │ using g = foo(); + · ┬ + · ╰── It can not be redeclared here + 7 │ } + ╰──── + + × Expected a semicolon or an implicit semicolon after a statement, but found none + ╭─[babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/invalid-export-default-using/input.js:1:21] + 1 │ export default using basic = reader(); + · ▲ + ╰──── + help: Try insert a semicolon here + + × Unexpected token + ╭─[babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/invalid-export-using/input.js:1:8] + 1 │ export using basic = reader(); + · ───── + ╰──── + + × Expected `)` but found `of` + ╭─[babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/invalid-for-await-using-binding-of-of/input.mjs:1:24] + 1 │ for await (using of of of); + · ─┬ + · ╰── `)` expected + ╰──── + + × The left-hand side of a for...in statement cannot be an using declaration. + ╭─[babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/invalid-for-using-binding-in/input.js:1:6] + 1 │ for (using foo in {}); + · ───────── + ╰──── + + × Unexpected token + ╭─[babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/invalid-for-using-binding-of-in/input.js:1:15] + 1 │ for (using of in []); + · ── + ╰──── + + × Expected `)` but found `of` + ╭─[babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/invalid-for-using-binding-of-of/input.js:1:18] + 1 │ for (using of of of); + · ─┬ + · ╰── `)` expected + ╰──── + + × Unexpected token + ╭─[babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/invalid-for-using-of-equal-equal/input.js:1:15] + 1 │ for (using of == {};;); + · ── + ╰──── + + × Unexpected token + ╭─[babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/invalid-for-using-of-no-initializer/input.js:1:14] + 1 │ for (using of;of.isValid;); + · ─ + ╰──── + + × Cannot use `await` as an identifier in an async context + ╭─[babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/invalid-using-binding-await-module/input.js:2:9] + 1 │ { + 2 │ using await = h(); + · ───── + 3 │ } + ╰──── + + × Cannot use `await` as an identifier in an async context + ╭─[babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/invalid-using-binding-await-module/input.js:5:9] + 4 │ { + 5 │ using \u0061wait = h(); + · ────────── + 6 │ } + ╰──── + + × Cannot use `await` as an identifier in an async context + ╭─[babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/invalid-using-binding-await-module/input.js:8:18] + 7 │ { + 8 │ using x = h(), await = h(); + · ───── + 9 │ } + ╰──── + + × Cannot use `await` as an identifier in an async context + ╭─[babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/invalid-using-binding-await-module/input.js:11:14] + 10 │ { + 11 │ for (using await of []); + · ───── + 12 │ } + ╰──── + + × The keyword 'await' is reserved + ╭─[babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/invalid-using-binding-await-module/input.js:2:9] + 1 │ { + 2 │ using await = h(); + · ───── + 3 │ } + ╰──── + + × The keyword 'await' is reserved + ╭─[babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/invalid-using-binding-await-module/input.js:5:9] + 4 │ { + 5 │ using \u0061wait = h(); + · ────────── + 6 │ } + ╰──── + + × The keyword 'await' is reserved + ╭─[babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/invalid-using-binding-await-module/input.js:8:18] + 7 │ { + 8 │ using x = h(), await = h(); + · ───── + 9 │ } + ╰──── + + × The keyword 'await' is reserved + ╭─[babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/invalid-using-binding-await-module/input.js:11:14] + 10 │ { + 11 │ for (using await of []); + · ───── + 12 │ } + ╰──── + + × `let` cannot be declared as a variable name inside of a `using` declaration + ╭─[babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/invalid-using-binding-let/input.js:2:9] + 1 │ { + 2 │ using let = h(); + · ─── + 3 │ } + ╰──── + + × Expected `;` but found `{` + ╭─[babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/invalid-using-binding-pattern-for-lhs/input.js:2:14] + 1 │ { + 2 │ for (using { qux } of h()); + · ┬ + · ╰── `;` expected + 3 │ } + ╰──── + + × Using declarations must have an initializer. + ╭─[babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/invalid-using-no-initializer/input.js:2:9] + 1 │ { + 2 │ using f; + · ─ + 3 │ } + ╰──── + × Identifier `x` has already been declared ╭─[babel/packages/babel-parser/test/fixtures/esprima/declaration-function/dupe-param/input.js:1:12] 1 │ function a(x, x) {'use strict';} @@ -12406,6 +12953,82 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc · ▲ ╰──── + × Expected a semicolon or an implicit semicolon after a statement, but found none + ╭─[babel/packages/babel-parser/test/fixtures/typescript/declare/invalid-await-using-declaration/input.ts:1:8] + 1 │ declare await using basic; + · ▲ + ╰──── + help: Try insert a semicolon here + + × Expected a semicolon or an implicit semicolon after a statement, but found none + ╭─[babel/packages/babel-parser/test/fixtures/typescript/declare/invalid-await-using-declaration-with-initializer/input.ts:1:8] + 1 │ declare await using basic = null; + · ▲ + ╰──── + help: Try insert a semicolon here + + × Using declarations must have an initializer. + ╭─[babel/packages/babel-parser/test/fixtures/typescript/declare/invalid-namespace-await-using/input.ts:2:15] + 1 │ declare namespace invalid_namespace_var { + 2 │ await using A; + · ─ + 3 │ await using A1 = 0; + ╰──── + + × Using declarations must have an initializer. + ╭─[babel/packages/babel-parser/test/fixtures/typescript/declare/invalid-namespace-await-using/input.ts:5:15] + 4 │ await using A2: number = 0; + 5 │ await using B, C; + · ─ + 6 │ } + ╰──── + + × Using declarations must have an initializer. + ╭─[babel/packages/babel-parser/test/fixtures/typescript/declare/invalid-namespace-await-using/input.ts:5:18] + 4 │ await using A2: number = 0; + 5 │ await using B, C; + · ─ + 6 │ } + ╰──── + + × Using declarations must have an initializer. + ╭─[babel/packages/babel-parser/test/fixtures/typescript/declare/invalid-namespace-using/input.ts:2:9] + 1 │ declare namespace invalid_namespace_var { + 2 │ using A; + · ─ + 3 │ using A1 = 0; + ╰──── + + × Using declarations must have an initializer. + ╭─[babel/packages/babel-parser/test/fixtures/typescript/declare/invalid-namespace-using/input.ts:5:9] + 4 │ using A2: number = 0; + 5 │ using B, C; + · ─ + 6 │ } + ╰──── + + × Using declarations must have an initializer. + ╭─[babel/packages/babel-parser/test/fixtures/typescript/declare/invalid-namespace-using/input.ts:5:12] + 4 │ using A2: number = 0; + 5 │ using B, C; + · ─ + 6 │ } + ╰──── + + × Expected a semicolon or an implicit semicolon after a statement, but found none + ╭─[babel/packages/babel-parser/test/fixtures/typescript/declare/invalid-using-declaration/input.ts:1:8] + 1 │ declare using basic; + · ▲ + ╰──── + help: Try insert a semicolon here + + × Expected a semicolon or an implicit semicolon after a statement, but found none + ╭─[babel/packages/babel-parser/test/fixtures/typescript/declare/invalid-using-declaration-with-initializer/input.ts:1:8] + 1 │ declare using basic = null; + · ▲ + ╰──── + help: Try insert a semicolon here + × Unexpected exponentiation expression ╭─[babel/packages/babel-parser/test/fixtures/typescript/exponentiation/await-non-null-before-exponential/input.ts:1:14] 1 │ async (a) => await a! ** 6; diff --git a/tasks/coverage/snapshots/semantic_babel.snap b/tasks/coverage/snapshots/semantic_babel.snap index bd28d74776475..e6c2f65116d58 100644 --- a/tasks/coverage/snapshots/semantic_babel.snap +++ b/tasks/coverage/snapshots/semantic_babel.snap @@ -1,8 +1,8 @@ -commit: 1d4546bc +commit: 98d18aa4 semantic_babel Summary: -AST Parsed : 2362/2362 (100.00%) -Positive Passed: 1959/2362 (82.94%) +AST Parsed : 2419/2419 (100.00%) +Positive Passed: 2003/2419 (82.80%) semantic Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/comments/decorators/decorators-after-export/input.js Symbol span mismatch for "C": after transform: SymbolId(0): Span { start: 65, end: 66 } @@ -29,6 +29,15 @@ semantic Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/op Unexpected new.target expression Unexpected new.target expression +semantic Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/sourcetype-commonjs/top-level-new-target/input.js +Unexpected new.target expression + +semantic Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/sourcetype-commonjs/top-level-return/input.js +A 'return' statement can only be used within a function body. + +semantic Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/sourcetype-commonjs/top-level-return-asi/input.js +A 'return' statement can only be used within a function body. + semantic Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/sourcetype-unambiguous/typescript-type-only/input.ts Bindings mismatch: after transform: ScopeId(0): ["Foo"] @@ -39,12 +48,6 @@ Bindings mismatch: after transform: ScopeId(0): ["Foo"] rebuilt : ScopeId(0): [] -semantic Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/uncategorised/327/input.js -A 'return' statement can only be used within a function body. - -semantic Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/uncategorised/328/input.js -A 'return' statement can only be used within a function body. - semantic Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2022/class-private-methods/async/input.js Scope flags mismatch: after transform: ScopeId(2): ScopeFlags(StrictMode | Function) @@ -105,6 +108,107 @@ Identifier `x` has already been declared semantic Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2022/top-level-await-unambiguous/module/input.js `await` is only allowed within async functions and at the top levels of modules +semantic Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/valid-await-using-comments/input.js +Bindings mismatch: +after transform: ScopeId(1): ["_usingCtx", "_usingCtx3", "_usingCtx4"] +rebuilt : ScopeId(3): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step", "_usingCtx", "_usingCtx3", "_usingCtx4"] +Bindings mismatch: +after transform: ScopeId(7): ["_didIteratorError", "_iterator", "_iteratorAbruptCompletion", "_iteratorError", "_step"] +rebuilt : ScopeId(16): [] +Symbol scope ID mismatch for "_iteratorAbruptCompletion": +after transform: SymbolId(14): ScopeId(7) +rebuilt : SymbolId(13): ScopeId(3) +Symbol scope ID mismatch for "_didIteratorError": +after transform: SymbolId(13): ScopeId(7) +rebuilt : SymbolId(14): ScopeId(3) +Symbol scope ID mismatch for "_iteratorError": +after transform: SymbolId(15): ScopeId(7) +rebuilt : SymbolId(15): ScopeId(3) +Symbol scope ID mismatch for "_iterator": +after transform: SymbolId(16): ScopeId(7) +rebuilt : SymbolId(16): ScopeId(3) +Symbol scope ID mismatch for "_step": +after transform: SymbolId(11): ScopeId(7) +rebuilt : SymbolId(17): ScopeId(3) + +semantic Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/valid-for-using-binding-of-of/input.js +Symbol reference IDs mismatch for "of": +after transform: SymbolId(1): [ReferenceId(0)] +rebuilt : SymbolId(7): [] +Symbol reference IDs mismatch for "of": +after transform: SymbolId(2): [ReferenceId(1)] +rebuilt : SymbolId(15): [] +Reference symbol mismatch for "of": +after transform: SymbolId(1) "of" +rebuilt : +Reference symbol mismatch for "of": +after transform: SymbolId(2) "of" +rebuilt : +Unresolved references mismatch: +after transform: ["arguments", "require"] +rebuilt : ["arguments", "of", "require"] + +semantic Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/valid-module-block-top-level-using-binding/input.js +Expected a semicolon or an implicit semicolon after a statement, but found none + +semantic Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/valid-using-binding-basic/input.js +Bindings mismatch: +after transform: ScopeId(1): ["_usingCtx", "basic"] +rebuilt : ScopeId(3): ["_usingCtx"] +Bindings mismatch: +after transform: ScopeId(2): [] +rebuilt : ScopeId(4): ["basic"] +Symbol scope ID mismatch for "basic": +after transform: SymbolId(1): ScopeId(1) +rebuilt : SymbolId(5): ScopeId(4) + +semantic Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/valid-using-binding-escaped/input.js +Bindings mismatch: +after transform: ScopeId(1): ["_usingCtx", "ab"] +rebuilt : ScopeId(3): ["_usingCtx"] +Bindings mismatch: +after transform: ScopeId(2): [] +rebuilt : ScopeId(4): ["ab"] +Symbol scope ID mismatch for "ab": +after transform: SymbolId(1): ScopeId(1) +rebuilt : SymbolId(5): ScopeId(4) + +semantic Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/valid-using-binding-non-bmp/input.js +Bindings mismatch: +after transform: ScopeId(1): ["_usingCtx", "𠮷"] +rebuilt : ScopeId(3): ["_usingCtx"] +Bindings mismatch: +after transform: ScopeId(2): [] +rebuilt : ScopeId(4): ["𠮷"] +Symbol scope ID mismatch for "𠮷": +after transform: SymbolId(1): ScopeId(1) +rebuilt : SymbolId(5): ScopeId(4) + +semantic Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2026/async-explicit-resource-management/valid-using-binding-using/input.js +Bindings mismatch: +after transform: ScopeId(1): ["_usingCtx", "_usingCtx3", "using"] +rebuilt : ScopeId(3): ["_usingCtx", "_usingCtx3"] +Bindings mismatch: +after transform: ScopeId(3): [] +rebuilt : ScopeId(4): ["using"] +Symbol scope ID mismatch for "using": +after transform: SymbolId(1): ScopeId(1) +rebuilt : SymbolId(5): ScopeId(4) + +semantic Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/valid-for-await-using-binding-escaped-of-of/input.mjs +Keywords cannot contain escape characters +Expected `)` but found `of` + +semantic Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/valid-for-using-binding-escaped-of-of/input.js +Keywords cannot contain escape characters +Expected `)` but found `of` + +semantic Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/valid-for-using-declaration-binding-of/input.js +Unexpected token + +semantic Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/es2026/explicit-resource-management/valid-module-block-top-level-using-binding/input.js +Expected a semicolon or an implicit semicolon after a statement, but found none + semantic Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/estree/class-method/typescript/input.ts Scope children mismatch: after transform: ScopeId(1): [ScopeId(2)] @@ -570,6 +674,14 @@ Scope children mismatch: after transform: ScopeId(0): [ScopeId(1)] rebuilt : ScopeId(0): [] +semantic Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/declare/valid-namespace-var/input.ts +Bindings mismatch: +after transform: ScopeId(0): ["valid_namespace_var"] +rebuilt : ScopeId(0): [] +Scope children mismatch: +after transform: ScopeId(0): [ScopeId(1)] +rebuilt : ScopeId(0): [] + semantic Error: tasks/coverage/babel/packages/babel-parser/test/fixtures/typescript/declare/var/input.ts Bindings mismatch: after transform: ScopeId(0): ["x"] diff --git a/tasks/coverage/snapshots/transformer_babel.snap b/tasks/coverage/snapshots/transformer_babel.snap index e608a46a80a06..b27375aef6139 100644 --- a/tasks/coverage/snapshots/transformer_babel.snap +++ b/tasks/coverage/snapshots/transformer_babel.snap @@ -1,8 +1,8 @@ -commit: 1d4546bc +commit: 98d18aa4 transformer_babel Summary: -AST Parsed : 2362/2362 (100.00%) -Positive Passed: 2359/2362 (99.87%) +AST Parsed : 2419/2419 (100.00%) +Positive Passed: 2416/2419 (99.88%) Mismatch: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/opts/allowYieldOutsideFunction-true-2/input.js Mismatch: tasks/coverage/babel/packages/babel-parser/test/fixtures/core/uncategorised/47/input.js diff --git a/tasks/transform_conformance/snapshots/babel.snap.md b/tasks/transform_conformance/snapshots/babel.snap.md index 3a91c12bfebb3..3fc3e595a4f84 100644 --- a/tasks/transform_conformance/snapshots/babel.snap.md +++ b/tasks/transform_conformance/snapshots/babel.snap.md @@ -1,6 +1,6 @@ -commit: 1d4546bc +commit: 98d18aa4 -Passed: 691/1173 +Passed: 705/1212 # All Passed: * babel-plugin-transform-logical-assignment-operators @@ -273,6 +273,62 @@ x Output mismatch x Output mismatch +# babel-plugin-transform-explicit-resource-management (21/29) +* integration/commonjs-transform/input.js +x Output mismatch + +* transform-sync/for-head-shadow/input.js +x Output mismatch + +* transform-sync/function-body/input.js +Bindings mismatch: +after transform: ScopeId(1): ["_usingCtx", "x"] +rebuilt : ScopeId(1): ["_usingCtx"] +Bindings mismatch: +after transform: ScopeId(2): [] +rebuilt : ScopeId(2): ["x"] +Symbol scope ID mismatch for "x": +after transform: SymbolId(1): ScopeId(1) +rebuilt : SymbolId(2): ScopeId(2) + +* transform-sync/multiple-nested/input.js +Bindings mismatch: +after transform: ScopeId(3): ["_usingCtx3", "z"] +rebuilt : ScopeId(3): ["_usingCtx3"] +Bindings mismatch: +after transform: ScopeId(10): [] +rebuilt : ScopeId(4): ["z"] +Symbol scope ID mismatch for "z": +after transform: SymbolId(2): ScopeId(3) +rebuilt : SymbolId(5): ScopeId(4) + +* transform-sync/named-evaluation/input.js +x Output mismatch + +* transform-top-level/hoisting/input.mjs +x Output mismatch + +* transform-top-level/hoisting-default-class/input.mjs +x Output mismatch + +* transform-top-level/hoisting-mutate-outer-class-binding/input.js +x Output mismatch + + +# babel-plugin-transform-unicode-sets-regex (0/4) +* basic/basic/input.js +x Output mismatch + +* basic/string-properties/input.js +x Output mismatch + +* transform-u/basic/input.js +x Output mismatch + +* transform-u/string-properties/input.js +x Output mismatch + + # babel-plugin-transform-class-properties (212/269) * assumption-constantSuper/complex-super-class/input.js x Output mismatch @@ -455,7 +511,37 @@ x Output mismatch x Output mismatch -# babel-plugin-transform-class-static-block (17/21) +# babel-plugin-transform-class-static-block (10/24) +* class-static-block/before-static-fields/input.js +x Output mismatch + +* class-static-block/class-binding/input.js +x Output mismatch + +* class-static-block/class-declaration/input.js +x Output mismatch + +* class-static-block/class-inferred-name/input.js +x Output mismatch + +* class-static-block/in-class-heritage/input.js +x Output mismatch + +* class-static-block/multiple-static-initializers/input.js +x Output mismatch + +* class-static-block/name-conflict/input.js +x Output mismatch + +* class-static-block/new-target/input.js +x Output mismatch + +* class-static-block/preserve-comments/input.js +x Output mismatch + +* class-static-block/var-scope/input.js +x Output mismatch + * integration/in-class-heritage/input.js x Output mismatch @@ -1197,6 +1283,17 @@ rebuilt : [ReferenceId(0), ReferenceId(7)] +# babel-plugin-transform-dotall-regex (0/3) +* dotall-regex/simple/input.js +x Output mismatch + +* dotall-regex/with-unicode-flag/input.js +x Output mismatch + +* dotall-regex/with-unicode-property-escape/input.js +x Output mismatch + + # babel-plugin-transform-async-to-generator (10/31) * assumption-ignoreFunctionLength-true/basic/input.mjs diff --git a/tasks/transform_conformance/snapshots/babel_exec.snap.md b/tasks/transform_conformance/snapshots/babel_exec.snap.md index bb2ba8cb906aa..a5953aecd6c6d 100644 --- a/tasks/transform_conformance/snapshots/babel_exec.snap.md +++ b/tasks/transform_conformance/snapshots/babel_exec.snap.md @@ -1,15 +1,11 @@ -commit: 1d4546bc +commit: 98d18aa4 node: v22.14.0 -Passed: 322 of 412 (78.16%) +Passed: 324 of 414 (78.26%) Failures: -./fixtures/babel/babel-plugin-proposal-explicit-resource-management-test-fixtures-transform-top-level-hoisting-mutate-outer-class-binding-exec.test.js -Parse failure: 'import', and 'export' cannot be used outside of module code -At file: ./tasks/transform_conformance/fixtures/babel/babel-plugin-proposal-explicit-resource-management-test-fixtures-transform-top-level-hoisting-mutate-outer-class-binding-exec.test.js:4:1 - ./fixtures/babel/babel-plugin-transform-arrow-functions-test-fixtures-arrow-functions-implicit-var-arguments-exec.test.js Parse failure: 'eval' and 'arguments' cannot be used as a binding identifier in strict mode At file: ./tasks/transform_conformance/fixtures/babel/babel-plugin-transform-arrow-functions-test-fixtures-arrow-functions-implicit-var-arguments-exec.test.js:4:5 @@ -81,6 +77,10 @@ TypeError: attempted to use private field on non-instance AssertionError: expected [Function Base] to be undefined // Object.is equality at ./tasks/transform_conformance/fixtures/babel/babel-plugin-transform-class-static-block-test-fixtures-integration-new-target-exec.test.js:10:29 +./fixtures/babel/babel-plugin-transform-explicit-resource-management-test-fixtures-transform-top-level-hoisting-mutate-outer-class-binding-exec.test.js +Parse failure: 'import', and 'export' cannot be used outside of module code +At file: ./tasks/transform_conformance/fixtures/babel/babel-plugin-transform-explicit-resource-management-test-fixtures-transform-top-level-hoisting-mutate-outer-class-binding-exec.test.js:4:1 + ./fixtures/babel/babel-plugin-transform-object-rest-spread-test-fixtures-object-rest-for-x-assignment-shadowed-block-scoped-bindings-exec.test.js ReferenceError: Cannot access 'a' before initialization at ./tasks/transform_conformance/fixtures/babel/babel-plugin-transform-object-rest-spread-test-fixtures-object-rest-for-x-assignment-shadowed-block-scoped-bindings-exec.test.js:8:19 diff --git a/tasks/transform_conformance/snapshots/oxc.snap.md b/tasks/transform_conformance/snapshots/oxc.snap.md index ef0c09f4a7838..e06d671a6af23 100644 --- a/tasks/transform_conformance/snapshots/oxc.snap.md +++ b/tasks/transform_conformance/snapshots/oxc.snap.md @@ -1,4 +1,4 @@ -commit: 1d4546bc +commit: 98d18aa4 Passed: 180/298 diff --git a/tasks/transform_conformance/snapshots/oxc_exec.snap.md b/tasks/transform_conformance/snapshots/oxc_exec.snap.md index 26dd7eb79d0e7..8d630b797976e 100644 --- a/tasks/transform_conformance/snapshots/oxc_exec.snap.md +++ b/tasks/transform_conformance/snapshots/oxc_exec.snap.md @@ -1,4 +1,4 @@ -commit: 1d4546bc +commit: 98d18aa4 node: v22.14.0 diff --git a/tasks/transform_conformance/src/constants.rs b/tasks/transform_conformance/src/constants.rs index 4bdc7a49e3960..68796b44265d8 100644 --- a/tasks/transform_conformance/src/constants.rs +++ b/tasks/transform_conformance/src/constants.rs @@ -1,13 +1,15 @@ pub const PLUGINS: &[&str] = &[ "babel-preset-env", - // // ES2024 - // "babel-plugin-transform-unicode-sets-regex", - // // ES2022 + // ES2026 + "babel-plugin-transform-explicit-resource-management", + // ES2024 + "babel-plugin-transform-unicode-sets-regex", + // ES2022 "babel-plugin-transform-class-properties", "babel-plugin-transform-class-static-block", "babel-plugin-transform-private-methods", "babel-plugin-transform-private-property-in-object", - // // [Syntax] "babel-plugin-transform-syntax-top-level-await", + // [Syntax] "babel-plugin-transform-syntax-top-level-await", // ES2021 "babel-plugin-transform-logical-assignment-operators", // "babel-plugin-transform-numeric-separator", @@ -16,19 +18,19 @@ pub const PLUGINS: &[&str] = &[ // "babel-plugin-transform-dynamic-import", "babel-plugin-transform-nullish-coalescing-operator", "babel-plugin-transform-optional-chaining", - // // [Syntax] "babel-plugin-transform-syntax-bigint", - // // [Syntax] "babel-plugin-transform-syntax-dynamic-import", - // // [Syntax] "babel-plugin-transform-syntax-import-meta", + // [Syntax] "babel-plugin-transform-syntax-bigint", + // [Syntax] "babel-plugin-transform-syntax-dynamic-import", + // [Syntax] "babel-plugin-transform-syntax-import-meta", // ES2019 "babel-plugin-transform-optional-catch-binding", // "babel-plugin-transform-json-strings", - // // ES2018 + // ES2018 "babel-plugin-transform-async-generator-functions", "babel-plugin-transform-object-rest-spread", - // // [Regex] "babel-plugin-transform-unicode-property-regex", - // "babel-plugin-transform-dotall-regex", - // // [Regex] "babel-plugin-transform-named-capturing-groups-regex", - // // ES2017 + // [Regex] "babel-plugin-transform-unicode-property-regex", + "babel-plugin-transform-dotall-regex", + // [Regex] "babel-plugin-transform-named-capturing-groups-regex", + // ES2017 "babel-plugin-transform-async-to-generator", // ES2016 "babel-plugin-transform-exponentiation-operator", @@ -56,7 +58,6 @@ pub const PLUGINS: &[&str] = &[ "babel-plugin-transform-react-jsx-development", // // Proposal // "babel-plugin-proposal-decorators", - "babel-plugin-transform-explicit-resource-management", // RegExp tests ported from esbuild + a few additions "regexp", // Legacy decorators, tests almost ported from TypeScript diff --git a/tasks/transform_conformance/tests/babel-plugin-proposal-explicit-resource-management/test/fixtures/export-class-name/options.json b/tasks/transform_conformance/tests/babel-plugin-proposal-explicit-resource-management/test/fixtures/export-class-name/options.json index 2bc3ea3845be0..f87dae6e7440f 100644 --- a/tasks/transform_conformance/tests/babel-plugin-proposal-explicit-resource-management/test/fixtures/export-class-name/options.json +++ b/tasks/transform_conformance/tests/babel-plugin-proposal-explicit-resource-management/test/fixtures/export-class-name/options.json @@ -1,3 +1,3 @@ { - "plugins": ["proposal-explicit-resource-management"] + "plugins": ["transform-explicit-resource-management"] } diff --git a/tasks/transform_conformance/tests/babel-plugin-proposal-explicit-resource-management/test/fixtures/for-of-no-block/options.json b/tasks/transform_conformance/tests/babel-plugin-proposal-explicit-resource-management/test/fixtures/for-of-no-block/options.json index 2bc3ea3845be0..f87dae6e7440f 100644 --- a/tasks/transform_conformance/tests/babel-plugin-proposal-explicit-resource-management/test/fixtures/for-of-no-block/options.json +++ b/tasks/transform_conformance/tests/babel-plugin-proposal-explicit-resource-management/test/fixtures/for-of-no-block/options.json @@ -1,3 +1,3 @@ { - "plugins": ["proposal-explicit-resource-management"] + "plugins": ["transform-explicit-resource-management"] } diff --git a/tasks/transform_conformance/tests/babel-plugin-proposal-explicit-resource-management/test/fixtures/function-with-scopes-in-params/options.json b/tasks/transform_conformance/tests/babel-plugin-proposal-explicit-resource-management/test/fixtures/function-with-scopes-in-params/options.json index 2bc3ea3845be0..f87dae6e7440f 100644 --- a/tasks/transform_conformance/tests/babel-plugin-proposal-explicit-resource-management/test/fixtures/function-with-scopes-in-params/options.json +++ b/tasks/transform_conformance/tests/babel-plugin-proposal-explicit-resource-management/test/fixtures/function-with-scopes-in-params/options.json @@ -1,3 +1,3 @@ { - "plugins": ["proposal-explicit-resource-management"] + "plugins": ["transform-explicit-resource-management"] } diff --git a/tasks/transform_conformance/tests/babel-plugin-proposal-explicit-resource-management/test/fixtures/try-catch/options.json b/tasks/transform_conformance/tests/babel-plugin-proposal-explicit-resource-management/test/fixtures/try-catch/options.json index 2bc3ea3845be0..f87dae6e7440f 100644 --- a/tasks/transform_conformance/tests/babel-plugin-proposal-explicit-resource-management/test/fixtures/try-catch/options.json +++ b/tasks/transform_conformance/tests/babel-plugin-proposal-explicit-resource-management/test/fixtures/try-catch/options.json @@ -1,3 +1,3 @@ { - "plugins": ["proposal-explicit-resource-management"] + "plugins": ["transform-explicit-resource-management"] } diff --git a/tasks/transform_conformance/update_fixtures.mjs b/tasks/transform_conformance/update_fixtures.mjs index dda43b04c38d1..7116047face0d 100644 --- a/tasks/transform_conformance/update_fixtures.mjs +++ b/tasks/transform_conformance/update_fixtures.mjs @@ -21,7 +21,7 @@ const PACKAGES = [ 'babel-plugin-transform-private-methods', 'babel-plugin-transform-private-property-in-object', 'babel-plugin-transform-logical-assignment-operators', - 'babel-plugin-proposal-explicit-resource-management', + 'babel-plugin-transform-explicit-resource-management', ]; const FILTER_OUT_PRESETS = ['env']; const FILTER_OUT_PLUGINS = [