aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ltable.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ltable.js b/src/ltable.js
index 1b55256..b1f48e8 100644
--- a/src/ltable.js
+++ b/src/ltable.js
@@ -80,6 +80,10 @@ const setgeneric = function(t, hash, key) {
const luaH_setint = function(t, key, value) {
assert(typeof key == "number" && (key|0) === key && value instanceof lobject.TValue);
let hash = key; /* table_hash known result */
+ if (value.ttisnil()) {
+ t.strong.delete(hash);
+ return;
+ }
let v = t.strong.get(hash);
if (v) {
let tv = v.value;