S9.2_A4_T4.js (1528B)
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 throw new Test262Error('#1: !(+Infinity) === false. Actual: ' + (!(+Infinity))); 18 } 19 20 // CHECK#2; 21 if (!(Number.NEGATIVE_INFINITY) !== false) { 22 throw new Test262Error('#2: !(-Infinity) === false. Actual: ' + (!(-Infinity))); 23 } 24 25 // CHECK#3 26 if (!(Number.MAX_VALUE) !== false) { 27 throw new Test262Error('#3: !(Number.MAX_VALUE) === false. Actual: ' + (!(Number.MAX_VALUE))); 28 } 29 30 // CHECK#4 31 if (!(Number.MIN_VALUE) !== false) { 32 throw new Test262Error('#4: !(Number.MIN_VALUE) === false. Actual: ' + (!(Number.MIN_VALUE))); 33 } 34 35 // CHECK#5 36 if (!(13) !== false) { 37 throw new Test262Error('#5: !(13) === false. Actual: ' + (!(13))); 38 } 39 40 // CHECK#6 41 if (!(-13) !== false) { 42 throw new Test262Error('#6: !(-13) === false. Actual: ' + (!(-13))); 43 } 44 45 // CHECK#7 46 if (!(1.3) !== false) { 47 throw new Test262Error('#7: !(1.3) === false. Actual: ' + (!(1.3))); 48 } 49 50 // CHECK#8 51 if (!(-1.3) !== false) { 52 throw new Test262Error('#8: !(-1.3) === false. Actual: ' + (!(-1.3))); 53 } 54 55 reportCompare(0, 0);