S9.2_A4_T3.js (1194B)
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 description: > 10 Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY, 11 Number.MAX_VALUE, Number.MIN_VALUE and some numbers convert to 12 Boolean by explicit transformation 13 ---*/ 14 assert.sameValue(Boolean(Number.POSITIVE_INFINITY), true, 'Boolean(Number.POSITIVE_INFINITY) must return true'); 15 assert.sameValue(Boolean(Number.NEGATIVE_INFINITY), true, 'Boolean(Number.NEGATIVE_INFINITY) must return true'); 16 assert.sameValue(Boolean(Number.MAX_VALUE), true, 'Boolean(Number.MAX_VALUE) must return true'); 17 assert.sameValue(Boolean(Number.MIN_VALUE), true, 'Boolean(Number.MIN_VALUE) must return true'); 18 assert.sameValue(Boolean(13), true, 'Boolean(13) must return true'); 19 assert.sameValue(Boolean(-13), true, 'Boolean(-13) must return true'); 20 assert.sameValue(Boolean(1.3), true, 'Boolean(1.3) must return true'); 21 assert.sameValue(Boolean(-1.3), true, 'Boolean(-1.3) must return true'); 22 23 reportCompare(0, 0);