| 300 | |
| 301 | |
| 302 | LUALIB_API void luaL_setn (lua_State *L, int t, int n) { |
| 303 | t = abs_index(L, t); |
| 304 | lua_pushliteral(L, "n"); |
| 305 | lua_rawget(L, t); |
| 306 | if (checkint(L, 1) >= 0) { /* is there a numeric field `n'? */ |
| 307 | lua_pushliteral(L, "n"); /* use it */ |
| 308 | lua_pushinteger(L, n); |
| 309 | lua_rawset(L, t); |
| 310 | } |
| 311 | else { /* use `sizes' */ |
| 312 | getsizes(L); |
| 313 | lua_pushvalue(L, t); |
| 314 | lua_pushinteger(L, n); |
| 315 | lua_rawset(L, -3); /* sizes[t] = n */ |
| 316 | lua_pop(L, 1); /* remove `sizes' */ |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | |
| 321 | LUALIB_API int luaL_getn (lua_State *L, int t) { |
no test coverage detected