js/src/jit-test/tests/debug/Frame-evalWithBindings-11.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 // var statements in non-strict evalWithBindings code behave like non-strict direct eval.
     2 var g = newGlobal();
     3 var dbg = new Debugger(g);
     4 var log;
     5 dbg.onDebuggerStatement = function (frame) {
     6   log += 'd';
     7   assertEq(frame.evalWithBindings("var i = v; 42;", { v: 'inner' }).return, 42);
     8 };
    10 g.i = 'outer';
    11 log = '';
    12 assertEq(g.eval('debugger; i;'), 'inner');
    13 assertEq(log, 'd');
    15 g.j = 'outer';
    16 log = '';
    17 assertEq(g.eval('debugger; j;'), 'outer');
    18 assertEq(log, 'd');

mercurial