js/src/jit-test/tests/debug/breakpoint-09.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/debug/breakpoint-09.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,13 @@
     1.4 +// Setting a breakpoint in an eval script that is not on the stack. Bug 746973.
     1.5 +// We don't assert that the breakpoint actually hits because that depends on
     1.6 +// the eval cache, an implementation detail.
     1.7 +
     1.8 +var g = newGlobal();
     1.9 +var dbg = Debugger(g);
    1.10 +g.eval("function f() { return eval('2+2'); }");
    1.11 +var s;
    1.12 +dbg.onNewScript = function (script) { s = script; };
    1.13 +g.f();
    1.14 +for (var offset of s.getLineOffsets(s.startLine))
    1.15 +    s.setBreakpoint(offset, {hit: function () {}});
    1.16 +assertEq(g.f(), 4);

mercurial