summaryrefslogtreecommitdiff
path: root/src/lapi.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-05 17:08:04 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-05 17:18:21 +1000
commit0e5585bd7078d6727382c0de51161fe377c1d81d (patch)
tree05b77887eb62922ac40645a6126e3001c0f6b9f8 /src/lapi.js
parentb54eee30383e4eaae74551afc9d1c59126269305 (diff)
downloadfengari-0e5585bd7078d6727382c0de51161fe377c1d81d.tar.gz
fengari-0e5585bd7078d6727382c0de51161fe377c1d81d.tar.bz2
fengari-0e5585bd7078d6727382c0de51161fe377c1d81d.zip
Simplify UpVal structure
No longer follows C api as closely (it is the way it is because C has unions) Instead, have a flat object. Also remove the 'setval' method, as it wasn't used from all call-sites and couldn't be extended to them (setval's body only worked with source TValue on a stack)
Diffstat (limited to 'src/lapi.js')
-rw-r--r--src/lapi.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/lapi.js b/src/lapi.js
index d3e4119..9347d84 100644
--- a/src/lapi.js
+++ b/src/lapi.js
@@ -822,7 +822,7 @@ const lua_load = function(L, reader, data, chunckname, 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].u.value = new TValue(gt.type, gt.value);
+ f.upvals[0].value.setfrom(gt);
}
}
return status;
@@ -1001,7 +1001,6 @@ const lua_upvaluejoin = function(L, fidx1, n1, fidx2, n2) {
let f1 = ref1.closure;
f1.upvals[up1] = up2;
- up2.u.open.touched = true; // TODO: useful
};
// This functions are only there for compatibility purposes