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/. */
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
20
var SECTION = "15.4.2.3";
21
var VERSION = "ECMA_1";
23
var TITLE = "The Array Constructor: new Array()";
25
writeHeaderToLog( SECTION + " "+ TITLE);
27
new TestCase( SECTION,
32
new TestCase( SECTION,
35
(typeof new Array()) );
37
new TestCase( SECTION,
38
"var arr = new Array(); arr.getClass = Object.prototype.toString; arr.getClass()",
40
eval("var arr = new Array(); arr.getClass = Object.prototype.toString; arr.getClass()") );
42
new TestCase( SECTION,
43
"(new Array()).length",
45
(new Array()).length );
47
new TestCase( SECTION,
48
"(new Array()).toString == Array.prototype.toString",
50
(new Array()).toString == Array.prototype.toString );
52
new TestCase( SECTION,
53
"(new Array()).join == Array.prototype.join",
55
(new Array()).join == Array.prototype.join );
57
new TestCase( SECTION,
58
"(new Array()).reverse == Array.prototype.reverse",
60
(new Array()).reverse == Array.prototype.reverse );
62
new TestCase( SECTION,
63
"(new Array()).sort == Array.prototype.sort",
65
(new Array()).sort == Array.prototype.sort );