js/src/jit-test/tests/debug/Frame-onPop-01.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 // When multiple frames have onPop handlers, they are called in the correct order.
     2 var g = newGlobal();
     3 g.eval("function f() { debugger; }");
     4 g.eval("function g() { f(); }");
     5 g.eval("function h() { g(); }");
     6 g.eval("function i() { h(); }");
     8 var dbg = new Debugger(g);
     9 var log;
    10 function logger(frame, mark) { 
    11     return function (completion) {
    12         assertEq(this, frame);
    13         assertEq('return' in completion, true);
    14         log += mark;
    15     };
    16 }
    17 dbg.onEnterFrame = function handleEnter(f) {
    18     log += "(" + f.callee.name;
    19     // Note that this establishes a distinct function object as each
    20     // frame's onPop handler. Thus, a pass proves that each frame is
    21     // remembering its handler separately.
    22     f.onPop = logger(f, f.callee.name + ")");  
    23 };
    24 dbg.onDebuggerStatement = function handleDebugger(f) {
    25     log += 'd';
    26 };
    27 log = '';
    28 g.i();
    29 assertEq(log, "(i(h(g(fdf)g)h)i)");

mercurial