diff --git a/NEWS b/NEWS index 9501ab9..2498cf2 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ UNRELEASED - Add os.setlocale that only understands the C locale - Fix incorrect length for certain tables + - Remove luai_apicheck - Note: this will be the last release to support Node 6 and Node 11 diff --git a/src/llimits.js b/src/llimits.js index 2e7b892..4f2b3f3 100644 --- a/src/llimits.js +++ b/src/llimits.js @@ -1,16 +1,12 @@ "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); + if (!e) throw Error(msg); }; module.exports.api_check = api_check; diff --git a/src/luaconf.js b/src/luaconf.js index dbdcf9a..5fb91cd 100644 --- a/src/luaconf.js +++ b/src/luaconf.js @@ -172,10 +172,6 @@ const lua_getlocaledecpoint = function() { return 46 /* '.'.charCodeAt(0) */; }; -const luai_apicheck = function(l, e) { - if (!e) throw Error(e); -}; - /* @@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system. */ @@ -220,4 +216,3 @@ 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;