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