Debian Codegraph @

js/src/tests/test262/built-ins/parseFloat/S15.1.2.3_A4_T4.js

raw
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: "\"Infinity\"+\"some string\""
10 ---*/
11
12 //CHECK#1
13 if (parseFloat("Infinity1") !== Number.POSITIVE_INFINITY) {
14 throw new Test262Error('#1: parseFloat("Infinity1") === Number.POSITIVE_INFINITY. Actual: ' + (parseFloat("Infinity1")));
15 }
16
17 //CHECK#2
18 if (parseFloat("Infinityx") !== Number.POSITIVE_INFINITY) {
19 throw new Test262Error('#2: parseFloat("Infinityx") === Number.POSITIVE_INFINITY. Actual: ' + (parseFloat("Infinityx")));
20 }
21
22 //CHECK#3
23 if (parseFloat("Infinity+1") !== Number.POSITIVE_INFINITY) {
24 throw new Test262Error('#3: parseFloat("Infinity+1") === Number.POSITIVE_INFINITY. Actual: ' + (parseFloat("Infinity+1")));
25 }
26
27 reportCompare(0, 0);