Debian Codegraph @

js/src/tests/test262/built-ins/Array/S15.4.1_A1.2_T1.js

raw
1 // Copyright 2009 the Sputnik authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 info: The [[Class]] property of the newly constructed object is set to "Array"
6 es5id: 15.4.1_A1.2_T1
7 description: Checking use Object.prototype.toString
8 ---*/
9
10 var x = Array();
11 x.getClass = Object.prototype.toString;
12 assert.sameValue(x.getClass(), "[object Array]", 'x.getClass() must return "[object Array]"');
13
14 var x = Array(0, 1, 2);
15 x.getClass = Object.prototype.toString;
16 assert.sameValue(x.getClass(), "[object Array]", 'x.getClass() must return "[object Array]"');
17
18 reportCompare(0, 0);