From c428f1241ebd5194a37c37d9d5376b326b78ee37 Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Wed, 15 Feb 2017 09:22:11 +0100 Subject: Implementing minimal path from main to luaV_execute of user script --- src/lstate.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/lstate.js') 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; } } -- cgit v1.2.3-54-g00ecf