diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-02-19 10:52:42 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-02-19 10:52:42 -0300 |
commit | c86b9da02276652a22426b2a5a194ba1f070fcf4 (patch) | |
tree | a910fbba8cdae6ad2344205b6547e154b6a12dff /ldblib.c | |
parent | a4c6dcf999ddea865e295ea34926a838a1f97b61 (diff) | |
download | lua-c86b9da02276652a22426b2a5a194ba1f070fcf4.tar.gz lua-c86b9da02276652a22426b2a5a194ba1f070fcf4.tar.bz2 lua-c86b9da02276652a22426b2a5a194ba1f070fcf4.zip |
userdata can have any Lua value as uservalue
Diffstat (limited to 'ldblib.c')
-rw-r--r-- | ldblib.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldblib.c,v 1.134 2013/07/10 20:57:05 roberto Exp roberto $ | 2 | ** $Id: ldblib.c,v 1.135 2013/07/22 16:05:53 roberto Exp roberto $ |
3 | ** Interface from Lua to its debug API | 3 | ** Interface from Lua to its debug API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -69,11 +69,8 @@ static int db_getuservalue (lua_State *L) { | |||
69 | 69 | ||
70 | 70 | ||
71 | static int db_setuservalue (lua_State *L) { | 71 | static int db_setuservalue (lua_State *L) { |
72 | if (lua_type(L, 1) == LUA_TLIGHTUSERDATA) | ||
73 | luaL_argerror(L, 1, "full userdata expected, got light userdata"); | ||
74 | luaL_checktype(L, 1, LUA_TUSERDATA); | 72 | luaL_checktype(L, 1, LUA_TUSERDATA); |
75 | if (!lua_isnoneornil(L, 2)) | 73 | luaL_checkany(L, 2); |
76 | luaL_checktype(L, 2, LUA_TTABLE); | ||
77 | lua_settop(L, 2); | 74 | lua_settop(L, 2); |
78 | lua_setuservalue(L, 1); | 75 | lua_setuservalue(L, 1); |
79 | return 1; | 76 | return 1; |