js/src/jit-test/tests/debug/Debugger-findAllGlobals-01.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 // Debugger.prototype.findAllGlobals surface.
     3 load(libdir + 'asserts.js');
     5 var dbg = new Debugger;
     6 var d = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(dbg), 'findAllGlobals');
     7 assertEq(d.configurable, true);
     8 assertEq(d.enumerable, false);
     9 assertEq(d.writable, true);
    10 assertEq(typeof d.value, 'function');
    11 assertEq(dbg.findAllGlobals.length, 0);
    12 assertEq(dbg.findAllGlobals.name, 'findAllGlobals');
    14 // findAllGlobals can only be applied to real Debugger instances.
    15 assertThrowsInstanceOf(function() {
    16                          Debugger.prototype.findAllGlobals.call(Debugger.prototype);
    17                        },
    18                        TypeError);
    19 var a = dbg.findAllGlobals();
    20 assertEq(a instanceof Array, true);
    21 assertEq(a.length > 0, true);
    22 for (g of a) {
    23   assertEq(g instanceof Debugger.Object, true);
    24 }

mercurial