@@ -320,6 +320,8 @@ namespace WebAssembly {
320
320
321
321
Promise<Instance> instantiate(
322
322
Module moduleObject, optional object importObject);
323
+
324
+ Instance namespaceInstance(ModuleNamespace moduleNamespace);
323
325
};
324
326
</pre>
325
327
@@ -331,6 +333,7 @@ Note:
331
333
WebAssembly.compile(|bytes|) asynchronously validates and complies bytes of WebAssembly into a Module.
332
334
WebAssembly.instantiate(|bytes|, |importObject|) asynchronously compiles and instantiates a WebAssembly module from bytes of source.
333
335
The WebAssembly.instantiate(|moduleObject|, |importObject|) asynchronously instantiates a compiled module.
336
+ WebAssembly.namespaceInstance(|namespace|) obtains the WebAssembly Instance from the Module Namespace Exotic Object for a WebAssembly Module Record.
334
337
-->
335
338
336
339
<div algorithm>
@@ -538,6 +541,14 @@ The verification of WebAssembly type requirements is deferred to the
538
541
539
542
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> .
540
543
544
+ <div algorithm>
545
+ The <dfn method for="WebAssembly">namespaceInstance(|namespace|)</dfn> method, when invoked, performs the following steps:
546
+ 1. Assert: |namespace| is a [=Module Namespace exotic object=] .
547
+ 1. If |namespace|.\[[Module]] is not a [=WebAssembly Module Record=] , [=throw=] a {{TypeError}} exception.
548
+ 1. Let |module| be |namespace|.\[[Module]] .
549
+ 1. Return |module|.\[[Instance]] .
550
+ </div>
551
+
541
552
<h3 id="modules">Modules</h3>
542
553
543
554
<pre class="idl">
@@ -633,7 +644,6 @@ Note: Some implementations enforce a size limitation on |bytes|. Use of this API
633
644
interface Instance {
634
645
constructor(Module module, optional object importObject);
635
646
readonly attribute object exports;
636
- static Instance namespaceInstance(ModuleNamespace moduleNamespace);
637
647
};
638
648
</pre>
639
649
@@ -651,14 +661,6 @@ Note: The use of this synchronous API is discouraged, as some implementations so
651
661
The getter of the <dfn attribute for="Instance">exports</dfn> attribute of {{Instance}} returns **this**.\[[Exports]] .
652
662
</div>
653
663
654
- <div algorithm>
655
- The <dfn method for="Instance">namespaceInstance(|namespace|)</dfn> method, when invoked, performs the following steps:
656
- 1. Assert: |namespace| is a [=Module Namespace exotic object=] .
657
- 1. If |namespace|.\[[Module]] is not a [=WebAssembly Module Record=] , [=throw=] a {{TypeError}} exception.
658
- 1. Let |module| be |namespace|.\[[Module]] .
659
- 1. Return |module|.\[[Instance]] .
660
- </div>
661
-
662
664
<h3 id="memories">Memories</h3>
663
665
664
666
<pre class="idl">
0 commit comments