Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Number/S9.3.1_A6_T2.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 The MV of StrUnsignedDecimalLiteral::: Infinity is 10<sup><small>10000</small></sup>
7 (a value so large that it will round to <b><tt>+&infin;</tt></b>)
8 es5id: 9.3.1_A6_T2
9 description: >
10 Compare Number('Infi'+'nity') with Number.POSITIVE_INFINITY,
11 10e10000, 10E10000 and Number("10e10000")
12 ---*/
13
14 function dynaString(s1, s2) {
15 return String(s1) + String(s2);
16 }
17
18
19 // CHECK#1
20 if (Number(dynaString("Infi", "nity")) !== Number.POSITIVE_INFINITY) {
21 $ERROR('#1: Number("Infi"+"nity") === Number.POSITIVE_INFINITY');
22 }
23
24 // CHECK#2
25 if (Number(dynaString("Infi", "nity")) !== 10e10000) {
26 $ERROR('#2: Number("Infi"+"nity") === 10e10000');
27 }
28
29 // CHECK#3
30 if (Number(dynaString("Infi", "nity")) !== 10E10000) {
31 $ERROR('#3: Number("Infi"+"nity") === 10E10000');
32 }
33
34 // CHECK#4
35 if (Number(dynaString("Infi", "nity")) !== Number("10e10000")) {
36 $ERROR('#4: Number("Infi"+"nity") === Number("10e10000")');
37 }