Fix parseInt when passing empty string.

Before allocating buffer for the string first
we check that the length of it is greater then 0.
If not then the result is a NaN.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
This commit is contained in:
Peter Gal
2015-07-17 15:25:31 +02:00
parent 33be4883a2
commit ee8d65063f
2 changed files with 142 additions and 130 deletions
+1
View File
@@ -27,6 +27,7 @@ assert(parseInt("ABC", 16) === 2748);
assert(parseInt("12A3") === 12);
assert(parseInt("12.34") === 12);
assert(isNaN(parseInt("AB")));
assert(isNaN(parseInt("")));
var bool = true;
var obj = new Object();