Skip to content

fix(blaze): rename reserved arguments parameter to fix SWC transpilation#508

Closed
italojs wants to merge 1 commit into
masterfrom
swc/strict-mode-args
Closed

fix(blaze): rename reserved arguments parameter to fix SWC transpilation#508
italojs wants to merge 1 commit into
masterfrom
swc/strict-mode-args

Conversation

@italojs
Copy link
Copy Markdown
Member

@italojs italojs commented Apr 24, 2026

Summary

  • Fix SWC transpilation failure in blaze/exceptions.js caused by using arguments as a rest parameter name (...arguments), which is a reserved identifier in strict mode
  • Rename ...arguments to ...args in Blaze._wrapCatchingExceptions
Screenshot 2026-04-24 at 1 43 48 PM

Problem

The SWC transpiler fails to parse blaze/exceptions.js because arguments cannot be used as a binding identifier in strict mode (ES module context). This causes a fallback to Babel with the error:

[Transpiler] Used Babel for blaze/exceptions.js (package) ⚠️ Fallback
↳ Error: x 'eval' and 'arguments' cannot be used as a binding identifier in strict mode

This error is currently occurring in CI (see failing job) and can be reproduced locally by running:

cd tools/modern-tests
npm test -- -t=Blaze

Fix

Renamed the rest parameter from ...arguments to ...args in Blaze._wrapCatchingExceptions. This is a safe rename since the function already used spread syntax, arguments was being shadowed as a regular parameter, not used as the implicit arguments object.

Test plan

- Run `npm test -- -t=Blaze` in `tools/modern-tests` and confirm `blaze/exceptions.js` no longer falls back to Babel
- Verify the function behavior is unchanged (spread args passed through f.apply(this, args))

@italojs italojs marked this pull request as draft April 24, 2026 16:52
@italojs italojs closed this Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant