aboutsummaryrefslogtreecommitdiff
path: root/src/ltm.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/ltm.js
parentb3c87776e08f546a9994527f7c2c7fc4ec07d9a1 (diff)
downloadfengari-888c1286cfe25c1b21605c3443cc0a20b522972b.tar.gz
fengari-888c1286cfe25c1b21605c3443cc0a20b522972b.tar.bz2
fengari-888c1286cfe25c1b21605c3443cc0a20b522972b.zip
Introduce setobj2s
Diffstat (limited to 'src/ltm.js')
-rw-r--r--src/ltm.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ltm.js b/src/ltm.js
index 041dd19..c3efc1e 100644
--- a/src/ltm.js
+++ b/src/ltm.js
@@ -110,13 +110,13 @@ const luaT_objtypename = function(L, o) {
const luaT_callTM = function(L, f, p1, p2, p3, hasres) {
let func = L.top;
- L.stack[L.top] = new lobject.TValue(f.type, f.value); /* push function (assume EXTRA_STACK) */
- L.stack[L.top + 1] = new lobject.TValue(p1.type, p1.value); /* 1st argument */
- L.stack[L.top + 2] = new lobject.TValue(p2.type, p2.value); /* 2nd argument */
+ lobject.setobj2s(L, L.top, f); /* push function (assume EXTRA_STACK) */
+ lobject.setobj2s(L, L.top + 1, p1); /* 1st argument */
+ lobject.setobj2s(L, L.top + 2, p2); /* 2nd argument */
L.top += 3;
if (!hasres) /* no result? 'p3' is third argument */
- L.stack[L.top++] = new lobject.TValue(p3.type, p3.value); /* 3rd argument */
+ lobject.setobj2s(L, L.top++, p3); /* 3rd argument */
if (L.ci.callstatus & lstate.CIST_LUA)
ldo.luaD_call(L, func, hasres);