S15.1.2.3_A4_T6.js (873B)
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 Compute the longest prefix of Result(2), which might be Result(2) itself, 7 which satisfies the syntax of a StrDecimalLiteral 8 esid: sec-parsefloat-string 9 description: Checking . DecimalDigits ExponentPart_opt 10 ---*/ 11 12 //CHECK#1 13 if (parseFloat("+.1string") !== 0.1) { 14 throw new Test262Error('#1: parseFloat("+.1string") === 0.1. Actual: ' + (parseFloat("+.1string"))); 15 } 16 17 //CHECK#2 18 if (parseFloat(".01string") !== 0.01) { 19 throw new Test262Error('#2: parseFloat(".01string") === 0.01. Actual: ' + (parseFloat(".01string"))); 20 } 21 22 //CHECK#3 23 if (parseFloat("+.22e-1string") !== 0.022) { 24 throw new Test262Error('#3: parseFloat("+.22e-1string") === 0.022. Actual: ' + (parseFloat("+.22e-1string"))); 25 } 26 27 reportCompare(0, 0);