DebuggableScript (Rhino)
Keywords: org.mozilla.javascript.debug.DebuggableScript interface

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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
`DebuggableScript` | `getFunction(int index)`
`int` | `getFunctionCount()`
`java.lang.String` | `getFunctionName()` 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()`.``
`int` | `getParamAndVarCount()` Get number of declared parameters and local variables.
`int` | `getParamCount()` Get number of declared parameters in function.
`java.lang.String` | `getParamOrVarName(int index)` Get name of a declared parameter or local variable.
`DebuggableScript` | `getParent()`
`java.lang.String` | `getSourceName()` Get the name of the source (usually filename or URL) of the script.
`boolean` | `isFunction()` Returns true if this is a function, false if it is a script.
`boolean` | `isGeneratedScript()` Returns true if this script or function were runtime-generated from JavaScript using `eval` function or `Function` or `Script` constructors.
`boolean` | `isTopLevel()`

Method Detail

### isTopLevel

    public boolean isTopLevel()

### isFunction

    public boolean isFunction()

  Returns true if this is a function, false if it is a script.

### getFunctionName

    public java.lang.String getFunctionName()

  Get name of the function described by this script. Return null or an empty string if this script is not function.

### getParamCount

    public int getParamCount()

  Get number of declared parameters in function. Return 0 if this script is not function.

  See Also:
    `getParamAndVarCount()`, `getParamOrVarName(int index)`

### 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()`, `getParamOrVarName(int index)`

### getParamOrVarName

    public java.lang.String getParamOrVarName(int index)

  Get name of a declared parameter or local variable. `index` should be less then `getParamAndVarCount()`. 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

    public java.lang.String getSourceName()

  Get the name of the source (usually filename or URL) of the 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.

### 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

  ``

### getFunctionCount

    public int getFunctionCount()

### getFunction

    public DebuggableScript getFunction(int index)

### getParent

    public DebuggableScript getParent()

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD