js/src/tests/ecma/Array/15.4-1.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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-1.js
     9    ECMA Section:       15.4 Array Objects
    11    Description:        Every Array object has a length property whose value
    12    is always an integer with positive sign and less than
    13    Math.pow(2,32).
    15    Author:             christine@netscape.com
    16    Date:               28 october 1997
    18 */
    19 var SECTION = "15.4-1";
    20 var VERSION = "ECMA_1";
    21 startTest();
    22 var TITLE   = "Array Objects";
    24 writeHeaderToLog( SECTION + " "+ TITLE);
    26 new TestCase(SECTION,
    27              "var myarr = new Array(); myarr[Math.pow(2,32)-2]='hi'; myarr[Math.pow(2,32)-2]",
    28              "hi",
    29              eval("var myarr = new Array(); myarr[Math.pow(2,32)-2]='hi'; myarr[Math.pow(2,32)-2]")
    30   );
    32 new TestCase(SECTION,
    33              "var myarr = new Array(); myarr[Math.pow(2,32)-2]='hi'; myarr.length",
    34              (Math.pow(2,32)-1),
    35              eval("var myarr = new Array(); myarr[Math.pow(2,32)-2]='hi'; myarr.length")
    36   );
    38 new TestCase(SECTION,
    39              "var myarr = new Array(); myarr[Math.pow(2,32)-3]='hi'; myarr[Math.pow(2,32)-3]",
    40              "hi",
    41              eval("var myarr = new Array(); myarr[Math.pow(2,32)-3]='hi'; myarr[Math.pow(2,32)-3]")
    42   );
    44 new TestCase(SECTION,
    45              "var myarr = new Array(); myarr[Math.pow(2,32)-3]='hi'; myarr.length",
    46              (Math.pow(2,32)-2),
    47              eval("var myarr = new Array(); myarr[Math.pow(2,32)-3]='hi'; myarr.length")
    48   );
    50 new TestCase(SECTION,
    51              "var myarr = new Array(); myarr[Math.pow(2,31)-2]='hi'; myarr[Math.pow(2,31)-2]",
    52              "hi",
    53              eval("var myarr = new Array(); myarr[Math.pow(2,31)-2]='hi'; myarr[Math.pow(2,31)-2]")
    54   );
    56 new TestCase(SECTION,
    57              "var myarr = new Array(); myarr[Math.pow(2,31)-2]='hi'; myarr.length",
    58              (Math.pow(2,31)-1),
    59              eval("var myarr = new Array(); myarr[Math.pow(2,31)-2]='hi'; myarr.length")
    60   );
    62 new TestCase(SECTION,
    63              "var myarr = new Array(); myarr[Math.pow(2,31)-1]='hi'; myarr[Math.pow(2,31)-1]",
    64              "hi",
    65              eval("var myarr = new Array(); myarr[Math.pow(2,31)-1]='hi'; myarr[Math.pow(2,31)-1]")
    66   );
    68 new TestCase(SECTION,
    69              "var myarr = new Array(); myarr[Math.pow(2,31)-1]='hi'; myarr.length",
    70              (Math.pow(2,31)),
    71              eval("var myarr = new Array(); myarr[Math.pow(2,31)-1]='hi'; myarr.length")
    72   );
    74 new TestCase(SECTION,
    75              "var myarr = new Array(); myarr[Math.pow(2,31)]='hi'; myarr[Math.pow(2,31)]",
    76              "hi",
    77              eval("var myarr = new Array(); myarr[Math.pow(2,31)]='hi'; myarr[Math.pow(2,31)]")
    78   );
    80 new TestCase(SECTION,
    81              "var myarr = new Array(); myarr[Math.pow(2,31)]='hi'; myarr.length",
    82              (Math.pow(2,31)+1),
    83              eval("var myarr = new Array(); myarr[Math.pow(2,31)]='hi'; myarr.length")
    84   );
    86 new TestCase(SECTION,
    87              "var myarr = new Array(); myarr[Math.pow(2,30)-2]='hi'; myarr[Math.pow(2,30)-2]",
    88              "hi",
    89              eval("var myarr = new Array(); myarr[Math.pow(2,30)-2]='hi'; myarr[Math.pow(2,30)-2]")
    90   );
    92 new TestCase(SECTION,
    93              "var myarr = new Array(); myarr[Math.pow(2,30)-2]='hi'; myarr.length",
    94              (Math.pow(2,30)-1),
    95              eval("var myarr = new Array(); myarr[Math.pow(2,30)-2]='hi'; myarr.length")
    96   );
    98 test();

mercurial