diff options
| author | Brad Nelson <flagxor@gmail.com> | 2017-05-18 11:37:39 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-05-18 11:37:39 -0700 |
| commit | 89cfa6242fdc5f0f965e636bf0b927071ead356b (patch) | |
| tree | 097daf83758320144e4572e0eabeaadbdcb41c49 /JS.md | |
| parent | abb557a97d672393aabba2f6fb9254a5ed95f60e (diff) | |
| download | nanowasm-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.md | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -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) |
