blob: bd86dda91a53037ebb2cdf9cd21177324957083d (
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
|
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S15.4.1_A3.1_T1;
* @section: 15.4.1, 11.4.3, 11.8.6;
* @assertion: When Array is called as a function rather than as a constructor,
* it creates and initialises a new Array object;
* @description: Checking use typeof, instanceof;
*/
// Converted for Test262 from original Sputnik source
ES5Harness.registerTest( {
id: "S15.4.1_A3.1_T1",
path: "TestCases/15_Native/15.4_Array_Objects/15.4.1_The_Array_Constructor_Called_as_a_Function/S15.4.1_A3.1_T1.js",
assertion: "When Array is called as a function rather than as a constructor,",
description: "Checking use typeof, instanceof",
test: function testcase() {
//CHECK#1
if (typeof Array() !== "object") {
$ERROR('#1: typeof Array() === "object". Actual: ' + (typeof Array()));
}
//CHECK#2
if ((Array() instanceof Array) !== true) {
$ERROR('#2: (Array() instanceof Array) === true. Actual: ' + (Array() instanceof Array));
}
}
});
|