diff options
author | Benoit Giannangeli <benoit.giannangeli@boursorama.fr> | 2017-02-15 09:22:11 +0100 |
---|---|---|
committer | Benoit Giannangeli <benoit.giannangeli@boursorama.fr> | 2017-02-15 17:07:58 +0100 |
commit | c428f1241ebd5194a37c37d9d5376b326b78ee37 (patch) | |
tree | 6e0357f728f525da8e27d73bcbc94ec8ce05c645 /src/lstate.js | |
parent | f94e2902d6e2e45840c5a63d46c57ddd888b84b8 (diff) | |
download | fengari-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/lstate.js')
-rw-r--r-- | src/lstate.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/lstate.js b/src/lstate.js index ed299b5..84aefc0 100644 --- a/src/lstate.js +++ b/src/lstate.js @@ -1,7 +1,9 @@ /*jshint esversion: 6 */ "use strict"; -const LUA_MULTRET = require('./lua.js').LUA_MULTRET; +const lua = require('./lua.js'); +const LUA_MULTRET = lua.LUA_MULTRET; +const TS = lua.thread_status; const Table = require('./lobject.js').Table; class CallInfo { @@ -14,9 +16,14 @@ class CallInfo { this.next = next; this.pcOff = 0; this.u = { - l: { - base: base, + l: { /* only for Lua functions */ + base: base, /* base for this function */ savedpc: [] + }, + c: { /* only for JS functions */ + k: null, /* continuation in case of yields */ + old_errfunc: null, + ctx: null /* context info. in case of yields */ } }; this.nresults = 0; @@ -37,6 +44,7 @@ class lua_State { cl ]; this.openupval = []; + this.status = TS.LUA_OK; } } |