diff --git a/doc/api/wasi.md b/doc/api/wasi.md index 622de02ff85c23..e66039f1b1ae02 100644 --- a/doc/api/wasi.md +++ b/doc/api/wasi.md @@ -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. diff --git a/lib/wasi.js b/lib/wasi.js index 7ea2d1bbe0f7c0..a382388197cc03 100644 --- a/lib/wasi.js +++ b/lib/wasi.js @@ -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; diff --git a/test/wasi/test-wasi-start-validation.js b/test/wasi/test-wasi-start-validation.js index a31c5847968491..94d31f2e1257c3 100644 --- a/test/wasi/test-wasi-start-validation.js +++ b/test/wasi/test-wasi-start-validation.js @@ -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() }; } });