js/src/jit-test/tests/debug/breakpoint-gc-03.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

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

mercurial