-------------------------------------------------------------------------*\ * Protect factory \*-------------------------------------------------------------------------*/
| 71 | * Protect factory |
| 72 | \*-------------------------------------------------------------------------*/ |
| 73 | static int unwrap(lua_State *L) { |
| 74 | if (lua_istable(L, -1) && lua_getmetatable(L, -1)) { |
| 75 | int r = lua_rawequal(L, -1, lua_upvalueindex(1)); |
| 76 | lua_pop(L, 1); |
| 77 | if (r) { |
| 78 | lua_pushnil(L); |
| 79 | lua_rawgeti(L, -2, 1); |
| 80 | return 1; |
| 81 | } |
| 82 | } |
| 83 | return 0; |
| 84 | } |
| 85 | |
| 86 | static int protected_finish(lua_State *L, int status, lua_KContext ctx) { |
| 87 | (void)ctx; |
no test coverage detected