summaryrefslogtreecommitdiff
path: root/src/lvm.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/lvm.js')
-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;
}