michael@0: // Check superficial characteristics of functions and properties (not functionality). michael@0: michael@0: function checkFunction(obj, name, nargs) { michael@0: var desc = Object.getOwnPropertyDescriptor(obj, name); michael@0: assertEq(desc.configurable, true, name + " should be configurable"); michael@0: assertEq(desc.writable, true, name + " should be writable"); michael@0: assertEq(desc.enumerable, false, name + " should be non-enumerable"); michael@0: assertEq(desc.value, obj[name]); // well obviously michael@0: assertEq(typeof desc.value, 'function', name + " should be a function"); michael@0: assertEq(desc.value.length, nargs, name + " should have .length === " + nargs); michael@0: } michael@0: michael@0: checkFunction(this, "Debugger", 1); michael@0: michael@0: assertEq(Debugger.prototype.constructor, Debugger); michael@0: assertEq(Object.prototype.toString.call(Debugger.prototype), "[object Debugger]"); michael@0: assertEq(Object.getPrototypeOf(Debugger.prototype), Object.prototype);