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: https://github.com/nodejs/node/pull/33073
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gus Caplan <me@gus.host>
This commit is contained in:
cjihrig 2020-04-25 23:38:34 -04:00
parent 9037ad3e78
commit 4791ea09bd
No known key found for this signature in database
GPG Key ID: 7434390BDBE9B9C5
3 changed files with 5 additions and 5 deletions

View File

@ -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.

View File

@ -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;

View File

@ -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()
};
}
});