js/src/tests/js1_2/function/Number.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    Filename:     Number.js
    10    Description:  'This tests the function Number(Object)'
    12    Author:       Nick Lerissa
    13    Date:         Fri Feb 13 09:58:28 PST 1998
    14 */
    16 var SECTION = 'As described in Netscape doc "Whats new in JavaScript 1.2"';
    17 var VERSION = 'no version';
    18 var TITLE = 'functions: Number';
    19 var BUGNUMBER="123435";
    21 startTest();
    22 writeHeaderToLog('Executing script: Number.js');
    23 writeHeaderToLog( SECTION + " "+ TITLE);
    25 date = new Date(2200);
    27 new TestCase( SECTION, "Number(new Date(2200))  ",
    28 	      2200,  (Number(date)));
    29 new TestCase( SECTION, "Number(true)            ",
    30 	      1,  (Number(true)));
    31 new TestCase( SECTION, "Number(false)           ",
    32 	      0,  (Number(false)));
    33 new TestCase( SECTION, "Number('124')           ",
    34 	      124,  (Number('124')));
    35 new TestCase( SECTION, "Number('1.23')          ",
    36 	      1.23,  (Number('1.23')));
    37 new TestCase( SECTION, "Number({p:1})           ",
    38 	      NaN,  (Number({p:1})));
    39 new TestCase( SECTION, "Number(null)            ",
    40 	      0,  (Number(null)));
    41 new TestCase( SECTION, "Number(-45)             ",
    42 	      -45,  (Number(-45)));
    44 // http://scopus.mcom.com/bugsplat/show_bug.cgi?id=123435
    45 // under js1.2, Number([1,2,3]) should return 3.
    47 new TestCase( SECTION, "Number([1,2,3])         ",
    48 	      3,  (Number([1,2,3])));
    51 test();

mercurial