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

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 // |jit-test| debug
     2 // frame properties throw if !frame.live
     4 load(libdir + "asserts.js");
     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 };
    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