| 631 | |
| 632 | |
| 633 | LUA_API int lua_gettable (lua_State *L, int idx) { |
| 634 | const TValue *slot; |
| 635 | TValue *t; |
| 636 | lua_lock(L); |
| 637 | t = index2value(L, idx); |
| 638 | if (luaV_fastget(L, t, s2v(L->top - 1), slot, luaH_get)) { |
| 639 | setobj2s(L, L->top - 1, slot); |
| 640 | } |
| 641 | else |
| 642 | luaV_finishget(L, t, s2v(L->top - 1), L->top - 1, slot); |
| 643 | lua_unlock(L); |
| 644 | return ttype(s2v(L->top - 1)); |
| 645 | } |
| 646 | |
| 647 | |
| 648 | LUA_API int lua_getfield (lua_State *L, int idx, const char *k) { |
no test coverage detected