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