summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-15 08:12:58 +0100
committerBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-15 08:16:12 +0100
commit533523c45540ab5ffe233bed58824ca8f30890ce (patch)
tree8eea589941ee222ea438aba0b7cdd13669a7749e /src
parent7e5ee49b3844eaa1623152878823eea2f54bb248 (diff)
downloadfengari-533523c45540ab5ffe233bed58824ca8f30890ce.tar.gz
fengari-533523c45540ab5ffe233bed58824ca8f30890ce.tar.bz2
fengari-533523c45540ab5ffe233bed58824ca8f30890ce.zip
__len
Diffstat (limited to 'src')
-rw-r--r--src/lvm.js4
1 files changed, 2 insertions, 2 deletions
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;
}