summaryrefslogtreecommitdiff
path: root/src/lstate.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-03 08:18:06 +0100
committerBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-03 09:03:15 +0100
commit9fbe044cbff12b635e535a36abcf2fb2a03dee11 (patch)
treef78e41199c8b40d50e39e4028de951be1e71c040 /src/lstate.js
parent7b844c5caf81ac843a210477ef47fd16e8af2f2c (diff)
downloadfengari-9fbe044cbff12b635e535a36abcf2fb2a03dee11.tar.gz
fengari-9fbe044cbff12b635e535a36abcf2fb2a03dee11.tar.bz2
fengari-9fbe044cbff12b635e535a36abcf2fb2a03dee11.zip
Dispatch loop
Diffstat (limited to 'src/lstate.js')
-rw-r--r--src/lstate.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/lstate.js b/src/lstate.js
new file mode 100644
index 0000000..9c7eec3
--- /dev/null
+++ b/src/lstate.js
@@ -0,0 +1,34 @@
+/*jshint esversion: 6 */
+"use strict";
+
+
+class CallInfo {
+
+ constructor(func, top, base, previous, next) {
+ this.func = func;
+ this.top = top;
+ this.base = base;
+ this.previous = previous;
+ this.next = next;
+ this.savedpc = [];
+ this.pcOff = 0;
+ }
+
+}
+
+class lua_State {
+
+ constructor(cl) {
+ this.top = 1;
+ this.ci = [
+ new CallInfo(0, 1, 1, null, null);
+ ];
+ this.ci[0].savedpc = cl.p.code;
+ this.ciOff = 0;
+ this.stack = [
+ closure
+ ];
+ this.openupval = [];
+ }
+
+} \ No newline at end of file