michael@0: // |jit-test| debug michael@0: // The GC can cope with old and new breakpoints at the same position. michael@0: michael@0: // This is a regression test for a bug Bill McCloskey found just by looking at michael@0: // the source code. See bug 677386 comment 8. Here we're testing that the trap michael@0: // string is correctly marked. (The silly expression for the trap string is to michael@0: // ensure that it isn't constant-folded; it's harder to get a compile-time michael@0: // constant to be GC'd.) michael@0: michael@0: var g = newGlobal(); michael@0: g.eval("var d = 0;\n" + michael@0: "function f() { return 'ok'; }\n" + michael@0: "trap(f, 0, Array(17).join('\\n') + 'd++;');\n"); michael@0: michael@0: var dbg = new Debugger; michael@0: var gw = dbg.addDebuggee(g); michael@0: var fw = gw.getOwnPropertyDescriptor("f").value; michael@0: var bp = {hits: 0, hit: function (frame) { this.hits++; }}; michael@0: fw.script.setBreakpoint(0, bp); michael@0: michael@0: gc(); michael@0: michael@0: g.f(); michael@0: assertEq(g.d, 1); michael@0: assertEq(bp.hits, 1);