Debian Codegraph @

js/src/jit-test/tests/debug/Environment-setVariable-18.js

raw
1 function f() {
2 (function () {
3 const otherDebugger = newGlobal({ sameZoneAs: this }).Debugger;
4 const dbg = otherDebugger(this);
5
6 const env = dbg.getNewestFrame().callee.environment;
7 var ran = false;
8 try {
9 // this should throw, as tdz_variable is still in the tdz at
10 // this point.
11 env.setVariable("tdz_variable", 10);
12 ran = true;
13 } catch (e) { }
14 assertEq(ran, false);
15 })();
16
17 function bar() {
18 return tdz_variable;
19 }
20
21
22 let tdz_variable = 10;
23 }
24 f();