summaryrefslogtreecommitdiff
path: root/src/lauxlib.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-03-05 15:57:04 +0100
committerBenoit Giannangeli <giann008@gmail.com>2017-03-05 15:57:04 +0100
commit2ac8543dfd87f4c227385d6890bfcb011fc341f1 (patch)
treee122a3d4c28406aadeba2557f76bb123a34025ef /src/lauxlib.js
parentdb136649e45a63edb8bc511e756249a9e6ca9ea7 (diff)
downloadfengari-2ac8543dfd87f4c227385d6890bfcb011fc341f1.tar.gz
fengari-2ac8543dfd87f4c227385d6890bfcb011fc341f1.tar.bz2
fengari-2ac8543dfd87f4c227385d6890bfcb011fc341f1.zip
lstrlib, string.len
Diffstat (limited to 'src/lauxlib.js')
-rw-r--r--src/lauxlib.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lauxlib.js b/src/lauxlib.js
index d58a171..5223b9b 100644
--- a/src/lauxlib.js
+++ b/src/lauxlib.js
@@ -158,6 +158,10 @@ const luaL_checktype = function(L, arg, t) {
tag_error(L, arg, t);
};
+const luaL_checkstring = function(L, n) {
+ luaL_checklstring(L, n, null);
+};
+
const luaL_checklstring = function(L, arg) {
let s = lapi.lua_tolstring(L, arg);
if (!s) tag_error(L, arg, CT.LUA_TSTRING);
@@ -394,6 +398,7 @@ module.exports.luaL_checkinteger = luaL_checkinteger;
module.exports.luaL_checklstring = luaL_checklstring;
module.exports.luaL_checknumber = luaL_checknumber;
module.exports.luaL_checkstack = luaL_checkstack;
+module.exports.luaL_checkstring = luaL_checkstring;
module.exports.luaL_checktype = luaL_checktype;
module.exports.luaL_error = luaL_error;
module.exports.luaL_getmetafield = luaL_getmetafield;