소스 검색

check first whether function is global.

Roberto Ierusalimschy 26 년 전
부모
커밋
a775a2d81a
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      lapi.c

+ 4 - 4
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
 ** Lua API
 ** See Copyright Notice in lua.h
 ** See Copyright Notice in lua.h
 */
 */
@@ -620,10 +620,10 @@ static int checkfunc (TObject *o)
 char *lua_getobjname (lua_Object o, char **name)
 char *lua_getobjname (lua_Object o, char **name)
 { /* try to find a name for given function */
 { /* try to find a name for given function */
   set_normalized(L->stack.top, Address(o)); /* to be accessed by "checkfunc" */
   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";
     return "global";
+  else if ((*name = luaT_travtagmethods(checkfunc)) != NULL)
+    return "tag-method";
   else return "";
   else return "";
 }
 }