diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-04-04 17:25:55 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-04-04 17:25:55 -0300 |
| commit | f438d00ef31e3aea54023602f529b68834ffb80a (patch) | |
| tree | 6cfe3a5eff087dcab1c81fb1a76a13aef1ddd039 | |
| parent | c3b90061ea8c9add053538945ac85188e48e48b1 (diff) | |
| download | lua-f438d00ef31e3aea54023602f529b68834ffb80a.tar.gz lua-f438d00ef31e3aea54023602f529b68834ffb80a.tar.bz2 lua-f438d00ef31e3aea54023602f529b68834ffb80a.zip | |
correct #args for calls with self (a:foo(...))
| -rw-r--r-- | lauxlib.c | 3 |
1 files changed, 2 insertions, 1 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lauxlib.c,v 1.63 2002/03/27 15:30:41 roberto Exp roberto $ | 2 | ** $Id: lauxlib.c,v 1.64 2002/04/02 20:42:49 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 | */ |
| @@ -46,6 +46,7 @@ LUALIB_API void luaL_argerror (lua_State *L, int narg, const char *extramsg) { | |||
| 46 | lua_Debug ar; | 46 | lua_Debug ar; |
| 47 | lua_getstack(L, 0, &ar); | 47 | lua_getstack(L, 0, &ar); |
| 48 | lua_getinfo(L, "n", &ar); | 48 | lua_getinfo(L, "n", &ar); |
| 49 | if (strcmp(ar.namewhat, "method") == 0) narg--; /* do not count `self' */ | ||
| 49 | if (ar.name == NULL) | 50 | if (ar.name == NULL) |
| 50 | ar.name = "?"; | 51 | ar.name = "?"; |
| 51 | luaL_verror(L, "bad argument #%d to `%.50s' (%.100s)", | 52 | luaL_verror(L, "bad argument #%d to `%.50s' (%.100s)", |
