summaryrefslogtreecommitdiff
path: root/src/lfunc.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/lfunc.js')
-rw-r--r--src/lfunc.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lfunc.js b/src/lfunc.js
index 37239b2..227606d 100644
--- a/src/lfunc.js
+++ b/src/lfunc.js
@@ -102,12 +102,16 @@ const luaF_close = function(L, level) {
}
};
+/*
+** fill a closure with new closed upvalues
+*/
const luaF_initupvals = function(L, cl) {
for (let i = 0; i < cl.nupvalues; i++) {
let uv = new UpVal(L);
uv.refcount = 1;
uv.u.value = null;
uv.v = uv.u.value;
+ cl.upvals[i] = uv;
}
};