You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Describe the bug
The problem appears on
ArrowFunctionExpression
that don't haveBlockStatement
:SWC result 🟥
Babel 🟢
TS 🟢
Input code
Config
Playground link
https://play.swc.rs/?version=1.3.86&code=H4sIAAAAAAAAA0vOzysuUUjLz1ewVdDQVLC1U0hKrAIy7O0VCksrrAEQVEH%2BHwAAAA%3D%3D&config=H4sIAAAAAAAAA1WQTU7EMAyF93OKymKJWmCBxGxZsYAdBzAZdyZDnUS2K6hGvTtJ%2F1R28ffs9xzfDlUFd%2BouxAjHCi5mSY9Nc9UY6hmrRaE6yrnRHycO7svIVV1uv%2BVnLhKKkmx1JjoEw99iaEMideKTTYOTalqkFjuljZ2GgOzdG6collWTniZtnFvABIO2UXifI4TOdqCgPphnKtnYW2Q072CRx3%2BOX6j0KV3prBtYY1DOVCyB9Onh8WXl30TptUPVD2TSZcFFYx98O%2Bz3cpGTkOr6zcOaPmWD1%2Fd46jva2QCvZDlqOdy8xjNsg1vS7Dr%2BAd6pGL%2B%2FAQAA
SWC Info output
N/A
Expected behavior
As in Babel & TS, the variable should be created in a scope of function instead of module scope i.e. the following result:
Actual behavior
The variable will be created in a module scope, this creates memory leaks if
baz()
returns an object that references other objects.Note: the following snippet is compiled properly:
Version
1.3.86
Additional context
No response
The text was updated successfully, but these errors were encountered: