summaryrefslogtreecommitdiff
path: root/src/lobject.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-15 09:22:11 +0100
committerBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-15 17:07:58 +0100
commitc428f1241ebd5194a37c37d9d5376b326b78ee37 (patch)
tree6e0357f728f525da8e27d73bcbc94ec8ce05c645 /src/lobject.js
parentf94e2902d6e2e45840c5a63d46c57ddd888b84b8 (diff)
downloadfengari-c428f1241ebd5194a37c37d9d5376b326b78ee37.tar.gz
fengari-c428f1241ebd5194a37c37d9d5376b326b78ee37.tar.bz2
fengari-c428f1241ebd5194a37c37d9d5376b326b78ee37.zip
Implementing minimal path from main to luaV_execute of user script
Diffstat (limited to 'src/lobject.js')
-rw-r--r--src/lobject.js24
1 files changed, 9 insertions, 15 deletions
diff --git a/src/lobject.js b/src/lobject.js
index 725f63d..5860f67 100644
--- a/src/lobject.js
+++ b/src/lobject.js
@@ -189,28 +189,22 @@ class LClosure extends TValue {
}
-class TString extends TValue {
-
- constructor(string) {
- super(CT.LUA_TSTRING, string);
- }
-
-}
+class CClosure extends TValue {
+ constructor(n, f) {
+ super(CT.LUA_TCCL, null);
-class Userdata extends TValue {
-
- constructor(jsObject) {
- super(CT.LUA_TUSERDATA, jsObject);
+ this.f = f;
+ this.nupvalues = n;
+ this.upvalue = new Array(n);
- this.metatable = null;
+ this.value = this;
}
}
module.exports.LClosure = LClosure;
+module.exports.CClosure = CClosure;
module.exports.TValue = TValue;
-module.exports.Table = Table;
-module.exports.TString = TString;
-module.exports.Userdata = Userdata; \ No newline at end of file
+module.exports.Table = Table; \ No newline at end of file