From 533523c45540ab5ffe233bed58824ca8f30890ce Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Wed, 15 Feb 2017 08:12:58 +0100 Subject: __len --- src/lvm.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lvm.js b/src/lvm.js index 815ca2f..07a9f96 100644 --- a/src/lvm.js +++ b/src/lvm.js @@ -854,8 +854,8 @@ const luaV_objlen = function(L, ra, rb) { let tm; switch(rb.ttype()) { case CT.LUA_TTABLE: { - tm = rb.value.metatable; - if (tm) break; + tm = ltm.luaT_gettmbyobj(L, rb, TMS.TM_LEN); + if (!tm.ttisnil()) break; L.stack[ra] = rb.luaH_getn(); return; } -- cgit v1.2.3-70-g09d2