Skip to content
This repository was archived by the owner on Mar 25, 2026. It is now read-only.

Commit abca602

Browse files
Add missing Completion(...) annotations
1 parent 2696327 commit abca602

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2703,7 +2703,7 @@ <h1><span class="secnum">13.3.10.1</span> Runtime Semantics: Evaluation</h1>
27032703
<emu-clause id="sec-evaluate-import-call" type="abstract operation" aoid="EvaluateImportCall">
27042704
<h1><span class="secnum">13.3.10.2</span> <ins>EvaluateImportCall ( <var>specifierExpression</var> [ , <var>optionsExpression</var> ] )</ins></h1>
27052705
<p>The abstract operation EvaluateImportCall takes argument <var>specifierExpression</var> (a ParseNode) and optional argument <var>optionsExpression</var> (a ParseNode) and returns a Promise. It performs the following steps when called:</p>
2706-
<emu-alg><ol><li>Let <var>referrer</var> be <emu-xref aoid="GetActiveScriptOrModule"><a href="https://tc39.es/ecma262/#sec-getactivescriptormodule">GetActiveScriptOrModule</a></emu-xref>().</li><li>If <var>referrer</var> is <emu-val>null</emu-val>, set <var>referrer</var> to <emu-xref href="#current-realm"><a href="https://tc39.es/ecma262/#current-realm">the current Realm Record</a></emu-xref>.</li><li>Let <var>referencingScriptOrModule</var> be !&nbsp;<emu-xref aoid="GetActiveScriptOrModule"><a href="https://tc39.es/ecma262/#sec-getactivescriptormodule">GetActiveScriptOrModule</a></emu-xref>().</li><li>Let <var>specifierRef</var> be the result of evaluating <var>specifierExpression</var>.</li><li>Let <var>specifier</var> be ?&nbsp;<emu-xref aoid="GetValue"><a href="https://tc39.es/ecma262/#sec-getvalue">GetValue</a></emu-xref>(<var>specifierRef</var>).</li><li>If <var>optionsExpression</var> is present, then<ol><li>Let <var>optionsRef</var> be the result of evaluating <var>optionsExpression</var>.</li><li>Let <var>options</var> be ?&nbsp;<emu-xref aoid="GetValue"><a href="https://tc39.es/ecma262/#sec-getvalue">GetValue</a></emu-xref>(<var>optionsRef</var>).</li></ol></li><li>Else,<ol><li>Let <var>options</var> be <emu-val>undefined</emu-val>.</li></ol></li><li>Let <var>promiseCapability</var> be !&nbsp;<emu-xref aoid="NewPromiseCapability"><a href="https://tc39.es/ecma262/#sec-newpromisecapability">NewPromiseCapability</a></emu-xref>(<emu-xref href="#sec-promise-constructor"><a href="https://tc39.es/ecma262/#sec-promise-constructor">%Promise%</a></emu-xref>).</li><li>Let <var>specifierString</var> be <emu-xref aoid="ToString"><a href="https://tc39.es/ecma262/#sec-tostring">ToString</a></emu-xref>(<var>specifier</var>).</li><li><emu-xref aoid="IfAbruptRejectPromise"><a href="https://tc39.es/ecma262/#sec-ifabruptrejectpromise">IfAbruptRejectPromise</a></emu-xref>(<var>specifierString</var>, <var>promiseCapability</var>).</li><li>Let <var>assertions</var> be a new empty <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref>.</li><li>If <var>options</var> is not <emu-val>undefined</emu-val>, then<ol><li>If <emu-xref aoid="Type"><a href="https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values">Type</a></emu-xref>(<var>options</var>) is not Object,<ol><li>Perform !&nbsp;<emu-xref aoid="Call"><a href="https://tc39.es/ecma262/#sec-call">Call</a></emu-xref>(<var>promiseCapability</var>.<var class="field">[[Reject]]</var>, <emu-val>undefined</emu-val>, « a newly created <emu-val>TypeError</emu-val> object »).</li><li>Return <var>promiseCapability</var>.<var class="field">[[Promise]]</var>.</li></ol></li><li>Let <var>assertionsObj</var> be <emu-xref aoid="Get"><a href="https://tc39.es/ecma262/#sec-get-o-p">Get</a></emu-xref>(<var>options</var>, <emu-val>"assert"</emu-val>).</li><li><emu-xref aoid="IfAbruptRejectPromise"><a href="https://tc39.es/ecma262/#sec-ifabruptrejectpromise">IfAbruptRejectPromise</a></emu-xref>(<var>assertionsObj</var>, <var>promiseCapability</var>).</li><li>If <var>assertionsObj</var> is not <emu-val>undefined</emu-val>,<ol><li>If <emu-xref aoid="Type"><a href="https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values">Type</a></emu-xref>(<var>assertionsObj</var>) is not Object,<ol><li>Perform !&nbsp;<emu-xref aoid="Call"><a href="https://tc39.es/ecma262/#sec-call">Call</a></emu-xref>(<var>promiseCapability</var>.<var class="field">[[Reject]]</var>, <emu-val>undefined</emu-val>, « a newly created <emu-val>TypeError</emu-val> object »).</li><li>Return <var>promiseCapability</var>.<var class="field">[[Promise]]</var>.</li></ol></li><li>Let <var>keys</var> be EnumerableOwnPropertyNames(<var>assertionsObj</var>, <emu-const>key</emu-const>).</li><li><emu-xref aoid="IfAbruptRejectPromise"><a href="https://tc39.es/ecma262/#sec-ifabruptrejectpromise">IfAbruptRejectPromise</a></emu-xref>(<var>keys</var>, <var>promiseCapability</var>).</li><li>Let <var>supportedAssertions</var> be !&nbsp;<emu-xref aoid="HostGetSupportedImportAssertions" id="_ref_6"><a href="#sec-hostgetsupportedimportassertions">HostGetSupportedImportAssertions</a></emu-xref>().</li><li>For each String <var>key</var> of <var>keys</var>,<ol><li>Let <var>value</var> be <emu-xref aoid="Get"><a href="https://tc39.es/ecma262/#sec-get-o-p">Get</a></emu-xref>(<var>assertionsObj</var>, <var>key</var>).</li><li><emu-xref aoid="IfAbruptRejectPromise"><a href="https://tc39.es/ecma262/#sec-ifabruptrejectpromise">IfAbruptRejectPromise</a></emu-xref>(<var>value</var>, <var>promiseCapability</var>).</li><li>If <emu-xref aoid="Type"><a href="https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values">Type</a></emu-xref>(<var>value</var>) is not String, then<ol><li>Perform !&nbsp;<emu-xref aoid="Call"><a href="https://tc39.es/ecma262/#sec-call">Call</a></emu-xref>(<var>promiseCapability</var>.<var class="field">[[Reject]]</var>, <emu-val>undefined</emu-val>, « a newly created <emu-val>TypeError</emu-val> object »).</li><li>Return <var>promiseCapability</var>.<var class="field">[[Promise]]</var>.</li></ol></li><li>If <var>supportedAssertions</var> contains <var>key</var>, then<ol><li>Append the <emu-xref href="#importassertion-record" id="_ref_7"><a href="#importassertion-record">ImportAssertion Record</a></emu-xref> { <var class="field">[[Key]]</var>: <var>key</var>, <var class="field">[[Value]]</var>: <var>value</var> } to <var>assertions</var>.</li></ol></li></ol></li></ol></li><li>Sort <var>assertions</var> by the code point order of the <var class="field">[[Key]]</var> of each element. NOTE: This sorting is observable only in that <emu-xref href="#host"><a href="https://tc39.es/ecma262/#host">hosts</a></emu-xref> are prohibited from distinguishing among assertions by the order they occur in.</li></ol></li><li>Let <var>moduleRequest</var> be a new <emu-xref href="#modulerequest-record" id="_ref_8"><a href="#modulerequest-record">ModuleRequest Record</a></emu-xref> { <var class="field">[[Specifier]]</var>: <var>specifierString</var>, <var class="field">[[Assertions]]</var>: <var>assertions</var> }.</li><li>Perform <emu-xref aoid="HostLoadImportedModule" id="_ref_9"><a href="#sec-HostLoadImportedModule">HostLoadImportedModule</a></emu-xref>(<var>referrer</var>, <var>moduleRequest</var>, <emu-const>empty</emu-const>, <var>promiseCapability</var>).</li><li>Return <var>promiseCapability</var>.<var class="field">[[Promise]]</var>.</li></ol></emu-alg>
2706+
<emu-alg><ol><li>Let <var>referrer</var> be <emu-xref aoid="GetActiveScriptOrModule"><a href="https://tc39.es/ecma262/#sec-getactivescriptormodule">GetActiveScriptOrModule</a></emu-xref>().</li><li>If <var>referrer</var> is <emu-val>null</emu-val>, set <var>referrer</var> to <emu-xref href="#current-realm"><a href="https://tc39.es/ecma262/#current-realm">the current Realm Record</a></emu-xref>.</li><li>Let <var>specifierRef</var> be the result of evaluating <var>specifierExpression</var>.</li><li>Let <var>specifier</var> be ?&nbsp;<emu-xref aoid="GetValue"><a href="https://tc39.es/ecma262/#sec-getvalue">GetValue</a></emu-xref>(<var>specifierRef</var>).</li><li>If <var>optionsExpression</var> is present, then<ol><li>Let <var>optionsRef</var> be the result of evaluating <var>optionsExpression</var>.</li><li>Let <var>options</var> be ?&nbsp;<emu-xref aoid="GetValue"><a href="https://tc39.es/ecma262/#sec-getvalue">GetValue</a></emu-xref>(<var>optionsRef</var>).</li></ol></li><li>Else,<ol><li>Let <var>options</var> be <emu-val>undefined</emu-val>.</li></ol></li><li>Let <var>promiseCapability</var> be !&nbsp;<emu-xref aoid="NewPromiseCapability"><a href="https://tc39.es/ecma262/#sec-newpromisecapability">NewPromiseCapability</a></emu-xref>(<emu-xref href="#sec-promise-constructor"><a href="https://tc39.es/ecma262/#sec-promise-constructor">%Promise%</a></emu-xref>).</li><li>Let <var>specifierString</var> be <emu-xref aoid="Completion"><a href="https://tc39.es/ecma262/#sec-completion-ao">Completion</a></emu-xref>(<emu-xref aoid="ToString"><a href="https://tc39.es/ecma262/#sec-tostring">ToString</a></emu-xref>(<var>specifier</var>)).</li><li><emu-xref aoid="IfAbruptRejectPromise"><a href="https://tc39.es/ecma262/#sec-ifabruptrejectpromise">IfAbruptRejectPromise</a></emu-xref>(<var>specifierString</var>, <var>promiseCapability</var>).</li><li>Let <var>assertions</var> be a new empty <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref>.</li><li>If <var>options</var> is not <emu-val>undefined</emu-val>, then<ol><li>If <emu-xref aoid="Type"><a href="https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values">Type</a></emu-xref>(<var>options</var>) is not Object,<ol><li>Perform !&nbsp;<emu-xref aoid="Call"><a href="https://tc39.es/ecma262/#sec-call">Call</a></emu-xref>(<var>promiseCapability</var>.<var class="field">[[Reject]]</var>, <emu-val>undefined</emu-val>, « a newly created <emu-val>TypeError</emu-val> object »).</li><li>Return <var>promiseCapability</var>.<var class="field">[[Promise]]</var>.</li></ol></li><li>Let <var>assertionsObj</var> be <emu-xref aoid="Completion"><a href="https://tc39.es/ecma262/#sec-completion-ao">Completion</a></emu-xref>(<emu-xref aoid="Get"><a href="https://tc39.es/ecma262/#sec-get-o-p">Get</a></emu-xref>(<var>options</var>, <emu-val>"assert"</emu-val>)).</li><li><emu-xref aoid="IfAbruptRejectPromise"><a href="https://tc39.es/ecma262/#sec-ifabruptrejectpromise">IfAbruptRejectPromise</a></emu-xref>(<var>assertionsObj</var>, <var>promiseCapability</var>).</li><li>If <var>assertionsObj</var> is not <emu-val>undefined</emu-val>,<ol><li>If <emu-xref aoid="Type"><a href="https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values">Type</a></emu-xref>(<var>assertionsObj</var>) is not Object,<ol><li>Perform !&nbsp;<emu-xref aoid="Call"><a href="https://tc39.es/ecma262/#sec-call">Call</a></emu-xref>(<var>promiseCapability</var>.<var class="field">[[Reject]]</var>, <emu-val>undefined</emu-val>, « a newly created <emu-val>TypeError</emu-val> object »).</li><li>Return <var>promiseCapability</var>.<var class="field">[[Promise]]</var>.</li></ol></li><li>Let <var>keys</var> be <emu-xref aoid="Completion"><a href="https://tc39.es/ecma262/#sec-completion-ao">Completion</a></emu-xref>(EnumerableOwnPropertyNames(<var>assertionsObj</var>, <emu-const>key</emu-const>)).</li><li><emu-xref aoid="IfAbruptRejectPromise"><a href="https://tc39.es/ecma262/#sec-ifabruptrejectpromise">IfAbruptRejectPromise</a></emu-xref>(<var>keys</var>, <var>promiseCapability</var>).</li><li>Let <var>supportedAssertions</var> be !&nbsp;<emu-xref aoid="HostGetSupportedImportAssertions" id="_ref_6"><a href="#sec-hostgetsupportedimportassertions">HostGetSupportedImportAssertions</a></emu-xref>().</li><li>For each String <var>key</var> of <var>keys</var>,<ol><li>Let <var>value</var> be <emu-xref aoid="Completion"><a href="https://tc39.es/ecma262/#sec-completion-ao">Completion</a></emu-xref>(<emu-xref aoid="Get"><a href="https://tc39.es/ecma262/#sec-get-o-p">Get</a></emu-xref>(<var>assertionsObj</var>, <var>key</var>)).</li><li><emu-xref aoid="IfAbruptRejectPromise"><a href="https://tc39.es/ecma262/#sec-ifabruptrejectpromise">IfAbruptRejectPromise</a></emu-xref>(<var>value</var>, <var>promiseCapability</var>).</li><li>If <emu-xref aoid="Type"><a href="https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values">Type</a></emu-xref>(<var>value</var>) is not String, then<ol><li>Perform !&nbsp;<emu-xref aoid="Call"><a href="https://tc39.es/ecma262/#sec-call">Call</a></emu-xref>(<var>promiseCapability</var>.<var class="field">[[Reject]]</var>, <emu-val>undefined</emu-val>, « a newly created <emu-val>TypeError</emu-val> object »).</li><li>Return <var>promiseCapability</var>.<var class="field">[[Promise]]</var>.</li></ol></li><li>If <var>supportedAssertions</var> contains <var>key</var>, then<ol><li>Append the <emu-xref href="#importassertion-record" id="_ref_7"><a href="#importassertion-record">ImportAssertion Record</a></emu-xref> { <var class="field">[[Key]]</var>: <var>key</var>, <var class="field">[[Value]]</var>: <var>value</var> } to <var>assertions</var>.</li></ol></li></ol></li></ol></li><li>Sort <var>assertions</var> by the code point order of the <var class="field">[[Key]]</var> of each element. NOTE: This sorting is observable only in that <emu-xref href="#host"><a href="https://tc39.es/ecma262/#host">hosts</a></emu-xref> are prohibited from distinguishing among assertions by the order they occur in.</li></ol></li><li>Let <var>moduleRequest</var> be a new <emu-xref href="#modulerequest-record" id="_ref_8"><a href="#modulerequest-record">ModuleRequest Record</a></emu-xref> { <var class="field">[[Specifier]]</var>: <var>specifierString</var>, <var class="field">[[Assertions]]</var>: <var>assertions</var> }.</li><li>Perform <emu-xref aoid="HostLoadImportedModule" id="_ref_9"><a href="#sec-HostLoadImportedModule">HostLoadImportedModule</a></emu-xref>(<var>referrer</var>, <var>moduleRequest</var>, <emu-const>empty</emu-const>, <var>promiseCapability</var>).</li><li>Return <var>promiseCapability</var>.<var class="field">[[Promise]]</var>.</li></ol></emu-alg>
27072707
</emu-clause>
27082708
</emu-clause>
27092709
</emu-clause>

