Constructor
new Program(fn:, globals:)
Create a program wrapper.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
fn: |
function
|
generated executable function |
globals: |
Array.<string>
|
global variable names in call order |
Methods
_namespaceToArgs(namespace:) → {Array.<*>}
Convert namespace values into argument list matching globals order.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
namespace: |
Object
|
values keyed by global variable names |
Returns:
- Type:
-
Array.<*>
argument values in globals order
eval(namespace:, cb:) → {*}
Execute the program against a namespace and callback.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
namespace: |
Object
|
values referenced by template globals |
cb: |
function
|
standard cb(result) callback |
Returns:
- Type:
-
*
return value from generated function
process(namespace:, cb:) → {*}
Execute the program against a namespace and callback.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
namespace: |
Object
|
values referenced by template globals |
cb: |
function
|
standard cb(result) callback |
Returns:
- Type:
-
*
return value from generated function