| 367 | |
| 368 | |
| 369 | LUALIB_API int luaL_getn (lua_State *L, int t) { |
| 370 | int n; |
| 371 | t = abs_index(L, t); |
| 372 | lua_pushliteral(L, "n"); /* try t.n */ |
| 373 | lua_rawget(L, t); |
| 374 | if ((n = checkint(L, 1)) >= 0) return n; |
| 375 | getsizes(L); /* else try sizes[t] */ |
| 376 | lua_pushvalue(L, t); |
| 377 | lua_rawget(L, -2); |
| 378 | if ((n = checkint(L, 2)) >= 0) return n; |
| 379 | return (int)lua_objlen(L, t); |
| 380 | } |
| 381 | |
| 382 | #endif |
| 383 |
no test coverage detected