From 48b5ebfac37a9d0e4c3622530121e28a50a38a38 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Wed, 3 May 2017 16:11:25 +1000 Subject: Move .id field from TValue to values themselves --- src/lobject.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/lobject.js') diff --git a/src/lobject.js b/src/lobject.js index d38e276..fe04f23 100644 --- a/src/lobject.js +++ b/src/lobject.js @@ -10,12 +10,10 @@ const llimit = require('./llimit.js'); const CT = defs.constant_types; const char = defs.char; -let tvalueCount = 0; class TValue { constructor(type, value) { - this.id = tvalueCount++; this.type = type; this.value = value; } @@ -166,6 +164,8 @@ module.exports.luaO_nilobject = luaO_nilobject; class LClosure { constructor(L, n) { + this.id = L.l_G.id_counter++; + this.p = null; this.nupvalues = n; this.upvals = Array(n); @@ -175,7 +175,9 @@ class LClosure { class CClosure { - constructor(f, n) { + constructor(L, f, n) { + this.id = L.l_G.id_counter++; + this.f = f; this.nupvalues = n; this.upvalue = new Array(n); -- cgit v1.2.3-54-g00ecf