Skip to content

Commit 023a0aa

Browse files
authored
Add missing ToString for assertion value in dynamic import() Runtime Semantics (#106)
* Add missing ToString for assertion value in dynamic import() Runtime Semantics * Check if type is string instead of converting to string. Move supportedAssertions check after type check.
1 parent 4336228 commit 023a0aa

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

spec.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,13 @@ <h1>Runtime Semantics: Evaluation</h1>
9595
1. <ins>Let _assertions_ be a new empty List.</ins>
9696
1. <ins>Let _keys_ be EnumerableOwnPropertyNames(_assertionsObj_, ~key~).</ins>
9797
1. <ins>IfAbruptRejectPromise(_keys_, _promiseCapability_).</ins>
98-
1. <ins>For each String _key_ of _keys_, if _key_ is an entry of _supportedAssertions_,</ins>
98+
1. <ins>For each String _key_ of _keys_,</ins>
9999
1. <ins>Let _value_ be Get(_assertionsObj_, _key_).</ins>
100100
1. <ins>IfAbruptRejectPromise(_value_, _promiseCapability_).</ins>
101-
1. <ins>Append { [[Key]]: _key_, [[Value]]: _value_ } to _assertions_.</ins>
101+
1. <ins>If Type(_value_) is not String, then</ins>
102+
1. <ins>Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, &laquo; a newly created *TypeError* object &raquo;).</ins>
103+
1. <ins>Return _promiseCapability_.[[Promise]].</ins>
104+
1. <ins>If _key_ is an entry of _supportedAssertions_, append { [[Key]]: _key_, [[Value]]: _value_ } to _assertions_.</ins>
102105
1. <ins>Sort _assertions_ by the code point order of the [[Key]] of each entry. NOTE: This sorting is observable only in that hosts are prohibited from distinguishing among assertions by the order they occur in.</ens>
103106
1. <ins>Let _moduleRequest_ be a new ModuleRequest Record { [[Specifier]]: _specifierString_, [[Assertions]]: _assertions_ }.</ins>
104107
1. Perform ! HostImportModuleDynamically(_referencingScriptOrModule_, <del>_specifierString_,</del> <ins>_moduleRequest_,</ins> _promiseCapability_).

0 commit comments

Comments
 (0)