Debian Codegraph @

js/src/tests/test262/built-ins/Boolean/S9.2_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: Result of boolean conversion from undefined value is false
6 esid: sec-toboolean
7 description: >
8 Undefined, void and others are converted to Boolean by explicit
9 transformation
10 ---*/
11
12 assert.sameValue(Boolean(undefined), false, 'Boolean(undefined) must return false');
13 assert.sameValue(Boolean(void 0), false, 'Boolean(void 0) must return false');
14 assert.sameValue(Boolean(eval("var x")), false, 'Boolean(eval("var x")) must return false');
15 assert.sameValue(Boolean(), false, 'Boolean() must return false');
16
17 reportCompare(0, 0);