summaryrefslogtreecommitdiff
path: root/src/lobject.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-06 11:04:05 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-09 13:28:31 +1000
commit048234f2ceaad1801473bf8a95219d08797b5e9d (patch)
tree8947f6e2d5cbc010287c2ff59400804298fd9681 /src/lobject.js
parent9136aea9f85db964dc368051326a2678d962b8f8 (diff)
downloadfengari-048234f2ceaad1801473bf8a95219d08797b5e9d.tar.gz
fengari-048234f2ceaad1801473bf8a95219d08797b5e9d.tar.bz2
fengari-048234f2ceaad1801473bf8a95219d08797b5e9d.zip
Initialise CClosure upvalues TValues in constructor
Diffstat (limited to 'src/lobject.js')
-rw-r--r--src/lobject.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lobject.js b/src/lobject.js
index ab50af8..e4ef380 100644
--- a/src/lobject.js
+++ b/src/lobject.js
@@ -197,6 +197,9 @@ class CClosure {
this.f = f;
this.nupvalues = n;
this.upvalue = new Array(n); /* list of upvalues as TValues */
+ while (n--) {
+ this.upvalue[n] = new TValue(CT.LUA_TNIL, null);
+ }
}
}