aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-04-18 15:10:54 +0200
committerBenoit Giannangeli <giann008@gmail.com>2017-04-18 15:10:54 +0200
commit924ca09e8e9ec765301868d90dd3eba98058cafb (patch)
tree3158501b9e057f3c01b6bbe1e5ed3b470f6f4488
parent75c14fadc22366a6165f593fb1a41e2a32de4354 (diff)
downloadfengari-924ca09e8e9ec765301868d90dd3eba98058cafb.tar.gz
fengari-924ca09e8e9ec765301868d90dd3eba98058cafb.tar.bz2
fengari-924ca09e8e9ec765301868d90dd3eba98058cafb.zip
Fixed _ENV upvalue which was the same for all closures
-rw-r--r--src/lapi.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lapi.js b/src/lapi.js
index c4e1029..35f8d21 100644
--- a/src/lapi.js
+++ b/src/lapi.js
@@ -808,7 +808,7 @@ const lua_load = function(L, reader, data, chunckname, mode) {
let reg = L.l_G.l_registry;
let gt = reg.value.get(lua.LUA_RIDX_GLOBALS);
/* set global table as 1st upvalue of 'f' (may be LUA_ENV) */
- f.upvals[0].u.value = gt;
+ f.upvals[0].u.value = new TValue(gt.type, gt.value);
}
}
return status;