summaryrefslogtreecommitdiff
path: root/src/lfunc.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-03-01 11:51:00 +0100
committerBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-03-01 11:51:00 +0100
commit444182dbbb18f44cf7cafc378f092c28006be365 (patch)
treea7d539ec3698c113c6cb68697bd3ec6f39b499e0 /src/lfunc.js
parentae8b95ee9c3871f506b20c74367fdc9e8cb098e2 (diff)
downloadfengari-444182dbbb18f44cf7cafc378f092c28006be365.tar.gz
fengari-444182dbbb18f44cf7cafc378f092c28006be365.tar.bz2
fengari-444182dbbb18f44cf7cafc378f092c28006be365.zip
Loading tests (binary/text)
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;
}
};