C# Class Jint.JintEngine

Afficher le fichier Open project: splhack/unity-jint Class Usage Examples

Protected Properties

Свойство Type Description
visitor ExecutionVisitor

Méthodes publiques

Méthode 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

Méthodes protégées

Méthode Description
OnBreak ( object sender, DebugInformation info ) : void
OnStep ( object sender, DebugInformation info ) : void

Private Methods

Méthode Description
JintEngine ( )
JintEngine ( Jint.Options options )

Method Details

AddPermission() public méthode

public AddPermission ( IPermission perm ) : JintEngine
perm IPermission
Résultat JintEngine

CallFunction() public méthode

public CallFunction ( JsFunction function ) : object
function JsFunction
Résultat object

CallFunction() public méthode

public CallFunction ( string name ) : object
name string
Résultat object

Compile() public static méthode

public static Compile ( string source, bool debugInformation ) : Program
source string
debugInformation bool
Résultat Program

DisableSecurity() public méthode

public DisableSecurity ( ) : JintEngine
Résultat JintEngine

EnableSecurity() public méthode

public EnableSecurity ( ) : JintEngine
Résultat JintEngine

EscapteStringLiteral() public static méthode

Escapes a JavaScript string literal
public static EscapteStringLiteral ( string value ) : string
value string The string literal to espace
Résultat string

HasErrors() public static méthode

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
Résultat bool

Load() public static méthode

public static Load ( Stream s ) : JintEngine
s Stream
Résultat JintEngine

Load() public static méthode

public static Load ( JintEngine engine, Stream s ) : void
engine JintEngine
s Stream
Résultat void

OnBreak() protected méthode

protected OnBreak ( object sender, DebugInformation info ) : void
sender object
info DebugInformation
Résultat void

OnStep() protected méthode

protected OnStep ( object sender, DebugInformation info ) : void
sender object
info DebugInformation
Résultat void

Run() public méthode

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
Résultat object

Run() public méthode

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.
Résultat object

Run() public méthode

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
Résultat object

Run() public méthode

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.
Résultat object

Run() public méthode

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
Résultat object

Run() public méthode

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.
Résultat object

Save() public méthode

public Save ( Stream s ) : void
s Stream
Résultat void

SetDebugMode() public méthode

public SetDebugMode ( bool debugMode ) : JintEngine
debugMode bool
Résultat JintEngine

SetFunction() public méthode

public SetFunction ( string name, Delegate function ) : JintEngine
name string
function Delegate
Résultat JintEngine

SetFunction() public méthode

public SetFunction ( string name, JsFunction function ) : JintEngine
name string
function JsFunction
Résultat JintEngine

SetMaxRecursions() public méthode

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

SetParameter() public méthode

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
Résultat JintEngine

SetParameter() public méthode

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
Résultat JintEngine

SetParameter() public méthode

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
Résultat JintEngine

SetParameter() public méthode

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
Résultat JintEngine

SetParameter() public méthode

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
Résultat JintEngine

Property Details

visitor protected_oe property

protected ExecutionVisitor,Jint visitor
Résultat ExecutionVisitor