diff --git a/document/js-api/index.bs b/document/js-api/index.bs index 97bb29464f..a8374f2792 100644 --- a/document/js-api/index.bs +++ b/document/js-api/index.bs @@ -35,7 +35,7 @@ Date: now
-urlPrefix: https://tc39.github.io/ecma262/; spec: ECMASCRIPT
+urlPrefix: https://tc39.es/ecma262/; spec: ECMASCRIPT
     type: interface; for: ECMAScript
         text: ArrayBuffer; url: sec-arraybuffer-objects
     type: exception; for: ECMAScript
@@ -68,14 +68,10 @@ urlPrefix: https://tc39.github.io/ecma262/; spec: ECMASCRIPT
             text: is an Object
             text: is not an Object
         text: current Realm; url: current-realm
-        text: ObjectCreate; url: sec-objectcreate
         text: CreateBuiltinFunction; url: sec-createbuiltinfunction
-        text: SetFunctionName; url: sec-setfunctionname
-        text: SetFunctionLength; url: sec-setfunctionlength
         text: the Number value; url: sec-ecmascript-language-types-number-type
         text: is a Number; url: sec-ecmascript-language-types-number-type
         text: is a BigInt; url: sec-ecmascript-language-types-bigint-type
-        text: NumberToRawBytes; url: sec-numbertorawbytes
         text: Built-in Function Objects; url: sec-built-in-function-objects
         text: NativeError Object Structure; url: sec-nativeerror-object-structure
         text: CreateArrayFromList; url: sec-createarrayfromlist
@@ -85,8 +81,6 @@ urlPrefix: https://tc39.github.io/ecma262/; spec: ECMASCRIPT
         text: BigInt; url: #sec-ecmascript-language-types-bigint-type
         text: MakeBasicObject; url: #sec-makebasicobject
         text: ℝ; url: #ℝ
-        text: Built-in Function Objects; url: sec-built-in-function-objects
-        text: NativeError Object Structure; url: sec-nativeerror-object-structure
         text: 𝔽; url: #𝔽
         text: ℤ; url: #ℤ
         text: mathematical value; url: #mathematical-value
@@ -102,7 +96,7 @@ urlPrefix: https://tc39.github.io/ecma262/; spec: ECMASCRIPT
         text: Array; url: sec-array-exotic-objects
         text: BigInt; url: sec-ecmascript-language-types-bigint-type
 urlPrefix: https://webassembly.github.io/spec/core/; spec: WebAssembly; type: dfn
-    text: embedding interface; url: appending/embedding.html
+    text: embedding interface; url: appendix/embedding.html
     text: scope; url: intro/introduction.html#scope
     url: valid/modules.html#valid-module
         text: valid
@@ -168,6 +162,7 @@ urlPrefix: https://webassembly.github.io/spec/core/; spec: WebAssembly; type: df
     text: match_valtype; url: appendix/embedding.html#embed-match-valtype
     text: match_externtype; url: appendix/embedding.html#embed-match-externtype
     text: error; url: appendix/embedding.html#embed-error
+    text: exception; url: appendix/embedding.html#embed-error
     text: store; url: exec/runtime.html#syntax-store
     text: address type; url: syntax/types.html#syntax-addrtype
     text: limits; url: syntax/types.html#syntax-limits
@@ -251,7 +246,7 @@ urlPrefix: https://webassembly.github.io/spec/core/; spec: WebAssembly; type: df
     text: signed_64; url: exec/numerics.html#aux-signed
     text: sequence; url: syntax/conventions.html#grammar-notation
     text: exception; for: tagtype/attribute; url: syntax/types.html#syntax-tagtype
-urlPrefix: https://heycam.github.io/webidl/; spec: WebIDL
+urlPrefix: https://webidl.spec.whatwg.org/; spec: WebIDL
     type: dfn
         text: create a namespace object; url: create-a-namespace-object
         text: [EnforceRange]; url: #EnforceRange
@@ -353,7 +348,7 @@ Each [=agent=] is associated with the following [=ordered map=]s:
     * The Exported Function cache, mapping [=function address=]es to [=Exported Function=] objects.
     * The Exported GC Object cache, mapping [=struct address=]es and [=array address=]es to [=Exported GC Object=] objects.
     * The Global object cache, mapping [=global address=]es to {{Global}} objects.
-    * The Tag object cache, mapping [=tag addresses=] to {{Tag}} objects.
+    * The Tag object cache, mapping [=tag address=]es to {{Tag}} objects.
     * The Exception object cache, mapping [=exception address=]es to {{Exception}} objects.
     * The Host value cache, mapping [=host address=]es to values.
 
