diff options
Diffstat (limited to 'src/ldblib.c')
| -rw-r--r-- | src/ldblib.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/ldblib.c b/src/ldblib.c index 30499a62..8a724a1e 100644 --- a/src/ldblib.c +++ b/src/ldblib.c @@ -1,5 +1,5 @@ /* -** $Id: ldblib.c,v 1.133 2013/06/25 19:37:00 roberto Exp $ +** $Id: ldblib.c,v 1.137 2014/03/12 20:57:40 roberto Exp $ ** 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; @@ -273,8 +270,7 @@ static void hookf (lua_State *L, lua_Debug *ar) { {"call", "return", "line", "count", "tail call"}; gethooktable(L); lua_pushthread(L); - lua_rawget(L, -2); - if (lua_isfunction(L, -1)) { + if (lua_rawget(L, -2) == LUA_TFUNCTION) { lua_pushstring(L, hooknames[(int)ar->event]); if (ar->currentline >= 0) lua_pushinteger(L, ar->currentline); |
