org.apache.cocoon.components.flow.javascript
Class LocationTrackingDebugger

java.lang.Object
  extended by org.apache.cocoon.components.flow.javascript.LocationTrackingDebugger
All Implemented Interfaces:
org.mozilla.javascript.debug.Debugger

public class LocationTrackingDebugger
extends Object
implements org.mozilla.javascript.debug.Debugger

A Rhino debugger that tracks location information when an exception is raised in some JavaScript code. It's purpose is to build a ProcessingException that holds the stacktrace in the JavaScript code.

This debugger implementation is designed to be as lightweight and fast as possible, in order to have a negligible impact on the performances of the Rhino interpreter.

Since:
2.1.8
Version:
$Id: LocationTrackingDebugger.html 1304258 2012-03-23 10:09:27Z ilgrosso $

Field Summary
protected  List locations
           
protected  Throwable throwable
           
 
Constructor Summary
LocationTrackingDebugger()
           
 
Method Summary
 org.mozilla.javascript.debug.DebugFrame enterFrame(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable scope, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.debug.DebuggableScript fnOrScript)
          Rhino+cont API
 Exception getException(String description, Exception originalException)
          Get an exception that reflects the known location stack
 org.mozilla.javascript.debug.DebugFrame getFrame(org.mozilla.javascript.Context cx, org.mozilla.javascript.debug.DebuggableScript fnOrScript)
          Rhino 1.6 API
 void handleCompilationDone(org.mozilla.javascript.Context cx, org.mozilla.javascript.debug.DebuggableScript fnOrScript, String source)
          Rhino 1.6 API
 void handleCompilationDone(org.mozilla.javascript.Context cx, org.mozilla.javascript.debug.DebuggableScript fnOrScript, StringBuffer source)
          Rhino+cont API
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

locations

protected List locations

throwable

protected Throwable throwable
Constructor Detail

LocationTrackingDebugger

public LocationTrackingDebugger()
Method Detail

handleCompilationDone

public void handleCompilationDone(org.mozilla.javascript.Context cx,
                                  org.mozilla.javascript.debug.DebuggableScript fnOrScript,
                                  StringBuffer source)
Rhino+cont API


enterFrame

public org.mozilla.javascript.debug.DebugFrame enterFrame(org.mozilla.javascript.Context cx,
                                                          org.mozilla.javascript.Scriptable scope,
                                                          org.mozilla.javascript.Scriptable thisObj,
                                                          Object[] args,
                                                          org.mozilla.javascript.debug.DebuggableScript fnOrScript)
Rhino+cont API


handleCompilationDone

public void handleCompilationDone(org.mozilla.javascript.Context cx,
                                  org.mozilla.javascript.debug.DebuggableScript fnOrScript,
                                  String source)
Rhino 1.6 API

Specified by:
handleCompilationDone in interface org.mozilla.javascript.debug.Debugger

getFrame

public org.mozilla.javascript.debug.DebugFrame getFrame(org.mozilla.javascript.Context cx,
                                                        org.mozilla.javascript.debug.DebuggableScript fnOrScript)
Rhino 1.6 API

Specified by:
getFrame in interface org.mozilla.javascript.debug.Debugger

getException

public Exception getException(String description,
                              Exception originalException)
                       throws ProcessingException
Get an exception that reflects the known location stack

Parameters:
description - a description for the exception
originalException - the original exception
Returns:
a suitable exception to throw
Throws:
ProcessingException
See Also:
ProcessingException.throwLocated(String, Throwable, Location)


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.