From c40f6b898cc36a1f6e2359946b524e46982d70f2 Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Fri, 14 Apr 2017 14:51:49 +0200 Subject: Fixed l_str2int fail case --- src/lobject.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/lobject.js b/src/lobject.js index cf3a52e..710a906 100644 --- a/src/lobject.js +++ b/src/lobject.js @@ -474,7 +474,7 @@ const l_str2int = function(s) { while (ljstype.lisspace(s[0])) s = s.slice(1); /* skip trailing spaces */ - if (empty || s[0] !== 0) return null; /* something wrong in the numeral */ + if (empty || (s.length > 0 && s[0] !== 0)) return null; /* something wrong in the numeral */ else { return neg ? -a : a; } -- cgit v1.2.3-54-g00ecf