import JavascriptContext from 'stencila-node/lib/contexts/JavascriptContext.js'JavascriptContext
Extends:
Direct Subclass:
An execution context for Javascript
Although this currently resides in the stencila/node repository,
it is intended for eventual use within the browser by
replacing the JsContext instencila/stencila`
Constructor Summary
| Public Constructor | ||
| public |
|
|
Member Summary
| Private Members | ||
| private |
Libraries registered in this context |
|
| private |
Variables residing in this context |
|
Method Summary
| Public Methods | ||
| public |
Compile a cell |
|
| public |
async evaluateCall(call: *): * |
|
| public |
async evaluateGet(get: *): * |
|
| public |
async execute(cell: *): * |
|
| public |
async libraries(): * Get the libraries registered in this context |
|
| public |
async pack(value: *): * Pack a value |
|
| public |
async variables(): * Get the variables residing in this context |
|
| Private Methods | ||
| private |
_compileFunction(name: *, decl: *, source: *, docs: *): * |
|
Inherited Summary
| From class Context | ||
| public get |
host: * |
|
| public get |
id: * |
|
| public get |
location: {"context": *, "host": *, "machine": *} |
|
| public get |
name: * |
|
| private |
_host: * |
|
| private |
|
|
| private |
_name: * |
|
| private |
_variables: {} |
|
| public |
async compile(cell: *): {"source": *, "expr": *, "global": *, "options": *, "inputs": *, "outputs": *, "messages": *} |
|
| public |
async evaluate(node: *): * |
|
| public |
async execute(cell: *): * |
|
| public |
async libraries(): {} |
|
| public |
async pack(value: *): * |
|
| public |
async packPackage(value: *): {"type": *, "data": *} |
|
| public |
async packPointer(objectPattern: {"type": *, "name": *, "preview": *}): {"type": *, "path": *, "preview": *} |
|
| public |
async provide(what: *): * |
|
| public |
async resolve(what: *): * |
|
| public |
Unpack a data node into a native data value |
|
| public |
async unpackPackage(pkg: *): * |
|
| public |
async unpackPointer(pointer: *): * |
|
Public Constructors
Private Members
Public Methods
public async compile(cell: *, internal: boolean): * source
Compile a cell
Override:
Context#compileParams:
| Name | Type | Attribute | Description |
| cell | * | ||
| internal | boolean |
|
Return:
| * |
public async execute(cell: *): * source
Override:
Context#executeParams:
| Name | Type | Attribute | Description |
| cell | * |
Return:
| * |
public async libraries(): * source
Get the libraries registered in this context
Override:
Context#librariesReturn:
| * |
public async pack(value: *): * source
Pack a value
An overide of Context.pack which deals
with packing of functions.
Override:
Context#packParams:
| Name | Type | Attribute | Description |
| value | * |
Return:
| * |
Private Methods
private _compileFunction(name: *, decl: *, source: *, docs: *): * source
Params:
| Name | Type | Attribute | Description |
| name | * | ||
| decl | * | ||
| source | * | ||
| docs | * |
Return:
| * |
