From c86b9da02276652a22426b2a5a194ba1f070fcf4 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 19 Feb 2014 10:52:42 -0300 Subject: userdata can have any Lua value as uservalue --- ldblib.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'ldblib.c') diff --git a/ldblib.c b/ldblib.c index 2b48113d..10328f3a 100644 --- a/ldblib.c +++ b/ldblib.c @@ -1,5 +1,5 @@ /* -** $Id: ldblib.c,v 1.134 2013/07/10 20:57:05 roberto Exp roberto $ +** $Id: ldblib.c,v 1.135 2013/07/22 16:05:53 roberto Exp roberto $ ** Interface from Lua to its debug API ** See Copyright Notice in lua.h */ @@ -69,11 +69,8 @@ static int db_getuservalue (lua_State *L) { static int db_setuservalue (lua_State *L) { - if (lua_type(L, 1) == LUA_TLIGHTUSERDATA) - luaL_argerror(L, 1, "full userdata expected, got light userdata"); luaL_checktype(L, 1, LUA_TUSERDATA); - if (!lua_isnoneornil(L, 2)) - luaL_checktype(L, 2, LUA_TTABLE); + luaL_checkany(L, 2); lua_settop(L, 2); lua_setuservalue(L, 1); return 1; -- cgit v1.2.3-55-g6feb