js/src/tests/js1_2/function/length.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 // |reftest| skip -- obsolete test
     2 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     3 /* This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     8 /**
     9    File Name:          15.3.5.1.js
    10    ECMA Section:       Function.length
    11    Description:
    13    The value of the length property is usually an integer that indicates the
    14    "typical" number of arguments expected by the function.  However, the
    15    language permits the function to be invoked with some other number of
    16    arguments. The behavior of a function when invoked on a number of arguments
    17    other than the number specified by its length property depends on the function.
    19    This checks the pre-ecma behavior Function.length.
    21    http://scopus.mcom.com/bugsplat/show_bug.cgi?id=104204
    24    Author:             christine@netscape.com
    25    Date:               12 november 1997
    26 */
    28 var SECTION = "function/length.js";
    29 var VERSION = "ECMA_1";
    30 var TITLE   = "Function.length";
    31 var BUGNUMBER="104204";
    33 startTest();
    34 writeHeaderToLog( SECTION + " "+ TITLE);
    36 var f = new Function( "a","b", "c", "return f.length");
    38 if ( version() <= 120 ) {
    40   new TestCase( SECTION,
    41 		'var f = new Function( "a","b", "c", "return f.length"); f()',
    42 		0,
    43 		f() );
    45   new TestCase( SECTION,
    46 		'var f = new Function( "a","b", "c", "return f.length"); f(1,2,3,4,5)',
    47 		5,
    48 		f(1,2,3,4,5) );
    49 } else {
    51   new TestCase( SECTION,
    52 		'var f = new Function( "a","b", "c", "return f.length"); f()',
    53 		3,
    54 		f() );
    56   new TestCase( SECTION,
    57 		'var f = new Function( "a","b", "c", "return f.length"); f(1,2,3,4,5)',
    58 		3,
    59 		f(1,2,3,4,5) );
    62 }
    63 test();

mercurial