| 2737 | } |
| 2738 | |
| 2739 | static void compat53_pushfuncname(lua_State *L, lua_Debug *ar) { |
| 2740 | if (*ar->namewhat != '\0') /* is there a name? */ |
| 2741 | lua_pushfstring(L, "function " LUA_QS, ar->name); |
| 2742 | else if (*ar->what == 'm') /* main? */ |
| 2743 | lua_pushliteral(L, "main chunk"); |
| 2744 | else if (*ar->what == 'C') { |
| 2745 | if (compat53_pushglobalfuncname(L, ar)) { |
| 2746 | lua_pushfstring(L, "function " LUA_QS, lua_tostring(L, -1)); |
| 2747 | lua_remove(L, -2); /* remove name */ |
| 2748 | } |
| 2749 | else |
| 2750 | lua_pushliteral(L, "?"); |
| 2751 | } |
| 2752 | else |
| 2753 | lua_pushfstring(L, "function <%s:%d>", ar->short_src, ar->linedefined); |
| 2754 | } |
| 2755 | |
| 2756 | #define COMPAT53_LEVELS1 12 /* size of the first part of the stack */ |
| 2757 | #define COMPAT53_LEVELS2 10 /* size of the second part of the stack */ |
no test coverage detected