diff --git a/spec.html b/spec.html
index 0cbff57..1045243 100644
--- a/spec.html
+++ b/spec.html
@@ -258,6 +258,17 @@
[[Async]]
@@ -420,7 +431,7 @@ Evaluate ( ) Concrete Method
1. Let _module_ be this Cyclic Module Record.
1. Assert: _module_.[[Status]] is `"linked"`, `"evaluating-async"`, or `"evaluated"`.
- 1. If _module_.[[Status]] is `"evaluated"` or `"evaluating-async"`, set _module_ to GetCycleRoot(_module_).
+ 1. If _module_.[[Status]] is `"evaluated"` or `"evaluating-async"`, set _module_ to _module_.[[CycleRoot]].
1. If _module_.[[TopLevelCapability]] is not *undefined*, then
1. Return _module_.[[TopLevelCapability]].
1. Let _stack_ be a new empty List.
@@ -475,7 +486,7 @@ InnerModuleEvaluation( _module_, _stack_, _index_ )
1. Assert: _requiredModule_.[[Status]] is `"evaluating"` if and only if _requiredModule_ is in _stack_.
1. If _requiredModule_.[[Status]] is `"evaluating"`, then
1. Set _module_.[[DFSAncestorIndex]] to min(_module_.[[DFSAncestorIndex]], _requiredModule_.[[DFSAncestorIndex]]).
- 1. Otherwise, set _requiredModule_ to GetCycleRoot(_requiredModule_).
+ 1. Otherwise, set _requiredModule_ to _requiredModule_.[[CycleRoot]].
1. If _requiredModule_.[[EvaluationError]] is not *undefined*, return _module_.[[EvaluationError]].
1. If _cycle_ is *false* and _requiredModule_.[[Status]] is not `"evaluated"`,
1. If either _requiredModule_.[[Async]] is *true*, or _requiredModule_.[[PendingAsyncDependencies]] is not 0, then
@@ -488,6 +499,7 @@ InnerModuleEvaluation( _module_, _stack_, _index_ )
1. Assert: _module_ occurs exactly once in _stack_.
1. Assert: _module_.[[DFSAncestorIndex]] is less than or equal to _module_.[[DFSIndex]].
1. If _module_.[[DFSAncestorIndex]] equals _module_.[[DFSIndex]], then
+ 1. Let _cycleRoot_ be _module_.
1. Let _done_ be *false*.
1. Repeat, while _done_ is *false*,
1. Let _requiredModule_ be the last element in _stack_.
@@ -497,13 +509,14 @@ InnerModuleEvaluation( _module_, _stack_, _index_ )
1. Set _requiredModule_.[[Status]] to `"evaluating-async"`.
1. Otherwise, set _requiredModule_.[[Status]] to `"evaluated"`.
1. If _requiredModule_ and _module_ are the same Module Record, set _done_ to *true*.
+ 1. Set _requiredModule_.[[CycleRoot]] to _cycleRoot_.
1. Return _index_.
A module is `"evaluating"` while it is being traversed by InnerModuleEvaluation. A module is `"evaluated"` on execution completion, and `"evaluating-async"` during execution if it is an asynchronous module.
- Any modules depending on a module of an async cycle when that cycle is not `"evaluating"` will instead depend on the execution of the root of the cycle via GetCycleRoot. This ensures that the cycle state can be treated as a single strongly connected component through its root module state.
+ Any modules depending on a module of an async cycle when that cycle is not `"evaluating"` will instead depend on the execution of the root of the cycle via [[CycleRoot]]. This ensures that the cycle state can be treated as a single strongly connected component through its root module state.
@@ -547,20 +560,6 @@ ExecuteCyclicModule ( _module_ )
-
- GetCycleRoot ( _module_ )
-
- 1. Assert: _module_.[[Status]] is `"evaluating-async"` or `"evaluated"`.
- 1. Repeat, while _module_.[[DFSIndex]] is greater than _module_.[[DFSAncestorIndex]],
- 1. Assert: _module_.[[AsyncParentModules]] is a non-empty List.
- 1. Let _nextCycleModule_ be the first element of _module_.[[AsyncParentModules]].
- 1. Assert: _nextCycleModule_.[[DFSAncestorIndex]] is equal to _module_.[[DFSAncestorIndex]].
- 1. Set _module_ to _nextCycleModule_.
- 1. Assert: _module_.[[DFSIndex]] is equal to _module_.[[DFSAncestorIndex]].
- 1. Return _module_.
-
-
-
CyclicModuleExecutionFulfilled ( _module_ )
@@ -577,8 +576,7 @@ CyclicModuleExecutionFulfilled ( _module_ )
1. Decrement _m_.[[PendingAsyncDependencies]] by 1.
1. If _m_.[[PendingAsyncDependencies]] is 0 and _m_.[[EvaluationError]] is *undefined*, then
1. Assert: _m_.[[Status]] is `"evaluating-async"`.
- 1. Let _cycleRoot_ be ! GetCycleRoot(_m_).
- 1. If _cycleRoot_.[[EvaluationError]] is not *undefined*, return *undefined*.
+ 1. If _m_.[[CycleRoot]].[[EvaluationError]] is not *undefined*, return *undefined*.
1. Perform ! ExecuteCyclicModule(_m_).
1. If _module_.[[TopLevelCapability]] is not *undefined*, then
1. Assert: _module_.[[DFSIndex]] is equal to _module_.[[DFSAncestorIndex]].
@@ -645,7 +643,7 @@ ParseModule ( _sourceText_, _realm_, _hostDefined_ )
1. Else,
1. Append _ee_ to _indirectExportEntries_.
1. Let _async_ be _body_ Contains |AwaitExpression|.
- 1. Return Source Text Module Record { [[Realm]]: _realm_, [[Environment]]: *undefined*, [[Namespace]]: *undefined*, [[Async]]: _async_, [[TopLevelCapability]]: *undefined*, [[AsyncParentModules]]: *undefined*, [[PendingAsyncDependencies]]: *undefined*, [[Status]]: `"unlinked"`, [[EvaluationError]]: *undefined*, [[HostDefined]]: _hostDefined_, [[ECMAScriptCode]]: _body_, [[RequestedModules]]: _requestedModules_, [[ImportEntries]]: _importEntries_, [[LocalExportEntries]]: _localExportEntries_, [[IndirectExportEntries]]: _indirectExportEntries_, [[StarExportEntries]]: _starExportEntries_, [[DFSIndex]]: *undefined*, [[DFSAncestorIndex]]: *undefined* }.
+ 1. Return Source Text Module Record { [[Realm]]: _realm_, [[Environment]]: *undefined*, [[Namespace]]: *undefined*, [[CycleRoot]]: *undefined*, [[Async]]: _async_, [[TopLevelCapability]]: *undefined*, [[AsyncParentModules]]: *undefined*, [[PendingAsyncDependencies]]: *undefined*, [[Status]]: `"unlinked"`, [[EvaluationError]]: *undefined*, [[HostDefined]]: _hostDefined_, [[ECMAScriptCode]]: _body_, [[RequestedModules]]: _requestedModules_, [[ImportEntries]]: _importEntries_, [[LocalExportEntries]]: _localExportEntries_, [[IndirectExportEntries]]: _indirectExportEntries_, [[StarExportEntries]]: _starExportEntries_, [[DFSIndex]]: *undefined*, [[DFSAncestorIndex]]: *undefined* }.
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.
|