Skip to content

Commit 8d5ac1b

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 <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host>
1 parent 8c40ffc commit 8d5ac1b

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

doc/api/wasi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ added:
7878

7979
Attempt to begin execution of `instance` by invoking its `_start()` export.
8080
If `instance` does not contain a `_start()` export, then `start()` attempts to
81-
invoke the `__wasi_unstable_reactor_start()` export. If neither of those exports
82-
is present on `instance`, then `start()` does nothing.
81+
invoke the `_initialize()` export. If neither of those exports is present on
82+
`instance`, then `start()` does nothing.
8383

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

lib/wasi.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ class WASI {
9797
try {
9898
if (exports._start)
9999
exports._start();
100-
else if (exports.__wasi_unstable_reactor_start)
101-
exports.__wasi_unstable_reactor_start();
100+
else if (exports._initialize)
101+
exports._initialize();
102102
} catch (err) {
103103
if (err !== kExitCode) {
104104
throw err;

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

Lines changed: 1 addition & 1 deletion
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)