** 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). */
| 406 | ** ignored). |
| 407 | */ |
| 408 | static int finishpcall (lua_State *L, int status, lua_KContext extra) { |
| 409 | if (status != LUA_OK && status != LUA_YIELD) { /* error? */ |
| 410 | lua_pushboolean(L, 0); /* first result (false) */ |
| 411 | lua_pushvalue(L, -2); /* error message */ |
| 412 | return 2; /* return false, msg */ |
| 413 | } |
| 414 | else |
| 415 | return lua_gettop(L) - (int)extra; /* return all results */ |
| 416 | } |
| 417 | |
| 418 | |
| 419 | static int luaB_pcall (lua_State *L) { |
no test coverage detected