letTDZAfterInitializer.js (338B)
1 function throwSomething() { 2 throw "something"; 3 } 4 5 try { 6 // Use eval to force BINDNAME. Should throw "something" instead of the TDZ 7 // ReferenceError. 8 eval("x = throwSomething()"); 9 let x; 10 } catch (e) { 11 assertEq(e, "something"); 12 } 13 14 try { 15 eval("x = 42"); 16 let x; 17 } catch (e) { 18 assertEq(e instanceof ReferenceError, true); 19 }