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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user