Skip to content

Commit ea72bf6

Browse files
Fix some review comments
1 parent 4dc2a7e commit ea72bf6

File tree

1 file changed

+8
-26
lines changed

1 file changed

+8
-26
lines changed

spec.html

+8-26
Original file line numberDiff line numberDiff line change
@@ -28507,11 +28507,11 @@ <h1>
2850728507
<emu-clause id="sec-synthetic-module-records">
2850828508
<h1>Synthetic Module Records</h1>
2850928509

28510-
<p>A <dfn variants="Synthetic Module Records">Synthetic Module Record</dfn> is used to represent information about a module that is defined by specifications. Its exported names are statically defined at creation as an argument to CreateSyntheticModule, while their corresponding values can change over time using SetSyntheticModuleExport. It has no imports or dependencies.</p>
28510+
<p>A <dfn variants="Synthetic Module Records">Synthetic Module Record</dfn> is used to represent information about a module that is defined by specifications. Its exported names are statically defined at creation, while their corresponding values can change over time using SetSyntheticModuleExport. It has no imports or dependencies.</p>
2851128511

28512-
<emu-note>A Synthetic Module Record could be used for defining a variety of module types: for example, built-in modules, or JSON modules, or CSS modules.</emu-note>
28512+
<emu-note>A Synthetic Module Record could be used for defining a variety of module types: for example, JSON modules or CSS modules.</emu-note>
2851328513

28514-
<p>In addition to the fields defined in <emu-xref href="#table-module-record-fields"></emu-xref> Synthetic Module Records have the additional fields listed in <emu-xref href="#table-synthetic-module-record-fields"></emu-xref>. Each of these fields is initially set in CreateSyntheticModule.</p>
28514+
<p>In addition to the fields defined in <emu-xref href="#table-module-record-fields"></emu-xref> Synthetic Module Records have the additional fields listed in <emu-xref href="#table-synthetic-module-record-fields"></emu-xref>.</p>
2851528515

2851628516
<emu-table id="table-synthetic-module-record-fields" caption="Additional Fields of Synthetic Module Records">
2851728517
<table>
@@ -28530,29 +28530,11 @@ <h1>Synthetic Module Records</h1>
2853028530
<tr>
2853128531
<td>[[EvaluationSteps]]</td>
2853228532
<td>an Abstract Closure</td>
28533-
<td>The initialization logic to perform upon evaluation of the module, taking the Synthetic Module Record as its sole argument. These will usually set up the exported values, by using SetSyntheticModuleExport. It must not modify [[ExportNames]]. It may return an abrupt completion.</td>
28533+
<td>The initialization logic to perform upon evaluation of the module, taking the Synthetic Module Record as its sole argument. It must not modify [[ExportNames]]. It may return an abrupt completion.</td>
2853428534
</tr>
2853528535
</table>
2853628536
</emu-table>
2853728537

28538-
<emu-clause id="sec-createsyntheticmodule" type="abstract operation">
28539-
<h1>
28540-
CreateSyntheticModule (
28541-
_exportNames_: a List of Strings without duplicates,
28542-
_evaluationSteps_: an Abstract Closure,
28543-
_realm_: a Realm Record,
28544-
): a Synthetic Module Record
28545-
</h1>
28546-
<dl class="header">
28547-
<dt>description</dt>
28548-
<dd></dd>
28549-
</dl>
28550-
28551-
<emu-alg>
28552-
1. Return the Synthetic Module Record { [[Realm]]: _realm_, [[Environment]]: ~empty~, [[Namespace]]: ~empty~, [[HostDefined]]: *undefined*, [[ExportNames]]: _exportNames_, [[EvaluationSteps]]: _evaluationSteps_ }.
28553-
</emu-alg>
28554-
</emu-clause>
28555-
2855628538
<emu-clause id="sec-create-default-export-synthetic-module" type="abstract operation">
2855728539
<h1>
2855828540
CreateDefaultExportSyntheticModule (
@@ -28567,7 +28549,7 @@ <h1>
2856728549
1. Let _realm_ be the current Realm Record.
2856828550
1. Let _setDefaultExport_ be a new Abstract Closure with parameters (_module_) that captures _defaultExport_ and performs the following steps when called:
2856928551
1. Perform SetSyntheticModuleExport(_module_, *"default"*, _defaultExport_).
28570-
1. Return CreateSyntheticModule(« *"default"* », _setDefaultExport_, _realm_).
28552+
1. Return the Synthetic Module Record { [[Realm]]: _realm_, [[Environment]]: ~empty~, [[Namespace]]: ~empty~, [[HostDefined]]: *undefined*, [[ExportNames]]: « *"default"* », [[EvaluationSteps]]: _setDefaultExport_ }.
2857128553
</emu-alg>
2857228554
</emu-clause>
2857328555

@@ -28598,7 +28580,7 @@ <h1>
2859828580
</h1>
2859928581
<dl class="header">
2860028582
<dt>description</dt>
28601-
<dd>It can be used to set or change the exported value for a pre-established export of a Synthetic Module Record.</dd>
28583+
<dd>It can be used to set or change the exported value for an existing export of a Synthetic Module Record.</dd>
2860228584
</dl>
2860328585

2860428586
<emu-alg>
@@ -28763,7 +28745,7 @@ <h1>
2876328745
<p>and it performs FinishLoadingImportedModule(_referrer_, _moduleRequest_, _payload_, _result_) where _result_ is a normal completion, then it must perform FinishLoadingImportedModule(_referrer_, _moduleRequest_, _payload_, _result_) with the same _result_ each time.</p>
2876428746
</li>
2876528747
<li>
28766-
<p>If _moduleRequest_.[[Attributes]] has an entry _entry_ such that _entry_.[[Key]] is *"type"* and _entry_.[[Value]] is *"json"*, the host environment must perform FinishLoadingImportedModule(_referrer_, _moduleRequest_, _payload_, _result_), where _result_ is either the Completion Record returned by an invokation of ParseJSONModule or a throw completion.</p>
28748+
<p>If _moduleRequest_.[[Attributes]] has an entry _entry_ such that _entry_.[[Key]] is *"type"* and _entry_.[[Value]] is *"json"*, the host environment must perform FinishLoadingImportedModule(_referrer_, _moduleRequest_, _payload_, _result_), where _result_ is either the Completion Record returned by an invocation of ParseJSONModule or a throw completion.</p>
2876728749
</li>
2876828750
<li>
2876928751
The operation must treat _payload_ as an opaque value to be passed through to FinishLoadingImportedModule.
@@ -28773,7 +28755,7 @@ <h1>
2877328755
<p>The actual process performed is host-defined, but typically consists of performing whatever I/O operations are necessary to load the appropriate Module Record. Multiple different (_referrer_, _moduleRequest_.[[Specifier]], _moduleRequest_.[[Attributes]]) triples may map to the same Module Record instance. The actual mapping semantics is host-defined but typically a normalization process is applied to _specifier_ as part of the mapping process. A typical normalization process would include actions such as expansion of relative and abbreviated path specifiers.</p>
2877428756

2877528757
<emu-note>
28776-
<p>The above text implies that hosts *must* support JSON modules imported with `type: "json"` (if it completes normally), but it doesn't prohibit hosts from supporting JSON modules imported with no type specified.</p>
28758+
<p>The above text requires that hosts support JSON modules when imported with `type: "json"` (and HostLoadImportedModule completes normally), but it does not prohibit hosts from supporting JSON modules when imported without `type: "json"`.</p>
2877728759
</emu-note>
2877828760
</emu-clause>
2877928761

0 commit comments

Comments
 (0)