Debian Codegraph @

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