aboutsummaryrefslogtreecommitdiff
path: root/JS.md
diff options
context:
space:
mode:
authorBrad Nelson <flagxor@gmail.com>2017-05-18 11:37:39 -0700
committerGitHub <noreply@github.com>2017-05-18 11:37:39 -0700
commit89cfa6242fdc5f0f965e636bf0b927071ead356b (patch)
tree097daf83758320144e4572e0eabeaadbdcb41c49 /JS.md
parentabb557a97d672393aabba2f6fb9254a5ed95f60e (diff)
downloadnanowasm-design-89cfa6242fdc5f0f965e636bf0b927071ead356b.tar.gz
Rename Response based compile + instantiate *Streaming. (#1068)
Clarify how the source parameter is resolved. Clarify how the result of instantiate* is described.
Diffstat (limited to 'JS.md')
-rw-r--r--JS.md13
1 files changed, 10 insertions, 3 deletions
diff --git a/JS.md b/JS.md
index 7ab73b1..61672a8 100644
--- a/JS.md
+++ b/JS.md
@@ -113,12 +113,19 @@ If neither of the following overloads match, then the returned `Promise` is
with a [`TypeError`](https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror).
```
-Promise<{module:WebAssembly.Module, instance:WebAssembly.Instance}>
+dictionary WebAssemblyInstantiatedSource {
+ required WebAssembly.Module module;
+ required WebAssembly.Instance instance;
+};
+
+Promise<WebAssemblyInstantiatedSource>
instantiate(BufferSource bytes [, importObject])
```
-This description applies if the first argument is a
-[`BufferSource`](https://heycam.github.io/webidl/#common-BufferSource).
+If the given `bytes` argument is not a
+[`BufferSource`](https://heycam.github.io/webidl/#common-BufferSource),
+the returned `Promise` is [rejected](http://tc39.github.io/ecma262/#sec-rejectpromise)
+with a [`TypeError`](https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror).
This function starts an asynchronous task that first compiles a `WebAssembly.Module`
from `bytes` as described in the [`WebAssembly.Module` constructor](#webassemblymodule-constructor)