Debian Codegraph @

js/src/tests/test262/built-ins/String/S9.8.1_A1.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 NaN, return the string "NaN"
6 es5id: 9.8.1_A1
7 description: NaN convert to String by explicit transformation
8 ---*/
9
10 // CHECK#1
11 if (String(NaN) !== "NaN") {
12 throw new Test262Error('#1: String(NaN) === Not-a-Number Actual: ' + (String(NaN)));
13 }
14
15 // CHECK#2
16 if (String(Number.NaN) !== "NaN") {
17 throw new Test262Error('#2: String(Number.NaN) === Not-a-Number Actual: ' + (String(Number.NaN)));
18 }
19
20 // CHECK#3
21 if (String(Number("asasa")) !== "NaN") {
22 throw new Test262Error('#3: String(Number("asasa")) === Not-a-Number Actual: ' + (String(Number("asasa"))));
23 }
24
25 reportCompare(0, 0);