summaryrefslogtreecommitdiff
path: root/src/lvm.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-23 17:37:20 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-27 22:14:35 +1000
commit888c1286cfe25c1b21605c3443cc0a20b522972b (patch)
tree803c8a31cccbb5013539fd0a575cc10f6af5a7fb /src/lvm.js
parentb3c87776e08f546a9994527f7c2c7fc4ec07d9a1 (diff)
downloadfengari-888c1286cfe25c1b21605c3443cc0a20b522972b.tar.gz
fengari-888c1286cfe25c1b21605c3443cc0a20b522972b.tar.bz2
fengari-888c1286cfe25c1b21605c3443cc0a20b522972b.zip
Introduce setobj2s
Diffstat (limited to 'src/lvm.js')
-rw-r--r--src/lvm.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lvm.js b/src/lvm.js
index 602fe5c..c7bb7ad 100644
--- a/src/lvm.js
+++ b/src/lvm.js
@@ -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 */