diff options
Diffstat (limited to 'src/lobject.js')
-rw-r--r-- | src/lobject.js | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/lobject.js b/src/lobject.js index 876a16f..4cc8c4e 100644 --- a/src/lobject.js +++ b/src/lobject.js @@ -3,15 +3,6 @@ const CT = require('./lua.js').constant_types; -class LClosure { - - constructor(n) { - this.p = null; - this.nupvalues = n; - } - -} - class TValue { @@ -24,6 +15,20 @@ class TValue { } +class LClosure extends TValue { + + constructor(n) { + super(CT.LUA_TLCL, null); + + this.p = null; + this.nupvalues = n; + this.upvals = []; + + this.value = this; + } + +} + class TString extends TValue { constructor(string) { |