Skip to content

Commit

Permalink
Assert no bad cycles, instead of throwing
Browse files Browse the repository at this point in the history
  • Loading branch information
domenic committed May 30, 2017
1 parent 2efb2f6 commit fb1a616
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -21076,8 +21076,13 @@ <h1>Abstract Module Records</h1>
<!-- es6num="15.2.1.16" -->
<emu-clause id="sec-source-text-module-records">
<h1>Source Text Module Records</h1>

<p>A <dfn>Source Text Module Record</dfn> is used to represent information about a module that was defined from ECMAScript source text (10) that was parsed using the goal symbol |Module|. Its fields contain digested information about the names that are imported by the module and its concrete methods use this digest to link, instantiate, and evaluate the module.</p>

<p>A Source Text Module Record can exist in a module graph with other subclasses of the abstract Module Record type. However, non-source text Module Records must not participate in dependency cycles with Source Text Module Records. Concretely, this is enforced below by assertions that non-source text Module Record dependencies do not have a [[Status]] of `"instantiating"` or `"evaluating"` during a call to ModuleDeclarationInstantiation() or ModuleEvaluation() on a Source Text Module Record.</p>

<p>In addition to the fields, defined in <emu-xref href="#table-36"></emu-xref>, Source Text Module Records have the additional fields listed in <emu-xref href="#table-38"></emu-xref>. Each of these fields initially has the value *undefined*.</p>

<emu-table id="table-38" caption="Additional Fields of Source Text Module Records">
<table>
<tbody>
Expand Down Expand Up @@ -21701,8 +21706,8 @@ <h1>Runtime Semantics: InnerModuleDeclarationInstantiation( _module_, _stack_, _
<p>The InnerModuleDeclarationInstantiation abstract operation performs the following steps:</p>
<emu-alg>
1. If _module_ is not a Source Text Module Record,
1. If _module_.[[Status]] is `"instantiating"`, throw a *TypeError* exception.
1. Otherwise, return _module_.ModuleDeclarationInstantiation().
1. Assert: _module_.[[Status]] is not `"instantiating"`.
1. Return _module_.ModuleDeclarationInstantiation().
1. If _module_.[[Status]] is `"instantiating"`, `"instantiated"`, or `"evaluated"`,
1. Return *undefined*.
1. If _module_.[[Status]] is `"errored"`,
Expand Down Expand Up @@ -21803,8 +21808,8 @@ <h1>Runtime Semantics: InnerModuleEvaluation( _module_, _stack_, _index_ )</h1>
<p>The InnerModuleEvaluation abstract operation performs the following steps:</p>
<emu-alg>
1. If _module_ is not a Source Text Module Record,
1. If _module_.[[Status]] is `"evaluating"`, throw a *TypeError* exception.
1. Otherwise, return _module_.ModuleEvaluation().
1. Assert: _module_.[[Status]] is not `"evaluating"`.
1. Return _module_.ModuleEvaluation().
1. If _module_.[[Status]] is `"evaluating"` or `"evaluated"`,
1. Return *undefined*.
1. If _module_.[[Status]] is `"errored"`,
Expand Down

0 comments on commit fb1a616

Please sign in to comment.