blob: baa90de1b6c5f5a07c68024ac0b8eef18fc6811e [file] [log] [blame]
// This regression test checks that a let in the TDZ state is handled properly
// with a for-of in a try as well as the ensuing catch block.
function test() {
try {
for ({o} of [, 0])
;
} catch (e) {
o[0] = 1.5;
}
let o = {
};
}
for (i = 0; i < 1000; i++) {
try {
test();
} catch(e) {
if (e != "ReferenceError: Cannot access uninitialized variable.")
throw "Expected \"ReferenceError: Cannot access uninitialized variable.\", but got \"" + e +"\"";
}
}