Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/S15.2.1.1_A3_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: |
6 Since calling Object as a function is identical to calling a function,
7 list of arguments bracketing is allowed
8 es5id: 15.2.1.1_A3_T1
9 description: Creating an object with "Object(1,2,3)"
10 ---*/
11
12 var obj = Object(1, 2, 3);
13
14 //CHECK#1
15 if (obj.constructor !== Number) {
16 $ERROR('#1: Since Object as a function calling is the same as function calling list of arguments can appears in braces;');
17 }
18
19 //CHECK#2
20 if (typeof obj !== "object") {
21 $ERROR('#2: Since Object as a function calling is the same as function calling list of arguments can appears in braces;');
22 }
23
24 //CHECK#3
25 if ((obj != 1) || (obj === 1)) {
26 $ERROR('3#: Since Object as a function calling is the same as function calling list of arguments can appears in braces;');
27 }