Skip to content

Commit dd55194

Browse files
committed
doc 1
1 parent 9af6651 commit dd55194

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

ts/quickjs.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* These tests demonstate some common patterns for using quickjs-emscripten.
33
*/
44

5-
import { getInstance, QuickJSVm, QuickJSHandle } from './quickjs'
5+
import { getQuickJS, QuickJSVm, QuickJSHandle } from './quickjs'
66
import { it, describe } from 'mocha'
77
import assert from 'assert'
88
import { VmCallResult } from './vm-interface'
@@ -11,7 +11,7 @@ describe('QuickJSVm', async () => {
1111
let vm: QuickJSVm = undefined as any
1212

1313
beforeEach(async () => {
14-
const quickjs = await getInstance()
14+
const quickjs = await getQuickJS()
1515
vm = quickjs.createVm()
1616
})
1717

ts/quickjs.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ export type QuickJSHandle = StaticJSValue | JSValue | JSValueConst
587587
* QuickJS presents a Javascript interface to QuickJS, a Javascript interpreter that
588588
* supports ES2019.
589589
*
590-
* QuickJS is a singleton. Use the {@link getInstance} function to instantiate
590+
* QuickJS is a singleton. Use the [[getQuickJS]] function to instantiate
591591
* or retrieve an instance.
592592
*
593593
* Use the {@link QuickJS.createVm} method to create a {@link QuickJSVm}.
@@ -603,13 +603,13 @@ export class QuickJS {
603603
constructor() {
604604
if (!isReady) {
605605
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()'
607607
)
608608
}
609609

610610
if (singleton) {
611611
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())'
613613
)
614614
}
615615
singleton = this
@@ -706,7 +706,7 @@ let singleton: QuickJS | undefined = undefined
706706
* This is the top-level entrypoint for the quickjs-emscripten library.
707707
* Get the root QuickJS API.
708708
*/
709-
export async function getInstance(): Promise<QuickJS> {
709+
export async function getQuickJS(): Promise<QuickJS> {
710710
await ready
711711
if (!singleton) {
712712
singleton = new QuickJS()

ts/vm-interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export type SuccessOrFail<S, F> =
1212
}
1313

1414
/**
15-
* Used as an optional.
15+
* Used as an optional for results of a Vm call.
1616
* `{ value: VmHandle } | { error: VmHandle }`.
1717
*/
1818
export type VmCallResult<VmHandle> = SuccessOrFail<VmHandle, VmHandle>

0 commit comments

Comments
 (0)