summaryrefslogtreecommitdiff
path: root/src/lbaselib.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-22 07:42:36 +0100
committerBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-22 07:48:59 +0100
commitc1824a99035a231172f3c10ae3ee24a3e6330260 (patch)
tree46136d16c9a7a7f34b3ef2818fff1d32e565b3c3 /src/lbaselib.js
parent653f4a07af6506e0b8ef71e8957976b9559f67e4 (diff)
downloadfengari-c1824a99035a231172f3c10ae3ee24a3e6330260.tar.gz
fengari-c1824a99035a231172f3c10ae3ee24a3e6330260.tar.bz2
fengari-c1824a99035a231172f3c10ae3ee24a3e6330260.zip
xpcall calls msgh
Diffstat (limited to 'src/lbaselib.js')
-rw-r--r--src/lbaselib.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lbaselib.js b/src/lbaselib.js
index ac0ac4c..b3dcd12 100644
--- a/src/lbaselib.js
+++ b/src/lbaselib.js
@@ -131,10 +131,10 @@ const luaB_pcall = function(L) {
*/
const luaB_xpcall = function(L) {
let n = lapi.lua_gettop(L);
- lauxlib.luaL_checktype(L, 2, CT.LUA_TFUNCTION);
- lapi.lua_pushboolean(L, 1);
- lapi.lua_pushvalue(L, 1);
- lapi.lua_rotate(L, 3, 2);
+ lauxlib.luaL_checktype(L, 2, CT.LUA_TFUNCTION); /* check error function */
+ lapi.lua_pushboolean(L, 1); /* first result */
+ lapi.lua_pushvalue(L, 1); /* function */
+ lapi.lua_rotate(L, 3, 2); /* move them below function's arguments */
let status = lapi.lua_pcallk(L, n - 2, lua.LUA_MULTRET, 2, 2, finishpcall);
return finishpcall(L, status, 2);
};
@@ -167,4 +167,4 @@ const luaopen_base = function(L) {
return 1;
};
-module.exports.luaopen_base = luaopen_base;
+module.exports.luaopen_base = luaopen_base;