diff options
author | Benoit Giannangeli <giann008@gmail.com> | 2017-05-02 11:06:38 +0200 |
---|---|---|
committer | Benoit Giannangeli <giann008@gmail.com> | 2017-05-02 11:06:38 +0200 |
commit | f2bb5dee9b90197185dd0367cee98b61b066ae70 (patch) | |
tree | b3222d28e409053e6c6e1036de25c8e5701c9d7d /src/lauxlib.js | |
parent | d35f4e1dcec1494483a9257b7a2cacb172047c1f (diff) | |
parent | 59d5ff59e3b9eacc2b2aa8e92e71f31914d09545 (diff) | |
download | fengari-f2bb5dee9b90197185dd0367cee98b61b066ae70.tar.gz fengari-f2bb5dee9b90197185dd0367cee98b61b066ae70.tar.bz2 fengari-f2bb5dee9b90197185dd0367cee98b61b066ae70.zip |
Merge remote-tracking branch 'daurnimator/fix-errors'
Diffstat (limited to 'src/lauxlib.js')
-rw-r--r-- | src/lauxlib.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lauxlib.js b/src/lauxlib.js index 68e7c12..1921237 100644 --- a/src/lauxlib.js +++ b/src/lauxlib.js @@ -403,6 +403,10 @@ const luaL_loadstring = function(L, s) { return luaL_loadbuffer(L, s, s.length, s); }; +const luaL_dostring = function(L, s) { + return (luaL_loadstring(L, s) || lua.lua_pcall(L, 0, lua.LUA_MULTRET, 0)); +}; + const luaL_getmetafield = function(L, obj, event) { if (!lua.lua_getmetatable(L, obj)) return lua.LUA_TNIL; @@ -699,6 +703,11 @@ if (typeof require === "function") { return luaL_loadfilex(L, filename, null); }; + const luaL_dofile = function(L, filename) { + return (luaL_loadfile(L, filename) || lua.lua_pcall(L, 0, lua.LUA_MULTRET, 0)); + }; + + module.exports.luaL_dofile = luaL_dofile; module.exports.luaL_loadfilex = luaL_loadfilex; module.exports.luaL_loadfile = luaL_loadfile; } @@ -729,6 +738,7 @@ module.exports.luaL_checkstack = luaL_checkstack; module.exports.luaL_checkstring = luaL_checkstring; module.exports.luaL_checktype = luaL_checktype; module.exports.luaL_checkudata = luaL_checkudata; +module.exports.luaL_dostring = luaL_dostring; module.exports.luaL_error = luaL_error; module.exports.luaL_execresult = luaL_execresult; module.exports.luaL_fileresult = luaL_fileresult; |