MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / finishpcall

Function finishpcall

extlibs/lua/src/lbaselib.c:439–447  ·  view source on GitHub ↗

** Continuation function for 'pcall' and 'xpcall'. Both functions ** already pushed a 'true' before doing the call, so in case of success ** 'finishpcall' only has to return everything in the stack minus ** 'extra' values (where 'extra' is exactly the number of items to be ** ignored). */

Source from the content-addressed store, hash-verified

437** ignored).
438*/
439static int finishpcall (lua_State *L, int status, lua_KContext extra) {
440 if (status != LUA_OK && status != LUA_YIELD) { /* error? */
441 lua_pushboolean(L, 0); /* first result (false) */
442 lua_pushvalue(L, -2); /* error message */
443 return 2; /* return false, msg */
444 }
445 else
446 return lua_gettop(L) - (int)extra; /* return all results */
447}
448
449
450static int luaB_pcall (lua_State *L) {

Callers 2

luaB_pcallFunction · 0.85
luaB_xpcallFunction · 0.85

Calls 3

lua_pushbooleanFunction · 0.85
lua_pushvalueFunction · 0.85
lua_gettopFunction · 0.85

Tested by

no test coverage detected