Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Bug]: SWC fails with nested array destructuring pattern with sparse array #6324

Open
p51lee opened this issue Nov 2, 2022 · 0 comments
Open
Labels

Comments

@p51lee
Copy link

p51lee commented Nov 2, 2022

Describe the bug

SWC fails to transpile input.js.

Input code

try { var [ [] ] = [ , ] ; }
catch { console.log("caught"); }

Config

No response

Playground link

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

Expected behavior

input.js is a valid JavaScript program:

$ node input.js
caught

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 2, 2022
@kdy1 kdy1 added this to the Planned milestone Nov 2, 2022
@kdy1 kdy1 self-assigned this Nov 3, 2022
@kdy1 kdy1 removed their assignment Nov 24, 2022
@kdy1 kdy1 removed this from the Planned milestone Jan 17, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Development

No branches or pull requests

2 participants