summaryrefslogtreecommitdiff
path: root/src/llimits.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/llimits.js')
-rw-r--r--src/llimits.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/llimits.js b/src/llimits.js
index 4a76bbe..bd48159 100644
--- a/src/llimits.js
+++ b/src/llimits.js
@@ -1,5 +1,19 @@
"use strict";
+const {luai_apicheck} = require("./luaconf.js");
+
+const lua_assert = function(c) {
+ if (!c) throw Error("assertion failed");
+};
+module.exports.lua_assert = lua_assert;
+
+module.exports.luai_apicheck = luai_apicheck || function(l, e) { return lua_assert(e); };
+
+const api_check = function(l, e, msg) {
+ return luai_apicheck(l, e && msg);
+};
+module.exports.api_check = api_check;
+
const LUAI_MAXCCALLS = 200;
module.exports.LUAI_MAXCCALLS = LUAI_MAXCCALLS;