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

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:84fff00d50b7
1 // |jit-test| debug
2 // frame properties throw if !frame.live
3
4 load(libdir + "asserts.js");
5
6 var g = newGlobal();
7 var f;
8 Debugger(g).onDebuggerStatement = function (frame) {
9 assertEq(frame.live, true);
10 assertEq(frame.type, "call");
11 assertEq(frame.this instanceof Object, true);
12 assertEq(frame.older instanceof Debugger.Frame, true);
13 assertEq(frame.callee instanceof Debugger.Object, true);
14 assertEq(frame.generator, false);
15 assertEq(frame.constructing, false);
16 assertEq(frame.arguments.length, 0);
17 f = frame;
18 };
19
20 g.eval("(function () { debugger; }).call({});");
21 assertEq(f.live, false);
22 assertThrowsInstanceOf(function () { f.type; }, Error);
23 assertThrowsInstanceOf(function () { f.this; }, Error);
24 assertThrowsInstanceOf(function () { f.older; }, Error);
25 assertThrowsInstanceOf(function () { f.callee; }, Error);
26 assertThrowsInstanceOf(function () { f.generator; }, Error);
27 assertThrowsInstanceOf(function () { f.constructing; }, Error);
28 assertThrowsInstanceOf(function () { f.arguments; }, Error);

mercurial