Skip to content

Commit

Permalink
add SourcesEqual concrete method
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Nov 19, 2024
1 parent 1b2eef4 commit 7058874
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions spec.emu
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,15 @@ contributors: Luca Casonato, Guy Bedford
<p>For Module Records that do not have a source representation, GetModuleSource() must always return a throw completion whose [[Value]] is a *ReferenceError*.</p>
</td>
</tr>
<tr>
<td>
<ins>SourcesEqual(_otherModuleRecord_)</ins>
</td>
<td>
<p><ins>For Module Records that implement a normal completion for GetModuleSource(), allows defining a source equality operation for host registry checks.</ins></p>
<p><ins>For Module Records that do not have a source representation, SourcesEqual() is never called.</ins></p>
</td>
</tr>
<tr>
<td>
<ins>GetModuleSourceName()</ins>
Expand Down Expand Up @@ -1266,6 +1275,28 @@ contributors: Luca Casonato, Guy Bedford
</emu-alg>
</emu-clause>

<emu-clause id="sec-source-text-module-record-sourceequals" type="concrete method">
<h1>
<ins>
SourcesEqual (
_moduleA_: a Module Record
): a Boolean
</ins>
</h1>
<dl class="header">
<dt>for</dt>
<dd>a Source Text Module Record _module_</dd>

<dt>description</dt>
<dd>Checks module source equality (not module instance equality) of this module record against another module record</dd>
</dl>
<emu-alg>
1. <ins>If _otherModule_ is not a Source Text Module Record, return *false*.</ins>
1. <ins>If _otherModule_.[[SourceText]] is equal to _module_.[[SourceText]], return *true*.</ins>
1. <ins>Return *false*.</ins>
</emu-alg>
</emu-clause>

<emu-clause id="sec-source-text-module-record-getmodulesourcename" type="concrete method">
<h1>
<ins>
Expand Down

0 comments on commit 7058874

Please sign in to comment.