js/src/jit-test/tests/debug/Frame-onPop-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 // When an exception is propagated out of multiple frames, their onPop
     2 // and onExceptionUnwind handlers are called in the correct order.
     3 var g = newGlobal();
     4 g.eval("function f() { throw 'mud'; }");
     5 g.eval("function g() { f(); }");
     6 g.eval("function h() { g(); }");
     7 g.eval("function i() { h(); }");
     9 var dbg = new Debugger(g);
    10 var log;
    11 function makePopHandler(label) {
    12     return function handlePop(completion) { 
    13         log += label;
    14         assertEq(completion.throw, "mud");
    15     };
    16 }
    17 dbg.onEnterFrame = function handleEnter(f) {
    18     log += "(" + f.callee.name;
    19     f.onPop = makePopHandler(")" + f.callee.name);  
    20 };
    21 dbg.onExceptionUnwind = function handleExceptionUnwind(f, x) {
    22     assertEq(x, 'mud');
    23     log += "u" + f.callee.name;
    24 };
    25 log = '';
    26 try {
    27     g.i();
    28 } catch (x) {
    29     log += 'c';
    30     assertEq(x, "mud");
    31 }
    32 assertEq(log, "(i(h(g(fuf)fug)guh)hui)ic");

mercurial