diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2012-10-19 12:55:01 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2012-10-19 12:55:01 -0300 |
| commit | 4082c77ff2fd09aef6131587a8e2537e86fc7d68 (patch) | |
| tree | 4a678c146b1fd1a6ad3eade59c63d2fe2cf47ba6 | |
| parent | bc84180d12f315f0e036edabc1457c29cb51ee21 (diff) | |
| download | lua-4082c77ff2fd09aef6131587a8e2537e86fc7d68.tar.gz lua-4082c77ff2fd09aef6131587a8e2537e86fc7d68.tar.bz2 lua-4082c77ff2fd09aef6131587a8e2537e86fc7d68.zip | |
error message for 'bad self' includes original 'extramsg'
| -rw-r--r-- | lauxlib.c | 5 |
1 files changed, 3 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lauxlib.c,v 1.245 2012/08/16 17:32:20 roberto Exp roberto $ | 2 | ** $Id: lauxlib.c,v 1.246 2012/09/24 22:57:26 roberto Exp roberto $ |
| 3 | ** Auxiliary functions for building Lua libraries | 3 | ** Auxiliary functions for building Lua libraries |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -158,7 +158,8 @@ LUALIB_API int luaL_argerror (lua_State *L, int narg, const char *extramsg) { | |||
| 158 | if (strcmp(ar.namewhat, "method") == 0) { | 158 | if (strcmp(ar.namewhat, "method") == 0) { |
| 159 | narg--; /* do not count `self' */ | 159 | narg--; /* do not count `self' */ |
| 160 | if (narg == 0) /* error is in the self argument itself? */ | 160 | if (narg == 0) /* error is in the self argument itself? */ |
| 161 | return luaL_error(L, "calling " LUA_QS " on bad self", ar.name); | 161 | return luaL_error(L, "calling " LUA_QS " on bad self (%s)", |
| 162 | ar.name, extramsg); | ||
| 162 | } | 163 | } |
| 163 | if (ar.name == NULL) | 164 | if (ar.name == NULL) |
| 164 | ar.name = (pushglobalfuncname(L, &ar)) ? lua_tostring(L, -1) : "?"; | 165 | ar.name = (pushglobalfuncname(L, &ar)) ? lua_tostring(L, -1) : "?"; |
