js/src/jit-test/tests/debug/surfaces-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 // Check superficial characteristics of functions and properties (not functionality).
     3 function checkFunction(obj, name, nargs) {
     4     var desc = Object.getOwnPropertyDescriptor(obj, name);
     5     assertEq(desc.configurable, true, name + " should be configurable");
     6     assertEq(desc.writable, true, name + " should be writable");
     7     assertEq(desc.enumerable, false, name + " should be non-enumerable");
     8     assertEq(desc.value, obj[name]);  // well obviously
     9     assertEq(typeof desc.value, 'function', name + " should be a function");
    10     assertEq(desc.value.length, nargs, name + " should have .length === " + nargs);
    11 }
    13 checkFunction(this, "Debugger", 1);
    15 assertEq(Debugger.prototype.constructor, Debugger);
    16 assertEq(Object.prototype.toString.call(Debugger.prototype), "[object Debugger]");
    17 assertEq(Object.getPrototypeOf(Debugger.prototype), Object.prototype);

mercurial