From d7f4cd696c9245870eabd5f57d3000a70aaad64b Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Fri, 19 May 2017 15:54:33 +0200 Subject: test dead_weak for undefined in luaH_next --- src/ltable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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'")); -- cgit v1.2.3-70-g09d2