summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/letTDZAfterInitializer.js
blob: 575615c176279d97396bd2fc0100a9484dd47c4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function throwSomething() {
  throw "something";
}

try {
  // Use eval to force BINDNAME. Should throw "something" instead of the TDZ
  // ReferenceError.
  eval("x = throwSomething()");
  let x;
} catch (e) {
  assertEq(e, "something");
}

try {
  eval("x = 42");
  let x;
} catch (e) {
  assertEq(e instanceof ReferenceError, true);
}