Skip to content

Commit

Permalink
Add notes to discourage using synchronous APIs.
Browse files Browse the repository at this point in the history
  • Loading branch information
littledan authored and Ms2ger committed Sep 23, 2022
1 parent 66e15de commit 4693e59
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions document/js-api/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,8 @@ interface Module {
1. If |module| is [=error=], throw a {{CompileError}} exception.
1. Set **this**.\[[Module]] to |module|.
1. Set **this**.\[[Bytes]] to |stableBytes|.

Note: Some implementations enforce a size limitation on |bytes|. Use of this API is discouraged, in favor of asynchronous APIs.
</div>

<h3 id="instances">Instances</h3>
Expand All @@ -610,6 +612,8 @@ interface Instance {
1. [=Read the imports=] of |module| with imports |importObject|, and let |imports| be the result.
1. [=Instantiate the core of a WebAssembly module=] |module| with |imports|, and let |instance| be the result.
1. [=initialize an instance object|Initialize=] **this** from |module| and |instance|.

Note: The use of this synchronous API is discouraged, as some implementations sometimes do long-running compilation work when instantiating.
</div>

<div algorithm>
Expand Down

0 comments on commit 4693e59

Please sign in to comment.