From 214dcf73833f7a29c58eef2b85d68ee3277039f0 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Thu, 18 Jan 2018 04:29:58 +1100 Subject: src/: Start using lua_assert() instead of plain assert() --- src/luaconf.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/luaconf.js') diff --git a/src/luaconf.js b/src/luaconf.js index 4bf8583..c2a7781 100644 --- a/src/luaconf.js +++ b/src/luaconf.js @@ -41,6 +41,10 @@ const lua_getlocaledecpoint = function() { return (1.1).toLocaleString().substring(1, 2); }; +const luai_apicheck = function(l, e) { + if (!e) throw Error(e); +}; + // See: http://croquetweak.blogspot.fr/2014/08/deconstructing-floats-frexp-and-ldexp.html const frexp = function(value) { if (value === 0) return [value, 0]; @@ -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; -- cgit v1.2.3-54-g00ecf