summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/lexical-environment/bug-1216623.js
blob: cbdbe9722e7bb7a12c7a147ee3c0909d90f4c17e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Scoping in the head of for(let;;) statements.

let x = 0;
for (let i = 0, a = () => i; i < 4; i++) {
  assertEq(i, x++);
  assertEq(a(), 0);
}
assertEq(x, 4);

x = 11;
let q = 0;
for (let {[++q]: r} = [0, 11, 22], s = () => r; r < 13; r++) {
  assertEq(r, x++);
  assertEq(s(), 11);
}
assertEq(x, 13);
assertEq(q, 1);

reportCompare(0, 0);