summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/parser/bug-1263355-51.js
blob: b2bdb680d0fac629974a58e40dfc298ae8d91370 (plain)
1
2
3
4
5
6
7
8
9
// TDZ checks work in destructuring default expressions,
// even after the variables are initialized the first time.

load(libdir + "asserts.js");

assertThrowsInstanceOf(() => {
    // should throw the second time through: b is uninitialized
    for (const {a=b, b} of [{a:1, b:2}, {b:3}]) {}
}, ReferenceError);