js/src/tests/ecma/Array/15.4.5.2-1.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    File Name:          15.4.5.2-1.js
     9    ECMA Section:       Array.length
    10    Description:
    11    15.4.5.2 length
    12    The length property of this Array object is always numerically greater
    13    than the name of every property whose name is an array index.
    15    The length property has the attributes { DontEnum, DontDelete }.
    16    Author:             christine@netscape.com
    17    Date:               12 november 1997
    18 */
    20 var SECTION = "15.4.5.2-1";
    21 var VERSION = "ECMA_1";
    22 startTest();
    23 var TITLE   = "Array.length";
    25 writeHeaderToLog( SECTION + " "+ TITLE);
    27 new TestCase(   SECTION,
    28 		"var A = new Array(); A.length",
    29 		0,
    30 		eval("var A = new Array(); A.length") );
    31 new TestCase(   SECTION,
    32 		"var A = new Array(); A[Math.pow(2,32)-2] = 'hi'; A.length",
    33 		Math.pow(2,32)-1,
    34 		eval("var A = new Array(); A[Math.pow(2,32)-2] = 'hi'; A.length") );
    35 new TestCase(   SECTION,
    36 		"var A = new Array(); A.length = 123; A.length",
    37 		123,
    38 		eval("var A = new Array(); A.length = 123; A.length") );
    39 new TestCase(   SECTION,
    40 		"var A = new Array(); A.length = 123; var PROPS = ''; for ( var p in A ) { PROPS += ( p == 'length' ? p : ''); } PROPS",
    41 		"",
    42 		eval("var A = new Array(); A.length = 123; var PROPS = ''; for ( var p in A ) { PROPS += ( p == 'length' ? p : ''); } PROPS") );
    43 new TestCase(   SECTION,
    44 		"var A = new Array(); A.length = 123; delete A.length",
    45 		false ,
    46 		eval("var A = new Array(); A.length = 123; delete A.length") );
    47 new TestCase(   SECTION,
    48 		"var A = new Array(); A.length = 123; delete A.length; A.length",
    49 		123,
    50 		eval("var A = new Array(); A.length = 123; delete A.length; A.length") );
    51 test();

mercurial