js/src/jit-test/tests/debug/surfaces-01.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/debug/surfaces-01.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,17 @@
     1.4 +// Check superficial characteristics of functions and properties (not functionality).
     1.5 +
     1.6 +function checkFunction(obj, name, nargs) {
     1.7 +    var desc = Object.getOwnPropertyDescriptor(obj, name);
     1.8 +    assertEq(desc.configurable, true, name + " should be configurable");
     1.9 +    assertEq(desc.writable, true, name + " should be writable");
    1.10 +    assertEq(desc.enumerable, false, name + " should be non-enumerable");
    1.11 +    assertEq(desc.value, obj[name]);  // well obviously
    1.12 +    assertEq(typeof desc.value, 'function', name + " should be a function");
    1.13 +    assertEq(desc.value.length, nargs, name + " should have .length === " + nargs);
    1.14 +}
    1.15 +
    1.16 +checkFunction(this, "Debugger", 1);
    1.17 +
    1.18 +assertEq(Debugger.prototype.constructor, Debugger);
    1.19 +assertEq(Object.prototype.toString.call(Debugger.prototype), "[object Debugger]");
    1.20 +assertEq(Object.getPrototypeOf(Debugger.prototype), Object.prototype);

mercurial