js/src/jit-test/tests/debug/Object-script-environment-nondebuggee.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 // The script and environment of a non-debuggee function are null.
     3 var g = newGlobal();
     4 g.eval('function f() { return "from f"; }');
     6 var dbg = new Debugger;
     7 var gw = dbg.makeGlobalObjectReference(g);
     8 var fw = gw.getOwnPropertyDescriptor('f').value;
    10 // g is not a debuggee, so we can't fetch f's script or environment.
    11 assertEq(fw.script, null);
    12 assertEq(fw.environment, null);
    14 // If we add g as a debuggee, we can fetch f's script and environment.
    15 dbg.addDebuggee(g);
    16 var fscript = fw.script;
    17 var fenv = fw.environment;
    18 assertEq(fscript instanceof Debugger.Script, true);
    19 assertEq(fenv instanceof Debugger.Environment, true);
    21 // Removing g as a debuggee makes the script and environment inaccessible again.
    22 dbg.removeDebuggee(g);
    23 assertEq(fw.script, null);
    24 assertEq(fw.environment, null);

mercurial