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 | var desc = Object.getOwnPropertyDescriptor(Debugger.prototype, "enabled"); |
michael@0 | 2 | assertEq(typeof desc.get, 'function'); |
michael@0 | 3 | assertEq(typeof desc.set, 'function'); |
michael@0 | 4 | |
michael@0 | 5 | var g = newGlobal(); |
michael@0 | 6 | var hits; |
michael@0 | 7 | var dbg = new Debugger(g); |
michael@0 | 8 | assertEq(dbg.enabled, true); |
michael@0 | 9 | dbg.onDebuggerStatement = function () { hits++; }; |
michael@0 | 10 | |
michael@0 | 11 | var vals = [true, false, null, undefined, NaN, "blah", {}]; |
michael@0 | 12 | for (var i = 0; i < vals.length; i++) { |
michael@0 | 13 | dbg.enabled = vals[i]; |
michael@0 | 14 | assertEq(dbg.enabled, !!vals[i]); |
michael@0 | 15 | hits = 0; |
michael@0 | 16 | g.eval("debugger;"); |
michael@0 | 17 | assertEq(hits, vals[i] ? 1 : 0); |
michael@0 | 18 | } |