| 10512 | |
| 10513 | |
| 10514 | LUALIB_API void luaL_setn (lua_State *L, int t, int n) { |
| 10515 | t = abs_index(L, t); |
| 10516 | lua_pushliteral(L, "n"); |
| 10517 | lua_rawget(L, t); |
| 10518 | if (checkint(L, 1) >= 0) { /* is there a numeric field `n'? */ |
| 10519 | lua_pushliteral(L, "n"); /* use it */ |
| 10520 | lua_pushinteger(L, n); |
| 10521 | lua_rawset(L, t); |
| 10522 | } |
| 10523 | else { /* use `sizes' */ |
| 10524 | getsizes(L); |
| 10525 | lua_pushvalue(L, t); |
| 10526 | lua_pushinteger(L, n); |
| 10527 | lua_rawset(L, -3); /* sizes[t] = n */ |
| 10528 | lua_pop(L, 1); /* remove `sizes' */ |
| 10529 | } |
| 10530 | } |
| 10531 | |
| 10532 | |
| 10533 | LUALIB_API int luaL_getn (lua_State *L, int t) { |
no test coverage detected