Merge "resourceloader: re-use getState() inside mw.loader.work loop"

This commit is contained in:
jenkins-bot 2021-09-02 19:12:31 +00:00 committed by Gerrit Code Review
commit 466ea84624

View file

@ -1445,23 +1445,23 @@
// - 3) Request from network.
while ( q-- ) {
var module = queue[ q ];
// Only consider modules which are the initial 'registered' state
if ( module in registry && registry[ module ].state === 'registered' ) {
// Ignore duplicates
if ( !batch.has( module ) ) {
// Progress the state machine
registry[ module ].state = 'loading';
batch.add( module );
// Only consider modules which are the initial 'registered' state,
// and ignore duplicates
if ( mw.loader.getState( module ) === 'registered' &&
!batch.has( module )
) {
// Progress the state machine
registry[ module ].state = 'loading';
batch.add( module );
var implementation = mw.loader.store.get( module );
if ( implementation ) {
// Module store enabled and contains this module/version
storedImplementations.push( implementation );
storedNames.push( module );
} else {
// Module store disabled or doesn't have this module/version
requestNames.push( module );
}
var implementation = mw.loader.store.get( module );
if ( implementation ) {
// Module store enabled and contains this module/version
storedImplementations.push( implementation );
storedNames.push( module );
} else {
// Module store disabled or doesn't have this module/version
requestNames.push( module );
}
}
}