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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/debug/Frame-live-03.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,28 @@
     1.4 +// |jit-test| debug
     1.5 +// frame properties throw if !frame.live
     1.6 +
     1.7 +load(libdir + "asserts.js");
     1.8 +
     1.9 +var g = newGlobal();
    1.10 +var f;
    1.11 +Debugger(g).onDebuggerStatement = function (frame) {
    1.12 +    assertEq(frame.live, true);
    1.13 +    assertEq(frame.type, "call");
    1.14 +    assertEq(frame.this instanceof Object, true);
    1.15 +    assertEq(frame.older instanceof Debugger.Frame, true);
    1.16 +    assertEq(frame.callee instanceof Debugger.Object, true);
    1.17 +    assertEq(frame.generator, false);
    1.18 +    assertEq(frame.constructing, false);
    1.19 +    assertEq(frame.arguments.length, 0);
    1.20 +    f = frame;
    1.21 +};
    1.22 +
    1.23 +g.eval("(function () { debugger; }).call({});");
    1.24 +assertEq(f.live, false);
    1.25 +assertThrowsInstanceOf(function () { f.type; }, Error);
    1.26 +assertThrowsInstanceOf(function () { f.this; }, Error);
    1.27 +assertThrowsInstanceOf(function () { f.older; }, Error);
    1.28 +assertThrowsInstanceOf(function () { f.callee; }, Error);
    1.29 +assertThrowsInstanceOf(function () { f.generator; }, Error);
    1.30 +assertThrowsInstanceOf(function () { f.constructing; }, Error);
    1.31 +assertThrowsInstanceOf(function () { f.arguments; }, Error);

mercurial