pass L to LuaHelpers::TypeError

This commit is contained in:
Glenn Maynard
2005-06-15 08:33:26 +00:00
parent cd30a6b852
commit 6bfb3f0bad
3 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -85,7 +85,7 @@ public:
if( bIsSelf )
luaL_typerror( L, narg, s_className );
else
LuaHelpers::TypeError( narg, s_className );
LuaHelpers::TypeError( L, narg, s_className );
}
return pUserdata->pT; // pointer to T object
+5 -5
View File
@@ -414,13 +414,13 @@ void LuaManager::Fail( const CString &err )
/* Like luaL_typerror, but without the special case for argument 1 being "self"
* in method calls, so we give a correct error message after we remove self. */
int LuaHelpers::TypeError( int iArgNo, const char *szName )
int LuaHelpers::TypeError( Lua *L, int iArgNo, const char *szName )
{
lua_Debug debug;
lua_getstack( LUA->L, 0, &debug );
lua_getinfo( LUA->L, "n", &debug );
return luaL_error( LUA->L, "bad argument #%d to \"%s\" (%s expected, got %s)",
iArgNo, debug.name? debug.name:"(unknown)", szName, lua_typename(LUA->L, lua_type(LUA->L, iArgNo)) );
lua_getstack( L, 0, &debug );
lua_getinfo( L, "n", &debug );
return luaL_error( L, "bad argument #%d to \"%s\" (%s expected, got %s)",
iArgNo, debug.name? debug.name:"(unknown)", szName, lua_typename(L, lua_type(L, iArgNo)) );
}
+1 -1
View File
@@ -149,7 +149,7 @@ namespace LuaHelpers
}
}
int TypeError( int narg, const char *tname );
int TypeError( Lua *L, int narg, const char *tname );
}