| 59 | |
| 60 | |
| 61 | const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, TMS event) { |
| 62 | Table *mt; |
| 63 | switch (ttype(o)) { |
| 64 | case LUA_TTABLE: |
| 65 | mt = hvalue(o)->metatable; |
| 66 | break; |
| 67 | case LUA_TUSERDATA: |
| 68 | mt = uvalue(o)->metatable; |
| 69 | break; |
| 70 | default: |
| 71 | mt = G(L)->mt[ttype(o)]; |
| 72 | } |
| 73 | return (mt ? luaH_getstr(mt, G(L)->tmname[event]) : luaO_nilobject); |
| 74 | } |
| 75 |
no test coverage detected