summaryrefslogtreecommitdiff
path: root/src/luaconf.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/luaconf.js')
-rw-r--r--src/luaconf.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/luaconf.js b/src/luaconf.js
index 4bf8583..533e316 100644
--- a/src/luaconf.js
+++ b/src/luaconf.js
@@ -38,7 +38,11 @@ const LUA_INTEGER_FMT = `%${LUA_INTEGER_FRMLEN}d`;
const LUA_NUMBER_FMT = "%.14g";
const lua_getlocaledecpoint = function() {
- return (1.1).toLocaleString().substring(1, 2);
+ return (1.1).toLocaleString().charCodeAt(1);
+};
+
+const luai_apicheck = function(l, e) {
+ if (!e) throw Error(e);
};
// See: http://croquetweak.blogspot.fr/2014/08/deconstructing-floats-frexp-and-ldexp.html
@@ -78,3 +82,4 @@ module.exports.lua_getlocaledecpoint = lua_getlocaledecpoint;
module.exports.lua_integer2str = lua_integer2str;
module.exports.lua_number2str = lua_number2str;
module.exports.lua_numbertointeger = lua_numbertointeger;
+module.exports.luai_apicheck = luai_apicheck;