From a70cf2feaf9f027c34784ccb3790c22465721eb7 Mon Sep 17 00:00:00 2001 From: hns Date: Wed, 14 Jan 2004 16:34:03 +0000 Subject: [PATCH] Reformatting. --- src/helma/scripting/rhino/debug/Tracer.java | 110 +++++++++++--------- 1 file changed, 62 insertions(+), 48 deletions(-) diff --git a/src/helma/scripting/rhino/debug/Tracer.java b/src/helma/scripting/rhino/debug/Tracer.java index 00afface..5230eeb4 100644 --- a/src/helma/scripting/rhino/debug/Tracer.java +++ b/src/helma/scripting/rhino/debug/Tracer.java @@ -13,13 +13,12 @@ * $Revision$ * $Date$ */ - + package helma.scripting.rhino.debug; - +import helma.framework.ResponseTrans; import org.mozilla.javascript.*; import org.mozilla.javascript.debug.*; -import helma.framework.ResponseTrans; public class Tracer implements Debugger { @@ -32,11 +31,12 @@ public class Tracer implements Debugger { this.res = res; } - /** * Implementws handleCompilationDone in interface org.mozilla.javascript.debug.Debugger */ - public void handleCompilationDone(Context cx, DebuggableScript script, String source) { + public void handleCompilationDone(Context cx, DebuggableScript script, + String source) { + // res.debug("CompilationDone: "+toString(script)); } @@ -44,69 +44,83 @@ public class Tracer implements Debugger { * Implementws getFrame in interface org.mozilla.javascript.debug.Debugger */ public DebugFrame getFrame(Context cx, DebuggableScript script) { + // res.debug("getFrame: "+toString(script)); if (script.isFunction()) { + return new TracerFrame(script); } + return null; } static String toString(DebuggableScript script) { + if (script.isFunction()) { - return script.getSourceName()+": "+script.getFunctionName(); + + return script.getSourceName() + ": " + script.getFunctionName(); } else { + return script.getSourceName(); } } -class TracerFrame implements DebugFrame { + class TracerFrame + implements DebugFrame { - DebuggableScript script; + DebuggableScript script; - TracerFrame(DebuggableScript script) { - this.script = script; - } - - /** - * Called when execution is ready to start bytecode interpretation - * for entered a particular function or script. - */ - public void onEnter(Context cx, Scriptable activation, - Scriptable thisObj, Object[] args) { - StringBuffer b = new StringBuffer("Trace: "); - b.append(Tracer.toString(script)); - b.append("("); - for (int i=0; i