From b3f5b92b221c0ad8a94b8cb95081bb85d235c39f Mon Sep 17 00:00:00 2001 From: daurnimator Date: Mon, 29 May 2017 13:28:24 +1000 Subject: Have lua closures point to directly to their upvalues on stack --- src/lapi.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lapi.js') 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; -- cgit v1.2.3-54-g00ecf