java.lang.Object
org.mozilla.javascript.JSCode<JSScript>
org.mozilla.javascript.optimizer.OptJSCode<JSScript>
org.mozilla.javascript.optimizer.OptJSScriptCode
- All Implemented Interfaces:
JSCodeExec<JSScript>,JSCodeResume<JSScript>
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.mozilla.javascript.optimizer.OptJSCode
OptJSCode.BuilderEnvNested classes/interfaces inherited from class org.mozilla.javascript.JSCode
JSCode.NullBuilder<V extends ScriptOrFn<V>> -
Field Summary
Fields inherited from interface org.mozilla.javascript.JSCodeResume
NULL_RESUMABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Objectexecute(Context cx, JSScript executableObject, Object newTarget, Scriptable scope, Object thisObj, Object[] args) Executes the code represented by this object.abstract Objectresume(Context cx, JSScript executableObject, Object state, Scriptable scope, int operation, Object value) Resuem execution of the code represented by this object.
-
Constructor Details
-
OptJSScriptCode
protected OptJSScriptCode()
-
-
Method Details
-
execute
public abstract Object execute(Context cx, JSScript executableObject, Object newTarget, Scriptable scope, Object thisObj, Object[] args) Description copied from interface:JSCodeExecExecutes the code represented by this object.- Parameters:
cx- should be context in which the call is being madeexecutableObject- should be function or script which owns this code.newTarget- should be null in the case of script or function calls, and the `new.target` of constructors.scope- should be the scope in which the script, function, or constructor should execute. This should normally be derived from the scope which the function or constructor was declared, or for scripts should be the scope in which they are being executed.thisObj- should be the value of `this` that the code will see while executing.args- is the array of arguments passed to the code.- Returns:
- the result of executing the code.
-
resume
public abstract Object resume(Context cx, JSScript executableObject, Object state, Scriptable scope, int operation, Object value) Description copied from interface:JSCodeResumeResuem execution of the code represented by this object.- Parameters:
cx- should be context in which the call is being madeexecutableObject- should be function or script which owns this code.state- should be the state object created at some previous point when execution was yielded.scope- should be the scope in which the code will be executed.operation- should be one of the constants defined onNativeGeneratorand represents the operation being performed.value- represents the value being passed into the generator (see https://tc39.es/ecma262/#sec-generatorresume for details).- Returns:
- the result of executing the code.
-