summaryrefslogtreecommitdiff
path: root/src/lstate.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-02 08:30:20 +0100
committerBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-02 08:48:32 +0100
commit04a7b7322446eae0f5da66bedc1e262a7d83419d (patch)
tree635af4541d978c5331ea37091e225d7c0688e2b3 /src/lstate.js
parentfa7ce109418aca2fd60fdb65b4b2451c4854dd09 (diff)
downloadfengari-04a7b7322446eae0f5da66bedc1e262a7d83419d.tar.gz
fengari-04a7b7322446eae0f5da66bedc1e262a7d83419d.tar.bz2
fengari-04a7b7322446eae0f5da66bedc1e262a7d83419d.zip
readHeader
Diffstat (limited to 'src/lstate.js')
-rw-r--r--src/lstate.js38
1 files changed, 15 insertions, 23 deletions
diff --git a/src/lstate.js b/src/lstate.js
index b0002c3..979b89c 100644
--- a/src/lstate.js
+++ b/src/lstate.js
@@ -1,32 +1,24 @@
/*jshint esversion: 6 */
"use strict";
+const thread_status = require('./lua.js').thread_status;
+
class lua_State {
constructor() {
- // CommonHeader;
- // unsigned short nci; /* number of items in 'ci' list */
- // lu_byte status;
- // StkId top; /* first free slot in the stack */
- // global_State *l_G;
- // CallInfo *ci; /* call info for current function */
- // const Instruction *oldpc; /* last pc traced */
- // StkId stack_last; /* last free slot in the stack */
- // StkId stack; /* stack base */
- // UpVal *openupval; /* list of open upvalues in this stack */
- // GCObject *gclist;
- // struct lua_State *twups; list of threads with open upvalues
- // struct lua_longjmp *errorJmp; /* current error recover point */
- // CallInfo base_ci; /* CallInfo for first level (C calling Lua) */
- // volatile lua_Hook hook;
- // ptrdiff_t errfunc; /* current error handling function (stack index) */
- // int stacksize;
- // int basehookcount;
- // int hookcount;
- // unsigned short nny; /* number of non-yieldable calls in stack */
- // unsigned short nCcalls; /* number of nested C calls */
- // l_signalT hookmask;
- // lu_byte allowhook;
+ this.next = null;
+ this.stack = null;
+ this.ci = null;
+ this.nci = 0;
+ this.stacksize = 0;
+ this.twups = [this];
+ this.errorJmp = null;
+ this.hook = null;
+ this.allowhook = true;
+ this.openupval = null;
+ this.nny = 1;
+ this.status = thread_status.LUA_OK;
+ this.errfunc = 0;
}
}