java.lang.Object
org.htmlunit.corejs.javascript.AInterpreter<org.htmlunit.corejs.javascript.CallFrame,org.htmlunit.corejs.javascript.InterpreterData<?>>
org.htmlunit.corejs.javascript.Interpreter
- All Implemented Interfaces:
Evaluator
public final class Interpreter
extends AInterpreter<org.htmlunit.corejs.javascript.CallFrame,org.htmlunit.corejs.javascript.InterpreterData<?>>
-
Nested Class Summary
Nested classes/interfaces inherited from class org.htmlunit.corejs.javascript.AInterpreter
AInterpreter.ContinuationJump<T extends ACallFrame<T,U>, U extends ACompilerData<?, U>>, AInterpreter.DebugScope -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic NativeContinuationcompileFunction(CompilerEnvirons compilerEnv, ScriptNode tree, String rawSource) Compile a function from intermediate representation tree into an executable form.compileScript(CompilerEnvirons compilerEnv, ScriptNode tree, String rawSource) Compile a script from intermediate representation tree into an executable form.createFunctionObject(Context cx, VarScope scope, CompilationResult<JSFunction> compiled, Object staticSecurityDomain) Create a function object.createScriptObject(CompilationResult<JSScript> compiled, Object staticSecurityDomain) Create a script object.static ObjectrestartContinuation(NativeContinuation c, Context cx, VarScope scope, Object[] args) static ObjectresumeGenerator(Context cx, VarScope scope, int operation, Object savedState, Object value) Methods inherited from class org.htmlunit.corejs.javascript.AInterpreter
captureStackInfo, enterFrame, getPatchedStack, getScriptStack, getScriptStackElements, getSourcePositionFromStack
-
Constructor Details
-
Interpreter
public Interpreter()
-
-
Method Details
-
compileScript
public CompilationResult<JSScript> compileScript(CompilerEnvirons compilerEnv, ScriptNode tree, String rawSource) Description copied from interface:EvaluatorCompile a script from intermediate representation tree into an executable form.- Parameters:
compilerEnv- Compiler environmenttree- parse treerawSource- the source code- Returns:
- a result that can be passed to
Evaluator.createScriptObject(org.htmlunit.corejs.javascript.CompilationResult<org.htmlunit.corejs.javascript.JSScript>, java.lang.Object)
-
compileFunction
public CompilationResult<JSFunction> compileFunction(CompilerEnvirons compilerEnv, ScriptNode tree, String rawSource) Description copied from interface:EvaluatorCompile a function from intermediate representation tree into an executable form.- Parameters:
compilerEnv- Compiler environmenttree- parse treerawSource- the source code- Returns:
- a result that can be passed to
Evaluator.createFunctionObject(org.htmlunit.corejs.javascript.Context, org.htmlunit.corejs.javascript.VarScope, org.htmlunit.corejs.javascript.CompilationResult<org.htmlunit.corejs.javascript.JSFunction>, java.lang.Object)
-
createScriptObject
Description copied from interface:EvaluatorCreate a script object.- Parameters:
compiled- the result returned byEvaluator.compileScript(org.htmlunit.corejs.javascript.CompilerEnvirons, org.htmlunit.corejs.javascript.ast.ScriptNode, java.lang.String)staticSecurityDomain- security domain- Returns:
- Script object that can be evaluated
-
createFunctionObject
public Function createFunctionObject(Context cx, VarScope scope, CompilationResult<JSFunction> compiled, Object staticSecurityDomain) Description copied from interface:EvaluatorCreate a function object.- Parameters:
cx- Current contextscope- scope of the functioncompiled- the result returned byEvaluator.compileFunction(org.htmlunit.corejs.javascript.CompilerEnvirons, org.htmlunit.corejs.javascript.ast.ScriptNode, java.lang.String)staticSecurityDomain- security domain- Returns:
- Function object that can be called
-
resumeGenerator
-
restartContinuation
public static Object restartContinuation(NativeContinuation c, Context cx, VarScope scope, Object[] args) -
captureContinuation
-