public/mediawiki/mediawiki-1.23.9/resources/src/mediawiki/mediawiki.js
/**
			 * Narrows a list of module names down to those matching a specific
			 * state (see comment on top of this scope for a list of valid states).
			 * One can also filter for 'unregistered', which will return the
			 * modules names that don't have a registry entry.
			 *
			 * @private
			 * @param {string|string[]} states Module states to filter by
			 * @param {Array} [modules] List of module names to filter (optional, by default the entire
			 * registry is used)
			 * @return {Array} List of filtered module names
			 */
Narrows a list of module names down to those matching a specific
state .
One can also filter for 'unregistered', which will return the
modules names that don't have a registry entry.

@private
@param {string|string[]} states Module states to filter by
@param {Array} [modules] List of module names to filter (optional, by default the entire
registry is used)
@return {Array} List of filtered module names
Narrows a list of module names down to those matching a specific state . One can also filter for ' unregistered ' which will return the modules names that don ' t have a registry entry . @private @param { string|string [] } states Module states to filter by @param { Array } [ modules ] List of module names to filter ( optional by default the entire registry is used ) @return { Array } List of filtered module names
function filter( states, modules ) {
				var list, module, s, m;
				if ( typeof states === 'string' ) {
					states = [states];
				}
				list = [];
				if ( modules === undefined ) {
					modules = [];
					for ( module in registry ) {
						modules[modules.length] = module;
					}
				}
				for ( s = 0; s < states.length; s += 1 ) {
					for ( m = 0; m < modules.length; m += 1 ) {
						if ( registry[modules[m]] === undefined ) {
							if ( states[s] === 'unregistered' ) {
								list[list.length] = modules[m];
							}
						} else {
							if ( registry[modules[m]].state === states[s] ) {
								list[list.length] = modules[m];
							}
						}
					}
				}
				return list;
			}
function filter ( states , modules ) { var list , module , s , m ; if ( typeof states === 'string' ) { states = [ states ] ; } list = [ ] ; if ( modules === undefined ) { modules = [ ] ; for ( module in registry ) { modules [ modules . length ] = module ; } } for ( s = 0 ; s < states . length ; s += 1 ) { for ( m = 0 ; m < modules . length ; m += 1 ) { if ( registry [ modules [ m ] ] === undefined ) { if ( states [ s ] === 'unregistered' ) { list [ list . length ] = modules [ m ] ; } } else { if ( registry [ modules [ m ] ] . state === states [ s ] ) { list [ list . length ] = modules [ m ] ; } } } } return list ; }
Narrows a list of module names down to those matching a specific
 state (see comment on top of this scope for a list of valid states).
Narrows a list of module names down to those matching a specific state ( see comment on top of this scope for a list of valid states ) .
// Allow states to be given as a string // If called without a list of modules, build and use a list of all modules // Build a list of modules which are in one of the specified states // Module does not exist // OK, undefined // Module exists, check state // OK, correct state