| 9887 | |
| 9888 | |
| 9889 | const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, TMS event) { |
| 9890 | Table *mt; |
| 9891 | switch (ttype(o)) { |
| 9892 | case LUA_TTABLE: |
| 9893 | mt = hvalue(o)->metatable; |
| 9894 | break; |
| 9895 | case LUA_TUSERDATA: |
| 9896 | mt = uvalue(o)->metatable; |
| 9897 | break; |
| 9898 | default: |
| 9899 | mt = G(L)->mt[ttype(o)]; |
| 9900 | } |
| 9901 | return (mt ? luaH_getstr(mt, G(L)->tmname[event]) : luaO_nilobject); |
| 9902 | } |
| 9903 | |
| 9904 | /* |
| 9905 | ** $Id: lundump.c,v 2.7.1.4 2008/04/04 19:51:41 roberto Exp $ |
no test coverage detected