| 319 | |
| 320 | |
| 321 | LUALIB_API int luaL_getn (lua_State *L, int t) { |
| 322 | int n; |
| 323 | t = abs_index(L, t); |
| 324 | lua_pushliteral(L, "n"); /* try t.n */ |
| 325 | lua_rawget(L, t); |
| 326 | if ((n = checkint(L, 1)) >= 0) return n; |
| 327 | getsizes(L); /* else try sizes[t] */ |
| 328 | lua_pushvalue(L, t); |
| 329 | lua_rawget(L, -2); |
| 330 | if ((n = checkint(L, 2)) >= 0) return n; |
| 331 | return (int)lua_objlen(L, t); |
| 332 | } |
| 333 | |
| 334 | #endif |
| 335 |
no test coverage detected