Files
Huáng JùnliàngandGitHub 6eb3cdfd69 Fix: improve object rest handling in array pattern (#17281)
* refactor: iterate object rest elements only

* refactor: use unshiftForXStatementBody

* fix: handle object rest in array pattern

* update tsconfig.json

* improve typings

* fix: declare uid identifiers when transforming array pattern within assignment
2025-05-05 14:09:49 -04:00

28 lines
441 B
JavaScript

// ForXStatement
{
let a, b;
for (const [{a, ...b}] of []) {}
for ([{a, ...b}] of []) {}
async function f() {
for await ([{a, ...b}] of []) {}
}
for (const { a: [{a, ...b}] } of []) {}
}
// skip
{
for ([{a}] in {}) {}
for ([{a}] of []) {}
async function a() {
for await ([{a}] of []) {}
}
}
{
for ([a, ...b] in {}) {}
for ([a, ...b] of []) {}
async function a() {
for await ([a, ...b] of []) {}
}
}