Skip to content

Commit 4ee0aad

Browse files
committed
throw when initialize gets wasmModule (#2323)
1 parent d500061 commit 4ee0aad

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

lib/deno/mod.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ let initializeWasCalled = false
5252
export const initialize: typeof types.initialize = async (options) => {
5353
options = common.validateInitializeOptions(options || {})
5454
if (options.wasmURL) throw new Error(`The "wasmURL" option only works in the browser`)
55+
if (options.wasmModule) throw new Error(`The "wasmModule" option only works in the browser`)
5556
if (options.worker) throw new Error(`The "worker" option only works in the browser`)
5657
if (initializeWasCalled) throw new Error('Cannot call "initialize" more than once')
5758
await ensureServiceIsRunning()

lib/npm/node.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ let initializeWasCalled = false;
226226
export let initialize: typeof types.initialize = options => {
227227
options = common.validateInitializeOptions(options || {});
228228
if (options.wasmURL) throw new Error(`The "wasmURL" option only works in the browser`)
229+
if (options.wasmModule) throw new Error(`The "wasmModule" option only works in the browser`)
229230
if (options.worker) throw new Error(`The "worker" option only works in the browser`)
230231
if (initializeWasCalled) throw new Error('Cannot call "initialize" more than once')
231232
ensureServiceIsRunning()

0 commit comments

Comments
 (0)