js/src/tests/ecma_3/FunExpr/regress-524826.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 /*
     2  * Any copyright is dedicated to the Public Domain.
     3  * http://creativecommons.org/licenses/publicdomain/
     4  */
     6 var BUGNUMBER = 524826;
     7 var summary = 'null-closure property initialiser mis-brands object literal scope';
     8 var actual;
     9 var expect;
    11 printBugNumber(BUGNUMBER);
    12 printStatus(summary);
    14 function make(g) {
    15     var o = {f: function(a,b) { return a*b; }, g: g};
    16     return o;
    17 }
    18 var z = -1;
    19 var x = make(function(c) { return c*z; });
    20 var y = make(function(c) { return -c*z; });
    22 function callg(o, c) { return o.g(c); };
    23 actual = callg(x, 1);
    24 expect = -callg(y, 1);
    26 reportCompare(expect, actual, summary);
    28 printStatus("All tests passed!");

mercurial