@@ -413,7 +408,7 @@ To validate builtins and imported string for a WebAssembly module fro
         1. Let |stringExternType| be `global const (ref extern)`.
         1. If [=match_externtype=](|stringExternType|, |importExternType|) is false, return false
     1. Else,
-        1. If [=validate an import for builtins|validating a import for builtin=] with |import| and |builtinSetNames| is false, return false.
+        1. If [=validate an import for builtins|validating an import for builtins=] with |import| and |builtinSetNames| is false, return false.
 1. Return true.
 
 
@@ -439,7 +434,7 @@ A {{Module}} object represents a single WebAssembly module. Each {{Module}} obje
 
To construct a WebAssembly module object from a module |module|, source bytes |bytes|, enabled builtins |builtinSetNames|, and |importedStringModule|, perform the following steps: - 1. Let |moduleObject| be a new {{Module}} object. + 1. Let |moduleObject| be a [=/new=] {{Module}}. 1. Set |moduleObject|.\[[Module]] to |module|. 1. Set |moduleObject|.\[[Bytes]] to |bytes|. 1. Set |moduleObject|.\[[BuiltinSets]] to |builtinSetNames|. @@ -453,8 +448,8 @@ A {{Module}} object represents a single WebAssembly module. Each {{Module}} obje 1. Let |promise| be [=a new promise=]. 1. Run the following steps [=in parallel=]: 1. [=compile a WebAssembly module|Compile the WebAssembly module=] |bytes| and store the result as |module|. - 1. [=Queue a task=] to perform the following steps. If |taskSource| was provided, queue the task on that task source. - 1. If |module| is [=error=], reject |promise| with a {{CompileError}} exception. + 1. [=Queue a task=] on |taskSource|, if provided, to perform the following steps: + 1. If |module| is [=error=], reject |promise| with a {{CompileError}} exception and return. 1. Let |builtinSetNames| be |options|["builtins"]. 1. Let |importedStringModule| be |options|["importedStringConstants"]. 1. If [=validate builtins and imported string for a WebAssembly module|validating builtins and imported strings=] for |module| with |builtinSetNames| and |importedStringModule| is false, reject |promise| with a {{CompileError}} exception. @@ -490,10 +485,10 @@ To instantiate imported strings with module |module| and |importedStr 1. If |module|.[=imports=] [=list/is empty|is not empty=], and |importObject| is undefined, throw a {{TypeError}} exception. 1. Let |builtinOrStringImports| be the ordered map « ». 1. [=list/iterate|For each=] |builtinSetName| of |builtinSetNames|, - 1. Assert: |builtinOrStringImports| does not contain |builtinSetName| + 1. Let |builtinSetQualifiedName| be |builtinSetName| prefixed with "wasm:" + 1. Assert: |builtinOrStringImports| does not contain |builtinSetQualifiedName| 1. If |builtinSetName| does not refer to a builtin set, then [=iteration/continue=]. 1. Let |exportsObject| be the result of [=instantiate a builtin set=] with |builtinSetName| - 1. Let |builtinSetQualifiedName| be |builtinSetName| prefixed with "wasm:" 1. [=map/set|Set=] |builtinOrStringImports|[|builtinSetQualifiedName|] to |exportsObject| 1. If |importedStringModule| is not null, 1. Let |exportsObject| be the result of [=instantiate imported strings=] with |module| and |importedStringModule| @@ -502,7 +497,7 @@ To instantiate imported strings with module |module| and |importedStr 1. [=list/iterate|For each=] (|moduleName|, |componentName|, |externtype|) of [=module_imports=](|module|), 1. If |builtinOrStringImports| [=map/exist|contains=] |moduleName|, 1. Let |o| be |builtinOrStringImports|[|moduleName|]. - 1. If |o| [=is not an Object=] or if |o| [=map/exist|does not contain=] |componentName|, + 1. If |o| [=is not an Object=] or if [$HasProperty$](|o|, |componentName|) is false, 1. Set |o| to [=?=] [$Get$](|importObject|, |moduleName|). 1. Else, 1. Let |o| be [=?=] [$Get$](|importObject|, |moduleName|). @@ -787,10 +782,10 @@ interface Instance {
- The Instance(|module|, |importObject|) constructor, when invoked, runs the following steps: - 1. Let |module| be |module|.\[[Module]]. - 1. Let |builtinSetNames| be |module|.\[[BuiltinSets]]. - 1. Let |importedStringModule| be |module|.\[[ImportedStringModule]]. + The Instance(|moduleObject|, |importObject|) constructor, when invoked, runs the following steps: + 1. Let |builtinSetNames| be |moduleObject|.\[[BuiltinSets]]. + 1. Let |importedStringModule| be |moduleObject|.\[[ImportedStringModule]]. + 1. Let |module| be |moduleObject|.\[[Module]]. 1. [=Read the imports=] of |module| with imports |importObject|, |builtinSetNames|, and |importedStringModule|, 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|. @@ -847,7 +842,7 @@ which can be simultaneously referenced by multiple {{Instance}} objects. Each 1. Let |buffer| be a new {{ArrayBuffer}} with the internal slots \[[ArrayBufferData]], \[[ArrayBufferByteLength]], \[[ArrayBufferMaxByteLength]], and \[[ArrayBufferDetachKey]]. 1. Set |buffer|.\[[ArrayBufferData]] to |block|. 1. Set |buffer|.\[[ArrayBufferByteLength]] to |length|. - 1. Set |buffer|.\[[ArrayBufferMaxByteLength]] is |maxsize|. + 1. Set |buffer|.\[[ArrayBufferMaxByteLength]] to |maxsize|. 1. Set |buffer|.\[[ArrayBufferDetachKey]] to "WebAssembly.Memory". 1. Return |buffer|.
@@ -925,13 +920,13 @@ which can be simultaneously referenced by multiple {{Instance}} objects. Each 1. Return [=U64ToAddressValue=](|ret|, |addrtype|). -Immediately after a WebAssembly [=memory.grow=] instruction executes, perform the following steps: +Immediately after a WebAssembly [=memory.grow=] |x| instruction executes, perform the following steps:
- 1. If the top of the stack is not [=i32.const=] (−1), + 1. If the top of the stack is not [=i32.const=] (−1) and the top of the stack is not [=i64.const=] (−1), 1. Let |frame| be the [=current frame=]. - 1. Assert: due to validation, |frame|.[=frame/module=].[=moduleinst/memaddrs=][0] exists. - 1. Let |memaddr| be the memory address |frame|.[=frame/module=].[=moduleinst/memaddrs=][0]. + 1. Assert: due to validation, |frame|.[=frame/module=].[=moduleinst/memaddrs=][|x|] exists. + 1. Let |memaddr| be the memory address |frame|.[=frame/module=].[=moduleinst/memaddrs=][|x|]. 1. [=Refresh the memory buffer=] of |memaddr|.
@@ -980,7 +975,7 @@ Immediately after a WebAssembly [=memory.grow=] instruction executes, perform th 1. Throw a {{RangeError}} exception. 1. Let |delta| be |lengthDelta| ÷ 65536. 1. [=Grow the memory buffer=] associated with |memaddr| by |delta|. - 1. Return handled. + 1. Return handled. 1. Otherwise, return unhandled. @@ -1045,13 +1040,13 @@ Each {{Table}} object has a \[[Table]] internal slot, which is a [=table address 1. If |descriptor|["address"] [=map/exists=], let |addrtype| be |descriptor|["address"]; otherwise, let |addrtype| be "i32". 1. Let |initial| be [=?=] [=AddressValueToU64=](|descriptor|["initial"], |addrtype|). 1. If |descriptor|["maximum"] [=map/exists=], let |maximum| be [=?=] [=AddressValueToU64=](|descriptor|["maximum"], |addrtype|); otherwise, let |maximum| be empty. - 1. Let |type| be the [=table type=] |addrtype| { [=limits|min=] |initial|, [=limits|max=] |maximum| } |elementType|. + 1. Let |type| be the [=table type=] |addrtype| { [=limits|min=] |initial|, [=limits|max=] |maximum| } |elementtype|. 1. If |type| is not [=valid tabletype|valid=], throw a {{RangeError}} exception. 1. If |value| is missing, 1. Let |ref| be [=DefaultValue=](|elementtype|). 1. Assert: |ref| is not [=error=]. 1. Otherwise, - 1. Let |ref| be [=?=] [=ToWebAssemblyValue=](|value|, |elementType|). + 1. Let |ref| be [=?=] [=ToWebAssemblyValue=](|value|, |elementtype|). 1. Let |store| be the [=surrounding agent=]'s [=associated store=]. 1. Let (|store|, |tableaddr|) be [=table_alloc=](|store|, |type|, |ref|). If allocation fails, throw a {{RangeError}} exception. 1. Set the [=surrounding agent=]'s [=associated store=] to |store|. @@ -1076,7 +1071,7 @@ Each {{Table}} object has a \[[Table]] internal slot, which is a [=table address Note: The above exception can happen due to either insufficient memory or an invalid size parameter. 1. Set the [=surrounding agent=]'s [=associated store=] to |result|. - 1. Return |initialSize|. + 1. Return [=U64ToAddressValue=](|initialSize|, |addrtype|).
@@ -1098,7 +1093,7 @@ Each {{Table}} object has a \[[Table]] internal slot, which is a [=table address 1. Let |index64| be [=?=] [=AddressValueToU64=](|index|, |addrtype|). 1. Let |result| be [=table_read=](|store|, |tableaddr|, |index64|). 1. If |result| is [=error=], throw a {{RangeError}} exception. - 1. Return [=ToJSValue=](|result|). + 1. Return [=!=] [=ToJSValue=](|result|).
@@ -1187,7 +1182,7 @@ which can be simultaneously referenced by multiple {{Instance}} objects. Each
The algorithm DefaultValue(|valuetype|) performs the following steps: - 1. If |valuetype| equals [=externref=], return [=ToWebAssemblyValue=](undefined, |valuetype|). + 1. If |valuetype| equals [=externref=], return [=!=] [=ToWebAssemblyValue=](undefined, |valuetype|). 1. Return [=val_default=](|valuetype|).
@@ -1201,22 +1196,22 @@ which can be simultaneously referenced by multiple {{Instance}} objects. Each 1. Let |value| be [=DefaultValue=](|valuetype|). 1. Assert: |value| is not [=error=]. 1. Otherwise, - 1. Let |value| be [=ToWebAssemblyValue=](|v|, |valuetype|). + 1. Let |value| be [=?=] [=ToWebAssemblyValue=](|v|, |valuetype|). 1. If |mutable| is true, let |globaltype| be [=var=] |valuetype|; otherwise, let |globaltype| be [=const=] |valuetype|. - 1. Let |store| be the current agent's [=associated store=]. + 1. Let |store| be the [=surrounding agent=]'s [=associated store=]. 1. Let (|store|, |globaladdr|) be [=global_alloc=](|store|, |globaltype|, |value|). - 1. Set the current agent's [=associated store=] to |store|. + 1. Set the [=surrounding agent=]'s [=associated store=] to |store|. 1. [=initialize a global object|Initialize=] **this** from |globaladdr|.
The algorithm GetGlobalValue({{Global}} |global|) performs the following steps: - 1. Let |store| be the current agent's [=associated store=]. + 1. Let |store| be the [=surrounding agent=]'s [=associated store=]. 1. Let |globaladdr| be |global|.\[[Global]]. 1. Let |globaltype| be [=global_type=](|store|, |globaladdr|). 1. If |globaltype| is of the form mut |valuetype| where |valuetype| [=matches/valtype|matches=] [=v128=] or [=exnref=], throw a {{TypeError}}. 1. Let |value| be [=global_read=](|store|, |globaladdr|). - 1. Return [=ToJSValue=](|value|). + 1. Return [=!=] [=ToJSValue=](|value|).
@@ -1224,15 +1219,15 @@ which can be simultaneously referenced by multiple {{Instance}} objects. Each 1. Return [=GetGlobalValue=](**this**). The setter of the value attribute of {{Global}}, when invoked, performs the following steps: - 1. Let |store| be the current agent's [=associated store=]. + 1. Let |store| be the [=surrounding agent=]'s [=associated store=]. 1. Let |globaladdr| be **this**.\[[Global]]. 1. Let |mut| |valuetype| be [=global_type=](|store|, |globaladdr|). 1. If |valuetype| [=matches/valtype|matches=] [=v128=] or [=exnref=], throw a {{TypeError}}. 1. If |mut| is [=const=], throw a {{TypeError}}. - 1. Let |value| be [=ToWebAssemblyValue=](**the given value**, |valuetype|). + 1. Let |value| be [=?=] [=ToWebAssemblyValue=](**the given value**, |valuetype|). 1. Let |store| be [=global_write=](|store|, |globaladdr|, |value|). 1. If |store| is [=error=], throw a {{RangeError}} exception. - 1. Set the current agent's [=associated store=] to |store|. + 1. Set the [=surrounding agent=]'s [=associated store=] to |store|.
@@ -1294,27 +1289,27 @@ This slot holds a [=function address=] relative to the [=surrounding agent=]'s [ 1. [=list/iterate|For each=] |t| of |parameters|, 1. If |argValues|'s [=list/size=] > |i|, let |arg| be |argValues|[|i|]. 1. Otherwise, let |arg| be undefined. - 1. [=list/Append=] [=ToWebAssemblyValue=](|arg|, |t|) to |args|. + 1. [=list/Append=] [=?=] [=ToWebAssemblyValue=](|arg|, |t|) to |args|. 1. Set |i| to |i| + 1. 1. Let (|store|, |ret|) be the result of [=func_invoke=](|store|, |funcaddr|, |args|). 1. Set the [=surrounding agent=]'s [=associated store=] to |store|. 1. If |ret| is [=error=], throw an exception. This exception should be a WebAssembly {{RuntimeError}} exception, unless otherwise indicated by the WebAssembly error mapping. - 1. If |ret| is [=THROW=] [=ref.exn=] |exnaddr|, then + 1. If |ret| is [=exception=] |exnaddr|, then 1. Let |tagaddr| be [=exn_tag=](|store|, |exnaddr|). 1. Let |payload| be [=exn_read=](|store|, |exnaddr|). - 1. Let |jsTagAddr| be the result of [=get the JavaScript exception tag |getting the JavaScript exception tag=]. + 1. Let |jsTagAddr| be the result of [=get the JavaScript exception tag|getting the JavaScript exception tag=]. 1. If |tagaddr| is equal to |jsTagAddr|, - 1. Throw the result of [=retrieving a host value=] from |payload|[0]. + 1. Throw [=!=] [=ToJSValue=](|payload|[0]). 1. Otherwise, 1. Let |exception| be [=create an Exception object|a new Exception=] created from |exnaddr|. 1. Throw |exception|. 1. Let |outArity| be the [=list/size=] of |ret|. 1. If |outArity| is 0, return undefined. - 1. Otherwise, if |outArity| is 1, return [=ToJSValue=](|ret|[0]). + 1. Otherwise, if |outArity| is 1, return [=!=] [=ToJSValue=](|ret|[0]). 1. Otherwise, 1. Let |values| be « ». 1. [=list/iterate|For each=] |r| of |ret|, - 1. [=list/Append=] [=ToJSValue=](|r|) to |values|. + 1. [=list/Append=] [=!=] [=ToJSValue=](|r|) to |values|. 1. Return [$CreateArrayFromList$](|values|).
@@ -1341,7 +1336,7 @@ Note: Exported Functions do not have a \[[Construct]] method and thus it is not 1. Let |wasmValues| be a new, empty [=list=]. 1. If |values|'s [=list/size=] is not |resultsSize|, throw a {{TypeError}} exception. 1. For each |value| and |resultType| in |values| and |results|, paired linearly, - 1. [=list/Append=] [=ToWebAssemblyValue=](|value|, |resultType|) to |wasmValues|. + 1. [=list/Append=] [=?=] [=ToWebAssemblyValue=](|value|, |resultType|) to |wasmValues|. 1. Return |wasmValues|. @@ -1365,12 +1360,13 @@ Note: Exported Functions do not have a \[[Construct]] method and thus it is not 1. If |v| [=implements=] {{Exception}}, 1. Let |address| be |v|.\[[Address]]. 1. Otherwise, - 1. Let |type| be the result of [=get the JavaScript exception tag |getting the JavaScript exception tag=]. + 1. Let |type| be the result of [=get the JavaScript exception tag|getting the JavaScript exception tag=]. 1. Let |payload| be [=!=] [=ToWebAssemblyValue=](|v|, [=externref=]). 1. Let (|store|, |address|) be [=exn_alloc=](|store|, |type|, « |payload| »). 1. Set the [=surrounding agent=]'s [=associated store=] to |store|. 1. Execute the WebAssembly instructions ([=ref.exn=] |address|) ([=throw_ref=]). 1. Otherwise, return |result|.\[[Value]]. + 1. Let |store| be the [=surrounding agent=]'s [=associated store=]. 1. Let (|store|, |funcaddr|) be [=func_alloc=](|store|, |functype|, |hostfunc|). 1. Set the [=surrounding agent=]'s [=associated store=] to |store|. 1. Return |funcaddr|. @@ -1386,7 +1382,7 @@ The algorithm ToJSValue(|w|) coerces a [=WebAssembly value=] to a Jav 1. Return [=ℤ=](|i64| interpreted as a [=mathematical value=]). 1. If |w| is of the form [=i32.const=] |u32|, 1. Let |i32| be [=signed_32=](|u32|). - 2. Return [=𝔽=](|i32| interpreted as a [=mathematical value=]). + 1. Return [=𝔽=](|i32| interpreted as a [=mathematical value=]). 1. If |w| is of the form [=f32.const=] |f32|, 1. If |f32| is [=+∞=] or [=−∞=], return **+∞**𝔽 or **-∞**𝔽, respectively. 1. If |f32| is [=nan=], return **NaN**. @@ -1398,7 +1394,7 @@ The algorithm ToJSValue(|w|) coerces a [=WebAssembly value=] to a Jav 1. If |w| is of the form [=ref.null=] t, return null. 1. If |w| is of the form [=ref.i31=] |u31|, 1. Let |i31| be [=signed_31=](|u31|). - 1. Let return [=𝔽=](|i31|). + 1. Return [=𝔽=](|i31|). 1. If |w| is of the form [=ref.struct=] |structaddr|, return the result of creating [=a new Exported GC Object=] from |structaddr| and "struct". 1. If |w| is of the form [=ref.array=] |arrayaddr|, return the result of creating [=a new Exported GC Object=] from |arrayaddr| and "array". 1. If |w| is of the form [=ref.func=] |funcaddr|, return the result of creating [=a new Exported Function=] from |funcaddr|. @@ -1452,21 +1448,21 @@ The algorithm ToWebAssemblyValue(|v|, |type|) coerces a JavaScript va 1. If |v| is null, 1. Let |r| be [=ref.null=] |heaptype|. 1. Else if [=match_valtype=](|type|, [=ref=] |null| [=heap-type/extern=]), - 1. Let |ref| be [=ToWebAssemblyValue=](|v|, [=ref=] [=heap-type/any=]). + 1. Let |ref| be [=!=] [=ToWebAssemblyValue=](|v|, [=ref=] [=heap-type/any=]). 1. Let |r| be [=ref.extern=] |ref|. 1. Else if |v| is an [=Exported Function=] and [=match_valtype=](|type|, [=ref=] |null| [=heap-type/func=]), 1. Let |funcaddr| be the value of |v|'s \[[FunctionAddress]] internal slot. 1. Let |r| be [=ref.func=] |funcaddr|. 1. Else if |v| [=is a Number=] and |v| is equal to [=?=] [$ToInt32$](|v|) and [=ℝ=](|v|) < 230 and [=ℝ=](|v|) ⩾ -230, - 1. Let |i31| [=?=] [$ToInt32$](|v|). - 1. Let |u31| be the unsigned integer such that |i31| is [=signed_31=](|i31|). + 1. Let |i31| be [=?=] [$ToInt32$](|v|). + 1. Let |u31| be the unsigned integer such that |i31| is [=signed_31=](|u31|). 1. Let |r| be [=ref.i31=] |u31|. 1. Else if |v| is an [=Exported GC Object=], 1. Let |objectaddr| be the value of |v|'s \[[ObjectAddress]] internal slot. 1. Let |objectkind| be the value of |v|'s \[[ObjectKind]] internal slot. 1. If |objectkind| is "array", 1. Let |r| be [=ref.array=] |objectaddr|. - 1. If |objectkind| is "struct", + 1. Else if |objectkind| is "struct", 1. Let |r| be [=ref.struct=] |objectaddr|. 1. Else, 1. Let |map| be the [=surrounding agent=]'s associated [=host value cache=]. @@ -1475,7 +1471,7 @@ The algorithm ToWebAssemblyValue(|v|, |type|) coerces a JavaScript va 1. Let [=host address=] |hostaddr| be the smallest address such that |map|[|hostaddr|] [=map/exists=] is false. 1. [=map/Set=] |map|[|hostaddr|] to |v|. 1. Let |r| be [=ref.host=] |hostaddr|. - 1. Let |store| be the current agent's [=associated store=]. + 1. Let |store| be the [=surrounding agent=]'s [=associated store=]. 1. Let |actualtype| be [=ref_type=](|store|, |r|). 1. If [=match_valtype=](|actualtype|, |type|) is false, 1. Throw a {{TypeError}}. @@ -1513,8 +1509,6 @@ The algorithm U64ToAddressValue(|v|, |addrtype|) converts a [=u64=] v

Tags

-The tag_alloc(|store|, |parameters|) algorithm creates a new [=tag address=] for |parameters| in |store| and returns the updated store and the [=tag address=]. -

Tag types

@@ -1547,7 +1541,7 @@ To create a Tag object from a [=tag address=] |tagAddress|, perform t
 1. Let |map| be the [=surrounding agent=]'s associated [=Tag object cache=].
 1. If |map|[|tagAddress|] [=map/exists=],
     1. Return |map|[|tagAddress|].
-1. Let |tag| be a [=new=] {{Tag}}.
+1. Let |tag| be a [=/new=] {{Tag}}.
 1. [=initialize a Tag object|Initialize=] |tag| from |tagAddress|.
 1. Return |tag|.
 
@@ -1559,11 +1553,11 @@ The new Tag(|type|) constructor
 
 1. Let |parameters| be |type|["parameters"].
 1. Let |wasmParameters| be «».
-1. [=list/iterate|For each=] |type| of |parameters|,
-    1. [=list/Append=] [=ToValueType=](|type|) to |wasmParameters|.
-1. Let |store| be the current agent's [=associated store=].
-1. Let (|store|, |tagAddress|) be [=tag_alloc=](|store|, |wasmParameters|).
-1. Set the current agent's [=associated store=] to |store|.
+1. [=list/iterate|For each=] |paramType| of |parameters|,
+    1. [=list/Append=] [=ToValueType=](|paramType|) to |wasmParameters|.
+1. Let |store| be the [=surrounding agent=]'s [=associated store=].
+1. Let (|store|, |tagAddress|) be [=tag_alloc=](|store|, |wasmParameters| → « »).
+1. Set the [=surrounding agent=]'s [=associated store=] to |store|.
 1. [=initialize a Tag object|Initialize=] **this** from |tagAddress|.
 
 
@@ -1656,7 +1650,7 @@ The internal methods of an [=Exported GC Object=] use the following implementati
     1. Let |map| be the [=surrounding agent=]'s associated [=exported GC object cache=].
     1. If |map|[|objectaddr|] [=map/exists=],
         1. Return |map|[|objectaddr|].
-    1. Let |object| be [=MakeBasicObject=](« \[[ObjectAddress]] »).
+    1. Let |object| be [=MakeBasicObject=](« \[[ObjectAddress]], \[[ObjectKind]] »).
     1. Set |object|.\[[ObjectAddress]] to |objectaddr|.
     1. Set |object|.\[[ObjectKind]] to |objectkind|.
     1. Set |object|.\[[GetPrototypeOf]] as specified in [=[[GetPrototypeOf]] internal method of an Exported GC Object=].
@@ -1716,7 +1710,7 @@ To create an Exception object from a [=exception address=] |exnAddres
 1. Let |map| be the [=surrounding agent=]'s associated [=Exception object cache=].
 1. If |map|[|exnAddress|] [=map/exists=],
     1. Return |map|[|exnAddress|].
-1. Let |exn| be a [=new=] {{Exception}}.
+1. Let |exn| be a [=/new=] {{Exception}}.
 1. [=initialize an Exception object|Initialize=] |exn| from |exnAddress|.
 1. Return |exn|.
 
@@ -1741,7 +1735,7 @@ constructor steps are:
     1. If |resultType| [=matches/valtype|matches=] [=v128=] or [=exnref=],
         1. Throw a {{TypeError}}.
     1. [=list/Append=] [=?=] [=ToWebAssemblyValue=](|value|, |resultType|) to |wasmPayload|.
-1. Let (|store|, |exceptionAddr|) be [=exn_alloc=](|store|, |exceptionTag|.\[[Address]], |wasmPayload|)
+1. Let (|store|, |exceptionAddr|) be [=exn_alloc=](|store|, |exceptionTag|.\[[Address]], |wasmPayload|).
 1. Set the [=surrounding agent=]'s [=associated store=] to |store|.
 1. [=initialize an Exception object|Initialize=] **this** from |exceptionAddr|.
 1. If |options|["traceStack"] is true,
@@ -1765,7 +1759,7 @@ The getArg(|exceptionTag|, |index|) method ste
 1. Let [|types|] → [] be [=tag_type=](|store|, |tagaddr|).
 1. If |types|[|index|] [=matches/valtype|matches=] [=v128=] or [=exnref=],
     1. Throw a {{TypeError}}.
-1. Return [=ToJSValue=](|payload|[|index|]).
+1. Return [=!=] [=ToJSValue=](|payload|[|index|]).
 
 
 
@@ -1802,8 +1796,8 @@ To get the JavaScript exception tag, perform the following steps:
         1. return the [=surrounding agent=]'s associated [=JavaScript exception tag=]
     1. Let |store| be the [=surrounding agent=]'s [=associated store=].
     1. Let (|store|, |tagAddress|) be [=tag_alloc=](|store|, « [=externref=] » → « »).
-    1. Set the current agent's [=associated store=] to |store|.
-    1. Set the current agent's associated [=JavaScript exception tag=] to |tagAddress|.
+    1. Set the [=surrounding agent=]'s [=associated store=] to |store|.
+    1. Set the [=surrounding agent=]'s associated [=JavaScript exception tag=] to |tagAddress|.
     1. return |tagAddress|.
 
 
@@ -1876,7 +1870,8 @@ To validate builtin set names with |builtinSetNames|, perform the fol
 To create a builtin function from type |funcType| and execution steps |steps|, perform the following steps:
 
 1. Let |hostfunc| be a [=host function=] which executes |steps| when called.
-1. Let (|store|, |funcaddr|) be [=func_alloc=](|store|, |functype|, |hostfunc|).
+1. Let |store| be the [=surrounding agent=]'s [=associated store=].
+1. Let (|store|, |funcaddr|) be [=func_alloc=](|store|, |funcType|, |hostfunc|).
 1. Set the [=surrounding agent=]'s [=associated store=] to |store|.
 1. Return |funcaddr|.
 
@@ -1889,7 +1884,7 @@ To instantiate a builtin set with name |builtinSetName|, perform the
 1. Let |builtins| be the result of [=get the builtins for a builtin set=] |builtinSetName|.
 1. Let |exportsObject| be [=!=] [$OrdinaryObjectCreate$](null).
 1. [=list/iterate|For each=] (|name|, |funcType|, |steps|) of |builtins|,
-    1. Let |funcaddr| be the result fo [=create a builtin function=] with |funcType| and |steps|.
+    1. Let |funcaddr| be the result of [=create a builtin function=] with |funcType| and |steps|.
     1. Let |func| be the result of creating [=a new Exported Function=] from |funcaddr|.
     1. Let |value| be |func|.
     1. Let |status| be [=!=] [$CreateDataProperty$](|exportsObject|, |name|, |value|).
@@ -1906,7 +1901,7 @@ To validate an import for builtins with |import|, enabled builtins |b
 1. Let |maybeBuiltin| be the result of [=find a builtin|finding a builtin=] for |import| and |builtinSetNames|.
 1. If |maybeBuiltin| is null, return true.
 1. Let |importExternType| be |import|[2].
-1. Let |builtinFuncType| be |maybeBuiltin|[0][1].
+1. Let |builtinFuncType| be |maybeBuiltin|[1][1].
 1. Let |builtinExternType| be `func |builtinFuncType|`.
 1. Return [=match_externtype=](|builtinExternType|, |importExternType|).
 
@@ -2021,7 +2016,7 @@ When this builtin is invoked with parameters |string|, |array|, and |start|, the
 1. Let |i| be 0.
 1. While |i| < |stringLength|:
     1. Let |charCode| be [$CharCodeAt$](|string|, |i|).
-    1. Set the element at index |start| + |i| in |array| to [=ToWebAssemblyValue=](|charCode|).
+    1. Set the element at index |start| + |i| in |array| to [=ToWebAssemblyValue=](|charCode|, [=i32=]).
     1. Set |i| to |i| + 1.
 1. Return |stringLength|.
 
diff --git a/document/legacy/exceptions/js-api/index.bs b/document/legacy/exceptions/js-api/index.bs
index e7db140740..6eaf8dac8b 100644
--- a/document/legacy/exceptions/js-api/index.bs
+++ b/document/legacy/exceptions/js-api/index.bs
@@ -1213,8 +1213,8 @@ The new Tag(|type|) constructor
 
 1. Let |parameters| be |type|["parameters"].
 1. Let |wasmParameters| be «».
-1. [=list/iterate|For each=] |type| of |parameters|,
-    1. [=list/Append=] [=ToValueType=](|type|) to |wasmParameters|.
+1. [=list/iterate|For each=] |paramType| of |parameters|,
+    1. [=list/Append=] [=ToValueType=](|paramType|) to |wasmParameters|.
 1. Let |store| be the current agent's [=associated store=].
 1. Let (|store|, |tagAddress|) be [=tag_alloc=](|store|, |wasmParameters|).
 1. Set the current agent's [=associated store=] to |store|.
diff --git a/document/web-api/index.bs b/document/web-api/index.bs
index 57b4211375..aa58250d5c 100644
--- a/document/web-api/index.bs
+++ b/document/web-api/index.bs
@@ -41,7 +41,7 @@ Date: now
 
-urlPrefix: https://tc39.github.io/ecma262/; spec: ECMASCRIPT
+urlPrefix: https://tc39.es/ecma262/; spec: ECMASCRIPT
     type: exception; for: ECMAScript
         text: TypeError; url: sec-native-error-types-used-in-this-standard-typeerror
     type: interface
@@ -62,7 +62,6 @@ urlPrefix: https://webassembly.github.io/spec/js-api/; spec: WASMJS
         text: WebAssemblyInstantiatedSource; url: #dictdef-webassemblyinstantiatedsource
     type: dfn
         text: compile a WebAssembly module; url: #compile-a-webassembly-module
-        text: instantiate a WebAssembly module; url: #instantiate-a-webassembly-module
         text: instantiate; url: #dom-webassembly-instantiate
         text: asynchronously compile a webassembly module; url: #asynchronously-compile-a-webassembly-module
         text: instantiate a promise of a module; url: #instantiate-a-promise-of-a-module