Skip to content

Commit

Permalink
wasi: rename __wasi_unstable_reactor_start()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
cjihrig authored and targos committed May 4, 2020
1 parent 8c40ffc commit 8d5ac1b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions doc/api/wasi.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ added:

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

`start()` requires that `instance` exports a [`WebAssembly.Memory`][] named
`memory`. If `instance` does not have a `memory` export an exception is thrown.
Expand Down
4 changes: 2 additions & 2 deletions lib/wasi.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ class WASI {
try {
if (exports._start)
exports._start();
else if (exports.__wasi_unstable_reactor_start)
exports.__wasi_unstable_reactor_start();
else if (exports._initialize)
exports._initialize();
} catch (err) {
if (err !== kExitCode) {
throw err;
Expand Down
2 changes: 1 addition & 1 deletion test/wasi/test-wasi-start-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const bufferSource = fixtures.readSync('simple.wasm');
get() {
return {
memory: new WebAssembly.Memory({ initial: 1 }),
__wasi_unstable_reactor_start: common.mustCall()
_initialize: common.mustCall()
};
}
});
Expand Down

0 comments on commit 8d5ac1b

Please sign in to comment.