summaryrefslogtreecommitdiff
path: root/src/lapi.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-29 13:28:24 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-29 13:43:11 +1000
commitb3f5b92b221c0ad8a94b8cb95081bb85d235c39f (patch)
treeddfacca952778520fe74976a88bd97b3cdb68785 /src/lapi.js
parent587b5c78d193426410c45c6f055272acf4a8bc7c (diff)
downloadfengari-b3f5b92b221c0ad8a94b8cb95081bb85d235c39f.tar.gz
fengari-b3f5b92b221c0ad8a94b8cb95081bb85d235c39f.tar.bz2
fengari-b3f5b92b221c0ad8a94b8cb95081bb85d235c39f.zip
Have lua closures point to directly to their upvalues on stack
Diffstat (limited to 'src/lapi.js')
-rw-r--r--src/lapi.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lapi.js b/src/lapi.js
index f24c4af..529a009 100644
--- a/src/lapi.js
+++ b/src/lapi.js
@@ -538,7 +538,7 @@ const aux_upvalue = function(L, fi, n) {
let name = p.upvalues[n-1].name;
return {
name: name ? name.getstr() : defs.to_luastring("(*no name)", true),
- val: f.upvals[n-1].val()
+ val: f.upvals[n-1].v
};
}
default: return null; /* not a closure */
@@ -926,7 +926,7 @@ const lua_load = function(L, reader, data, chunkname, mode) {
/* get global table from registry */
let gt = ltable.luaH_getint(L.l_G.l_registry.value, defs.LUA_RIDX_GLOBALS);
/* set global table as 1st upvalue of 'f' (may be LUA_ENV) */
- f.upvals[0].value.setfrom(gt);
+ f.upvals[0].v.setfrom(gt);
}
}
return status;