| 344 | |
| 345 | |
| 346 | LUALIB_API int luaL_getn (lua_State *L, int t) { |
| 347 | int n; |
| 348 | t = abs_index(L, t); |
| 349 | lua_pushliteral(L, "n"); /* try t.n */ |
| 350 | lua_rawget(L, t); |
| 351 | if ((n = checkint(L, 1)) >= 0) return n; |
| 352 | getsizes(L); /* else try sizes[t] */ |
| 353 | lua_pushvalue(L, t); |
| 354 | lua_rawget(L, -2); |
| 355 | if ((n = checkint(L, 2)) >= 0) return n; |
| 356 | return (int)lua_objlen(L, t); |
| 357 | } |
| 358 | |
| 359 | #endif |
| 360 |
no test coverage detected