From b3c87776e08f546a9994527f7c2c7fc4ec07d9a1 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Tue, 23 May 2017 17:09:03 +1000 Subject: Introduce setobjs2s --- src/ltm.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/ltm.js') 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); } }; -- cgit v1.2.3-54-g00ecf