Debian Codegraph @

js/src/tests/test262/built-ins/Boolean/S15.6.2.1_A3.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 The [[Value]] property of the newly constructed object
7 is set to ToBoolean(value)
8 esid: sec-boolean-constructor
9 description: Checking value of the newly created object
10 ---*/
11
12 // CHECK#1
13 var x1 = new Boolean(1);
14 assert.sameValue(x1.valueOf(), true, 'x1.valueOf() must return true');
15
16 var x2 = new Boolean();
17 assert.sameValue(x2.valueOf(), false, 'x2.valueOf() must return false');
18
19 var x2 = new Boolean(0);
20 assert.sameValue(x2.valueOf(), false, 'x2.valueOf() must return false');
21
22 var x2 = new Boolean(new Object());
23 assert.sameValue(x2.valueOf(), true, 'x2.valueOf() must return true');
24
25 reportCompare(0, 0);