** 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). */
| 437 | ** ignored). |
| 438 | */ |
| 439 | static 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 | |
| 450 | static int luaB_pcall (lua_State *L) { |
no test coverage detected