Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
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");