You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Editorial: Replace [[DFSIndex]] with a local variable (#3625)
The [[DFSIndex]] field of module records is only ever read by `InnerModule*`
algorithms, and only on the same module that the algorithm is called on.
There is no need to have it as a field on the module record, and removing it
helps by having on less piece of potentially mutable state to keep track
of while reading the algorithms.
A throw completion representing the exception that occurred during evaluation. *undefined* if no exception occurred or if [[Status]] is not ~evaluated~.
26827
26827
</td>
26828
26828
</tr>
26829
-
<tr>
26830
-
<td>
26831
-
[[DFSIndex]]
26832
-
</td>
26833
-
<td>
26834
-
an integer or ~empty~
26835
-
</td>
26836
-
<td>
26837
-
Auxiliary field used during Link and Evaluate only. If [[Status]] is either ~linking~ or ~evaluating~, this non-negative number records the point at which the module was first visited during the depth-first traversal of the dependency graph.
Auxiliary field used during Link and Evaluate only. If [[Status]] is either ~linking~ or ~evaluating~, this is either the module's own [[DFSIndex]] or that of an "earlier" module in the same strongly connected component.
26837
+
Auxiliary field used during Link and Evaluate only. If [[Status]] is either ~linking~ or ~evaluating~, this is either the module's depth-first traversal index or that of an "earlier" module in the same strongly connected component.
The first visited module of the cycle, the root DFS ancestor of the strongly connected component. For a module not in a cycle, this would be the module itself. Once Evaluate has completed, a module's [[DFSAncestorIndex]] is the [[DFSIndex]] of its [[CycleRoot]].
26870
+
The first visited module of the cycle, the root DFS ancestor of the strongly connected component. For a module not in a cycle, this would be the module itself. Once Evaluate has completed, a module's [[DFSAncestorIndex]] is the depth-first traversal index of its [[CycleRoot]].
26882
26871
</td>
26883
26872
</tr>
26884
26873
<tr>
@@ -27174,7 +27163,7 @@ <h1>
27174
27163
</h1>
27175
27164
<dl class="header">
27176
27165
<dt>description</dt>
27177
-
<dd>It is used by Link to perform the actual linking process for _module_, as well as recursively on all other modules in the dependency graph. The _stack_ and _index_ parameters, as well as a module's [[DFSIndex]] and [[DFSAncestorIndex]] fields, keep track of the depth-first search (DFS) traversal. In particular, [[DFSAncestorIndex]] is used to discover strongly connected components (SCCs), such that all modules in an SCC transition to ~linked~ together.</dd>
27166
+
<dd>It is used by Link to perform the actual linking process for _module_, as well as recursively on all other modules in the dependency graph. The _stack_ and _index_ parameters, as well as a module's [[DFSAncestorIndex]] field, keep track of the depth-first search (DFS) traversal. In particular, [[DFSAncestorIndex]] is used to discover strongly connected components (SCCs), such that all modules in an SCC transition to ~linked~ together.</dd>
27178
27167
</dl>
27179
27168
27180
27169
<emu-alg>
@@ -27185,7 +27174,7 @@ <h1>
27185
27174
1. Return _index_.
27186
27175
1. Assert: _module_.[[Status]] is ~unlinked~.
27187
27176
1. Set _module_.[[Status]] to ~linking~.
27188
-
1. Set _module_.[[DFSIndex]] to _index_.
27177
+
1. Let _moduleIndex_ be _index_.
27189
27178
1. Set _module_.[[DFSAncestorIndex]] to _index_.
27190
27179
1. Set _index_ to _index_ + 1.
27191
27180
1. Append _module_ to _stack_.
@@ -27199,8 +27188,8 @@ <h1>
27199
27188
1. Set _module_.[[DFSAncestorIndex]] to min(_module_.[[DFSAncestorIndex]], _requiredModule_.[[DFSAncestorIndex]]).
27200
27189
1. Perform ? _module_.InitializeEnvironment().
27201
27190
1. Assert: _module_ occurs exactly once in _stack_.
1. If _module_.[[DFSAncestorIndex]] = _moduleIndex_, then
27204
27193
1. Let _done_ be *false*.
27205
27194
1. Repeat, while _done_ is *false*,
27206
27195
1. Let _requiredModule_ be the last element of _stack_.
@@ -27263,7 +27252,7 @@ <h1>
27263
27252
</h1>
27264
27253
<dl class="header">
27265
27254
<dt>description</dt>
27266
-
<dd>It is used by Evaluate to perform the actual evaluation process for _module_, as well as recursively on all other modules in the dependency graph. The _stack_ and _index_ parameters, as well as _module_'s [[DFSIndex]] and [[DFSAncestorIndex]] fields, are used the same way as in InnerModuleLinking.</dd>
27255
+
<dd>It is used by Evaluate to perform the actual evaluation process for _module_, as well as recursively on all other modules in the dependency graph. The _stack_ and _index_ parameters, as well as _module_'s [[DFSAncestorIndex]] field, are used the same way as in InnerModuleLinking.</dd>
27267
27256
</dl>
27268
27257
27269
27258
<emu-alg>
@@ -27276,7 +27265,7 @@ <h1>
27276
27265
1. If _module_.[[Status]] is ~evaluating~, return _index_.
27277
27266
1. Assert: _module_.[[Status]] is ~linked~.
27278
27267
1. Set _module_.[[Status]] to ~evaluating~.
27279
-
1. Set _module_.[[DFSIndex]] to _index_.
27268
+
1. Let _moduleIndex_ be _index_.
27280
27269
1. Set _module_.[[DFSAncestorIndex]] to _index_.
27281
27270
1. Set _module_.[[PendingAsyncDependencies]] to 0.
<p>An implementation may parse module source text and analyse it for Early Error conditions prior to the evaluation of ParseModule for that module source text. However, the reporting of any errors must be deferred until the point where this specification actually performs ParseModule upon that source text.</p>
0 commit comments