Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | // Check superficial characteristics of functions and properties (not functionality). |
michael@0 | 2 | |
michael@0 | 3 | function checkFunction(obj, name, nargs) { |
michael@0 | 4 | var desc = Object.getOwnPropertyDescriptor(obj, name); |
michael@0 | 5 | assertEq(desc.configurable, true, name + " should be configurable"); |
michael@0 | 6 | assertEq(desc.writable, true, name + " should be writable"); |
michael@0 | 7 | assertEq(desc.enumerable, false, name + " should be non-enumerable"); |
michael@0 | 8 | assertEq(desc.value, obj[name]); // well obviously |
michael@0 | 9 | assertEq(typeof desc.value, 'function', name + " should be a function"); |
michael@0 | 10 | assertEq(desc.value.length, nargs, name + " should have .length === " + nargs); |
michael@0 | 11 | } |
michael@0 | 12 | |
michael@0 | 13 | checkFunction(this, "Debugger", 1); |
michael@0 | 14 | |
michael@0 | 15 | assertEq(Debugger.prototype.constructor, Debugger); |
michael@0 | 16 | assertEq(Object.prototype.toString.call(Debugger.prototype), "[object Debugger]"); |
michael@0 | 17 | assertEq(Object.getPrototypeOf(Debugger.prototype), Object.prototype); |