js/src/tests/js1_4/Eval/regress-531682.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 /* -*- Mode: java; tab-width:8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     2 /*
     3  * Any copyright is dedicated to the Public Domain.
     4  * http://creativecommons.org/licenses/publicdomain/
     5  */
     7 //-----------------------------------------------------------------------------
     8 var BUGNUMBER = 531682;
     9 var summary = 'Checking proper wrapping of scope in  eval(source, scope)';
    10 var actual;
    11 var expect;
    13 //-----------------------------------------------------------------------------
    14 var x = 0;
    16 test();
    17 //-----------------------------------------------------------------------------
    19 function scope1() {
    20     eval('var x = 1;');
    21     return function() { return x; }
    22 }
    24 function test() {
    25     enterFunc ('test');
    26     printBugNumber(BUGNUMBER);
    27     printStatus (summary);
    29     // The scope chain in eval should be just scope1() and the global object.
    30     actual = eval('x', scope1());
    31     expect = 0;
    32     reportCompare(expect, actual, summary);
    33     exitFunc ('test');
    34 }

mercurial