You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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_.
249
249
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:
253
253
1. Append the record { [[key]]: _dep_, [[value]]: *undefined* } to _deps_.
254
254
1. Set _entry_.[[Dependencies]] to _deps_.
255
-
1. Set _entry_.[[Module]] to _instance_.
255
+
1. Set _entry_.[[Module]] to _module_.
256
256
1. Set _entry_.[[State]] to the max of _entry_.[[State]] and "link".
257
257
</pre>
258
258
@@ -275,9 +275,9 @@ A <dfn>registry entry</dfn> is a record with the following fields:
275
275
1. Let _hook_ be _loader_.[[Fetch]].
276
276
1. // TODO: metadata object
277
277
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:
279
279
1. Set _entry_.[[State]] to the max of _entry_.[[State]] and "translate".
280
-
1. Return _v_.
280
+
1. Return _payload_.
281
281
1. Set _entry_.[[Fetch]] to _p_.
282
282
1. Return _p_.
283
283
</pre>
@@ -306,27 +306,31 @@ A <dfn>registry entry</dfn> is a record with the following fields:
306
306
1. If _entry_.[[State]] is "ready", return a new error promise.
307
307
1. If _entry_.[[Instantiate]] is not *undefined*, return _entry_.[[Instantiate]].
308
308
1. Let _hook_ be _loader_.[[Instantiate]].
309
-
1. Let _p_ be the result of transforming RequestFetch(_loader_, _key_) with a fulfillment handler that, when called with argument _payload_, runs the following steps:
310
-
1. Return the result of transforming RequestTranslate(_loader_, _key_) with a fulfillment handler that, when called with argument _source_, runs the following steps:
311
-
1. // TODO: metadata
312
-
1. Let _p1_ be the result of promise-calling _hook_(_key_, _payload_, _source_).
313
-
1. Return the result of transforming _p1_ with a fulfillment handler that, when called with argument _instance_, runs the following steps:
314
-
1. Let _status_ be CommitInstantiated(_entry_, _instance_, _source_).
315
-
1. ReturnIfAbrupt(_status_).
316
-
1. Return _entry_.
309
+
1. Let _p_ be the result of transforming RequestTranslate(_loader_, _key_) with a fulfillment handler that, when called with argument _source_, runs the following steps:
310
+
1. // TODO: metadata
311
+
1. Let _p1_ be the result of promise-calling _hook_(_key_, _payload_, _source_).
312
+
1. Return the result of transforming _p1_ with a fulfillment handler that, when called with argument _instance_, runs the following steps:
313
+
1. Let _status_ be CommitInstantiated(_loader_, _entry_, _instance_, _source_).
1. Let _entry0_ be EnsureRegistered(_loader_, _key_).
325
-
1. If _entry0_.[[State]] is "ready", return a new promise fulfilled with _entry_.[[Module]].
323
+
1. Let _entry_ be EnsureRegistered(_loader_, _key_).
324
+
1. If _entry_.[[State]] is "ready", return a new promise fulfilled with _entry_.[[Module]].
326
325
1. Return the result of transforming RequestInstantiate(_loader_, _key_) with a fulfillment handler that, when called with argument _entry_, runs the following steps:
327
326
1. Let _depLoads_ be a new empty List.
328
327
1. For each _pair_ in _entry_.[[Dependencies]], do:
329
328
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:
329
+
1. Let _depEntry_ be EnsureRegistered(_loader_, _depKey_).
330
+
1. If _depEntry_.[[State]] is "ready", then:
331
+
1. Let _dep_ be _depEntry_.[[Module]].
332
+
1. Set _pair_.[[value]] to _dep_.
333
+
1. Return _dep_.
330
334
1. Return the result of transforming RequestInstantiate(_loader_, _depKey_) with a fulfillment handler that, when called with value _dep_, runs the following steps:
331
335
1. Set _pair_.[[value]] to _dep_.
332
336
1. Return _dep_.
@@ -501,7 +505,7 @@ The modules spec should only invoke this operation from methods of Normal Module
0 commit comments