summaryrefslogtreecommitdiff
path: root/src/luaconf.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2018-01-18 04:29:58 +1100
committerdaurnimator <quae@daurnimator.com>2018-01-18 06:27:15 +1100
commit214dcf73833f7a29c58eef2b85d68ee3277039f0 (patch)
treee48560b5193f81e5dc4ba5ea4ff78004d274234b /src/luaconf.js
parent2fec758ebe4205ffdbd955967890dbbe4b1869b9 (diff)
downloadfengari-214dcf73833f7a29c58eef2b85d68ee3277039f0.tar.gz
fengari-214dcf73833f7a29c58eef2b85d68ee3277039f0.tar.bz2
fengari-214dcf73833f7a29c58eef2b85d68ee3277039f0.zip
src/: Start using lua_assert() instead of plain assert()
Diffstat (limited to 'src/luaconf.js')
-rw-r--r--src/luaconf.js5
1 files changed, 5 insertions, 0 deletions
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;