From 048234f2ceaad1801473bf8a95219d08797b5e9d Mon Sep 17 00:00:00 2001 From: daurnimator Date: Sat, 6 May 2017 11:04:05 +1000 Subject: Initialise CClosure upvalues TValues in constructor --- src/lobject.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/lobject.js') 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); + } } } -- cgit v1.2.3-54-g00ecf