Move DEBUG_ENABLED flag

This commit is contained in:
James Roseborough
2010-04-25 06:28:31 +00:00
parent de9c967ac5
commit 5d23d37255
2 changed files with 8 additions and 4 deletions

View File

@@ -103,14 +103,13 @@ public class DebugLib extends OneArgFunction {
private static final LuaString ACTIVELINES = valueOf("activelines"); private static final LuaString ACTIVELINES = valueOf("activelines");
public DebugLib() { public DebugLib() {
DEBUG_ENABLED = true;
} }
public LuaValue call(LuaValue arg) { public LuaValue call(LuaValue arg) {
LuaTable t = new LuaTable(); LuaTable t = new LuaTable();
bindv(t, NAMES); bindv(t, NAMES);
env.set("debug", t); env.set("debug", t);
if ( ! DEBUG_ENABLED )
DEBUG_ENABLED = true;
return t; return t;
} }

View File

@@ -43,7 +43,6 @@ public class JsePlatform {
_G.load(new TableLib()); _G.load(new TableLib());
_G.load(new StringLib()); _G.load(new StringLib());
_G.load(new CoroutineLib()); _G.load(new CoroutineLib());
_G.load(new DebugLib());
_G.load(new JseMathLib()); _G.load(new JseMathLib());
_G.load(new JseIoLib()); _G.load(new JseIoLib());
_G.load(new JseOsLib()); _G.load(new JseOsLib());
@@ -51,4 +50,10 @@ public class JsePlatform {
LuaThread.setGlobals(_G); LuaThread.setGlobals(_G);
return _G; return _G;
} }
public static LuaTable debugGlobals() {
LuaTable _G = standardGlobals();
_G.load(new DebugLib());
return _G;
}
} }