When available, use metafield '__name' in error messages

This commit is contained in:
Roberto Ierusalimschy
2016-02-26 16:20:15 -03:00
parent c3e9b14d24
commit 7777b412de
3 changed files with 25 additions and 8 deletions

5
ltm.h
View File

@@ -1,5 +1,5 @@
/*
** $Id: ltm.h,v 2.20 2014/06/10 18:53:18 roberto Exp roberto $
** $Id: ltm.h,v 2.21 2014/10/25 11:50:46 roberto Exp roberto $
** Tag methods
** See Copyright Notice in lua.h
*/
@@ -51,11 +51,12 @@ typedef enum {
#define fasttm(l,et,e) gfasttm(G(l), et, e)
#define ttypename(x) luaT_typenames_[(x) + 1]
#define objtypename(x) ttypename(ttnov(x))
LUAI_DDEC const char *const luaT_typenames_[LUA_TOTALTAGS];
LUAI_FUNC const char *luaT_objtypename (lua_State *L, const TValue *o);
LUAI_FUNC const TValue *luaT_gettm (Table *events, TMS event, TString *ename);
LUAI_FUNC const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o,
TMS event);