Debian Codegraph @

js/src/tests/test262/built-ins/String/S9.8.1_A4.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: If m is infinity, return the string "Infinity"
6 es5id: 9.8.1_A4
7 description: +/-Infinity convert to String by explicit transformation
8 ---*/
9
10 // CHECK#1
11 if (String(Infinity) !== "Infinity") {
12 throw new Test262Error('#1: String(Infinity) === "Infinity". Actual: ' + (String(Infinity)));
13 }
14
15 // CHECK#2
16 if (String(Number.POSITIVE_INFINITY) !== "Infinity") {
17 throw new Test262Error('#2: String(Number.POSITIVE_INFINITY) === "Infinity". Actual: ' + (String(Number.POSITIVE_INFINITY)));
18 }
19
20 // CHECK#3
21 if (String(-Infinity) !== "-Infinity") {
22 throw new Test262Error('#3: String(-Infinity) === "-Infinity". Actual: ' + (String(-Infinity)));
23 }
24
25 // CHECK#4
26 if (String(Number.NEGATIVE_INFINITY) !== "-Infinity") {
27 throw new Test262Error('#4: String(Number.NEGATIVE_INFINITY) === "-Infinity". Actual: ' + (String(Number.NEGATIVE_INFINITY)));
28 }
29
30 reportCompare(0, 0);