js/src/jit-test/tests/debug/Object-name-02.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 // The .name of a non-function object is undefined.
     3 var g = newGlobal();
     4 var hits = 0;
     5 var dbg = new Debugger(g);
     6 dbg.onDebuggerStatement = function (frame) {
     7     assertEq(frame.arguments[0].name, undefined);
     8     hits++;
     9 };
    10 g.eval("function f(nonfunction) { debugger; }");
    12 g.eval("f({});");
    13 g.eval("f(/a*/);");
    14 g.eval("f({name: 'bad'});");
    15 g.eval("f(Proxy.createFunction({name: {value: 'bad'}}, function () {}));");
    16 assertEq(hits, 4);

mercurial