** Call closing method for object 'obj' with error message 'err'. The ** boolean 'yy' controls whether the call is yieldable. ** (This function assumes EXTRA_STACK.) */
| 105 | ** (This function assumes EXTRA_STACK.) |
| 106 | */ |
| 107 | static void callclosemethod (lua_State *L, TValue *obj, TValue *err, int yy) { |
| 108 | StkId top = L->top.p; |
| 109 | const TValue *tm = luaT_gettmbyobj(L, obj, TM_CLOSE); |
| 110 | setobj2s(L, top, tm); /* will call metamethod... */ |
| 111 | setobj2s(L, top + 1, obj); /* with 'self' as the 1st argument */ |
| 112 | setobj2s(L, top + 2, err); /* and error msg. as 2nd argument */ |
| 113 | L->top.p = top + 3; /* add function and arguments */ |
| 114 | if (yy) |
| 115 | luaD_call(L, top, 0); |
| 116 | else |
| 117 | luaD_callnoyield(L, top, 0); |
| 118 | } |
| 119 | |
| 120 | |
| 121 | /* |
no test coverage detected