From beab1b6d42b3e9bd0ea8a37e4389b0a44f603ead Mon Sep 17 00:00:00 2001 From: daurnimator Date: Fri, 24 Mar 2017 00:01:21 +1100 Subject: lstate: Don't localise ldo.js fields Doing so breaks due to circular dependencies --- src/lstate.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/lstate.js b/src/lstate.js index 99992c5..80dcc21 100644 --- a/src/lstate.js +++ b/src/lstate.js @@ -7,8 +7,6 @@ const lua = require('./lua.js'); const lobject = require('./lobject.js'); const ldo = require('./ldo.js'); const lapi = require('./lapi.js'); -const nil = ldo.nil; -const luaD_rawrunprotected = ldo.luaD_rawrunprotected; const luaT_init = require('./ltm.js').luaT_init; const CT = lua.constant_types; const LUA_MULTRET = lua.LUA_MULTRET; @@ -70,7 +68,7 @@ class global_State { constructor(L) { this.mainthread = L; this.strt = new Map(); - this.l_registry = nil; + this.l_registry = ldo.nil; this.panic = null; this.version = null; this.twups = []; @@ -100,7 +98,7 @@ const stack_init = function(L1, L) { ci.callstatus = 0; ci.func = L1.stack[L1.top]; ci.funcOff = L1.top; - L1.stack[L1.top++] = nil; + L1.stack[L1.top++] = ldo.nil; ci.top = L1.top + lua.LUA_MINSTACK; L1.ci = ci; }; @@ -166,7 +164,7 @@ const lua_newstate = function() { preinit_thread(L, g); - if (luaD_rawrunprotected(L, f_luaopen, null) !== TS.LUA_OK) { + if (ldo.luaD_rawrunprotected(L, f_luaopen, null) !== TS.LUA_OK) { L = null; } -- cgit v1.2.3-70-g09d2