-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Mixup in tagged template literals in exported function #598
Comments
I think the problem is Btw, I need to find a better test suite. |
Yes, the bug only appears in |
Kind indicates type of identifier. hygiene pass tracks it to preserve ident renaming rule. It means, ```js export function foo() { console.log(i18n(_templateObject())); console.log(i18n(_templateObject())); console.log(i18n(_templateObject())); } ``` should be ```js export function foo() { console.log(i18n(_templateObject())); console.log(i18n(_templateObject1())); console.log(i18n(_templateObject2())); } ``` Closes #598
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Hello,
swc+webpack got our compilation times for debug builds down to ~3s from ~7s, which makes hitting F5 after a change much less frustrating! Thanks!
However, it breaks our use of tagged template literals for i18n. Setting target: "es2019" avoids the broken transformation, but there's still a bug somewhere.
cat test.js
:npx swc --no-swcrc test.js
Note the last line, where it should use
_templateObject1()
, but uses_templateObject()
again. Consequently, if we insert an implementation of i18n() and call foo(), running the transformed function saysHello World
twice.Note that the bug only appears in
export
ed functions.The text was updated successfully, but these errors were encountered: