Debian Codegraph @

js/src/tests/test262/built-ins/parseInt/S15.1.2.2_A1_T6.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: Operator use ToString
6 esid: sec-parseint-string-radix
7 description: Checking for String object
8 ---*/
9
10 assert.sameValue(parseInt(new String("-1")), parseInt("-1"), 'parseInt(new String("-1")) must return the same value returned by parseInt("-1")');
11
12 assert.sameValue(
13 String(parseInt(new String("Infinity"))),
14 "NaN",
15 'String(parseInt(new String("Infinity"))) must return "NaN"'
16 );
17
18 assert.sameValue(String(parseInt(new String("NaN"))), "NaN", 'String(parseInt(new String("NaN"))) must return "NaN"');
19 assert.sameValue(String(parseInt(new String("false"))), "NaN", 'String(parseInt(new String("false"))) must return "NaN"');
20
21 reportCompare(0, 0);