Debian Codegraph @

js/src/jit-test/tests/debug/Frame-onStack-03.js

raw
1 // frame properties throw if !frame.onStack
2
3 load(libdir + "asserts.js");
4
5 var g = newGlobal({newCompartment: true});
6 var f;
7 Debugger(g).onDebuggerStatement = function (frame) {
8 assertEq(frame.onStack, true);
9 assertEq(frame.type, "call");
10 assertEq(frame.this instanceof Object, true);
11 assertEq(frame.older instanceof Debugger.Frame, true);
12 assertEq(frame.callee instanceof Debugger.Object, true);
13 assertEq(frame.constructing, false);
14 assertEq(frame.arguments.length, 0);
15 f = frame;
16 };
17
18 g.eval("(function () { debugger; }).call({});");
19 assertEq(f.onStack, false);
20 assertThrowsInstanceOf(function () { f.type; }, Error);
21 assertThrowsInstanceOf(function () { f.this; }, Error);
22 assertThrowsInstanceOf(function () { f.older; }, Error);
23 assertThrowsInstanceOf(function () { f.callee; }, Error);
24 assertThrowsInstanceOf(function () { f.constructing; }, Error);
25 assertThrowsInstanceOf(function () { f.arguments; }, Error);