Engine
Container class for all of esper.
Constructor Summary
Public Constructor | ||
public |
constructor(options: *, realm: boolean) |
Member Summary
Public Members | ||
public |
evaluator: * |
|
public |
evloop: {"next": *} |
|
public get |
generator: * |
|
public set |
generator: * |
|
public get |
globalScope: Scope: * Refrence to the global scope. |
|
public get |
language: * |
|
public |
options: {} |
|
public |
realm: * |
|
public |
runtime: * |
|
public |
threads: *[] |
Method Summary
Public Methods | ||
public |
addGlobal(name: *, what: *, opts: *) |
|
public |
addGlobalBridge(name: *, what: *, opts: *) |
|
public |
addGlobalFx(name: *, what: *, opts: *) |
|
public |
addGlobalValue(name: *, what: *, opts: *) |
|
public |
Evalute |
|
public |
Evalute |
|
public |
evalASTSync(ast: *, opts: *): * |
|
public |
evalDetatched(code: *): * |
|
public |
Evalute |
|
public |
fetchFunction(name: *, shouldYield: *): * |
|
public |
fetchFunctionSync(name: *, shouldYield: *): * |
|
public |
* filterGenerator(gen: *, shouldYield: *, evaluator: *): * |
|
public |
Returns a new engine that executes in the same Realm. |
|
public |
functionFromAST(ast: *, shouldYield: *, source: *): * |
|
public |
functionFromASTSync(ast: *, shouldYield: *, source: *): * |
|
public |
functionFromSource(source: *, shouldYield: *): * |
|
public |
functionFromSourceSync(source: *, shouldYield: *): * |
|
public |
load(code: *) |
|
public |
loadAST(ast: *, opts: *) |
|
public |
|
|
public |
makeEvaluatorClone(): * |
|
public |
makeFunctionFromClosure(val: *, shouldYield: *, evalu: *): * |
|
public |
preprocessAST(ast: *, opts: *): * |
|
public |
run(): * |
|
public |
runSync(): * |
|
public |
step(): * |
Public Constructors
Public Members
public evaluator: * source
public evloop: {"next": *} source
public get generator: * source
public set generator: * source
public get language: * source
public options: {} source
public realm: * source
public runtime: * source
public threads: *[] source
Public Methods
public addGlobal(name: *, what: *, opts: *) source
Params:
Name | Type | Attribute | Description |
name | * | ||
what | * | ||
opts | * |
public addGlobalBridge(name: *, what: *, opts: *) source
Params:
Name | Type | Attribute | Description |
name | * | ||
what | * | ||
opts | * |
public addGlobalFx(name: *, what: *, opts: *) source
Params:
Name | Type | Attribute | Description |
name | * | ||
what | * | ||
opts | * |
public addGlobalValue(name: *, what: *, opts: *) source
Params:
Name | Type | Attribute | Description |
name | * | ||
what | * | ||
opts | * |
public eval(code: string): Promise<Value> source
Evalute code
and return a promise for the result.
Params:
Name | Type | Attribute | Description |
code | string | String of code to evaluate |
public evalAST(ast: Node, codeRef: string): Value source
Evalute ast
and return a promise for the result.
public evalASTSync(ast: *, opts: *): * source
Params:
Name | Type | Attribute | Description |
ast | * | ||
opts | * |
Return:
* |
public evalSync(code: string): Value source
Evalute code
and return a the result.
Params:
Name | Type | Attribute | Description |
code | string | String of code to evaluate |
public fetchFunction(name: *, shouldYield: *): * source
Params:
Name | Type | Attribute | Description |
name | * | ||
shouldYield | * |
Return:
* |
public fetchFunctionSync(name: *, shouldYield: *): * source
Params:
Name | Type | Attribute | Description |
name | * | ||
shouldYield | * |
Return:
* |
public * filterGenerator(gen: *, shouldYield: *, evaluator: *): * source
Params:
Name | Type | Attribute | Description |
gen | * | ||
shouldYield | * | ||
evaluator | * |
Return:
* |
public fork(): Engine source
Returns a new engine that executes in the same Realm. Useful for creating threads / coroutines
public functionFromAST(ast: *, shouldYield: *, source: *): * source
Params:
Name | Type | Attribute | Description |
ast | * | ||
shouldYield | * | ||
source | * |
Return:
* |
public functionFromASTSync(ast: *, shouldYield: *, source: *): * source
Params:
Name | Type | Attribute | Description |
ast | * | ||
shouldYield | * | ||
source | * |
Return:
* |
public functionFromSource(source: *, shouldYield: *): * source
Params:
Name | Type | Attribute | Description |
source | * | ||
shouldYield | * |
Return:
* |
public functionFromSourceSync(source: *, shouldYield: *): * source
Params:
Name | Type | Attribute | Description |
source | * | ||
shouldYield | * |
Return:
* |
public load(code: *) source
Params:
Name | Type | Attribute | Description |
code | * |
public loadAST(ast: *, opts: *) source
Params:
Name | Type | Attribute | Description |
ast | * | ||
opts | * |
public loadLangaugeStartupCode() source
public makeFunctionFromClosure(val: *, shouldYield: *, evalu: *): * source
Params:
Name | Type | Attribute | Description |
val | * | ||
shouldYield | * | ||
evalu | * |
Return:
* |
public preprocessAST(ast: *, opts: *): * source
Params:
Name | Type | Attribute | Description |
ast | * | ||
opts | * |
Return:
* |