diff options
author | daurnimator <quae@daurnimator.com> | 2017-05-23 17:37:20 +1000 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2017-05-27 22:14:35 +1000 |
commit | 888c1286cfe25c1b21605c3443cc0a20b522972b (patch) | |
tree | 803c8a31cccbb5013539fd0a575cc10f6af5a7fb /src/lvm.js | |
parent | b3c87776e08f546a9994527f7c2c7fc4ec07d9a1 (diff) | |
download | fengari-888c1286cfe25c1b21605c3443cc0a20b522972b.tar.gz fengari-888c1286cfe25c1b21605c3443cc0a20b522972b.tar.bz2 fengari-888c1286cfe25c1b21605c3443cc0a20b522972b.zip |
Introduce setobj2s
Diffstat (limited to 'src/lvm.js')
-rw-r--r-- | src/lvm.js | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -126,13 +126,13 @@ const luaV_execute = function(L) { } case OCi.OP_LOADK: { let konst = k[i.Bx]; - L.stack[ra] = new lobject.TValue(konst.type, konst.value); + lobject.setobj2s(L, ra, konst); break; } case OCi.OP_LOADKX: { assert(ci.l_code[ci.l_savedpc].opcode === OCi.OP_EXTRAARG); let konst = k[ci.l_code[ci.l_savedpc++].Ax]; - L.stack[ra] = new lobject.TValue(konst.type, konst.value); + lobject.setobj2s(L, ra, konst); break; } case OCi.OP_LOADBOOL: { @@ -150,7 +150,7 @@ const luaV_execute = function(L) { } case OCi.OP_GETUPVAL: { let o = cl.upvals[i.B].val(); - L.stack[ra] = new lobject.TValue(o.type, o.value); + lobject.setobj2s(L, ra, o); break; } case OCi.OP_SETUPVAL: { @@ -1033,7 +1033,7 @@ const gettable = function(L, t, key, ra) { } else { let slot = ltable.luaH_get(L, t.value, key); if (!slot.ttisnil()) { - L.stack[ra] = new lobject.TValue(slot.type, slot.value); + lobject.setobj2s(L, ra, slot); return; } else { /* 't' is a table */ tm = ltm.fasttm(L, t.value.metatable, ltm.TMS.TM_INDEX); /* table's metamethod */ |