Skip to content

Commit b5e27bc

Browse files
Revert browser.d.ts API change
1 parent 71b4bde commit b5e27bc

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Plugins/PackageToJS/Templates/platforms/browser.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { InstantiateOptions, ModuleSource/* #if HAS_IMPORTS */, Imports/* #endif */ } from "../instantiate.js"
22

3-
export function defaultBrowserSetup(options?: {
3+
export function defaultBrowserSetup(options: {
44
module: ModuleSource,
55
/* #if IS_WASI */
66
args?: string[],

Plugins/PackageToJS/Templates/platforms/browser.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ class DefaultBrowserThreadRegistry {
102102
/** @type {import('./browser.d.ts').defaultBrowserSetup} */
103103
export async function defaultBrowserSetup(options) {
104104
/* #if IS_WASI */
105-
const args = options?.args ?? []
106-
const onStdoutLine = options?.onStdoutLine ?? ((line) => console.log(line))
107-
const onStderrLine = options?.onStderrLine ?? ((line) => console.error(line))
105+
const args = options.args ?? []
106+
const onStdoutLine = options.onStdoutLine ?? ((line) => console.log(line))
107+
const onStderrLine = options.onStderrLine ?? ((line) => console.error(line))
108108
const wasi = new WASI(/* args */[MODULE_PATH, ...args], /* env */[], /* fd */[
109109
new OpenFile(new File([])), // stdin
110110
ConsoleStdout.lineBuffered((stdout) => {
@@ -118,13 +118,13 @@ export async function defaultBrowserSetup(options) {
118118
/* #endif */
119119
/* #if USE_SHARED_MEMORY */
120120
const memory = new WebAssembly.Memory(MEMORY_TYPE);
121-
const threadChannel = new DefaultBrowserThreadRegistry(options?.spawnWorker || createDefaultWorkerFactory())
121+
const threadChannel = new DefaultBrowserThreadRegistry(options.spawnWorker || createDefaultWorkerFactory())
122122
/* #endif */
123123

124124
return {
125-
module: options?.module,
125+
module: options.module,
126126
/* #if HAS_IMPORTS */
127-
getImports() { return options?.getImports() },
127+
getImports() { return options.getImports() },
128128
/* #endif */
129129
/* #if IS_WASI */
130130
wasi: Object.assign(wasi, {

0 commit comments

Comments
 (0)