diff options
Diffstat (limited to 'js/src/jit-test/tests/basic/letTDZAfterInitializer.js')
-rw-r--r-- | js/src/jit-test/tests/basic/letTDZAfterInitializer.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/basic/letTDZAfterInitializer.js b/js/src/jit-test/tests/basic/letTDZAfterInitializer.js new file mode 100644 index 0000000000..575615c176 --- /dev/null +++ b/js/src/jit-test/tests/basic/letTDZAfterInitializer.js @@ -0,0 +1,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); +} |