blob: f9dbf8e3f860363f11a38b05fae0b321007a0770 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
/*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.pcOff = 0;
this.u = {
l: {
base: null,
savedpc: []
}
};
}
}
class lua_State {
constructor(cl) {
this.top = 1;
this.ci = [
new CallInfo(cl, 1, 1, null, null)
];
this.ci[0].u.l.savedpc = cl.p.code;
this.ciOff = 0;
this.stack = [
cl
];
this.openupval = [];
}
}
module.exports = {
lua_State: lua_State,
CallInfo: CallInfo
};
|