Debian Codegraph @

js/src/tests/test262/built-ins/Boolean/S15.6.2.1_A1.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 Boolean is called as part of a new expression it is
7 a constructor: it initialises the newly created object
8 esid: sec-boolean-constructor
9 description: Checking type of the newly created object and it value
10 ---*/
11
12 assert.sameValue(typeof new Boolean(), "object", 'The value of `typeof new Boolean()` is expected to be "object"');
13 assert.notSameValue(new Boolean(), undefined, 'new Boolean() is expected to not equal ``undefined``');
14
15 var x3 = new Boolean();
16 assert.sameValue(typeof x3, "object", 'The value of `typeof x3` is expected to be "object"');
17
18 var x4 = new Boolean();
19 assert.notSameValue(x4, undefined, 'The value of x4 is expected to not equal ``undefined``');
20 assert.sameValue(typeof new Boolean(1), "object", 'The value of `typeof new Boolean(1)` is expected to be "object"');
21 assert.notSameValue(new Boolean(1), undefined, 'new Boolean(1) is expected to not equal ``undefined``');
22
23 var x7 = new Boolean(1);
24 assert.sameValue(typeof x7, "object", 'The value of `typeof x7` is expected to be "object"');
25
26 var x8 = new Boolean(1);
27 assert.notSameValue(x8, undefined, 'The value of x8 is expected to not equal ``undefined``');
28
29 reportCompare(0, 0);