[ArgoUI] fix gloable function  register
@@ -506,15 +506,15 @@ static int mlnui_errorFunc_traceback (lua_State *L) {
}
BOOL needSetGlobal = YES;
if (strcmp(packageName, "NULL") != 0) {
+ needSetGlobal = NO;
lua_getglobal(L, packageName);
if (!lua_istable(L, -1)) {
lua_newtable(L);
lua_pushvalue(L, -1);
- lua_setglobal(L, libname);
+ lua_setglobal(L, packageName);
}
- }
- if (strcmp(packageName, "NULL") != 0) {
- needSetGlobal = NO;
+
+ if (strcmp(libname, "NULL") != 0) {
if (!lua_istable(L, -1)) {
lua_getglobal(L, libname);
if (!lua_istable(L, -1)) {
@@ -533,6 +533,8 @@ static int mlnui_errorFunc_traceback (lua_State *L) {
lua_remove(L, -2);
}
}
+ }
+
for (; list->l_mn; list++) {
if (!charpNotEmpty(list->clz)) {
@@ -573,7 +575,7 @@ static int mlnui_errorFunc_traceback (lua_State *L) {
int number = atoi(list->l_mn);
lua_pushnumber(L, number);
} else {
- lua_pushstring(L, list->mn);
+ lua_pushstring(L, list->l_mn);
}
lua_insert(L, -2);
lua_settable(L, -3);
