Repository navigation
Array destructuring - #2008
Array destructuring#2008romdotdog wants to merge 60 commits into
Conversation
|
🥳 |
|
Parser test |
|
Yeah, no need, that's why I hid that message. By the way, have you seen the other dcodeIO suggestions? |
|
Thank you! I completely missed those. I'll implement those tomorrow |
|
Could you also add destructing tests for typed and static arrays? let arr = new Int32Array(3);
arr[0] = 1;
arr[1] = 2;
arr[2] = 3;
let [a, b, c] = arr;
assert(a == 1);
assert(b == 2);
assert(c == 3); |
|
BTW, for the next PR I think I'm going to replace binding patterns with array literals for more flexible parsing and for normal assignments and declarations to have more similar code |
|
@romdotdog It seems some tests have failed |
|
I like the idea of reusing array literal expressions here, would be cool if it could be done right away :) |
It's an "issue" that's only worth fixing when further developing array destructuring; I don't think this base PR is worth delaying more for something that can be included in the next PR, if that makes sense (: |
|
BTW, I couldn't reproduce the failed compiler test on my machine. EDIT: Thanks to MaxGraey, I was able to reproduce and make new fixtures after pulling from upstream. |
… into array-destructuring
… into remove-binding-patterns
|
Had some extra time, pulled from upstream and squashed the resulting bugs. I hope this can be merged soon! |

This is a
work in progressalmost finishedfinished PR to hopefully implement array destructuring