diff options
author | Benoit Giannangeli <benoit.giannangeli@boursorama.fr> | 2017-02-08 11:15:56 +0100 |
---|---|---|
committer | Benoit Giannangeli <benoit.giannangeli@boursorama.fr> | 2017-02-08 11:15:56 +0100 |
commit | 7d63489f2615609e21befc9d21a0e9f8fe2bf61a (patch) | |
tree | 4513b89e976963986499a45ce0328923fc947a25 /src/lvm.js | |
parent | d28b76c80bf49c31a5513c3de1b0c7a4d0ca6322 (diff) | |
download | fengari-7d63489f2615609e21befc9d21a0e9f8fe2bf61a.tar.gz fengari-7d63489f2615609e21befc9d21a0e9f8fe2bf61a.tar.bz2 fengari-7d63489f2615609e21befc9d21a0e9f8fe2bf61a.zip |
OP_GETTABLE, OP_SETTABLE, metatable
Diffstat (limited to 'src/lvm.js')
-rw-r--r-- | src/lvm.js | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -102,9 +102,27 @@ class LuaVM { break; } case "OP_GETTABLE": { + let t = L.stack[this.RKB(base, i)]; + let k = L.stack[this.RKC(base, i)]; + + if (!t.ttistable() || !t.value.__index(t, k)) { + // __index + } else { + L.stack[ra] = t.value.__index(t, k); + } break; } case "OP_SETTABLE": { + let t = L.stack[ra]; + let k = L.stack[this.RKB(base, i)]; + let v = L.stack[this.RKC(base, i)]; + + if (!t.ttistable() || !t.value.__index(t, k)) { + // __index + } else { + t.value.__newindex(t, k, v); + } + break; } case "OP_NEWTABLE": { |