Skip to content

Commit e1fe0b6

Browse files
cjihrigtargos
authored andcommitted
wasi: rename __wasi_unstable_reactor_start()
Upstream WASI has renamed __wasi_unstable_reactor_start() to _initialize(). This commit updates Node's WASI implementation to reflect that change. PR-URL: #33073 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Gus Caplan <[email protected]>
1 parent b9d9c24 commit e1fe0b6

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

doc/api/wasi.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ added: v12.16.0
7272

7373
Attempt to begin execution of `instance` by invoking its `_start()` export.
7474
If `instance` does not contain a `_start()` export, then `start()` attempts to
75-
invoke the `__wasi_unstable_reactor_start()` export. If neither of those exports
76-
is present on `instance`, then `start()` does nothing.
75+
invoke the `_initialize()` export. If neither of those exports is present on
76+
`instance`, then `start()` does nothing.
7777

7878
`start()` requires that `instance` exports a [`WebAssembly.Memory`][] named
7979
`memory`. If `instance` does not have a `memory` export an exception is thrown.

lib/wasi.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ class WASI {
9696
try {
9797
if (exports._start)
9898
exports._start();
99-
else if (exports.__wasi_unstable_reactor_start)
100-
exports.__wasi_unstable_reactor_start();
99+
else if (exports._initialize)
100+
exports._initialize();
101101
} catch (err) {
102102
if (err !== kExitCode) {
103103
throw err;

test/wasi/test-wasi-start-validation.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const bufferSource = fixtures.readSync('simple.wasm');
8383
get() {
8484
return {
8585
memory: new WebAssembly.Memory({ initial: 1 }),
86-
__wasi_unstable_reactor_start: common.mustCall()
86+
_initialize: common.mustCall()
8787
};
8888
}
8989
});

0 commit comments

Comments
 (0)