blob: 27ca37c7edfbc9d7191503f158d738b69a9fbbf7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S15.4.2.1_A1.3_T1;
* @section: 15.4.2.1;
* @assertion: This description of Array constructor applies if and only if
* the Array constructor is given no arguments or at least two arguments;
* @description: Checking case when Array constructor is given one argument;
*/
// Converted for Test262 from original Sputnik source
ES5Harness.registerTest( {
id: "S15.4.2.1_A1.3_T1",
path: "TestCases/15_Native/15.4_Array_Objects/15.4.2_The_Array_Constructor/15.4.2.1_new_Array/S15.4.2.1_A1.3_T1.js",
assertion: "This description of Array constructor applies if and only if",
description: "Checking case when Array constructor is given one argument",
test: function testcase() {
var x = new Array(2);
//CHECK#1
if (x.length === 1) {
$ERROR('#1: var x = new Array(2); x.length !== 1');
}
//CHECK#2
if (x[0] === 2) {
$ERROR('#2: var x = new Array(2); x[0] !== 2');
}
}
});
|