michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: michael@0: /** michael@0: File Name: 15.4.1.3.js michael@0: ECMA Section: 15.4.1.3 Array() michael@0: michael@0: Description: When Array is called as a function rather than as a michael@0: constructor, it creates and initializes a new array michael@0: object. Thus, the function call Array(...) is michael@0: equivalent to the object creationi new Array(...) with michael@0: the same arguments. michael@0: michael@0: An array is created and returned as if by the michael@0: expression new Array(len). michael@0: michael@0: Author: christine@netscape.com michael@0: Date: 7 october 1997 michael@0: */ michael@0: var SECTION = "15.4.1.3"; michael@0: var VERSION = "ECMA_1"; michael@0: startTest(); michael@0: var TITLE = "Array Constructor Called as a Function: Array()"; michael@0: michael@0: writeHeaderToLog( SECTION + " "+ TITLE); michael@0: michael@0: new TestCase( SECTION, michael@0: "typeof Array()", michael@0: "object", michael@0: typeof Array() ); michael@0: michael@0: new TestCase( SECTION, michael@0: "MYARR = new Array();MYARR.getClass = Object.prototype.toString;MYARR.getClass()", michael@0: "[object Array]", michael@0: eval("MYARR = Array();MYARR.getClass = Object.prototype.toString;MYARR.getClass()") ); michael@0: michael@0: new TestCase( SECTION, michael@0: "(Array()).length", michael@0: 0, michael@0: (Array()).length ); michael@0: michael@0: new TestCase( SECTION, michael@0: "Array().toString()", michael@0: "", michael@0: Array().toString() ); michael@0: michael@0: test();