aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lapi.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/lapi.js b/src/lapi.js
index a7d7033..3fbcee9 100644
--- a/src/lapi.js
+++ b/src/lapi.js
@@ -678,8 +678,7 @@ const lua_compare_ = function(L, o1, o2, op) {
};
const lua_stringtonumber = function(L, s) {
- let number = parseFloat(lobject.jsstring(s));
- L.stack[L.top++] = new TValue(number % 1 !== 0 ? CT.LUA_TNUMFLT : CT.LUA_TNUMINT, number);
+ L.stack[L.top++] = lobject.luaO_str2num(s);
assert(L.top <= L.ci.top, "stack overflow");
return s.length;
};