diff options
author | daurnimator <quae@daurnimator.com> | 2017-05-23 17:09:03 +1000 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2017-05-27 22:14:29 +1000 |
commit | b3c87776e08f546a9994527f7c2c7fc4ec07d9a1 (patch) | |
tree | d12ee5c396408d8a0d8e5e2d2cb74f46eb1b1e19 /src/ltm.js | |
parent | 51ea4bdd2d2ac1166911b54ba5a1aa6aa8a573dd (diff) | |
download | fengari-b3c87776e08f546a9994527f7c2c7fc4ec07d9a1.tar.gz fengari-b3c87776e08f546a9994527f7c2c7fc4ec07d9a1.tar.bz2 fengari-b3c87776e08f546a9994527f7c2c7fc4ec07d9a1.zip |
Introduce setobjs2s
Diffstat (limited to 'src/ltm.js')
-rw-r--r-- | src/ltm.js | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -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); } }; |