** Prepare closing method plus its arguments for object 'obj' with ** error message 'err'. (This function assumes EXTRA_STACK.) */
| 111 | ** error message 'err'. (This function assumes EXTRA_STACK.) |
| 112 | */ |
| 113 | static int prepclosingmethod (lua_State *L, TValue *obj, TValue *err) { |
| 114 | StkId top = L->top; |
| 115 | const TValue *tm = luaT_gettmbyobj(L, obj, TM_CLOSE); |
| 116 | if (ttisnil(tm)) /* no metamethod? */ |
| 117 | return 0; /* nothing to call */ |
| 118 | setobj2s(L, top, tm); /* will call metamethod... */ |
| 119 | setobj2s(L, top + 1, obj); /* with 'self' as the 1st argument */ |
| 120 | setobj2s(L, top + 2, err); /* and error msg. as 2nd argument */ |
| 121 | L->top = top + 3; /* add function and arguments */ |
| 122 | return 1; |
| 123 | } |
| 124 | |
| 125 | |
| 126 | /* |
no test coverage detected