summaryrefslogtreecommitdiff
path: root/src/ltm.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-05 15:53:14 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-05 15:58:55 +1000
commit1dc893efcd664df86606b571d4b6bbee5b5868ca (patch)
treefaac1dcfacdad1de1cc8fa71123fc994c4bc2c94 /src/ltm.js
parent4c8de564f08e122e011c5f5ecaa96bea595603ed (diff)
downloadfengari-1dc893efcd664df86606b571d4b6bbee5b5868ca.tar.gz
fengari-1dc893efcd664df86606b571d4b6bbee5b5868ca.tar.bz2
fengari-1dc893efcd664df86606b571d4b6bbee5b5868ca.zip
Need to copy to the stack if not coming from a stack
Diffstat (limited to 'src/ltm.js')
-rw-r--r--src/ltm.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ltm.js b/src/ltm.js
index 76e7b0c..4bf37fe 100644
--- a/src/ltm.js
+++ b/src/ltm.js
@@ -83,9 +83,9 @@ const luaT_callTM = function(L, f, p1, p2, p3, hasres) {
let result = p3;
let func = L.top;
- L.stack[L.top] = f; /* push function (assume EXTRA_STACK) */
- L.stack[L.top + 1] = p1; /* 1st argument */
- L.stack[L.top + 2] = p2; /* 2nd argument */
+ 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 */
L.top += 3;
if (!hasres) /* no result? 'p3' is third argument */