mirror of https://github.com/rusefi/lua.git
error message for 'bad self' includes original 'extramsg'
This commit is contained in:
parent
bc84180d12
commit
4082c77ff2
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** $Id: lauxlib.c,v 1.245 2012/08/16 17:32:20 roberto Exp roberto $
|
** $Id: lauxlib.c,v 1.246 2012/09/24 22:57:26 roberto Exp roberto $
|
||||||
** Auxiliary functions for building Lua libraries
|
** Auxiliary functions for building Lua libraries
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
|
@ -158,7 +158,8 @@ LUALIB_API int luaL_argerror (lua_State *L, int narg, const char *extramsg) {
|
||||||
if (strcmp(ar.namewhat, "method") == 0) {
|
if (strcmp(ar.namewhat, "method") == 0) {
|
||||||
narg--; /* do not count `self' */
|
narg--; /* do not count `self' */
|
||||||
if (narg == 0) /* error is in the self argument itself? */
|
if (narg == 0) /* error is in the self argument itself? */
|
||||||
return luaL_error(L, "calling " LUA_QS " on bad self", ar.name);
|
return luaL_error(L, "calling " LUA_QS " on bad self (%s)",
|
||||||
|
ar.name, extramsg);
|
||||||
}
|
}
|
||||||
if (ar.name == NULL)
|
if (ar.name == NULL)
|
||||||
ar.name = (pushglobalfuncname(L, &ar)) ? lua_tostring(L, -1) : "?";
|
ar.name = (pushglobalfuncname(L, &ar)) ? lua_tostring(L, -1) : "?";
|
||||||
|
|
Loading…
Reference in New Issue