Package 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
Modifier and TypeMethodDescriptiongetFunction
(int index) int
Get name of the function described by this script.int[]
Get array containing the line numbers that that can be passed toDebugFrame.onLineChange()
.
int
Get number of declared parameters and local variables.int
Get number of declared parameters in the function.getParamOrVarName
(int index) Get name of a declared parameter or local variable.Get the name of the source (usually filename or URL) of the script.boolean
Returns true if this is a function, false if it is a script.boolean
Returns true if this script or function were runtime-generated from JavaScript using eval function or Function or Script constructors.boolean
-
Method Details
-
isTopLevel
boolean isTopLevel() -
isFunction
boolean isFunction()Returns true if this is a function, false if it is a script. -
getFunctionName
String getFunctionName()Get name of the function described by this script. Return null or an empty string if this script is not a function. -
getParamCount
int getParamCount()Get number of declared parameters in the function. Return 0 if this script is not a function.- See Also:
-
getParamAndVarCount
int getParamAndVarCount()Get number of declared parameters and local variables. Return number of declared global variables if this script is not a function.- See Also:
-
getParamOrVarName
Get name of a declared parameter or local variable. index should be less thengetParamAndVarCount()
. If index <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. -
getSourceName
String getSourceName()Get the name of the source (usually filename or URL) of the script. -
isGeneratedScript
boolean isGeneratedScript()Returns true if this script or function were runtime-generated from JavaScript using eval function or Function or Script constructors. -
getLineNumbers
int[] getLineNumbers()Get array containing the line numbers that that can be passed toDebugFrame.onLineChange()
. Note that line order in the resulting array is arbitrary
-
getFunctionCount
int getFunctionCount() -
getFunction
-
getParent
DebuggableScript getParent()
-