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

Array destructuring into @vars doesn't declare temporary variables #1312

Closed
STRd6 opened this issue Jul 8, 2024 · 1 comment
Closed

Array destructuring into @vars doesn't declare temporary variables #1312

STRd6 opened this issue Jul 8, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@STRd6
Copy link
Contributor

STRd6 commented Jul 8, 2024

[ @x, @y ] = z
{ @x, @y } = z

Object destructuring works because we can use ({x: this.x} = y) but arrays need a temporary variable and it looks like we're failing to hoist the ref declarations.

https://civet.dev/playground?code=WyBAeCwgQHkgXSA9IHoKeyBAeCwgQHkgfSA9IHo%3D

@edemaine
Copy link
Collaborator

edemaine commented Jul 9, 2024

Somewhat related: #1139

@STRd6 STRd6 added the bug Something isn't working label Jul 9, 2024
@STRd6 STRd6 closed this as completed in 93fe16d Jul 9, 2024
STRd6 added a commit that referenced this issue Jul 9, 2024
Hoist array binding and rest ref declarations. Fixes #1139. Fixes #1312
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants