aboutsummaryrefslogtreecommitdiff
path: root/src/lobject.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-02-04 09:01:25 +0100
committerBenoit Giannangeli <giann008@gmail.com>2017-02-04 22:17:24 +0100
commit18b89ee8e1059a21f8d5e3a52c2e256b7dea79cb (patch)
tree3f215ba709174b057ea76b2a8b0fbb2f6ad850e5 /src/lobject.js
parentb618b835c74a8637e00ba1f4adf6b8884d360d43 (diff)
downloadfengari-18b89ee8e1059a21f8d5e3a52c2e256b7dea79cb.tar.gz
fengari-18b89ee8e1059a21f8d5e3a52c2e256b7dea79cb.tar.bz2
fengari-18b89ee8e1059a21f8d5e3a52c2e256b7dea79cb.zip
CLOSURE, CALL
Diffstat (limited to 'src/lobject.js')
-rw-r--r--src/lobject.js23
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) {