Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/S15.2.2.1_A5_T4.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 When the Object constructor is called with one argument value and
7 the type of value is Number, return ToObject(number)
8 es5id: 15.2.2.1_A5_T4
9 description: Argument value is numeric expression
10 ---*/
11
12 var n_obj = new Object(2 * ([].length + {
13 q: 1
14 }["q"]));
15
16 //CHECK#2
17 if (n_obj.constructor !== Number) {
18 $ERROR('#2: When the Object constructor is called with Number argument return ToObject(number)');
19 }
20
21 //CHECK#3
22 if (typeof n_obj !== 'object') {
23 $ERROR('#3: When the Object constructor is called with Number argument return ToObject(number)');
24 }
25
26 //CHECK#4
27 if (n_obj != 2) {
28 $ERROR('#4: When the Object constructor is called with Number argument return ToObject(number)');
29 }
30
31 //CHECK#5
32 if (n_obj === 2) {
33 $ERROR('#5: When the Object constructor is called with Number argument return ToObject(number)');
34 }