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