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 [email protected]
This commit is contained in:
1 parent
33be4883a2
commit
ee8d65063f
2 files changed
+142
-130
No files matched your search
@@ -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