summaryrefslogtreecommitdiff
path: root/src/ltm.js
diff options
context:
space:
mode:
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);
}
};