lua_settagmethod does not return old tag method

This commit is contained in:
Roberto Ierusalimschy
2000-10-31 11:10:24 -02:00
parent 03770ecfc9
commit 67c1afff59
5 changed files with 14 additions and 12 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: lbaselib.c,v 1.14 2000/10/24 19:19:15 roberto Exp roberto $
** $Id: lbaselib.c,v 1.15 2000/10/27 16:15:53 roberto Exp roberto $
** Basic library
** See Copyright Notice in lua.h
*/
@@ -184,10 +184,13 @@ static int luaB_settagmethod (lua_State *L) {
"function or nil expected");
if (strcmp(event, "gc") == 0)
lua_error(L, "deprecated use: cannot set the `gc' tag method from Lua");
lua_gettagmethod(L, tag, event);
lua_pushvalue(L, 3);
lua_settagmethod(L, tag, event);
return 1;
}
static int luaB_gettagmethod (lua_State *L) {
int tag = luaL_check_int(L, 1);
const char *event = luaL_check_string(L, 2);