** Check whether a given upvalue from a given closure exists and ** returns its index */
| 273 | ** returns its index |
| 274 | */ |
| 275 | static int checkupval (lua_State *L, int argf, int argnup) { |
| 276 | int nup = (int)luaL_checkinteger(L, argnup); /* upvalue index */ |
| 277 | luaL_checktype(L, argf, LUA_TFUNCTION); /* closure */ |
| 278 | luaL_argcheck(L, (lua_getupvalue(L, argf, nup) != NULL), argnup, |
| 279 | "invalid upvalue index"); |
| 280 | return nup; |
| 281 | } |
| 282 | |
| 283 | |
| 284 | static int db_upvalueid (lua_State *L) { |
no test coverage detected