diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-10-20 09:35:25 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-10-20 09:35:25 -0200 |
| commit | 515d55683224eb78b8e8c69d3b0c7ed7a7c2076f (patch) | |
| tree | 41c04984589e0cc746b609a946db23d1d595900b | |
| parent | ed7039024d32778a62fd52a98fe98f3e38133853 (diff) | |
| download | lua-515d55683224eb78b8e8c69d3b0c7ed7a7c2076f.tar.gz lua-515d55683224eb78b8e8c69d3b0c7ed7a7c2076f.tar.bz2 lua-515d55683224eb78b8e8c69d3b0c7ed7a7c2076f.zip | |
access to metamethods and metafields should be raw
| -rw-r--r-- | lauxlib.c | 5 |
1 files changed, 3 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lauxlib.c,v 1.153 2005/10/03 14:36:45 roberto Exp roberto $ | 2 | ** $Id: lauxlib.c,v 1.154 2005/10/19 13:05:11 roberto Exp roberto $ |
| 3 | ** Auxiliary functions for building Lua libraries | 3 | ** Auxiliary functions for building Lua libraries |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -199,7 +199,8 @@ LUALIB_API lua_Integer luaL_optinteger (lua_State *L, int narg, | |||
| 199 | LUALIB_API int luaL_getmetafield (lua_State *L, int obj, const char *event) { | 199 | LUALIB_API int luaL_getmetafield (lua_State *L, int obj, const char *event) { |
| 200 | if (!lua_getmetatable(L, obj)) /* no metatable? */ | 200 | if (!lua_getmetatable(L, obj)) /* no metatable? */ |
| 201 | return 0; | 201 | return 0; |
| 202 | lua_getfield(L, -1, event); | 202 | lua_pushstring(L, event); |
| 203 | lua_rawget(L, -2); | ||
| 203 | if (lua_isnil(L, -1)) { | 204 | if (lua_isnil(L, -1)) { |
| 204 | lua_pop(L, 2); /* remove metatable and metafield */ | 205 | lua_pop(L, 2); /* remove metatable and metafield */ |
| 205 | return 0; | 206 | return 0; |
