Skip to content

Commit

Permalink
review feedback from jack
Browse files Browse the repository at this point in the history
  • Loading branch information
caridy authored and kriskowal committed Aug 18, 2022
1 parent dd9f070 commit 67aef24
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions 0-module-and-module-source.emu
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,6 @@ location: https://tc39.es/proposal-compartments/
1. If Type(_importMeta_) is not Object, throw a *TypeError* exception.
1. If IsCallable(_importHook_) is *false*, throw a *TypeError* exception.
1. Perform ? RequireInternalSlot(_moduleSource_, [[ModuleSource]]).
1. Let _P_ be MakeBasicObject(« [[ImportHook]], [[ImportMeta]] »).
1. Let _O_ be ? OrdinaryCreateFromConstructor(NewTarget, *"%Module.prototype%"*, « [[Module]], [[ModuleSourceInstance]], [[ImportHook]] »).
1. Let _moduleRecord_ to ! CreateModuleRecord(_moduleSource_.[[ModuleSource]]).
1. Set _moduleRecord_.[[ModuleInstance]] to _O_.
Expand All @@ -528,7 +527,7 @@ location: https://tc39.es/proposal-compartments/
1. return ? Call(_importHook_, *undefined*, « _specifier_, _importMeta_ »).
1. Set _O_.[[Module]] to _moduleRecord_.
1. Set _O_.[[ModuleSourceInstance]] to _moduleSource_.
1. Set _O_.[[ImportHook]] be CreateBuiltinFunction(_importHookClosure_, 0, *""*, « »).
1. Set _O_.[[ImportHook]] be CreateBuiltinFunction(_importHookClosure_, 1, *""*, « »).
1. Perform ? CreateCustomImportMeta(_moduleRecord_, _importMeta_).
1. Return _O_.
</emu-alg>
Expand Down
2 changes: 1 addition & 1 deletion 0-module-and-module-source.html
Original file line number Diff line number Diff line change
Expand Up @@ -2867,7 +2867,7 @@ <h1><span class="secnum">5.2</span> The Module Constructor</h1>
<emu-clause id="sec-module">
<h1><span class="secnum">5.2.1</span> Module ( <var>moduleSource</var>, <var>importHook</var>, <var>importMeta</var> )</h1>
<p>When the <code>Module</code> function is called with the arguments <var>moduleSource</var>, <var>importHook</var> and <var>importMeta</var>, the following steps are taken:</p>
<emu-alg><ol><li>If NewTarget is <emu-val>undefined</emu-val>, throw a <emu-val>TypeError</emu-val> exception.</li><li>If <emu-xref aoid="Type"><a href="https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values">Type</a></emu-xref>(<var>moduleSource</var>) is not Callable, throw a <emu-val>TypeError</emu-val> exception.</li><li>If <emu-xref aoid="Type"><a href="https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values">Type</a></emu-xref>(<var>importHook</var>) is not Callable, throw a <emu-val>TypeError</emu-val> exception.</li><li>If <emu-xref aoid="Type"><a href="https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values">Type</a></emu-xref>(<var>importMeta</var>) is not Object, throw a <emu-val>TypeError</emu-val> exception.</li><li>If <emu-xref aoid="IsCallable"><a href="https://tc39.es/ecma262/#sec-iscallable">IsCallable</a></emu-xref>(<var>importHook</var>) is <emu-val>false</emu-val>, throw a <emu-val>TypeError</emu-val> exception.</li><li>Perform ?&nbsp;<emu-xref aoid="RequireInternalSlot"><a href="https://tc39.es/ecma262/#sec-requireinternalslot">RequireInternalSlot</a></emu-xref>(<var>moduleSource</var>, [[ModuleSource]]).</li><li>Let <var>P</var> be <emu-xref aoid="MakeBasicObject"><a href="https://tc39.es/ecma262/#sec-makebasicobject">MakeBasicObject</a></emu-xref>(« [[ImportHook]], [[ImportMeta]] »).</li><li>Let <var>O</var> be ?&nbsp;<emu-xref aoid="OrdinaryCreateFromConstructor"><a href="https://tc39.es/ecma262/#sec-ordinarycreatefromconstructor">OrdinaryCreateFromConstructor</a></emu-xref>(NewTarget, <emu-val>"%Module.prototype%"</emu-val>, « [[Module]], [[ModuleSourceInstance]], [[ImportHook]] »).</li><li>Let <var>moduleRecord</var> to !&nbsp;<emu-xref aoid="CreateModuleRecord" id="_ref_30"><a href="#sec-createmodulerecord">CreateModuleRecord</a></emu-xref>(<var>moduleSource</var>.[[ModuleSource]]).</li><li>Set <var>moduleRecord</var>.[[ModuleInstance]] to <var>O</var>.</li><li>Let <var>importHookClosure</var> be a new <emu-xref href="#sec-abstract-closure"><a href="https://tc39.es/ecma262/#sec-abstract-closure">Abstract Closure</a></emu-xref> with parameters (<var>specifier</var>) that captures <var>importHook</var> and <var>importMeta</var> and performs the following steps when called<ol><li><emu-xref href="#assert"><a href="https://tc39.es/ecma262/#assert">Assert</a></emu-xref>: <emu-xref aoid="Type"><a href="https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values">Type</a></emu-xref>(<var>specifier</var>) is String.</li><li>return ?&nbsp;<emu-xref aoid="Call"><a href="https://tc39.es/ecma262/#sec-call">Call</a></emu-xref>(<var>importHook</var>, <emu-val>undefined</emu-val>, « <var>specifier</var>, <var>importMeta</var> »).</li></ol></li><li>Set <var>O</var>.[[Module]] to <var>moduleRecord</var>.</li><li>Set <var>O</var>.[[ModuleSourceInstance]] to <var>moduleSource</var>.</li><li>Set <var>O</var>.[[ImportHook]] be <emu-xref aoid="CreateBuiltinFunction"><a href="https://tc39.es/ecma262/#sec-createbuiltinfunction">CreateBuiltinFunction</a></emu-xref>(<var>importHookClosure</var>, 0, <emu-val>""</emu-val>, « »).</li><li>Perform ?&nbsp;<emu-xref aoid="CreateCustomImportMeta" id="_ref_31"><a href="#sec-createcustomimportmeta">CreateCustomImportMeta</a></emu-xref>(<var>moduleRecord</var>, <var>importMeta</var>).</li><li>Return <var>O</var>.</li></ol></emu-alg>
<emu-alg><ol><li>If NewTarget is <emu-val>undefined</emu-val>, throw a <emu-val>TypeError</emu-val> exception.</li><li>If <emu-xref aoid="Type"><a href="https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values">Type</a></emu-xref>(<var>moduleSource</var>) is not Callable, throw a <emu-val>TypeError</emu-val> exception.</li><li>If <emu-xref aoid="Type"><a href="https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values">Type</a></emu-xref>(<var>importHook</var>) is not Callable, throw a <emu-val>TypeError</emu-val> exception.</li><li>If <emu-xref aoid="Type"><a href="https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values">Type</a></emu-xref>(<var>importMeta</var>) is not Object, throw a <emu-val>TypeError</emu-val> exception.</li><li>If <emu-xref aoid="IsCallable"><a href="https://tc39.es/ecma262/#sec-iscallable">IsCallable</a></emu-xref>(<var>importHook</var>) is <emu-val>false</emu-val>, throw a <emu-val>TypeError</emu-val> exception.</li><li>Perform ?&nbsp;<emu-xref aoid="RequireInternalSlot"><a href="https://tc39.es/ecma262/#sec-requireinternalslot">RequireInternalSlot</a></emu-xref>(<var>moduleSource</var>, [[ModuleSource]]).</li><li>Let <var>O</var> be ?&nbsp;<emu-xref aoid="OrdinaryCreateFromConstructor"><a href="https://tc39.es/ecma262/#sec-ordinarycreatefromconstructor">OrdinaryCreateFromConstructor</a></emu-xref>(NewTarget, <emu-val>"%Module.prototype%"</emu-val>, « [[Module]], [[ModuleSourceInstance]], [[ImportHook]] »).</li><li>Let <var>moduleRecord</var> to !&nbsp;<emu-xref aoid="CreateModuleRecord" id="_ref_30"><a href="#sec-createmodulerecord">CreateModuleRecord</a></emu-xref>(<var>moduleSource</var>.[[ModuleSource]]).</li><li>Set <var>moduleRecord</var>.[[ModuleInstance]] to <var>O</var>.</li><li>Let <var>importHookClosure</var> be a new <emu-xref href="#sec-abstract-closure"><a href="https://tc39.es/ecma262/#sec-abstract-closure">Abstract Closure</a></emu-xref> with parameters (<var>specifier</var>) that captures <var>importHook</var> and <var>importMeta</var> and performs the following steps when called<ol><li><emu-xref href="#assert"><a href="https://tc39.es/ecma262/#assert">Assert</a></emu-xref>: <emu-xref aoid="Type"><a href="https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values">Type</a></emu-xref>(<var>specifier</var>) is String.</li><li>return ?&nbsp;<emu-xref aoid="Call"><a href="https://tc39.es/ecma262/#sec-call">Call</a></emu-xref>(<var>importHook</var>, <emu-val>undefined</emu-val>, « <var>specifier</var>, <var>importMeta</var> »).</li></ol></li><li>Set <var>O</var>.[[Module]] to <var>moduleRecord</var>.</li><li>Set <var>O</var>.[[ModuleSourceInstance]] to <var>moduleSource</var>.</li><li>Set <var>O</var>.[[ImportHook]] be <emu-xref aoid="CreateBuiltinFunction"><a href="https://tc39.es/ecma262/#sec-createbuiltinfunction">CreateBuiltinFunction</a></emu-xref>(<var>importHookClosure</var>, 1, <emu-val>""</emu-val>, « »).</li><li>Perform ?&nbsp;<emu-xref aoid="CreateCustomImportMeta" id="_ref_31"><a href="#sec-createcustomimportmeta">CreateCustomImportMeta</a></emu-xref>(<var>moduleRecord</var>, <var>importMeta</var>).</li><li>Return <var>O</var>.</li></ol></emu-alg>
</emu-clause>
</emu-clause>

Expand Down

0 comments on commit 67aef24

Please sign in to comment.