S15.1.2.2_A3.2_T3.js (844B)
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 ToInt32 6 esid: sec-parseint-string-radix 7 description: ToInt32 use modulo 8 ---*/ 9 10 assert.sameValue( 11 parseInt("11", 4294967298), 12 parseInt("11", 2), 13 'parseInt("11", 4294967298) must return the same value returned by parseInt("11", 2)' 14 ); 15 assert.sameValue( 16 parseInt("11", 4294967296), 17 parseInt("11", 10), 18 'parseInt("11", 4294967296) must return the same value returned by parseInt("11", 10)' 19 ); 20 21 assert.sameValue(parseInt("11", -2147483650), NaN, 'parseInt("11", -2147483650) must return NaN'); 22 23 assert.sameValue( 24 parseInt("11", -4294967294), 25 parseInt("11", 2), 26 'parseInt("11", -4294967294) must return the same value returned by parseInt("11", 2)' 27 ); 28 29 reportCompare(0, 0);