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
@@ -271,7 +288,7 @@ A <dfn>registry entry</dfn> is a record with the following fields:
271
288
1. Append the record { [[key]]: _dep_, [[value]]: *undefined* } to _deps_.
272
289
1. Set _entry_.[[Dependencies]] to _deps_.
273
290
1. Set _entry_.[[Module]] to _instance_.
274
-
1. Set _entry_.[[State]] to the max of _entry_.[[State]] and "link".
291
+
1. SetStateToMax(_entry_, "link").
275
292
1. Set _instance_.[[RegistryEntry]] to _entry_.
276
293
</emu-alg>
277
294
@@ -290,13 +307,15 @@ A <dfn>registry entry</dfn> is a record with the following fields:
290
307
291
308
<emu-alg>
292
309
1. Let _entry_ be EnsureRegistered(_loader_, _key_).
293
-
1. If _entry_.[[State]] is greater than "link", return a new error promise.
310
+
1. Let _stateValue_ be GetStateValue(_entry_.[[State]]).
311
+
1. Let _linkStateValue_ be GetStateValue("link").
312
+
1. If _stateValue_ is greater than _linkStateValue_, return a new error promise.
294
313
1. If _entry_.[[Fetch]] is not *undefined*, return _entry_.[[Fetch]].
295
314
1. Let _hook_ be _loader_.[[Fetch]].
296
315
1. // TODO: metadata object
297
316
1. Let _p0_ be the result of promise-calling _hook_(_key_).
298
317
1. Let _p_ be the result of transforming _p0_ with a fulfillment handler that, when called with argument _payload_, runs the following steps:
299
-
1. Set _entry_.[[State]] to the max of _entry_.[[State]] and "translate".
318
+
1. SetStateToMax(_entry_, "translate").
300
319
1. Return _payload_.
301
320
1. Set _entry_.[[Fetch]] to _p_.
302
321
1. Return _p_.
@@ -306,14 +325,16 @@ A <dfn>registry entry</dfn> is a record with the following fields:
306
325
307
326
<emu-alg>
308
327
1. Let _entry_ be EnsureRegistered(_loader_, _key_).
309
-
1. If _entry_.[[State]] is greater than "link", return a new error promise.
328
+
1. Let _stateValue_ be GetStateValue(_entry_.[[State]]).
329
+
1. Let _linkStateValue_ be GetStateValue("link").
330
+
1. If _stateValue_ is greater than _linkStateValue_, return a new error promise.
310
331
1. If _entry_.[[Translate]] is not *undefined*, return _entry_.[[Translate]].
311
332
1. Let _hook_ be _loader_.[[Translate]].
312
333
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:
313
334
1. // TODO: metadata
314
335
1. Let _p1_ be the result of promise-calling _hook_(_key_, _payload_).
315
336
1. Return the result of transforming _p1_ with a fulfillment handler that, when called with argument _source_, runs the following steps:
316
-
1. Set _entry_.[[State]] to the max of _entry_.[[State]] and "instantiate".
337
+
1. SetStateToMax(_entry_, "instantiate").
317
338
1. Return _source_.
318
339
1. Set _entry_.[[Translate]] to _p_.
319
340
1. Return _p_.
@@ -397,7 +418,9 @@ The modules spec should only invoke this operation from methods of Source Text M
397
418
1. Let _pair_ be the pair in _entry_.[[Dependencies]] such that _pair_.[[key]] is equal to _requestName_.
398
419
1. Assert: _pair_ is defined.
399
420
1. Let _dep_ be _pair_.[[value]].
400
-
1. Assert: _dep_.[[State]] is greater than or equal to "link".
421
+
1. Let _stateValue_ be GetStateValue(_dep_.[[State]]).
422
+
1. Let _linkStateValue_ be GetStateValue("link").
423
+
1. Assert: _stateValue_ is greater than or equal to _linkStateValue_.
401
424
1. Return _dep_.[[Module]].
402
425
</emu-alg>
403
426
@@ -510,16 +533,22 @@ The modules spec should only invoke this operation from methods of Source Text M
510
533
1. If _loader_ does not have a [[Registry]] internal slot throw a *TypeError* exception.
511
534
1. Let _entry_ be EnsureRegistered(_loader_, _key_).
512
535
1. If _stage_ is "fetch", then:
513
-
1. If _entry_.[[State]] is greater than "fetch", throw a new TypeError.
536
+
1. Let _stateValue_ be GetStateValue(_entry_.[[State]]).
537
+
1. Let _fetchStateValue_ be GetStateValue("fetch").
538
+
1. If _stateValue_ is greater than _fetchStateValue_, throw a new TypeError.
514
539
1. Call FulfillFetch(_loader_, _entry_, _value_).
515
540
1. Return *undefined*.
516
541
1. If _stage_ is "translate", then:
517
-
1. If _entry_.[[State]] is greater than "translate", throw a new TypeError.
542
+
1. Let _stateValue_ be GetStateValue(_entry_.[[State]]).
543
+
1. Let _translateStateValue_ be GetStateValue("translate").
544
+
1. If _stateValue_ is greater than _translateStateValue_, throw a new TypeError.
0 commit comments