Debian Codegraph @

js/src/tests/test262/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 assert.sameValue(
20 Number(dynaString("Infi", "nity")),
21 Number.POSITIVE_INFINITY,
22 'Number(dynaString("Infi", "nity")) returns Number.POSITIVE_INFINITY'
23 );
24
25 assert.sameValue(
26 Number(dynaString("Infi", "nity")),
27 10e10000,
28 'Number(dynaString("Infi", "nity")) must return 10e10000'
29 );
30
31 assert.sameValue(
32 Number(dynaString("Infi", "nity")),
33 10E10000,
34 'Number(dynaString("Infi", "nity")) must return 10E10000'
35 );
36
37 assert.sameValue(
38 Number(dynaString("Infi", "nity")),
39 Number("10e10000"),
40 'Number(dynaString("Infi", "nity")) must return the same value returned by Number("10e10000")'
41 );
42
43 reportCompare(0, 0);