C# Class Jint.JintEngine

ファイルを表示 Open project: splhack/unity-jint Class Usage Examples

Protected Properties

Property Type Description
visitor ExecutionVisitor

Public Methods

Method Description
AddPermission ( IPermission perm ) : JintEngine
CallFunction ( JsFunction function ) : object
CallFunction ( string name ) : object
Compile ( string source, bool debugInformation ) : Program
DisableSecurity ( ) : JintEngine
EnableSecurity ( ) : JintEngine
EscapteStringLiteral ( string value ) : string

Escapes a JavaScript string literal

HasErrors ( string script, string &errors ) : bool

Pre-compiles the expression in order to check syntax errors. If errors are detected, the Error property contains the message.

Load ( Stream s ) : JintEngine
Load ( JintEngine engine, Stream s ) : void
Run ( Program program ) : object

Runs a set of JavaScript statements and optionally returns a value if return is called

Run ( Program program, bool unwrap ) : object

Runs a set of JavaScript statements and optionally returns a value if return is called

Run ( TextReader reader ) : object

Runs a set of JavaScript statements and optionally returns a value if return is called

Run ( TextReader reader, bool unwrap ) : object

Runs a set of JavaScript statements and optionally returns a value if return is called

Run ( string script ) : object

Runs a set of JavaScript statements and optionally returns a value if return is called

Run ( string script, bool unwrap ) : object

Runs a set of JavaScript statements and optionally returns a value if return is called

Save ( Stream s ) : void
SetDebugMode ( bool debugMode ) : JintEngine
SetFunction ( string name, Delegate function ) : JintEngine
SetFunction ( string name, JsFunction function ) : JintEngine
SetMaxRecursions ( int maxRecursions ) : JintEngine

Defines the max allowed number of recursions in the script

SetParameter ( string name, DateTime value ) : JintEngine

Defines an external DateTime value to be available inside the script

SetParameter ( string name, bool value ) : JintEngine

Defines an external Boolean value to be available inside the script

SetParameter ( string name, double value ) : JintEngine

Defines an external Double value to be available inside the script

SetParameter ( string name, int value ) : JintEngine

Defines an external Int32 value to be available inside the script

SetParameter ( string name, string value ) : JintEngine

Defines an external String instance to be available inside the script

Protected Methods

Method Description
OnBreak ( object sender, DebugInformation info ) : void
OnStep ( object sender, DebugInformation info ) : void

Private Methods

Method Description
JintEngine ( )
JintEngine ( Jint.Options options )

Method Details

AddPermission() public method

public AddPermission ( IPermission perm ) : JintEngine
perm IPermission
return JintEngine

CallFunction() public method

public CallFunction ( JsFunction function ) : object
function JsFunction
return object

CallFunction() public method

public CallFunction ( string name ) : object
name string
return object

Compile() public static method

public static Compile ( string source, bool debugInformation ) : Program
source string
debugInformation bool
return Program

DisableSecurity() public method

public DisableSecurity ( ) : JintEngine
return JintEngine

EnableSecurity() public method

public EnableSecurity ( ) : JintEngine
return JintEngine

EscapteStringLiteral() public static method

Escapes a JavaScript string literal
public static EscapteStringLiteral ( string value ) : string
value string The string literal to espace
return string

HasErrors() public static method

Pre-compiles the expression in order to check syntax errors. If errors are detected, the Error property contains the message.
public static HasErrors ( string script, string &errors ) : bool
script string
errors string
return bool

Load() public static method

public static Load ( Stream s ) : JintEngine
s Stream
return JintEngine

Load() public static method

public static Load ( JintEngine engine, Stream s ) : void
engine JintEngine
s Stream
return void

OnBreak() protected method

protected OnBreak ( object sender, DebugInformation info ) : void
sender object
info DebugInformation
return void

OnStep() protected method

protected OnStep ( object sender, DebugInformation info ) : void
sender object
info DebugInformation
return void

Run() public method

Runs a set of JavaScript statements and optionally returns a value if return is called
public Run ( Program program ) : object
program Program The expression tree to execute
return object

Run() public method

Runs a set of JavaScript statements and optionally returns a value if return is called
public Run ( Program program, bool unwrap ) : object
program Program The expression tree to execute
unwrap bool Whether to unwrap the returned value to a CLR instance. True by default.
return object

Run() public method

Runs a set of JavaScript statements and optionally returns a value if return is called
public Run ( TextReader reader ) : object
reader TextReader The TextReader to read script from
return object

Run() public method

Runs a set of JavaScript statements and optionally returns a value if return is called
public Run ( TextReader reader, bool unwrap ) : object
reader TextReader The TextReader to read script from
unwrap bool Whether to unwrap the returned value to a CLR instance. True by default.
return object

Run() public method

Runs a set of JavaScript statements and optionally returns a value if return is called
public Run ( string script ) : object
script string The script to execute
return object

Run() public method

Runs a set of JavaScript statements and optionally returns a value if return is called
public Run ( string script, bool unwrap ) : object
script string The script to execute
unwrap bool Whether to unwrap the returned value to a CLR instance. True by default.
return object

Save() public method

public Save ( Stream s ) : void
s Stream
return void

SetDebugMode() public method

public SetDebugMode ( bool debugMode ) : JintEngine
debugMode bool
return JintEngine

SetFunction() public method

public SetFunction ( string name, Delegate function ) : JintEngine
name string
function Delegate
return JintEngine

SetFunction() public method

public SetFunction ( string name, JsFunction function ) : JintEngine
name string
function JsFunction
return JintEngine

SetMaxRecursions() public method

Defines the max allowed number of recursions in the script
public SetMaxRecursions ( int maxRecursions ) : JintEngine
maxRecursions int
return JintEngine

SetParameter() public method

Defines an external DateTime value to be available inside the script
public SetParameter ( string name, DateTime value ) : JintEngine
name string Local name of the DateTime value during the execution of the script
value DateTime Available DateTime value
return JintEngine

SetParameter() public method

Defines an external Boolean value to be available inside the script
public SetParameter ( string name, bool value ) : JintEngine
name string Local name of the Boolean value during the execution of the script
value bool Available Boolean value
return JintEngine

SetParameter() public method

Defines an external Double value to be available inside the script
public SetParameter ( string name, double value ) : JintEngine
name string Local name of the Double value during the execution of the script
value double Available Double value
return JintEngine

SetParameter() public method

Defines an external Int32 value to be available inside the script
public SetParameter ( string name, int value ) : JintEngine
name string Local name of the Int32 value during the execution of the script
value int Available Int32 value
return JintEngine

SetParameter() public method

Defines an external String instance to be available inside the script
public SetParameter ( string name, string value ) : JintEngine
name string Local name of the String instance during the execution of the script
value string Available String instance
return JintEngine

Property Details

visitor protected_oe property

protected ExecutionVisitor,Jint visitor
return ExecutionVisitor