|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mozilla.javascript.Interpreter
public final class Interpreter
Constructor Summary | |
---|---|
Interpreter()
|
Method Summary | |
---|---|
static NativeContinuation |
captureContinuation(Context cx)
|
void |
captureStackInfo(RhinoException ex)
Capture stack information from the given exception. |
Object |
compile(CompilerEnvirons compilerEnv,
ScriptNode tree,
String encodedSource,
boolean returnFunction)
Compile the script or function from intermediate representation tree into an executable form. |
Function |
createFunctionObject(Context cx,
Scriptable scope,
Object bytecode,
Object staticSecurityDomain)
Create a function object. |
Script |
createScriptObject(Object bytecode,
Object staticSecurityDomain)
Create a script object. |
String |
getPatchedStack(RhinoException ex,
String nativeStackTrace)
Given a native stack trace, patch it with script-specific source and line information |
List<String> |
getScriptStack(RhinoException ex)
Get the script stack for the given exception |
ScriptStackElement[][] |
getScriptStackElements(RhinoException ex)
|
String |
getSourcePositionFromStack(Context cx,
int[] linep)
Get the source position information by examining the stack. |
static Object |
restartContinuation(NativeContinuation c,
Context cx,
Scriptable scope,
Object[] args)
|
static Object |
resumeGenerator(Context cx,
Scriptable scope,
int operation,
Object savedState,
Object value)
|
void |
setEvalScriptFlag(Script script)
Mark the given script to indicate it was created by a call to eval() or to a Function constructor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Interpreter()
Method Detail |
---|
public Object compile(CompilerEnvirons compilerEnv, ScriptNode tree, String encodedSource, boolean returnFunction)
Evaluator
compile
in interface Evaluator
compilerEnv
- Compiler environmenttree
- parse treeencodedSource
- encoding of the source code for decompilationreturnFunction
- if true, compiling a function
public Script createScriptObject(Object bytecode, Object staticSecurityDomain)
Evaluator
createScriptObject
in interface Evaluator
bytecode
- opaque object returned by compilestaticSecurityDomain
- security domain
public void setEvalScriptFlag(Script script)
Evaluator
setEvalScriptFlag
in interface Evaluator
script
- script to mark as from evalpublic Function createFunctionObject(Context cx, Scriptable scope, Object bytecode, Object staticSecurityDomain)
Evaluator
createFunctionObject
in interface Evaluator
cx
- Current contextscope
- scope of the functionbytecode
- opaque object returned by compilestaticSecurityDomain
- security domain
public void captureStackInfo(RhinoException ex)
Evaluator
captureStackInfo
in interface Evaluator
ex
- an exception thrown during executionpublic String getSourcePositionFromStack(Context cx, int[] linep)
Evaluator
getSourcePositionFromStack
in interface Evaluator
cx
- Contextlinep
- Array object of length >= 1; getSourcePositionFromStack
will assign the line number to linep[0].
public String getPatchedStack(RhinoException ex, String nativeStackTrace)
Evaluator
getPatchedStack
in interface Evaluator
ex
- exceptionnativeStackTrace
- the native stack trace
public List<String> getScriptStack(RhinoException ex)
Evaluator
getScriptStack
in interface Evaluator
ex
- exception from execution
public ScriptStackElement[][] getScriptStackElements(RhinoException ex)
public static Object resumeGenerator(Context cx, Scriptable scope, int operation, Object savedState, Object value)
public static Object restartContinuation(NativeContinuation c, Context cx, Scriptable scope, Object[] args)
public static NativeContinuation captureContinuation(Context cx)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |