Skip to content

Commit fa3da3b

Browse files
committed
clarify resolution
1 parent 447b95d commit fa3da3b

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

document/js-api/index.bs

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@ urlPrefix: https://tc39.github.io/ecma262/; spec: ECMASCRIPT
7979
text: CreateArrayFromList; url: sec-createarrayfromlist
8080
text: Cyclic Module Record; url: cyclic-module-record
8181
text: GetMethod; url: sec-getmethod
82-
text: ToBigInt64; url: #sec-tobigint64
83-
text: Module Namespace exotic object; url: #sec-module-namespace-exotic-objects
82+
text: ToBigInt64; url: sec-tobigint64
83+
text: Module Namespace exotic object; url: sec-module-namespace-exotic-objects
84+
text: ResolvedBinding Record; url: resolvedbinding-record
8485
type: abstract-op
8586
text: CreateDataPropertyOrThrow; url: sec-createdatapropertyorthrow
8687
text: CreateMethodProperty; url: sec-createmethodproperty
@@ -1488,21 +1489,24 @@ WebAssembly Module Records have the following methods:
14881489
1. [=list/iterate|For each=] (|importedModuleName|, |name|, |importtype|) in [=module_imports=](|module|),
14891490
1. Let |importedModule| be [$GetImportedModule$](|record|, |importedModuleName|).
14901491
1. Let |resolution| be |importedModule|.ResolveExport(|name|).
1491-
1. If |resolution|.\[[Module]] is a WebAssembly Module Record,
1492-
1. Let |resolutionInstance| be |resolution|.\[[Module]].\[[Instance]].
1493-
1. If |resolutionInstance| is ~empty~ then,
1492+
1. Assert: |resolution| is a [=ResolvedBinding Record=], as validated during environment initialization.
1493+
1. Let |resolvedModule| be |resolution|.\\[[Module]].
1494+
1. Let |resolvedName| be |resolution|.\[[BindingName]].
1495+
1. If |resolvedModule| is a WebAssembly Module Record,
1496+
1. If |resolvedModule|.\[[Instance]] is ~empty~ then,
14941497
1. Throw a {LinkError} exception.
1495-
1. Let |resolutionModule| be |resolution|.\[[Module]].\[[ModuleSource]].\[[Module]].
1496-
1. Let |resolutionName| be |resolution|.\[[BindingName]].
1497-
1. Let |externval| be [=instance_export=](|resolutionInstance|, |resolutionName|).
1498+
1. Assert: |resolvedModule|.\[[Instance]] is a WebAssembly {{Instance}} object.
1499+
1. Assert: |resolvedModule|.\[[ModuleSource]] is a WebAssembly {{Module}} object.
1500+
1. Let |module| be |resolvedModule|.\[[ModuleSource]].\[[Module]].
1501+
1. Let |externval| be [=instance_export=](|resolvedModule|.\[[Instance]], |resolvedName|).
14981502
1. Assert: |externval| is not [=error=].
1499-
1. Assert: [=module_exports=](|resolutionModule|) contains an element (|resolutionName|, <var ignore>type</var>).
1500-
1. Let |externtype| be the value of |type| for the element (|resolutionName|, |type|) in [=module_exports=](|resolutionModule|).
1503+
1. Assert: [=module_exports=](|module|) contains an element (|resolvedName|, <var ignore>type</var>).
1504+
1. Let |externtype| be the value of |type| for the element (|resolvedName|, |type|) in [=module_exports=](|module|).
15011505
1. If |importtype| is not an [=extern subtype=] of |externtype|, throw a {{LinkError}} exception.
15021506
1. [=list/Append=] |externval| to |imports|.
15031507
1. Otherwise,
1504-
1. Let |env| be |resolution|.\[[Module]].\[[Environment]].
1505-
1. Let |v| be [=?=] |env|.GetBindingValue(|resolution|.\[[BindingName]], true).
1508+
1. Let |env| be |resolvedModule|.\[[Environment]].
1509+
1. Let |v| be [=?=] |env|.GetBindingValue(|resolvedName|, true).
15061510
1. If |importtype| is of the form [=func=] |functype|,
15071511
1. If [$IsCallable$](|v|) is false, throw a {{LinkError}} exception.
15081512
1. If |v| has a \[[FunctionAddress]] internal slot, and therefore is an [=Exported Function=],

0 commit comments

Comments
 (0)