From 18b89ee8e1059a21f8d5e3a52c2e256b7dea79cb Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Sat, 4 Feb 2017 09:01:25 +0100 Subject: CLOSURE, CALL --- src/lstate.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/lstate.js') diff --git a/src/lstate.js b/src/lstate.js index 15dedcb..f9dbf8e 100644 --- a/src/lstate.js +++ b/src/lstate.js @@ -10,8 +10,13 @@ class CallInfo { this.base = base; this.previous = previous; this.next = next; - this.savedpc = []; this.pcOff = 0; + this.u = { + l: { + base: null, + savedpc: [] + } + }; } } @@ -21,9 +26,9 @@ class lua_State { constructor(cl) { this.top = 1; this.ci = [ - new CallInfo(0, 1, 1, null, null) + new CallInfo(cl, 1, 1, null, null) ]; - this.ci[0].savedpc = cl.p.code; + this.ci[0].u.l.savedpc = cl.p.code; this.ciOff = 0; this.stack = [ cl -- cgit v1.2.3-54-g00ecf