Skip to content

Commit 8307913

Browse files
committed
move to Instance, assume IDL integration
1 parent 09b4432 commit 8307913

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

document/js-api/index.bs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,6 @@ namespace WebAssembly {
319319

320320
Promise<Instance> instantiate(
321321
Module moduleObject, optional object importObject);
322-
323-
Instance namespaceInstance(ModuleNamespace namespace);
324322
};
325323
</pre>
326324

@@ -537,14 +535,6 @@ The verification of WebAssembly type requirements is deferred to the
537535
1. [=asynchronously instantiate a WebAssembly module|Asynchronously instantiate the WebAssembly module=] |moduleObject| importing |importObject|, and return the result.
538536
</div>
539537

540-
<div algorithm>
541-
The <dfn method for="WebAssembly">namespaceInstance(|namespace|)</dfn> method, when invoked, performs the following steps:
542-
1. If |namespace| is not a [=Module Namespace exotic object=], [=throw=] a {{TypeError}} exception.
543-
1. If |namespace|.\[[Module]] is not a [=WebAssembly Module Record=], [=throw=] a {{TypeError}} exception.
544-
1. Let |module| be |namespace|.\[[Module]].
545-
1. Return |module|.\[[Instance]].
546-
</div>
547-
548538
Note: A follow-on streaming API is documented in the <a href="https://webassembly.github.io/spec/web-api/index.html">WebAssembly Web API</a>.
549539

550540
<h3 id="modules">Modules</h3>
@@ -642,6 +632,7 @@ Note: Some implementations enforce a size limitation on |bytes|. Use of this API
642632
interface Instance {
643633
constructor(Module module, optional object importObject);
644634
readonly attribute object exports;
635+
static Instance namespaceInstance(ModuleNamespace moduleNamespace);
645636
};
646637
</pre>
647638

@@ -659,6 +650,14 @@ Note: The use of this synchronous API is discouraged, as some implementations so
659650
The getter of the <dfn attribute for="Instance">exports</dfn> attribute of {{Instance}} returns **this**.\[[Exports]].
660651
</div>
661652

653+
<div algorithm>
654+
The <dfn method for="Instance">namespaceInstance(|moduleNamespace|)</dfn> method, when invoked, performs the following steps:
655+
1. Assert: |namespace| is a [=Module Namespace exotic object=].
656+
1. If |namespace|.\[[Module]] is not a [=WebAssembly Module Record=], [=throw=] a {{TypeError}} exception.
657+
1. Let |module| be |namespace|.\[[Module]].
658+
1. Return |module|.\[[Instance]].
659+
</div>
660+
662661
<h3 id="memories">Memories</h3>
663662

664663
<pre class="idl">

0 commit comments

Comments
 (0)