js/src/jit-test/tests/debug/Debugger-findAllGlobals-01.js

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     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