js/src/tests/js1_2/Array/general1.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/. */
     7 /**
     8    Filename:     general1.js
     9    Description:  'This tests out some of the functionality on methods on the Array objects'
    11    Author:       Nick Lerissa
    12    Date:         Fri Feb 13 09:58:28 PST 1998
    13 */
    15 var SECTION = 'As described in Netscape doc "Whats new in JavaScript 1.2"';
    16 var VERSION = 'no version';
    17 startTest();
    18 var TITLE = 'String:push,unshift,shift';
    20 writeHeaderToLog('Executing script: general1.js');
    21 writeHeaderToLog( SECTION + " "+ TITLE);
    23 var array1 = [];
    25 array1.push(123);            //array1 = [123]
    26 array1.push("dog");          //array1 = [123,dog]
    27 array1.push(-99);            //array1 = [123,dog,-99]
    28 array1.push("cat");          //array1 = [123,dog,-99,cat]
    29 new TestCase( SECTION, "array1.pop()", array1.pop(),'cat');
    30 //array1 = [123,dog,-99]
    31 array1.push("mouse");        //array1 = [123,dog,-99,mouse]
    32 new TestCase( SECTION, "array1.shift()", array1.shift(),123);
    33 //array1 = [dog,-99,mouse]
    34 array1.unshift(96);          //array1 = [96,dog,-99,mouse]
    35 new TestCase( SECTION, "state of array", String([96,"dog",-99,"mouse"]), String(array1));
    36 new TestCase( SECTION, "array1.length", array1.length,4);
    37 array1.shift();              //array1 = [dog,-99,mouse]
    38 array1.shift();              //array1 = [-99,mouse]
    39 array1.shift();              //array1 = [mouse]
    40 new TestCase( SECTION, "array1.shift()", array1.shift(),"mouse");
    41 new TestCase( SECTION, "array1.shift()", "undefined", String(array1.shift()));
    43 test();

mercurial