* Extract for-of iterator handling to a helper Dis greatly recudes the code size when for-of is used multiple times across the codebase. Also, makes it easier to read what's happening in a compiled loop. * Unify spec and loose code * Legacy implementation fallback * Update tmp var name * Updates from review and after rebase
10 lines
162 B
JavaScript
10 lines
162 B
JavaScript
let arr = (() => [1, 2, 3])(); // Disable inference
|
|
let res = [];
|
|
|
|
for (const x of arr) {
|
|
if (x === 2) continue;
|
|
res.push(x);
|
|
}
|
|
|
|
expect(res).toEqual([1, 3]);
|