js/src/tests/ecma/Array/15.4.1.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.1.3.js
     9    ECMA Section:       15.4.1.3 Array()
    11    Description:        When Array is called as a function rather than as a
    12    constructor, it creates and initializes a new array
    13    object.  Thus, the function call Array(...) is
    14    equivalent to the object creationi new Array(...) with
    15    the same arguments.
    17    An array is created and returned as if by the
    18    expression new Array(len).
    20    Author:             christine@netscape.com
    21    Date:               7 october 1997
    22 */
    23 var SECTION = "15.4.1.3";
    24 var VERSION = "ECMA_1";
    25 startTest();
    26 var TITLE   = "Array Constructor Called as a Function:  Array()";
    28 writeHeaderToLog( SECTION + " "+ TITLE);
    30 new TestCase(   SECTION,
    31 		"typeof Array()",
    32 		"object",
    33 		typeof Array() );
    35 new TestCase(   SECTION,
    36 		"MYARR = new Array();MYARR.getClass = Object.prototype.toString;MYARR.getClass()",
    37 		"[object Array]",
    38 		eval("MYARR = Array();MYARR.getClass = Object.prototype.toString;MYARR.getClass()") );
    40 new TestCase(   SECTION,
    41 		"(Array()).length",
    42 		0,         
    43 		(Array()).length );
    45 new TestCase(   SECTION,
    46 		"Array().toString()",
    47 		"",
    48 		Array().toString() );
    50 test();

mercurial