From 924ca09e8e9ec765301868d90dd3eba98058cafb Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Tue, 18 Apr 2017 15:10:54 +0200 Subject: Fixed _ENV upvalue which was the same for all closures --- src/lapi.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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; -- cgit v1.2.3-70-g09d2