js/src/tests/js1_5/Array/regress-94257.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: 30 October 2001
     8  *
     9  * SUMMARY: Regression test for bug 94257
    10  * See http://bugzilla.mozilla.org/show_bug.cgi?id=94257
    11  *
    12  * Rhino used to crash on this code; specifically, on the line
    13  *
    14  *                       arr[1+1] += 2;
    15  */
    16 //-----------------------------------------------------------------------------
    17 var UBound = 0;
    18 var BUGNUMBER = 94257;
    19 var summary = "Making sure we don't crash on this code -";
    20 var status = '';
    21 var statusitems = [];
    22 var actual = '';
    23 var actualvalues = [];
    24 var expect= '';
    25 var expectedvalues = [];
    28 var arr = new Array(6);
    29 arr[1+1] = 1;
    30 arr[1+1] += 2;
    33 status = inSection(1);
    34 actual = arr[1+1];
    35 expect = 3;
    36 addThis();
    38 status = inSection(2);
    39 actual = arr[1+1+1];
    40 expect = undefined;
    41 addThis();
    43 status = inSection(3);
    44 actual = arr[1];
    45 expect = undefined;
    46 addThis();
    49 arr[1+2] = 'Hello';
    52 status = inSection(4);
    53 actual = arr[1+1+1];
    54 expect = 'Hello';
    55 addThis();
    59 //-----------------------------------------------------------------------------
    60 test();
    61 //-----------------------------------------------------------------------------
    65 function addThis()
    66 {
    67   statusitems[UBound] = status;
    68   actualvalues[UBound] = actual;
    69   expectedvalues[UBound] = expect;
    70   UBound++;
    71 }
    74 function test()
    75 {
    76   enterFunc ('test');
    77   printBugNumber(BUGNUMBER);
    78   printStatus (summary);
    80   for (var i=0; i<UBound; i++)
    81   {
    82     reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
    83   }
    85   exitFunc ('test');
    86 }

mercurial