Skip to content

Commit

Permalink
Lua 5.3 support: set __name field in metatables to debug_name for bet…
Browse files Browse the repository at this point in the history
…ter error messages (e.g. tostring and luaL_check... functions)
  • Loading branch information
osch committed Dec 8, 2019
1 parent 0e27029 commit 573399e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions oocairo.c
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,9 @@ create_object_metatable (lua_State *L, const char *mt_name,
lua_pushliteral(L, "_NAME");
lua_pushstring(L, debug_name);
lua_rawset(L, -3);
lua_pushliteral(L, "__name");
lua_pushstring(L, debug_name);
lua_rawset(L, -3);
add_funcs_to_table(L, methods);
lua_pushliteral(L, "__index");
lua_pushvalue(L, -2);
Expand Down

0 comments on commit 573399e

Please sign in to comment.