S15.1.2.2_A1_T2.js (646B)
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 number primitive 8 ---*/ 9 10 assert.sameValue(parseInt(-1), parseInt("-1"), 'parseInt(-1) must return the same value returned by parseInt("-1")'); 11 assert.sameValue(String(parseInt(Infinity)), "NaN", 'String(parseInt(Infinity)) must return "NaN"'); 12 assert.sameValue(String(parseInt(NaN)), "NaN", 'String(parseInt(NaN)) must return "NaN"'); 13 assert.sameValue(parseInt(-0), 0, 'parseInt(-0) must return 0'); 14 15 reportCompare(0, 0);