Skip to content

Commit 719956e

Browse files
committed
implementation feedback from issue whatwg#24 - first pass
1 parent 819035f commit 719956e

File tree

1 file changed

+22
-17
lines changed

1 file changed

+22
-17
lines changed

index.bs

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -236,23 +236,23 @@ A <dfn>registry entry</dfn> is a record with the following fields:
236236

237237
<pre emu-alg>
238238
1. If _entry_.[[Instantiate]] is *undefined*, then set _entry_.[[Instantiate]] to a new promise.
239-
1. Return CommitInstantiated(_entry_, _instance_, _source_).
239+
1. Return CommitInstantiated(_loader_, _entry_, _instance_, _source_).
240240
</pre>
241241

242-
<h4 id="commit-instantiated">CommitInstantiated(entry, instance, source)</h4>
242+
<h4 id="commit-instantiated">CommitInstantiated(loader, entry, instance, source)</h4>
243243

244244
<pre emu-alg>
245-
1. Let _instance_ be Instantiation(_instance_, _source_).
246-
1. ReturnIfAbrupt(_instance_).
247-
1. // TODO: edge case: what if _instance_ is a thenable function?
248-
1. Resolve _entry_.[[Instantiate]] with _instance_.
245+
1. Let _module_ be Instantiation(_loader_, _instance_, _source_).
246+
1. ReturnIfAbrupt(_module_).
247+
1. // TODO: edge case: what if _module_ is a thenable function?
248+
1. Resolve _entry_.[[Instantiate]] with _module_.
249249
1. Let _deps_ be a new empty List.
250-
1. If _instance_ is a Module Record, then:
251-
1. Assert: _instance_ is a Normal Module Record.
252-
1. For each _dep_ in _instance_.[[ImportedModules]], do:
250+
1. If _module_ is a Module Record, then:
251+
1. Assert: _module_ is a Normal Module Record.
252+
1. For each _dep_ in _module_.[[ImportedModules]], do:
253253
1. Append the record { [[key]]: _dep_, [[value]]: *undefined* } to _deps_.
254254
1. Set _entry_.[[Dependencies]] to _deps_.
255-
1. Set _entry_.[[Module]] to _instance_.
255+
1. Set _entry_.[[Module]] to _module_.
256256
1. Set _entry_.[[State]] to the max of _entry_.[[State]] and "link".
257257
</pre>
258258

@@ -275,9 +275,9 @@ A <dfn>registry entry</dfn> is a record with the following fields:
275275
1. Let _hook_ be _loader_.[[Fetch]].
276276
1. // TODO: metadata object
277277
1. Let _p0_ be the result of promise-calling _hook_(_key_).
278-
1. Let _p_ be the result of transforming _p0_ with a fulfillment handler that, when called with argument _v_, runs the following steps:
278+
1. Let _p_ be the result of transforming _p0_ with a fulfillment handler that, when called with argument _payload_, runs the following steps:
279279
1. Set _entry_.[[State]] to the max of _entry_.[[State]] and "translate".
280-
1. Return _v_.
280+
1. Return _payload_.
281281
1. Set _entry_.[[Fetch]] to _p_.
282282
1. Return _p_.
283283
</pre>
@@ -321,12 +321,17 @@ A <dfn>registry entry</dfn> is a record with the following fields:
321321
<h4 id="request-link">RequestLink(loader, key)</h4>
322322

323323
<pre emu-alg>
324-
1. Let _entry0_ be EnsureRegistered(_loader_, _key_).
325-
1. If _entry0_.[[State]] is "ready", return a new promise fulfilled with _entry_.[[Module]].
324+
1. Let _entry_ be EnsureRegistered(_loader_, _key_).
325+
1. If _entry_.[[State]] is "ready", return a new promise fulfilled with _entry_.[[Module]].
326326
1. Return the result of transforming RequestInstantiate(_loader_, _key_) with a fulfillment handler that, when called with argument _entry_, runs the following steps:
327327
1. Let _depLoads_ be a new empty List.
328328
1. For each _pair_ in _entry_.[[Dependencies]], do:
329329
1. Let _p_ be the result of transforming Resolve(_loader_, _pair_.[[key]], _key_) with a fulfillment handler that, when called with value _depKey_, runs the following steps:
330+
1. Let _depEntry_ be EnsureRegistered(_loader_, _depKey_).
331+
1. If _depEntry_.[[State]] is "ready", then:
332+
1. Let _dep_ be _depEntry_.[[Module]].
333+
1. Set _pair_.[[value]] to _dep_.
334+
1. Return _dep_.
330335
1. Return the result of transforming RequestInstantiate(_loader_, _depKey_) with a fulfillment handler that, when called with value _dep_, runs the following steps:
331336
1. Set _pair_.[[value]] to _dep_.
332337
1. Return _dep_.
@@ -501,7 +506,7 @@ The modules spec should only invoke this operation from methods of Normal Module
501506
<h4 id="reflect-loader-error">Reflect.Loader.error(key, stage, value)</h4>
502507

503508
<pre emu-alg>
504-
1.
509+
1.
505510
</pre>
506511

507512

@@ -553,7 +558,7 @@ The modules spec should only invoke this operation from methods of Normal Module
553558
1. Append { [[key]]: _key_, [[value]]: _entry_ } to _loader_.[[Registry]].
554559
</pre>
555560

556-
<h4 id="reflect-loader-uninstall">Reflect.Loader.uninstall(module)</h4>
561+
<h4 id="reflect-loader-uninstall">Reflect.Loader.uninstall(key)</h4>
557562

558563
<pre emu-alg>
559564
1. Let _loader_ be *this* value.
@@ -597,7 +602,7 @@ The modules spec should only invoke this operation from methods of Normal Module
597602

598603
<h4 id="reflective-module-record">Reflective Module Records</h4>
599604

600-
A <dfn>reflective module record</dfn> is a kind of module record. It extends
605+
A <dfn>reflective module record</dfn> is a kind of module record. It extends
601606

602607
<table>
603608
<thead>

0 commit comments

Comments
 (0)