| 325 | |
| 326 | |
| 327 | LUALIB_API void luaL_setn (lua_State *L, int t, int n) { |
| 328 | t = abs_index(L, t); |
| 329 | lua_pushliteral(L, "n"); |
| 330 | lua_rawget(L, t); |
| 331 | if (checkint(L, 1) >= 0) { /* is there a numeric field `n'? */ |
| 332 | lua_pushliteral(L, "n"); /* use it */ |
| 333 | lua_pushinteger(L, n); |
| 334 | lua_rawset(L, t); |
| 335 | } |
| 336 | else { /* use `sizes' */ |
| 337 | getsizes(L); |
| 338 | lua_pushvalue(L, t); |
| 339 | lua_pushinteger(L, n); |
| 340 | lua_rawset(L, -3); /* sizes[t] = n */ |
| 341 | lua_pop(L, 1); /* remove `sizes' */ |
| 342 | } |
| 343 | } |
| 344 | |
| 345 | |
| 346 | LUALIB_API int luaL_getn (lua_State *L, int t) { |
no test coverage detected