js/src/tests/ecma/Array/15.4.2.3.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.2.3.js
     9    ECMA Section:       15.4.2.3 new Array()
    10    Description:        The [[Prototype]] property of the newly constructed
    11    object is set to the origianl Array prototype object,
    12    the one that is the initial value of Array.prototype.
    13    The [[Class]] property of the new object is set to
    14    "Array".  The length of the object is set to 0.
    16    Author:             christine@netscape.com
    17    Date:               7 october 1997
    18 */
    20 var SECTION = "15.4.2.3";
    21 var VERSION = "ECMA_1";
    22 startTest();
    23 var TITLE   = "The Array Constructor:  new Array()";
    25 writeHeaderToLog( SECTION + " "+ TITLE);
    27 new TestCase( SECTION,
    28 	      "new   Array() +''",       
    29 	      "",                
    30 	      (new Array()) +"" );
    32 new TestCase( SECTION,
    33 	      "typeof new Array()",      
    34 	      "object",          
    35 	      (typeof new Array()) );
    37 new TestCase( SECTION,
    38 	      "var arr = new Array(); arr.getClass = Object.prototype.toString; arr.getClass()",
    39 	      "[object Array]",
    40 	      eval("var arr = new Array(); arr.getClass = Object.prototype.toString; arr.getClass()") );
    42 new TestCase( SECTION,
    43 	      "(new Array()).length",    
    44 	      0,                 
    45 	      (new Array()).length );
    47 new TestCase( SECTION,
    48 	      "(new Array()).toString == Array.prototype.toString",  
    49 	      true,      
    50 	      (new Array()).toString == Array.prototype.toString );
    52 new TestCase( SECTION,
    53 	      "(new Array()).join  == Array.prototype.join",         
    54 	      true,      
    55 	      (new Array()).join  == Array.prototype.join );
    57 new TestCase( SECTION,
    58 	      "(new Array()).reverse == Array.prototype.reverse",    
    59 	      true,      
    60 	      (new Array()).reverse  == Array.prototype.reverse );
    62 new TestCase( SECTION,
    63 	      "(new Array()).sort  == Array.prototype.sort",        
    64 	      true,      
    65 	      (new Array()).sort  == Array.prototype.sort );
    67 test();

mercurial