eris: refactoring table API so that table methods can see value being inserted
This commit is contained in:
@@ -804,7 +804,7 @@ LUA_API void lua_rawset (lua_State *L, int idx) {
|
||||
api_checknelems(L, 2);
|
||||
t = index2addr(L, idx);
|
||||
api_check(L, ttistable(t), "table expected");
|
||||
setobj2t(L, luaH_set(L, hvalue(t), L->top-2), L->top-1);
|
||||
luaH_setvalue(L, hvalue(t), L->top-2, L->top-1);
|
||||
invalidateTMcache(hvalue(t));
|
||||
luaC_barrierback(L, gcvalue(t), L->top-1);
|
||||
L->top -= 2;
|
||||
@@ -833,7 +833,7 @@ LUA_API void lua_rawsetp (lua_State *L, int idx, const void *p) {
|
||||
t = index2addr(L, idx);
|
||||
api_check(L, ttistable(t), "table expected");
|
||||
setpvalue(&k, cast(void *, p));
|
||||
setobj2t(L, luaH_set(L, hvalue(t), &k), L->top - 1);
|
||||
luaH_setvalue(L, hvalue(t), &k, L->top-1);
|
||||
luaC_barrierback(L, gcvalue(t), L->top - 1);
|
||||
L->top--;
|
||||
lua_unlock(L);
|
||||
|
||||
Reference in New Issue
Block a user