@@ -1507,10 +1507,10 @@ WebAssembly Module Records have the following methods:
1507
1507
1. If |v| [=implements=] {{Global}} ,
1508
1508
1. Let |globaladdr| be |v|.\[[Global]] .
1509
1509
1. Let |targetmut| <var ignore> valuetype</var> be [=global_type=] (|store|, |globaladdr|).
1510
- 1. If |mut| is [=const=] and |targetmut| is [=var=] , throw a {{TypeError}} .
1510
+ 1. If |mut| is [=const=] and |targetmut| is [=var=] , throw a {{LinkError}} exception .
1511
1511
1. Otherwise,
1512
1512
1. If |valtype| is [=v128=] , throw a {{LinkError}} exception.
1513
- 1. If |mut| is [=var=] , throw a {{TypeError}} .
1513
+ 1. If |mut| is [=var=] , throw a {{LinkError}} exception .
1514
1514
1. Let |value| be [=?=] [=ToWebAssemblyValue=] (|v|, |valtype|).
1515
1515
1. Let (|store|, |globaladdr|) be [=global_alloc=] (|store|, |mut| |valtype|, |value|).
1516
1516
1. Set the [=surrounding agent=] 's [=associated store=] to |store|.
@@ -1543,6 +1543,11 @@ WebAssembly Module Records have the following methods:
1543
1543
1. Otherwise,
1544
1544
1. Perform ! |record|.\[[Environment]] .InitializeBinding(|name|, ! Get(|instance|.\[[Exports]] , |name|)).
1545
1545
1546
+ Note: The linking semantics here for Wasm to Wasm modules are identical to the WebAssembly JS API semantics as if passing the
1547
+ the exports object as the imports object in instantiation. When linking Wasm module imports to JS module exports, the JS API semantics
1548
+ are exactly followed as well. It is only in the case of importing Wasm from JS that WebAssembly.Global unwrapping is observable on the
1549
+ WebAssembly Module Record Environment Record.
1550
+
1546
1551
</div>
1547
1552
1548
1553
<h3 id="hostgetmodulesourcemodulerecord">HostGetModuleSourceModuleRecord ( |specifier| )</h3>
0 commit comments