diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2004-09-29 18:00:25 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2004-09-29 18:00:25 -0300 |
commit | cf2a194edc8b1d3e6b342a31d042e1b5fd0d2e8a (patch) | |
tree | ec4656ebd3b6a2fa65d6cf2f9b917496f552e5a1 /ltests.c | |
parent | 66845f415feb5aa98be5190c7bf12931d3d4c388 (diff) | |
download | lua-github-cf2a194edc8b1d3e6b342a31d042e1b5fd0d2e8a.tar.gz |
better API for luaL_getfield/setfield
Diffstat (limited to 'ltests.c')
-rw-r--r-- | ltests.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1,5 +1,5 @@ /* -** $Id: ltests.c,v 2.11 2004/08/24 20:12:06 roberto Exp roberto $ +** $Id: ltests.c,v 2.12 2004/09/21 16:54:32 roberto Exp roberto $ ** Internal Module for Debugging of the Lua Implementation ** See Copyright Notice in lua.h */ @@ -1049,8 +1049,8 @@ static int auxgsub (lua_State *L) { static int auxgetf (lua_State *L) { const char *s = luaL_checkstring(L, 1); lua_settop(L, 2); - lua_pushstring(L, luaL_getfield(L, s)); - lua_assert(lua_gettop(L) == 3); + lua_pushstring(L, luaL_getfield(L, 2, s)); + lua_assert(lua_gettop(L) == 4); return 2; } @@ -1058,8 +1058,8 @@ static int auxgetf (lua_State *L) { static int auxsetf (lua_State *L) { const char *s = luaL_checkstring(L, 1); lua_settop(L, 3); - lua_pushstring(L, luaL_setfield(L, s)); - lua_assert(lua_gettop(L) == 2); + lua_pushstring(L, luaL_setfield(L, 2, s)); + lua_assert(lua_gettop(L) == 3); return 1; } |