| 70 | |
| 71 | |
| 72 | const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, TMS event) { |
| 73 | Table *mt; |
| 74 | switch (ttnov(o)) { |
| 75 | case LUA_TTABLE: |
| 76 | mt = hvalue(o)->metatable; |
| 77 | break; |
| 78 | case LUA_TUSERDATA: |
| 79 | mt = uvalue(o)->metatable; |
| 80 | break; |
| 81 | default: |
| 82 | mt = G(L)->mt[ttnov(o)]; |
| 83 | } |
| 84 | return (mt ? luaH_getshortstr(mt, G(L)->tmname[event]) : luaO_nilobject); |
| 85 | } |
| 86 | |
| 87 | |
| 88 | /* |
no test coverage detected