| 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 |
Result of boolean conversion from number value is false if the argument |
| 7 |
is +0, -0, or NaN; otherwise, is true |
| 8 |
esid: sec-toboolean |
| 9 |
es5id: 9.2_A4_T1 |
| 10 |
description: +0, -0 and NaN convert to Boolean by explicit transformation |
| 11 |
---*/ |
| 12 |
|
| 13 |
// CHECK#1 |
| 14 |
if (Boolean(+0) !== false) { |
| 15 |
$ERROR('#1: Boolean(+0) === false. Actual: ' + (Boolean(+0))); |
| 16 |
} |
| 17 |
|
| 18 |
// CHECK#2 |
| 19 |
if (Boolean(-0) !== false) { |
| 20 |
$ERROR('#2: Boolean(-0) === false. Actual: ' + (Boolean(-0))); |
| 21 |
} |
| 22 |
|
| 23 |
// CHECK#3 |
| 24 |
if (Boolean(Number.NaN) !== false) { |
| 25 |
$ERROR('#3: Boolean(Number.NaN) === false. Actual: ' + (Boolean(Number.NaN))); |
| 26 |
} |