Make parseInt unicode tolerant.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
This commit is contained in:
Peter Gal
2015-07-24 14:43:08 +02:00
committed by Dániel Bátyai
parent 382b2b48b7
commit 3fbe54393f
2 changed files with 77 additions and 29 deletions
+6
View File
@@ -28,6 +28,12 @@ assert(parseInt("12A3") === 12);
assert(parseInt("12.34") === 12);
assert(isNaN(parseInt("AB")));
assert(isNaN(parseInt("")));
assert(isNaN(parseInt("-")));
assert(isNaN(parseInt("-", 11)));
assert(parseInt("\u00a0123") === 123);
assert(parseInt("\u20291 123\u00D0") === 1);
assert(parseInt("\u00a0123", 13) === 198);
assert(parseInt("\u2029123 1\u00D0", 11) === 146);
var bool = true;
var obj = new Object();