spec.emu

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
<emu-alg>
7373
1. Let _referrer_ be GetActiveScriptOrModule().
7474
1. If _referrer_ is *null*, set _referrer_ to the current Realm Record.
75-
1. Let _referencingScriptOrModule_ be ! GetActiveScriptOrModule().
7675
1. Let _specifierRef_ be the result of evaluating _specifierExpression_.
7776
1. Let _specifier_ be ? GetValue(_specifierRef_).
7877
1. If _optionsExpression_ is present, then
@@ -81,24 +80,24 @@
8180
1. Else,
8281
1. Let _options_ be *undefined*.
8382
1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%).
84-
1. Let _specifierString_ be ToString(_specifier_).
83+
1. Let _specifierString_ be Completion(ToString(_specifier_)).
8584
1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_).
8685
1. Let _assertions_ be a new empty List.
8786
1. If _options_ is not *undefined*, then
8887
1. If Type(_options_) is not Object,
8988
1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, &laquo; a newly created *TypeError* object &raquo;).
9089
1. Return _promiseCapability_.[[Promise]].
91-
1. Let _assertionsObj_ be Get(_options_, *"assert"*).
90+
1. Let _assertionsObj_ be Completion(Get(_options_, *"assert"*)).
9291
1. IfAbruptRejectPromise(_assertionsObj_, _promiseCapability_).
9392
1. If _assertionsObj_ is not *undefined*,
9493
1. If Type(_assertionsObj_) is not Object,
9594
1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, &laquo; a newly created *TypeError* object &raquo;).
9695
1. Return _promiseCapability_.[[Promise]].
97-
1. Let _keys_ be EnumerableOwnPropertyNames(_assertionsObj_, ~key~).
96+
1. Let _keys_ be Completion(EnumerableOwnPropertyNames(_assertionsObj_, ~key~)).
9897
1. IfAbruptRejectPromise(_keys_, _promiseCapability_).
9998
1. Let _supportedAssertions_ be ! HostGetSupportedImportAssertions().
10099
1. For each String _key_ of _keys_,
101-
1. Let _value_ be Get(_assertionsObj_, _key_).
100+
1. Let _value_ be Completion(Get(_assertionsObj_, _key_)).
102101
1. IfAbruptRejectPromise(_value_, _promiseCapability_).
103102
1. If Type(_value_) is not String, then
104103
1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, &laquo; a newly created *TypeError* object &raquo;).

0 commit comments

Comments
 (0)