From a9fe1ab76cb527d8bdafa3071f796b646aada17e Mon Sep 17 00:00:00 2001 From: daurnimator Date: Thu, 11 May 2017 17:14:31 +1000 Subject: src/ltable.js: luaH_delete can't fully delete immediately as it might need dead keys for next() --- src/ltable.js | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'src/ltable.js') diff --git a/src/ltable.js b/src/ltable.js index b1f48e8..79c8215 100644 --- a/src/ltable.js +++ b/src/ltable.js @@ -34,10 +34,17 @@ class Table { constructor(L) { this.id = L.l_G.id_counter++; this.strong = new Map(); + this.dead_hashes = []; this.metatable = null; } } +const clean_dead_keys = function(t) { + for (let i=0; i Date: Thu, 11 May 2017 11:18:26 +0200 Subject: Don't use luaO_nilobject when deleting table entry --- src/ltable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ltable.js') diff --git a/src/ltable.js b/src/ltable.js index 79c8215..52b5aee 100644 --- a/src/ltable.js +++ b/src/ltable.js @@ -116,7 +116,7 @@ const delete_hash = function(t, hash) { let e = t.strong.get(hash); if (e) { e.key.setdeadvalue(); - e.value = lobject.luaO_nilobject; + e.value = new lobject.TValue(CT.LUA_TNIL, null); t.dead_hashes.push(hash); } }; -- cgit v1.2.3-54-g00ecf