** Check whether a given upvalue from a given closure exists and ** returns its index */
| 282 | ** returns its index |
| 283 | */ |
| 284 | static int checkupval (lua_State *L, int argf, int argnup) { |
| 285 | int nup = (int)luaL_checkinteger(L, argnup); /* upvalue index */ |
| 286 | luaL_checktype(L, argf, LUA_TFUNCTION); /* closure */ |
| 287 | luaL_argcheck(L, (lua_getupvalue(L, argf, nup) != NULL), argnup, |
| 288 | "invalid upvalue index"); |
| 289 | return nup; |
| 290 | } |
| 291 | |
| 292 | |
| 293 | static int db_upvalueid (lua_State *L) { |
no test coverage detected