Latest Results
fix(nodejs): complete Amaro REPL support APIs (#12395)
**Description:**
Complete the four Node.js/Amaro support requests in
`@swc/nodejs-support-wasm`. An input such as `import fs from "node:fs"`
now declares `fs`, so later REPL inputs can use it. Static imports use
local declarations instead of rewriting references within a single
input; existing import hoisting, export validation, and import
attributes are preserved.
Add `tokenize` for compact highlighting tokens and `findTopLevelAwaits`
for module-scope await locations, including `for await` and `await
using`. Both support strings and UTF-8 `Uint8Array` inputs, with
JavaScript UTF-16 coordinates. Also recognize `SyntaxError::Unexpected`
with `<eof>` as recoverable. Include TypeScript declarations,
documentation, shared Rust/WASM fixtures, and executable REPL coverage.
**BREAKING CHANGE:**
In `@swc/nodejs-support-wasm`, transformed default and named imports now
capture initial export values in local `const` bindings rather than
rewriting reads into live namespace property accesses. Namespace imports
retain the module namespace object. This matches the requested REPL
behavior.
**Validation:**
- `cargo fmt --all`
- `cargo clippy --all --all-targets -- -D warnings`
- `cargo test -p binding_nodejs_support_wasm`: 20 passed
- Node.js support WASM test script: 57 passed in both default and
`nightly` feature builds
- Core, minifier, TypeScript, and AST viewer WASM test scripts: all
passed
- `packages/core`: `pnpm build:dev` and `pnpm test`; 119 passed, 3
skipped by the existing configuration
- Checked 525 incremental REPL input prefixes for valid, non-overlapping
token ranges
Rust commands ran with `RUSTC_WRAPPER=` because the configured `sccache`
executable is unavailable locally.
**Related issue (if exists):**
Closes #12378. Latest Branches
0%
pederbe:learn/5394-import-validation 0%
kdy1/fix-nodejs-support-12378 0%
kdy1/fix-12380-class-field-captures © 2026 CodSpeed Technology