From 8d5ac1bbf0a3b1f5d1ebc6f0e6898813d29dda3e Mon Sep 17 00:00:00 2001 From: cjihrig Date: Sat, 25 Apr 2020 23:38:34 -0400 Subject: [PATCH] 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 Reviewed-By: Gus Caplan --- doc/api/wasi.md | 4 ++-- lib/wasi.js | 4 ++-- test/wasi/test-wasi-start-validation.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/api/wasi.md b/doc/api/wasi.md index 1fe78aeecd6a1f..09ea12e811f6a5 100644 --- a/doc/api/wasi.md +++ b/doc/api/wasi.md @@ -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. diff --git a/lib/wasi.js b/lib/wasi.js index a6d90f0f57365f..4283216afc7547 100644 --- a/lib/wasi.js +++ b/lib/wasi.js @@ -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; 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() }; } });