Thu, 15 Jan 2015 21:03:48 +0100
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.)
michael@0 | 1 | // Debugger.prototype.onDebuggerStatement |
michael@0 | 2 | |
michael@0 | 3 | load(libdir + 'asserts.js'); |
michael@0 | 4 | |
michael@0 | 5 | var g = newGlobal(); |
michael@0 | 6 | var dbg = new Debugger(g); |
michael@0 | 7 | gc(); // don't assert marking debug hooks |
michael@0 | 8 | assertEq(dbg.onDebuggerStatement, undefined); |
michael@0 | 9 | |
michael@0 | 10 | function f() {} |
michael@0 | 11 | |
michael@0 | 12 | assertThrowsInstanceOf(function () { dbg.onDebuggerStatement = null; }, TypeError); |
michael@0 | 13 | assertThrowsInstanceOf(function () { dbg.onDebuggerStatement = "bad"; }, TypeError); |
michael@0 | 14 | assertThrowsInstanceOf(function () { dbg.onDebuggerStatement = {}; }, TypeError); |
michael@0 | 15 | dbg.onDebuggerStatement = f; |
michael@0 | 16 | assertEq(dbg.onDebuggerStatement, f); |
michael@0 | 17 | |
michael@0 | 18 | assertEq(Object.getOwnPropertyNames(dbg).length, 0); |
michael@0 | 19 | var desc = Object.getOwnPropertyDescriptor(Debugger.prototype, "onDebuggerStatement"); |
michael@0 | 20 | assertEq(desc.configurable, true); |
michael@0 | 21 | assertEq(desc.enumerable, false); |
michael@0 | 22 | |
michael@0 | 23 | assertThrowsInstanceOf(function () { desc.get(); }, TypeError); |
michael@0 | 24 | assertThrowsInstanceOf(function () { desc.get.call(undefined); }, TypeError); |
michael@0 | 25 | assertThrowsInstanceOf(function () { desc.get.call(Debugger.prototype); }, TypeError); |
michael@0 | 26 | assertEq(desc.get.call(dbg), f); |
michael@0 | 27 | |
michael@0 | 28 | assertThrowsInstanceOf(function () { desc.set(); }, TypeError); |
michael@0 | 29 | assertThrowsInstanceOf(function () { desc.set.call(dbg); }, TypeError); |
michael@0 | 30 | assertThrowsInstanceOf(function () { desc.set.call({}, f); }, TypeError); |
michael@0 | 31 | assertThrowsInstanceOf(function () { desc.set.call(Debugger.prototype, f); }, TypeError); |