** Do a protected call with error handling. After 'lua_rotate', the ** stack will have ; so, the function passes ** 2 to 'finishpcall' to skip the 2 first values when returning results. */
| 545 | ** 2 to 'finishpcall' to skip the 2 first values when returning results. |
| 546 | */ |
| 547 | static int luaB_xpcall(lua_State *L) { |
| 548 | int status; |
| 549 | int n = lua_gettop(L); |
| 550 | luaL_checktype(L, 2, LUA_TFUNCTION); /* check error function */ |
| 551 | lua_pushboolean(L, 1); /* first result */ |
| 552 | lua_pushvalue(L, 1); /* function */ |
| 553 | lua_rotate(L, 3, 2); /* move them below function's arguments */ |
| 554 | status = lua_pcallk(L, n - 2, LUA_MULTRET, 2, 2, finishpcall); |
| 555 | return finishpcall(L, status, 2); |
| 556 | } |
| 557 | |
| 558 | |
| 559 | static int luaB_tostring(lua_State *L) { |
nothing calls this directly
no test coverage detected