js/src/tests/js1_5/Regress/regress-449666.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: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /*
     3  * Any copyright is dedicated to the Public Domain.
     4  * http://creativecommons.org/licenses/publicdomain/
     5  * Contributor: Robert Sayre
     6  */
     8 //-----------------------------------------------------------------------------
     9 var BUGNUMBER = 449666;
    10 var summary = 'Do not assert: JSSTRING_IS_FLAT(str_)';
    11 var actual = '';
    12 var expect = '';
    15 //-----------------------------------------------------------------------------
    16 test();
    17 //-----------------------------------------------------------------------------
    19 function test()
    20 {
    21   enterFunc ('test');
    22   printBugNumber(BUGNUMBER);
    23   printStatus (summary);
    25   var global;
    27   jit(true);
    29   if (typeof window == 'undefined') {
    30     global = this;
    31   }
    32   else {
    33     global = window;
    34   }
    36   if (!global['g']) {
    37     global['g'] = {};
    38   }
    40   if (!global['g']['l']) {
    41     global['g']['l'] = {};
    42     (function() {
    43       function k(a,b){
    44         var c=a.split(/\./);
    45         var d=global;
    46         for(var e=0;e<c.length-1;e++){
    47           if(!d[c[e]]){
    48             d[c[e]]={};
    49           }
    50           d=d[c[e]];
    51         }
    52         d[c[c.length-1]]=b;
    53         print("hi");
    54       }
    56       function T(a){return "hmm"}
    57       k("g.l.loaded",T);
    58     })();
    60   }
    62   jit(false);
    64   reportCompare(expect, actual, summary);
    66   exitFunc ('test');
    67 }

mercurial