Debian Codegraph @

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

raw
1 // Debugger.Environment should throw trying to setVariable on optimized out scope.
2
3 load(libdir + "asserts.js");
4
5 var g = newGlobal({newCompartment: true});
6 var dbg = new Debugger;
7 dbg.addDebuggee(g);
8
9 g.eval("" + function f() {
10 var x = 42;
11 function g() { }
12 g();
13 });
14
15 dbg.onEnterFrame = function (f) {
16 if (f.callee && (f.callee.name === "g"))
17 assertThrowsInstanceOf(function () { f.environment.parent.setVariable("x", 43) }, ReferenceError);
18 }
19
20 g.f();