org.apache.bsf.debug.jsdi

Interface JsScript

All Superinterfaces:
JsCode, JsObject, Remote

public interface JsScript
extends JsCode

Represents a script in the engine since JavaScript has code as first-class objects.

Fields inherited from interface org.apache.bsf.debug.jsdi.JsObject

DONTDELETE, DONTENUM, EMPTY, INTERNAL, READONLY

Method Summary

Object
exec(JsContext cx, JsObject scope)
Execute the script.

Methods inherited from interface org.apache.bsf.debug.jsdi.JsCode

getLineNumbers, getSourceName

Methods inherited from interface org.apache.bsf.debug.jsdi.JsObject

define, delete, delete, get, get, getClassName, getDefaultValue, getIds, getPrototype, getScope, has, has, hasInstance, isFunction, isScript, put, put, setPrototype, setScope

Method Details

exec

public Object exec(JsContext cx,
                   JsObject scope)
            throws RemoteException
Execute the script.

The script is executed in a particular runtime Context, which must be associated with the current thread. The script is executed relative to a scope--definitions and uses of global top-level variables and functions will access properties of the scope object. For compliant ECMA programs, the scope must be an object that has been initialized as a global object using Context.initStandardObjects.

Parameters:
cx - the Context associated with the current thread
scope - the scope to execute relative to
Returns:
the result of executing the script