org.mozilla.javascript.debug

Interface DebuggableScript

public interface DebuggableScript

This interface exposes debugging information from executable code (either functions or top-level scripts).
Method Summary
DebuggableScriptgetFunction(int index)
intgetFunctionCount()
StringgetFunctionName()
Get name of the function described by this script.
int[]getLineNumbers()
Get array containing the line numbers that that can be passed to DebugFrame.onLineChange().
intgetParamAndVarCount()
Get number of declared parameters and local variables.
intgetParamCount()
Get number of declared parameters in function.
StringgetParamOrVarName(int index)
Get name of a declared parameter or local variable.
DebuggableScriptgetParent()
StringgetSourceName()
Get the name of the source (usually filename or URL) of the script.
booleanisFunction()
Returns true if this is a function, false if it is a script.
booleanisGeneratedScript()
Returns true if this script or function were runtime-generated from JavaScript using eval function or Function or Script constructors.
booleanisTopLevel()

Method Detail

getFunction

public DebuggableScript getFunction(int index)

getFunctionCount

public int getFunctionCount()

getFunctionName

public String getFunctionName()
Get name of the function described by this script. Return null or an empty string if this script is not function.

getLineNumbers

public int[] getLineNumbers()
Get array containing the line numbers that that can be passed to DebugFrame.onLineChange(). Note that line order in the resulting array is arbitrary

getParamAndVarCount

public int getParamAndVarCount()
Get number of declared parameters and local variables. Return number of declared global variables if this script is not function.

See Also: getParamCount DebuggableScript

getParamCount

public int getParamCount()
Get number of declared parameters in function. Return 0 if this script is not function.

See Also: getParamAndVarCount DebuggableScript

getParamOrVarName

public String getParamOrVarName(int index)
Get name of a declared parameter or local variable. index should be less then {@link #getParamAndVarCount()}. If index < {@link #getParamCount()}, return the name of the corresponding parameter, otherwise return the name of variable. If this script is not function, return the name of the declared global variable.

getParent

public DebuggableScript getParent()

getSourceName

public String getSourceName()
Get the name of the source (usually filename or URL) of the script.

isFunction

public boolean isFunction()
Returns true if this is a function, false if it is a script.

isGeneratedScript

public boolean isGeneratedScript()
Returns true if this script or function were runtime-generated from JavaScript using eval function or Function or Script constructors.

isTopLevel

public boolean isTopLevel()