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