Skip to content

Commit a9c908a

Browse files
committed
[js-api] Define Tag constructor.
1 parent 7618dd2 commit a9c908a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

document/js-api/index.bs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,6 +1166,8 @@ The algorithm <dfn>ToWebAssemblyValue</dfn>(|v|, |type|) coerces a JavaScript va
11661166

11671167
<h3 id="tags">Tags</h3>
11681168

1169+
The <dfn>tag_alloc</dfn>(|store|, |parameters|) algorithm creates a new [=tag address=] for |parameters| in |store| and returns the updated store and the [=tag address=].
1170+
11691171
The <dfn>tag_parameters</dfn>(|store|, |tagAddress|) algorithm returns the [=list=] of types for |tagAddress| in |store|.
11701172

11711173
<h4 id="exceptions-types">Exception types</h4>
@@ -1210,6 +1212,21 @@ To <dfn>create a Tag object</dfn> from a [=tag address=] |tagAddress|, perform t
12101212

12111213
<div algorithm>
12121214

1215+
The <dfn constructor for="Tag" lt="Tag(type)">new Tag(|type|)</dfn> constructor steps are:
1216+
1217+
1. Let |parameters| be |type|["parameters"].
1218+
1. Let |wasmParameters| be «».
1219+
1. [=list/iterate|For each=] |type| of |parameters|,
1220+
1. [=list/Append=] [=ToValueType=](|type|) to |wasmParameters|.
1221+
1. Let |store| be the current agent's [=associated store=].
1222+
1. Let (|store|, |tagAddress|) be [=tag_alloc=](|store|, |wasmParameters|).
1223+
1. Set the current agent's [=associated store=] to |store|.
1224+
1. [=initialize a Tag object|Initialize=] **this** from |tagAddress|.
1225+
1226+
</div>
1227+
1228+
<div algorithm>
1229+
12131230
The <dfn method for="Tag">type()</dfn> method steps are:
12141231

12151232
1. Let |store| be the [=surrounding agent=]'s [=associated store=].

0 commit comments

Comments
 (0)