* Get information about where a Lua function is defined * @param L lua state * @param stack_index which index on the stack that contains the lua function ref * @param out_function_info pointer to the function information that is filled out * @return true on success, out_function_info is only touched if the function succeeds */
| 2079 | * @return true on success, out_function_info is only touched if the function succeeds |
| 2080 | */ |
| 2081 | static bool GetLuaFunctionRefInfo(lua_State* L, int stack_index, LuaFunctionInfo* out_function_info) |
| 2082 | { |
| 2083 | lua_Debug ar; |
| 2084 | lua_pushvalue(L, stack_index); |
| 2085 | if (lua_getinfo(L, ">Sn", &ar)) |
| 2086 | { |
| 2087 | out_function_info->m_FileName = &ar.source[1]; // Skip source prefix character |
| 2088 | out_function_info->m_LineNumber = ar.linedefined; |
| 2089 | out_function_info->m_OptionalName = ar.name; |
| 2090 | return true; |
| 2091 | } |
| 2092 | return false; |
| 2093 | } |
| 2094 | |
| 2095 | // Fast length limited string concatenation that assume we already point to |
| 2096 | // the end of the string. Returns the new end of the string so we do not need |
no test coverage detected