Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Boolean/S15.6.1.1_A1_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 Returns a boolean value (not a Boolean object) computed by
7 ToBoolean(value)
8 esid: sec-terms-and-definitions-boolean-value
9 es5id: 15.6.1.1_A1_T1
10 description: >
11 Used values 1, new String("1"), new Object(1) and called without
12 argument
13 ---*/
14
15 //CHECK#1
16 if (typeof Boolean() !== "boolean") {
17 $ERROR('#1: typeof Boolean() should be "boolean", actual is "' + typeof Boolean() + '"');
18 }
19
20 //CHECK#2
21 if (typeof Boolean(1) !== "boolean") {
22 $ERROR('#2: typeof Boolean(1) should be "boolean", actual is "' + typeof Boolean(1) + '"');
23 }
24
25 //CHECK#3
26 if (typeof Boolean(new String("1")) !== "boolean") {
27 $ERROR('#3: typeof Boolean(new String("1")) should be "boolean", actual is "' + typeof Boolean(new String("1")) + '"');
28 }
29
30 //CHECK#4
31 if (typeof Boolean(new Object(1)) !== "boolean") {
32 $ERROR('#4: typeof Boolean(new Object(1)) should be "boolean", actual is "' + typeof Boolean(new Object(1)) + '"');
33 }