* Clean up formatting.
This commit is contained in:
parent
2ec32f146a
commit
68756f4b3e
1 changed files with 11 additions and 25 deletions
|
@ -34,39 +34,32 @@ public class Tracer implements Debugger {
|
||||||
/**
|
/**
|
||||||
* Implementws handleCompilationDone in interface org.mozilla.javascript.debug.Debugger
|
* Implementws handleCompilationDone in interface org.mozilla.javascript.debug.Debugger
|
||||||
*/
|
*/
|
||||||
public void handleCompilationDone(Context cx, DebuggableScript script,
|
public void handleCompilationDone(Context cx, DebuggableScript script, String source) {}
|
||||||
String source) {
|
|
||||||
|
|
||||||
// res.debug("CompilationDone: "+toString(script));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementws getFrame in interface org.mozilla.javascript.debug.Debugger
|
* Implementws getFrame in interface org.mozilla.javascript.debug.Debugger
|
||||||
*/
|
*/
|
||||||
public DebugFrame getFrame(Context cx, DebuggableScript script) {
|
public DebugFrame getFrame(Context cx, DebuggableScript script) {
|
||||||
|
|
||||||
// res.debug("getFrame: "+toString(script));
|
|
||||||
if (script.isFunction()) {
|
if (script.isFunction()) {
|
||||||
|
|
||||||
return new TracerFrame(script);
|
return new TracerFrame(script);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a string representation for the given script
|
||||||
|
* @param script a function or script
|
||||||
|
* @return the file and/or function name of the script
|
||||||
|
*/
|
||||||
static String toString(DebuggableScript script) {
|
static String toString(DebuggableScript script) {
|
||||||
|
|
||||||
if (script.isFunction()) {
|
if (script.isFunction()) {
|
||||||
|
|
||||||
return script.getSourceName() + ": " + script.getFunctionName();
|
return script.getSourceName() + ": " + script.getFunctionName();
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
return script.getSourceName();
|
return script.getSourceName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class TracerFrame
|
class TracerFrame implements DebugFrame {
|
||||||
implements DebugFrame {
|
|
||||||
|
|
||||||
DebuggableScript script;
|
DebuggableScript script;
|
||||||
|
|
||||||
|
@ -107,20 +100,13 @@ public class Tracer implements Debugger {
|
||||||
/**
|
/**
|
||||||
* Called when the function or script for this frame is about to return.
|
* Called when the function or script for this frame is about to return.
|
||||||
*/
|
*/
|
||||||
public void onExit(Context cx, boolean byThrow,
|
public void onExit(Context cx, boolean byThrow, Object resultOrException) {}
|
||||||
Object resultOrException) {
|
|
||||||
|
|
||||||
// res.debug("Exit: "+Tracer.toString(script));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when executed code reaches new line in the source.
|
* Called when executed code reaches new line in the source.
|
||||||
*/
|
*/
|
||||||
public void onLineChange(Context cx, int lineNumber) {
|
public void onLineChange(Context cx, int lineNumber) {}
|
||||||
|
|
||||||
// res.debug("LineChange: "+Tracer.toString(script));
|
|
||||||
}
|
|
||||||
|
|
||||||
} // end of class TracerFrame
|
}
|
||||||
} // end of class Tracer
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue