Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2020-04-26 08:20:10 +0300
committercjihrig <cjihrig@gmail.com>2020-04-28 20:04:43 +0300
commit6ca6db105d8db40af538e275f39612b569b9c141 (patch)
tree4353ce3fee11afec4247e737e1bfe88e140bc892 /doc/api/wasi.md
parent4791ea09bd15fac9d7a057611d62c145f4f7a536 (diff)
wasi: update start() behavior to match spec
_start() and _initialize() shouldn't be called from the same function, as they have different behavior. Furthermore, Node should throw if both are provided. This commit updates the implementation, docs, and tests accordingly. PR-URL: https://github.com/nodejs/node/pull/33073 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host>
Diffstat (limited to 'doc/api/wasi.md')
-rw-r--r--doc/api/wasi.md9
1 files changed, 5 insertions, 4 deletions
diff --git a/doc/api/wasi.md b/doc/api/wasi.md
index 09ea12e811f..ebaf15525d0 100644
--- a/doc/api/wasi.md
+++ b/doc/api/wasi.md
@@ -76,14 +76,15 @@ added:
* `instance` {WebAssembly.Instance}
-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 `_initialize()` export. If neither of those exports is present on
-`instance`, then `start()` does nothing.
+Attempt to begin execution of `instance` as a WASI command by invoking its
+`_start()` export. If `instance` does not contain a `_start()` export, or if
+`instance` contains an `_initialize()` export, then an exception is thrown.
`start()` requires that `instance` exports a [`WebAssembly.Memory`][] named
`memory`. If `instance` does not have a `memory` export an exception is thrown.
+If `start()` is called more than once, an exception is thrown.
+
### `wasi.wasiImport`
<!-- YAML
added: