From 89cfa6242fdc5f0f965e636bf0b927071ead356b Mon Sep 17 00:00:00 2001 From: Brad Nelson Date: Thu, 18 May 2017 11:37:39 -0700 Subject: Rename Response based compile + instantiate *Streaming. (#1068) Clarify how the source parameter is resolved. Clarify how the result of instantiate* is described. --- JS.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'JS.md') 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 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) -- cgit v1.2.3