diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-09-19 17:12:47 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-09-19 17:12:47 -0300 |
commit | e8f35fc4ff01c09b3529e25caeca047e3e1e3517 (patch) | |
tree | dbe5bdbdb9a39343789f057a38a3873420a06d23 /lvm.c | |
parent | 6fb0fd506367d70fb83a7885441fc5bd499e937a (diff) | |
download | lua-e8f35fc4ff01c09b3529e25caeca047e3e1e3517.tar.gz lua-e8f35fc4ff01c09b3529e25caeca047e3e1e3517.tar.bz2 lua-e8f35fc4ff01c09b3529e25caeca047e3e1e3517.zip |
unification of __index & __gettable (and __newindex & __settable)
Diffstat (limited to 'lvm.c')
-rw-r--r-- | lvm.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 1.254 2002/08/21 18:56:19 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 1.255 2002/09/19 13:03:53 roberto Exp roberto $ |
3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -134,7 +134,7 @@ static const TObject *luaV_index (lua_State *L, const TObject *t, | |||
134 | 134 | ||
135 | static const TObject *luaV_getnotable (lua_State *L, const TObject *t, | 135 | static const TObject *luaV_getnotable (lua_State *L, const TObject *t, |
136 | TObject *key, int loop) { | 136 | TObject *key, int loop) { |
137 | const TObject *tm = luaT_gettmbyobj(L, t, TM_GETTABLE); | 137 | const TObject *tm = luaT_gettmbyobj(L, t, TM_INDEX); |
138 | if (ttisnil(tm)) | 138 | if (ttisnil(tm)) |
139 | luaG_typeerror(L, t, "index"); | 139 | luaG_typeerror(L, t, "index"); |
140 | if (ttisfunction(tm)) { | 140 | if (ttisfunction(tm)) { |
@@ -181,7 +181,7 @@ void luaV_settable (lua_State *L, const TObject *t, TObject *key, StkId val) { | |||
181 | } | 181 | } |
182 | /* else will try the tag method */ | 182 | /* else will try the tag method */ |
183 | } | 183 | } |
184 | else if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_SETTABLE))) | 184 | else if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_NEWINDEX))) |
185 | luaG_typeerror(L, t, "index"); | 185 | luaG_typeerror(L, t, "index"); |
186 | if (ttisfunction(tm)) { | 186 | if (ttisfunction(tm)) { |
187 | callTM(L, tm, t, key, val); | 187 | callTM(L, tm, t, key, val); |