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 13, 2020
1 parent b9d9c24 commit e1fe0b6
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
Expand Up @@ -72,8 +72,8 @@ added: v12.16.0

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
Expand Up @@ -96,8 +96,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
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 e1fe0b6

Please sign in to comment.