diff options
Diffstat (limited to 'src/lobject.js')
-rw-r--r-- | src/lobject.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lobject.js b/src/lobject.js index 3cbde26..bdbccb9 100644 --- a/src/lobject.js +++ b/src/lobject.js @@ -342,7 +342,8 @@ const l_str2dloc = function(s, mode) { }; const l_str2d = function(s) { - let pidx = /[.xXnN]/g.exec(s).index; + let pidx = /[.xXnN]/g.exec(s); + pidx = pidx ? pidx.index : null; let pmode = pidx ? s[pidx] : null; let mode = pmode ? pmode.toLowerCase() : 0; if (mode === 'n') /* reject 'inf' and 'nan' */ |