org.mozilla.javascript
Class InterpretedScript
java.lang.Object
|
+--org.mozilla.javascript.ScriptableObject
|
+--org.mozilla.javascript.IdScriptable
|
+--org.mozilla.javascript.BaseFunction
|
+--org.mozilla.javascript.NativeFunction
|
+--org.mozilla.javascript.NativeScript
|
+--org.mozilla.javascript.InterpretedScript
- All Implemented Interfaces:
- DebuggableScript, Function, IdFunctionMaster, Script, Scriptable, java.io.Serializable
- public class InterpretedScript
- extends NativeScript
- implements DebuggableScript
- See Also:
- Serialized Form
Method Summary |
java.lang.Object |
call(Context cx,
Scriptable scope,
Scriptable thisObj,
java.lang.Object[] args)
Should be overridden. |
java.lang.Object |
exec(Context cx,
Scriptable scope)
Execute the script.
|
int[] |
getLineNumbers()
Get array containing the line numbers that
can have breakpoints placed on them. |
Scriptable |
getScriptable()
Get the Scriptable object (Function or Script) that is
described by this DebuggableScript object. |
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 |
placeBreakpoint(int line)
Place a breakpoint at the given line. |
boolean |
removeBreakpoint(int line)
Remove a breakpoint from the given line. |
Methods inherited from class org.mozilla.javascript.ScriptableObject |
callMethod, defineClass, defineClass, defineFunctionProperties, defineProperty, defineProperty, defineProperty, delete, deleteProperty, deleteProperty, get, getAllIds, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, has, hasProperty, hasProperty, isSealed, put, putProperty, putProperty, sealObject, setAttributes, setParentScope, setPrototype |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.mozilla.javascript.Scriptable |
delete, delete, get, get, getDefaultValue, getIds, getParentScope, getPrototype, has, has, put, put, setParentScope, setPrototype |
exec
public java.lang.Object exec(Context cx,
Scriptable scope)
throws JavaScriptException
- Description copied from class:
NativeScript
- Execute the script.
Will be overridden by generated scripts; needed to implement Script.
- Overrides:
exec
in class NativeScript
- Following copied from interface:
org.mozilla.javascript.Script
- Parameters:
cx
- the Context associated with the current threadscope
- the scope to execute relative to- Returns:
- the result of executing the script
- Throws:
JavaScriptException
- if an uncaught JavaScript exception
occurred while executing the script- See Also:
Context.initStandardObjects(org.mozilla.javascript.ScriptableObject)
call
public java.lang.Object call(Context cx,
Scriptable scope,
Scriptable thisObj,
java.lang.Object[] args)
throws JavaScriptException
- Description copied from class:
BaseFunction
- Should be overridden.
- Overrides:
call
in class NativeScript
- Following copied from interface:
org.mozilla.javascript.Function
- Parameters:
cx
- the current Context for this threadscope
- the scope to execute the function relative to. This is
set to the value returned by getParentScope() except
when the function is called from a closure.thisObj
- the JavaScript this
objectargs
- the array of arguments- Returns:
- the result of the call
- Throws:
JavaScriptException
- if an uncaught exception
occurred while executing the function
isFunction
public boolean isFunction()
- Description copied from interface:
DebuggableScript
- Returns true if this is a function, false if it is a script.
- Specified by:
isFunction
in interface DebuggableScript
getScriptable
public Scriptable getScriptable()
- Description copied from interface:
DebuggableScript
- Get the Scriptable object (Function or Script) that is
described by this DebuggableScript object.
- Specified by:
getScriptable
in interface DebuggableScript
getSourceName
public java.lang.String getSourceName()
- Description copied from interface:
DebuggableScript
- Get the name of the source (usually filename or URL)
of the script.
- Specified by:
getSourceName
in interface DebuggableScript
getLineNumbers
public int[] getLineNumbers()
- Description copied from interface:
DebuggableScript
- Get array containing the line numbers that
can have breakpoints placed on them.
- Specified by:
getLineNumbers
in interface DebuggableScript
placeBreakpoint
public boolean placeBreakpoint(int line)
- Description copied from interface:
DebuggableScript
- Place a breakpoint at the given line.
- Specified by:
placeBreakpoint
in interface DebuggableScript
- Following copied from interface:
org.mozilla.javascript.debug.DebuggableScript
- Returns:
- true if the breakpoint was successfully set.
removeBreakpoint
public boolean removeBreakpoint(int line)
- Description copied from interface:
DebuggableScript
- Remove a breakpoint from the given line.
- Specified by:
removeBreakpoint
in interface DebuggableScript
- Following copied from interface:
org.mozilla.javascript.debug.DebuggableScript
- Returns:
- true if there was a breakpoint at the given line.