summaryrefslogtreecommitdiff
path: root/src/lapi.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/lapi.js')
-rw-r--r--src/lapi.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lapi.js b/src/lapi.js
index 97cb061..89297cc 100644
--- a/src/lapi.js
+++ b/src/lapi.js
@@ -280,7 +280,8 @@ const lua_pushcclosure = function(L, fn, n) {
L.top -= n;
while (n--) {
- cl.upvalue[n] = L.stack[L.top + n];
+ cl.upvalue[n].setfrom(L.stack[L.top + n])
+ L.stack[L.top + n] = void 0;
}
L.stack[L.top] = new TValue(CT.LUA_TCCL, cl);