Move DEBUG_ENABLED flag
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -281,7 +280,7 @@ public class DebugLib extends OneArgFunction {
|
|||||||
public String toString() {
|
public String toString() {
|
||||||
return DebugLib.traceback(thread, 0);
|
return DebugLib.traceback(thread, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static DebugState getDebugState( LuaThread thread ) {
|
private static DebugState getDebugState( LuaThread thread ) {
|
||||||
if ( thread.debugState == null )
|
if ( thread.debugState == null )
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user