Debian Codegraph @

rhino/testsrc/tests/ecma/Array/15.4.2.3.js

raw symbols SCIP
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/. */
5
6 gTestfile = '15.4.2.3.js';
7
8 /**
9 File Name: 15.4.2.3.js
10 ECMA Section: 15.4.2.3 new Array()
11 Description: The [[Prototype]] property of the newly constructed
12 object is set to the origianl Array prototype object,
13 the one that is the initial value of Array.prototype.
14 The [[Class]] property of the new object is set to
15 "Array". The length of the object is set to 0.
16
17 Author: [email protected]
18 Date: 7 october 1997
19 */
20
21 var SECTION = "15.4.2.3";
22 var VERSION = "ECMA_1";
23 startTest();
24 var TITLE = "The Array Constructor: new Array()";
25
26 writeHeaderToLog( SECTION + " "+ TITLE);
27
28 new TestCase( SECTION,
29 "new Array() +''",
30 "",
31 (new Array()) +"" );
32
33 new TestCase( SECTION,
34 "typeof new Array()",
35 "object",
36 (typeof new Array()) );
37
38 new TestCase( SECTION,
39 "var arr = new Array(); arr.getClass = Object.prototype.toString; arr.getClass()",
40 "[object Array]",
41 eval("var arr = new Array(); arr.getClass = Object.prototype.toString; arr.getClass()") );
42
43 new TestCase( SECTION,
44 "(new Array()).length",
45 0,
46 (new Array()).length );
47
48 new TestCase( SECTION,
49 "(new Array()).toString == Array.prototype.toString",
50 true,
51 (new Array()).toString == Array.prototype.toString );
52
53 new TestCase( SECTION,
54 "(new Array()).join == Array.prototype.join",
55 true,
56 (new Array()).join == Array.prototype.join );
57
58 new TestCase( SECTION,
59 "(new Array()).reverse == Array.prototype.reverse",
60 true,
61 (new Array()).reverse == Array.prototype.reverse );
62
63 new TestCase( SECTION,
64 "(new Array()).sort == Array.prototype.sort",
65 true,
66 (new Array()).sort == Array.prototype.sort );
67
68 test();