S9.3_A1_T2.js (737B)
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: Result of number conversion from undefined value is NaN 6 es5id: 9.3_A1_T2 7 description: Undefined convert to Number by implicit transformation 8 ---*/ 9 10 // CHECK#1 11 if (isNaN(+(undefined)) !== true) { 12 throw new Test262Error('#1: +(undefined) === Not-a-Number. Actual: ' + (+(undefined))); 13 } 14 15 // CHECK#2 16 if (isNaN(+(void 0)) !== true) { 17 throw new Test262Error('#2: +(void 0) === Not-a-Number. Actual: ' + (+(void 0))); 18 } 19 20 // CHECK#3 21 if (isNaN(+(eval("var x"))) !== true) { 22 throw new Test262Error('#3: +(eval("var x")) === Not-a-Number. Actual: ' + (+(eval("var x")))); 23 } 24 25 reportCompare(0, 0);