mirror of
https://github.com/lua/lua
synced 2024-12-24 03:16:50 +03:00
check first whether function is global.
This commit is contained in:
parent
e9aa98d594
commit
a775a2d81a
8
lapi.c
8
lapi.c
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: lapi.c,v 1.40 1999/03/01 17:49:04 roberto Exp roberto $
|
||||
** $Id: lapi.c,v 1.41 1999/03/04 21:17:26 roberto Exp roberto $
|
||||
** Lua API
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@ -620,10 +620,10 @@ static int checkfunc (TObject *o)
|
||||
char *lua_getobjname (lua_Object o, char **name)
|
||||
{ /* try to find a name for given function */
|
||||
set_normalized(L->stack.top, Address(o)); /* to be accessed by "checkfunc" */
|
||||
if ((*name = luaT_travtagmethods(checkfunc)) != NULL)
|
||||
return "tag-method";
|
||||
else if ((*name = luaS_travsymbol(checkfunc)) != NULL)
|
||||
if ((*name = luaS_travsymbol(checkfunc)) != NULL)
|
||||
return "global";
|
||||
else if ((*name = luaT_travtagmethods(checkfunc)) != NULL)
|
||||
return "tag-method";
|
||||
else return "";
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user