| 71 | |
| 72 | |
| 73 | static int luaB_auxwrap (lua_State *L) { |
| 74 | lua_State *co = lua_tothread(L, lua_upvalueindex(1)); |
| 75 | int r = auxresume(L, co, lua_gettop(L)); |
| 76 | if (l_unlikely(r < 0)) { /* error? */ |
| 77 | int stat = lua_status(co); |
| 78 | if (stat != LUA_OK && stat != LUA_YIELD) { /* error in the coroutine? */ |
| 79 | stat = lua_closethread(co, L); /* close its tbc variables */ |
| 80 | lua_assert(stat != LUA_OK); |
| 81 | lua_xmove(co, L, 1); /* move error message to the caller */ |
| 82 | } |
| 83 | if (stat != LUA_ERRMEM && /* not a memory error and ... */ |
| 84 | lua_type(L, -1) == LUA_TSTRING) { /* ... error object is a string? */ |
| 85 | luaL_where(L, 1); /* add extra info, if available */ |
| 86 | lua_insert(L, -2); |
| 87 | lua_concat(L, 2); |
| 88 | } |
| 89 | return lua_error(L); /* propagate error */ |
| 90 | } |
| 91 | return r; |
| 92 | } |
| 93 | |
| 94 | |
| 95 | static int luaB_cocreate (lua_State *L) { |
nothing calls this directly
no test coverage detected