aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-05-19 15:54:33 +0200
committerBenoit Giannangeli <giann008@gmail.com>2017-05-19 15:54:33 +0200
commitd7f4cd696c9245870eabd5f57d3000a70aaad64b (patch)
treeda25e9bb7350d85b695518a622568ff1967d981a
parent6e2e6f1607857810ccfdb20a160284b920f716c9 (diff)
downloadfengari-d7f4cd696c9245870eabd5f57d3000a70aaad64b.tar.gz
fengari-d7f4cd696c9245870eabd5f57d3000a70aaad64b.tar.bz2
fengari-d7f4cd696c9245870eabd5f57d3000a70aaad64b.zip
test dead_weak for undefined in luaH_next
-rw-r--r--src/ltable.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ltable.js b/src/ltable.js
index a06e5d8..e4d21e2 100644
--- a/src/ltable.js
+++ b/src/ltable.js
@@ -187,7 +187,7 @@ const luaH_next = function(L, table, keyI) {
return false;
} else {
/* Try dead keys */
- entry = table.dead_weak.get(hash) || table.dead_strong.get(hash);
+ entry = (table.dead_weak && table.dead_weak.get(hash)) || table.dead_strong.get(hash);
if (!entry)
/* item not in table */
return ldebug.luaG_runerror(L, defs.to_luastring("invalid key to 'next'"));