js/src/tests/js1_5/Regress/regress-68498-002.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 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 /*
     7  * Date: 15 Feb 2001
     8  *
     9  * SUMMARY: create a Deletable local variable using eval
    10  *
    11  * See http://bugzilla.mozilla.org/show_bug.cgi?id=68498
    12  * See http://bugzilla.mozilla.org/showattachment.cgi?attach_id=25251
    13  *
    14  * Brendan:
    15  *
    16  * "Demonstrate the creation of a Deletable local variable using eval"
    17  */
    18 //-----------------------------------------------------------------------------
    19 var BUGNUMBER = 68498;
    20 var summary = 'Creating a Deletable local variable using eval';
    21 var statprefix = '; currently at expect[';
    22 var statsuffix = '] within test -';
    23 var actual = [ ];
    24 var expect = [ ];
    27 // Capture a reference to the global object -
    28 var self = this;
    30 // This function is the heart of the test -
    31 function f(s) {eval(s); actual[0]=y; return delete y;}
    34 // Set the actual-results array. The next line will set actual[0] and actual[1] in one shot
    35 actual[1] = f('var y = 42');
    36 actual[2] = 'y' in self && y;
    38 // Set the expected-results array -
    39 expect[0] = 42;
    40 expect[1] = true;
    41 expect[2] = false;
    44 //-------------------------------------------------------------------------------------------------
    45 test();
    46 //-------------------------------------------------------------------------------------------------
    49 function test()
    50 {
    51   enterFunc ('test');
    52   printBugNumber(BUGNUMBER);
    53   printStatus (summary);
    55   for (var i in expect)
    56   {
    57     reportCompare(expect[i], actual[i], getStatus(i));
    58   }
    60   exitFunc ('test');
    61 }
    64 function getStatus(i)
    65 {
    66   return (summary  +  statprefix  +  i  +  statsuffix);
    67 }

mercurial