diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-05-05 12:34:03 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-05-05 12:34:03 -0300 |
| commit | 6cf85dcc900c71687678bc316164142e76df7385 (patch) | |
| tree | c7d672fc9c68f2cdaffb5e57d1bf8c846091aaa0 /ltm.c | |
| parent | 65f4a0f636eede0f026d0205ac929bc5a56f8b9c (diff) | |
| download | lua-6cf85dcc900c71687678bc316164142e76df7385.tar.gz lua-6cf85dcc900c71687678bc316164142e76df7385.tar.bz2 lua-6cf85dcc900c71687678bc316164142e76df7385.zip | |
metatables for all types
Diffstat (limited to 'ltm.c')
| -rw-r--r-- | ltm.c | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltm.c,v 2.3 2004/04/30 20:13:38 roberto Exp roberto $ | 2 | ** $Id: ltm.c,v 2.4 2005/03/08 18:00:16 roberto Exp roberto $ |
| 3 | ** Tag methods | 3 | ** Tag methods |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -32,7 +32,7 @@ void luaT_init (lua_State *L) { | |||
| 32 | "__index", "__newindex", | 32 | "__index", "__newindex", |
| 33 | "__gc", "__mode", "__eq", | 33 | "__gc", "__mode", "__eq", |
| 34 | "__add", "__sub", "__mul", "__div", "__mod", | 34 | "__add", "__sub", "__mul", "__div", "__mod", |
| 35 | "__pow", "__unm", "__lt", "__le", | 35 | "__pow", "__unm", "__siz", "__lt", "__le", |
| 36 | "__concat", "__call" | 36 | "__concat", "__call" |
| 37 | }; | 37 | }; |
| 38 | int i; | 38 | int i; |
| @@ -68,8 +68,8 @@ const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, TMS event) { | |||
| 68 | mt = uvalue(o)->metatable; | 68 | mt = uvalue(o)->metatable; |
| 69 | break; | 69 | break; |
| 70 | default: | 70 | default: |
| 71 | mt = NULL; | 71 | mt = G(L)->mt[ttype(o)]; |
| 72 | } | 72 | } |
| 73 | return (mt ? luaH_getstr(mt, G(L)->tmname[event]) : &luaO_nilobject); | 73 | return (mt ? luaH_getstr(mt, G(L)->tmname[event]) : &luaO_nilobject); |
| 74 | } | 74 | } |
| 75 | 75 | ||
