File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 2
2
* These tests demonstate some common patterns for using quickjs-emscripten.
3
3
*/
4
4
5
- import { getInstance , QuickJSVm , QuickJSHandle } from './quickjs'
5
+ import { getQuickJS , QuickJSVm , QuickJSHandle } from './quickjs'
6
6
import { it , describe } from 'mocha'
7
7
import assert from 'assert'
8
8
import { VmCallResult } from './vm-interface'
@@ -11,7 +11,7 @@ describe('QuickJSVm', async () => {
11
11
let vm : QuickJSVm = undefined as any
12
12
13
13
beforeEach ( async ( ) => {
14
- const quickjs = await getInstance ( )
14
+ const quickjs = await getQuickJS ( )
15
15
vm = quickjs . createVm ( )
16
16
} )
17
17
Original file line number Diff line number Diff line change @@ -587,7 +587,7 @@ export type QuickJSHandle = StaticJSValue | JSValue | JSValueConst
587
587
* QuickJS presents a Javascript interface to QuickJS, a Javascript interpreter that
588
588
* supports ES2019.
589
589
*
590
- * QuickJS is a singleton. Use the { @link getInstance} function to instantiate
590
+ * QuickJS is a singleton. Use the [[getQuickJS]] function to instantiate
591
591
* or retrieve an instance.
592
592
*
593
593
* Use the {@link QuickJS.createVm} method to create a {@link QuickJSVm}.
@@ -603,13 +603,13 @@ export class QuickJS {
603
603
constructor ( ) {
604
604
if ( ! isReady ) {
605
605
throw new Error (
606
- 'QuickJS WASM module not initialized. Either wait for `ready` or use getInstance ()'
606
+ 'QuickJS WASM module not initialized. Either wait for `ready` or use getQuickJS ()'
607
607
)
608
608
}
609
609
610
610
if ( singleton ) {
611
611
throw new Error (
612
- 'Cannot create another QuickJS instance. Use the instance already created (try getInstance ())'
612
+ 'Cannot create another QuickJS instance. Use the instance already created (try getQuickJS ())'
613
613
)
614
614
}
615
615
singleton = this
@@ -706,7 +706,7 @@ let singleton: QuickJS | undefined = undefined
706
706
* This is the top-level entrypoint for the quickjs-emscripten library.
707
707
* Get the root QuickJS API.
708
708
*/
709
- export async function getInstance ( ) : Promise < QuickJS > {
709
+ export async function getQuickJS ( ) : Promise < QuickJS > {
710
710
await ready
711
711
if ( ! singleton ) {
712
712
singleton = new QuickJS ( )
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ export type SuccessOrFail<S, F> =
12
12
}
13
13
14
14
/**
15
- * Used as an optional.
15
+ * Used as an optional for results of a Vm call .
16
16
* `{ value: VmHandle } | { error: VmHandle }`.
17
17
*/
18
18
export type VmCallResult < VmHandle > = SuccessOrFail < VmHandle , VmHandle >
You can’t perform that action at this time.
0 commit comments