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.)
1 // A frame's onPop handler is called only once, even if it is for a function
2 // called from a loop.
3 var g = newGlobal();
4 var dbg = new Debugger(g);
5 var log;
7 var count;
8 dbg.onDebuggerStatement = function handleDebug(frame) {
9 log += 'd';
10 assertEq(frame.type, "call");
11 count++;
12 if (count == 10) {
13 frame.onPop = function handlePop(c) {
14 log += ')' + this.arguments[0];
15 assertEq(c.return, "snifter");
16 };
17 }
18 };
20 g.eval("function f(n) { debugger; return 'snifter'; }");
21 log = '';
22 count = 0;
23 g.eval("for (i = 0; i < 20; i++) f(i);");
24 assertEq(count, 20);
25 assertEq(log, "dddddddddd)9dddddddddd");