From 9fbe044cbff12b635e535a36abcf2fb2a03dee11 Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Fri, 3 Feb 2017 08:18:06 +0100 Subject: Dispatch loop --- src/lstate.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/lstate.js (limited to 'src/lstate.js') 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 -- cgit v1.2.3-54-g00ecf