| 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 |
es5id: 9.2_A4_T4 |
| 9 |
description: > |
| 10 |
Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY, |
| 11 |
Number.MAX_VALUE, Number.MIN_VALUE and some other numbers are |
| 12 |
converted to Boolean by implicit transformation |
| 13 |
---*/ |
| 14 |
|
| 15 |
// CHECK#1 |
| 16 |
if (!(Number.POSITIVE_INFINITY) !== false) { |
| 17 |
$ERROR('#1: !(+Infinity) === false. Actual: ' + (!(+Infinity))); |
| 18 |
} |
| 19 |
|
| 20 |
// CHECK#2; |
| 21 |
if (!(Number.NEGATIVE_INFINITY) !== false) { |
| 22 |
$ERROR('#2: !(-Infinity) === false. Actual: ' + (!(-Infinity))); |
| 23 |
} |
| 24 |
|
| 25 |
// CHECK#3 |
| 26 |
if (!(Number.MAX_VALUE) !== false) { |
| 27 |
$ERROR('#3: !(Number.MAX_VALUE) === false. Actual: ' + (!(Number.MAX_VALUE))); |
| 28 |
} |
| 29 |
|
| 30 |
// CHECK#4 |
| 31 |
if (!(Number.MIN_VALUE) !== false) { |
| 32 |
$ERROR('#4: !(Number.MIN_VALUE) === false. Actual: ' + (!(Number.MIN_VALUE))); |
| 33 |
} |
| 34 |
|
| 35 |
// CHECK#5 |
| 36 |
if (!(13) !== false) { |
| 37 |
$ERROR('#5: !(13) === false. Actual: ' + (!(13))); |
| 38 |
} |
| 39 |
|
| 40 |
// CHECK#6 |
| 41 |
if (!(-13) !== false) { |
| 42 |
$ERROR('#6: !(-13) === false. Actual: ' + (!(-13))); |
| 43 |
} |
| 44 |
|
| 45 |
// CHECK#7 |
| 46 |
if (!(1.3) !== false) { |
| 47 |
$ERROR('#7: !(1.3) === false. Actual: ' + (!(1.3))); |
| 48 |
} |
| 49 |
|
| 50 |
// CHECK#8 |
| 51 |
if (!(-1.3) !== false) { |
| 52 |
$ERROR('#8: !(-1.3) === false. Actual: ' + (!(-1.3))); |
| 53 |
} |