From 4650ac9ab96eadcd5918c56c6eb93618ac054bba Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Sat, 11 Feb 2017 15:38:14 +0100 Subject: SELF --- src/lvm.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') diff --git a/src/lvm.js b/src/lvm.js index 7b70c01..7ca6921 100644 --- a/src/lvm.js +++ b/src/lvm.js @@ -149,6 +149,17 @@ class LuaVM { break; } case "OP_SELF": { + let table = L.stack[this.RB(base, i)]; + let key = this.RKC(base, k, i); + + L.stack[ra + 1] = table; + + // if (!table.ttistable() || !table.metatable.__index(table, key)) { + // // __index + // } else { + L.stack[ra] = table.metatable.__index(table, key); + // } + break; } case "OP_ADD": { -- cgit v1.2.3-70-g09d2