aboutsummaryrefslogtreecommitdiff
path: root/src/lfunc.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-05 14:40:14 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-05 14:40:14 +1000
commit4a265e29565718684ce30a7e90263da0ba71a0c1 (patch)
treeec9de879792db8fb9df8e56063a471ace592b89c /src/lfunc.js
parent7de17e1f67ec8da30d19450f6de05c8b5ad6e10e (diff)
downloadfengari-4a265e29565718684ce30a7e90263da0ba71a0c1.tar.gz
fengari-4a265e29565718684ce30a7e90263da0ba71a0c1.tar.bz2
fengari-4a265e29565718684ce30a7e90263da0ba71a0c1.zip
src/lfunc: Move refcount initialisation into constructor
Diffstat (limited to 'src/lfunc.js')
-rw-r--r--src/lfunc.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lfunc.js b/src/lfunc.js
index e038cc0..544b87c 100644
--- a/src/lfunc.js
+++ b/src/lfunc.js
@@ -29,6 +29,7 @@ class UpVal {
constructor(L) {
this.L = L; // Keep track of the thread it comes from
this.v = null; /* if null, upval is closed, value is in u.value */
+ this.refcount = 0;
this.u = {
open: { /* (when open) */
next: null, /* linked list */
@@ -74,7 +75,6 @@ const findupval = function(L, level) {
}
let uv = new UpVal(L);
- uv.refcount = 0;
uv.u.open.next = pp;
uv.u.open.touched = true;