js/src/jit-test/tests/debug/Frame-onPop-14.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:8de2224414f2
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;
6
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 };
19
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");

mercurial