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
Function can only be declared at top level of the program or inside the block in strict mode.
Interestingly, marking function as a generator or normal function makes program valid.
Describe the bug
Function can only be declared at top level of the program or inside the block in strict mode.
Interestingly, marking function as a generator or normal function makes program valid.
Input code
Config
Playground link (or link to the minimal reproduction)
https://play.swc.rs/?version=1.5.6-nightly-20240511.1&code=H4sIAAAAAAAAAx2MwQqAIBBE737F0EmPXRP7l1iMpDBwVzLCf2%2FrOG9m3lA5gqUkksEbOjMLdgRY6xBmPAY4oqApGj008ZWENtjm%2FhKgRQ1twsJ3Jqw1k6Qzo6ng6bro36tEqUWhN91Z518M6BU4dgAAAA%3D%3D&config=H4sIAAAAAAAAA32UO5LbMAyG%2Bz2FR3WKjMscIF3OwKFJUKZDEhoC9Fqz47sHeviRNeROwocfIAEQXx%2B7XXci1%2F3afcmn%2FAy2EtT7v1hoLGwvYunAZUuuxoG7Hzd6ogkFmwhm03UhHdvaA88q2v%2Fc71dFlxAJborVlmOJYXzO6TAPFYiebGKVkC1DYfpfv7KKnxPg2p7tB8QEtrwhxpKJhaGHqgV2mJIdCMzZViXKdFJbI6GWYoKNwZuh4qDy4iNHLJLzlXqw3jj0oKBYwXE8gyaTXCIrJNdT7jNjD4fW93Ofv6nhbFOzrOSEy9wSOa0S9YiR2IRWtBIucKMGC1yL%2B10Zg6nArZZX3Qlj2ejJXwCpQLJExWbQ4s4eQeZpSx3eKmMJMrI8KlzmW7tlgV6KamIMSmWnykDlqHWzgm8Opso67Tgr3igfRQ8GQpBZUULTZ2R31JLyOAAGBUh%2FbdCmagHm%2Fgo3%2BPQg3uDfckvWB2z1yJaP25TGfMD0JkEGPqJ%2F4yCtYNzGVbbEZdjmrXiQ0QCvujSawesSkAfAaNK8L19mQ56HRDR9wsNjTawO1%2Fsezrb0j%2Fe%2BrOKP1aHL6NsM1yU%2F9XdazdKOjOVE3cPztorvp%2B8i%2FbnJl9jXf3MIldo2BgAA
SWC Info output
No response
Expected behavior
Actual behavior
Version
1.5.6-nightly-20240511.1
Additional context
This may not be worth fixing because using function
x
meaningly will break inlining or make block on if statement.The text was updated successfully, but these errors were encountered: