diff options
author | daurnimator <quae@daurnimator.com> | 2018-01-29 14:46:36 +1100 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2018-01-29 14:49:42 +1100 |
commit | 32fee0764e9e5e1a903ef5d16fb94718a86d7a09 (patch) | |
tree | 691c82fac8532ec4138c6fc9ed38f21018bd7a8f /src/lobject.js | |
parent | 1046bc323bb5d59b894377ea8af53c3b8f38ad6f (diff) | |
download | fengari-32fee0764e9e5e1a903ef5d16fb94718a86d7a09.tar.gz fengari-32fee0764e9e5e1a903ef5d16fb94718a86d7a09.tar.bz2 fengari-32fee0764e9e5e1a903ef5d16fb94718a86d7a09.zip |
src/{luaconf,lobject,lstrlib}.js: lua_getlocaledecpoint now returns char code instead of string
Diffstat (limited to 'src/lobject.js')
-rw-r--r-- | src/lobject.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lobject.js b/src/lobject.js index 1f26b96..9834df7 100644 --- a/src/lobject.js +++ b/src/lobject.js @@ -15,7 +15,6 @@ const { LUA_OPSHR, LUA_OPSUB, LUA_OPUNM, - char, constant_types: { LUA_NUMTAGS, LUA_TBOOLEAN, @@ -430,7 +429,7 @@ const MAXSIGDIG = 30; */ const lua_strx2number = function(s) { let i = 0; - let dot = char[lua_getlocaledecpoint()]; + let dot = lua_getlocaledecpoint(); let r = 0.0; /* result (accumulator) */ let sigdig = 0; /* number of significant digits */ let nosigdig = 0; /* number of non-significant digits */ @@ -597,7 +596,7 @@ const luaO_tostring = function(L, obj) { let str = lua_number2str(obj.value); // Assume no LUA_COMPAT_FLOATSTRING if (/^[-0123456789]+$/.test(str)) { /* looks like an int? */ - str += lua_getlocaledecpoint() + '0'; /* adds '.0' to result */ + str += String.fromCharCode(lua_getlocaledecpoint()) + '0'; /* adds '.0' to result */ } buff = to_luastring(str); } |