Interface JSCodeExec<T extends ScriptOrFn<T>>

All Known Subinterfaces:
ClassDescriptor.BuiltInJSCodeExec<U>, ClassDescriptor.BuiltInJSCodeResume<U>
All Known Implementing Classes:
ACompilerData, CompilerData, JSCode

public interface JSCodeExec<T extends ScriptOrFn<T>>
This interface represent a thing which can be executed in JavaScript, whether that is a script, function call, or function constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    execute(Context cx, T executableObject, Object newTarget, VarScope scope, Object thisObj, Object[] args)
    Executes the code represented by this object.
  • Method Details

    • execute

      Object execute(Context cx, T executableObject, Object newTarget, VarScope scope, Object thisObj, Object[] args)
      Executes the code represented by this object.
      Parameters:
      cx - should be context in which the call is being made
      executableObject - 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.