aboutsummaryrefslogtreecommitdiff
path: root/src/ltm.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-23 17:09:03 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-27 22:14:29 +1000
commitb3c87776e08f546a9994527f7c2c7fc4ec07d9a1 (patch)
treed12ee5c396408d8a0d8e5e2d2cb74f46eb1b1e19 /src/ltm.js
parent51ea4bdd2d2ac1166911b54ba5a1aa6aa8a573dd (diff)
downloadfengari-b3c87776e08f546a9994527f7c2c7fc4ec07d9a1.tar.gz
fengari-b3c87776e08f546a9994527f7c2c7fc4ec07d9a1.tar.bz2
fengari-b3c87776e08f546a9994527f7c2c7fc4ec07d9a1.zip
Introduce setobjs2s
Diffstat (limited to 'src/ltm.js')
-rw-r--r--src/ltm.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/ltm.js b/src/ltm.js
index ad09c26..041dd19 100644
--- a/src/ltm.js
+++ b/src/ltm.js
@@ -108,7 +108,6 @@ const luaT_objtypename = function(L, o) {
};
const luaT_callTM = function(L, f, p1, p2, p3, hasres) {
- let result = p3;
let func = L.top;
L.stack[L.top] = new lobject.TValue(f.type, f.value); /* push function (assume EXTRA_STACK) */
@@ -124,9 +123,8 @@ const luaT_callTM = function(L, f, p1, p2, p3, hasres) {
else
ldo.luaD_callnoyield(L, func, hasres);
- if (hasres) {
- assert(typeof result === "number");
- L.stack[result] = L.stack[--L.top];
+ if (hasres) { /* if has result, move it to its place */
+ lobject.setobjs2s(L, p3, --L.top);
}
};