Skip to content
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

[Bug]: Unable to use await as an identifier in ExprStmt #6301

Closed
p51lee opened this issue Nov 1, 2022 · 2 comments · Fixed by #6316
Closed

[Bug]: Unable to use await as an identifier in ExprStmt #6301

p51lee opened this issue Nov 1, 2022 · 2 comments · Fixed by #6316
Assignees
Labels
Milestone

Comments

@p51lee
Copy link

p51lee commented Nov 1, 2022

Describe the bug

SWC fails to transpile input.js, which uses await as an identifier.

Input code

// input.js
try { await; } catch { console.log("caught"); }

Config

No response

Playground link

https://play.swc.rs/?version=1.3.11&code=H4sIAAAAAAAAA9PXV8jMKygt0csq5iopqlSoVkgsT8wssVaoVUhOLEnOAAok5%2BcV5%2Bek6uXkp2soJSeWpmeUKGkCFQAAP70bcTsAAAA%3D&config=H4sIAAAAAAAAA0WMTQrEIAxG75K1286id5hDBCctFv9IUhgR714tlu7C915ehUMsrBUyshCPS0pU%2FMMKZAOKZZcVTNf6tKEXagYUeScdiiyd%2BZSEJjUQXHRbGSWbQmYSeRHG3T9m66GQfucYKmjJdAc%2F0N7G%2FHPynaLySe0Cj9ke9LUAAAA%3D

Expected behavior

input.js is a valid JavaScript program:

$ d8 input.js
caught

so it should be transpiled by SWC.

Actual behavior

SWC crashes when the input.js is given:
image

Version

1.3.11 (default SWC playground)

Additional context

No response

@p51lee p51lee added the C-bug label Nov 1, 2022
@kdy1 kdy1 added this to the Planned milestone Nov 1, 2022
@kdy1 kdy1 changed the title [Bug]: Unable to use await as an identifier [Bug]: Unable to use await as an identifier in ExprStmt Nov 1, 2022
@kdy1
Copy link
Member

kdy1 commented Nov 1, 2022

@swc-bot
Copy link
Collaborator

swc-bot commented Dec 12, 2022

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.

@swc-project swc-project locked as resolved and limited conversation to collaborators Dec 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging a pull request may close this issue.

3 participants