pass L to LuaHelpers::TypeError
This commit is contained in:
@@ -85,7 +85,7 @@ public:
|
|||||||
if( bIsSelf )
|
if( bIsSelf )
|
||||||
luaL_typerror( L, narg, s_className );
|
luaL_typerror( L, narg, s_className );
|
||||||
else
|
else
|
||||||
LuaHelpers::TypeError( narg, s_className );
|
LuaHelpers::TypeError( L, narg, s_className );
|
||||||
}
|
}
|
||||||
|
|
||||||
return pUserdata->pT; // pointer to T object
|
return pUserdata->pT; // pointer to T object
|
||||||
|
|||||||
@@ -414,13 +414,13 @@ void LuaManager::Fail( const CString &err )
|
|||||||
|
|
||||||
/* Like luaL_typerror, but without the special case for argument 1 being "self"
|
/* 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. */
|
* 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_Debug debug;
|
||||||
lua_getstack( LUA->L, 0, &debug );
|
lua_getstack( L, 0, &debug );
|
||||||
lua_getinfo( LUA->L, "n", &debug );
|
lua_getinfo( L, "n", &debug );
|
||||||
return luaL_error( LUA->L, "bad argument #%d to \"%s\" (%s expected, got %s)",
|
return luaL_error( 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)) );
|
iArgNo, debug.name? debug.name:"(unknown)", szName, lua_typename(L, lua_type(L, iArgNo)) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ namespace LuaHelpers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int TypeError( int narg, const char *tname );
|
int TypeError( Lua *L, int narg, const char *tname );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user