IJavaScriptEngine Interface
A common interface to a JavaScript engine. Every JavaScript engine is obtained from a IJavaScriptEnginePool and will be returned to the pool when it is disposed. Therefore, you must dispose the engine when you are done with it.
Namespace
Statiq.Common
Interfaces
  • IDisposable
Implementing Types
graph BT Type-.->Interface0["IDisposable"] Type["IJavaScriptEngine"] class Type type-node Implementing0["TestJsEngine"]-.->Type click Implementing0 "/api/Statiq.Testing.JavaScript/TestJsEngine"

Syntax

public interface IJavaScriptEngine : IDisposable

Properties

Name Property Type Summary
Name string
Gets the name of JavaScript engine.
Version string
Gets the version of original JavaScript engine.

Methods

Name Return Value Summary
CallFunction(string, object[]) object
Calls a JavaScript function.
CallFunction<T>(string, object[]) T
Calls a JavaScript function.
EmbedHostObject(string, object) void
Embeds a host object to script code.
EmbedHostType(string, Type) void
Embeds a host type to script code.
Evaluate(string) object
Evaluates an expression.
Evaluate<T>(string) T
Evaluates an expression.
Execute(string) void
Executes JavaScript code.
ExecuteFile(string, Encoding) void
Executes code from JavaScript file.
ExecuteResource(string, Assembly) void
Executes code from embedded JavaScript resource.
ExecuteResource(string, Type) void
Executes code from embedded JavaScript resource.
GetVariableValue(string) object
Gets the value of variable.
GetVariableValue<T>(string) T
Gets the value of variable.
HasVariable(string) bool
Сhecks for the existence of a variable.
RemoveVariable(string) void
Removes a variable.
SetVariableValue(string, object) void
Sets the value of variable.

Extension Methods