js/src/jit-test/tests/basic/cross-context-stack-1.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 // Error().stack (ScriptFrameIter) is no longer context-bound.
     2 function beta() {
     3     evaluate("function gamma() {\nstack = Error().stack;\n };\n gamma();", {newContext: true});
     4 }
     5 function alpha() {
     6     beta();
     7 }
     8 alpha();
     9 assertEq(/alpha@/.test(stack), true);
    10 assertEq(/beta@/.test(stack), true);
    11 assertEq(/gamma@/.test(stack), true);
    12 assertEq(/delta@/.test(stack), false);
    14 function delta() {
    15     evaluate("stack = Error().stack", {newContext: true});
    16 }
    17 delta();
    18 assertEq(/alpha@/.test(stack), false);
    19 assertEq(/beta@/.test(stack), false);
    20 assertEq(/gamma@/.test(stack), false);
    21 assertEq(/delta@/.test(stack), true);

mercurial