function ModuleDefinitionQueue() {
		var aQueue = [],
			iRun = 0,
			vTimer;

		this.push = function(name, deps, factory, _export) {
			if ( log.isLoggable() ) {
				log.debug(sLogPrefix + "pushing define() call"
					+ (document.currentScript ? " from " + document.currentScript.src : "")
					+ " to define queue #" + iRun);
			}
			aQueue.push({
				name: name,
				deps: deps,
				factory: factory,
				_export: _export,
				guess: document.currentScript && document.currentScript.getAttribute('data-sap-ui-module')
			});

			// trigger queue processing via a timer in case the currently executing script is not managed by the loader
			if ( !vTimer ) {
				vTimer = setTimeout(this.process.bind(this, null, "timer"));
			}
		};

		this.clear = function() {
			aQueue = [];
			if ( vTimer ) {
				clearTimeout(vTimer);
				vTimer = null;
			}
		};

		/**
		 * Process the queue of module definitions, assuming that the original request was for
		 * <code>oRequestedModule</code>. If there is an unnamed module definition, it is assumed to be
		 * the one for the requested module.
		 *
		 * When called via timer, <code>oRequestedModule</code> will be undefined.
		 *
		 * @param {Module} [oRequestedModule] Module for which the current script was loaded.
		 * @param {string} [sInitiator] A string describing the caller of <code>process</code>
		 */
		this.process = function(oRequestedModule, sInitiator) {
			var bLoggable = log.isLoggable(),
				iCurrentRun = iRun++,
				aQueueCopy = aQueue,
				sModuleName = null;

			// clear the queue and timer early, we've already taken a copy of the queue
			this.clear();


			if ( oRequestedModule ) {

				// if a module execution error was detected, stop processing the queue
				if ( oRequestedModule.execError ) {
					if ( bLoggable ) {
						log.debug("module execution error detected, ignoring queued define calls (" + aQueueCopy.length + ")");
					}
					oRequestedModule.fail(oRequestedModule.execError);
					return;
				}

			}

			/*
			 * Name of the requested module, null when unknown or already consumed.
			 *
			 *  - when no module request is known (e.g. script was embedded in the page as an unmanaged script tag),
			 *    then no name is known and unnamed module definitions will be reported as an error
			 *  - multiple unnamed module definitions also are reported as an error
			 *  - when the name of a named module definition matches the name of requested module, the name is 'consumed'.
			 *    Any later unnamed module definition will be reported as an error, too
			 */
			sModuleName = oRequestedModule && oRequestedModule.name;

			// check whether there's a module definition for the requested module
			aQueueCopy.forEach(function(oEntry) {
				if ( oEntry.name == null ) {
					if ( sModuleName != null ) {
						oEntry.name = sModuleName;
						sModuleName = null;
					} else {
						// multiple modules have been queued, but only one module can inherit the name from the require call
						if ( strictModuleDefinitions ) {
							var oError = new Error(
								"Modules that use an anonymous define() call must be loaded with a require() call; " +
								"they must not be executed via script tag or nested into other modules. ");
							if ( oRequestedModule ) {
								oRequestedModule.fail(oError);
							} else {
								throw oError;
							}
						}
						// give anonymous modules a unique pseudo ID
						oEntry.name = '~anonymous~' + (++iAnonymousModuleCount) + '.js';
						log.error(
							"Modules that use an anonymous define() call must be loaded with a require() call; " +
							"they must not be executed via script tag or nested into other modules. " +
							"All other usages will fail in future releases or when standard AMD loaders are used. " +
							"Now using substitute name " + oEntry.name);
					}
				} else if ( oRequestedModule && oEntry.name === oRequestedModule.name ) {
					if ( sModuleName == null && !strictModuleDefinitions ) {
						// if 'strictModuleDefinitions' is active, double execution will be reported anyhow
						log.error(
							"Duplicate module definition: both, an unnamed module and a module with the expected name exist." +
							"This use case will fail in future releases or when standard AMD loaders are used. ");
					}
					sModuleName = null;
				}
			});

			// if not, assign an alias if there's at least one queued module definition
			if ( sModuleName && aQueueCopy.length > 0 ) {
				if ( bLoggable ) {
					log.debug(
						"No queued module definition matches the ID of the request. " +
						"Now assuming that the first definition '" + aQueueCopy[0].name + "' is an alias of '" + sModuleName + "'");
				}
				Module.get(aQueueCopy[0].name).addAlias(sModuleName);
				sModuleName = null;
			}

			if ( bLoggable ) {
				log.debug(sLogPrefix + "[" + sInitiator + "] "
					+ "processing define queue #" + iCurrentRun
					+ (oRequestedModule ? " for '" + oRequestedModule.name + "'" : "")
					+ " with entries [" + aQueueCopy.map(function(entry) { return "'" + entry.name + "'"; }) + "]");
			}

			aQueueCopy.forEach(function(oEntry) {
				// start to resolve the dependencies
				executeModuleDefinition(oEntry.name, oEntry.deps, oEntry.factory, oEntry._export, /* bAsync = */ true);
			});

			if ( sModuleName != null && !oRequestedModule.settled ) {
				// module name still not consumed, might be a non-UI5 module (e.g. in 'global' format)
				if ( bLoggable ) {
					log.debug(sLogPrefix + "no queued module definition for the requested module found, assume the module to be ready");
				}
				oRequestedModule.data = undefined; // allow GC
				oRequestedModule.ready(); // no export known, has to be retrieved via global name
			}

			if ( bLoggable ) {
				log.debug(sLogPrefix + "processing define queue #" + iCurrentRun + " done");
			}
		};
	}
/**
	 * Queue of modules for which sap.ui.define has been called (in async mode), but which have not been executed yet.
	 * When loading modules via script tag, only the onload handler knows the relationship between executed sap.ui.define calls and
	 * module name. It then resolves the pending modules in the queue. Only one entry can get the name of the module
	 * if there are more entries, then this is an error
	 */
Queue of modules for which sap.ui.define has been called (in async mode), but which have not been executed yet.
When loading modules via script tag, only the onload handler knows the relationship between executed sap.ui.define calls and
module name. It then resolves the pending modules in the queue. Only one entry can get the name of the module
if there are more entries, then this is an error
Queue of modules for which sap . ui . define has been called ( in async mode ) but which have not been executed yet . When loading modules via script tag only the onload handler knows the relationship between executed sap . ui . define calls and module name . It then resolves the pending modules in the queue . Only one entry can get the name of the module if there are more entries then this is an error
function ModuleDefinitionQueue() {
		var aQueue = [],
			iRun = 0,
			vTimer;
		this.push = function(name, deps, factory, _export) {
			if ( log.isLoggable() ) {
				log.debug(sLogPrefix + "pushing define() call"
					+ (document.currentScript ? " from " + document.currentScript.src : "")
					+ " to define queue #" + iRun);
			}
			aQueue.push({
				name: name,
				deps: deps,
				factory: factory,
				_export: _export,
				guess: document.currentScript && document.currentScript.getAttribute('data-sap-ui-module')
			});
			if ( !vTimer ) {
				vTimer = setTimeout(this.process.bind(this, null, "timer"));
			}
		};
		this.clear = function() {
			aQueue = [];
			if ( vTimer ) {
				clearTimeout(vTimer);
				vTimer = null;
			}
		};
		this.process = function(oRequestedModule, sInitiator) {
			var bLoggable = log.isLoggable(),
				iCurrentRun = iRun++,
				aQueueCopy = aQueue,
				sModuleName = null;
			this.clear();
			if ( oRequestedModule ) {
				if ( oRequestedModule.execError ) {
					if ( bLoggable ) {
						log.debug("module execution error detected, ignoring queued define calls (" + aQueueCopy.length + ")");
					}
					oRequestedModule.fail(oRequestedModule.execError);
					return;
				}
			}
			sModuleName = oRequestedModule && oRequestedModule.name;
			aQueueCopy.forEach(function(oEntry) {
				if ( oEntry.name == null ) {
					if ( sModuleName != null ) {
						oEntry.name = sModuleName;
						sModuleName = null;
					} else {
						if ( strictModuleDefinitions ) {
							var oError = new Error(
								"Modules that use an anonymous define() call must be loaded with a require() call; " +
								"they must not be executed via script tag or nested into other modules. ");
							if ( oRequestedModule ) {
								oRequestedModule.fail(oError);
							} else {
								throw oError;
							}
						}
						oEntry.name = '~anonymous~' + (++iAnonymousModuleCount) + '.js';
						log.error(
							"Modules that use an anonymous define() call must be loaded with a require() call; " +
							"they must not be executed via script tag or nested into other modules. " +
							"All other usages will fail in future releases or when standard AMD loaders are used. " +
							"Now using substitute name " + oEntry.name);
					}
				} else if ( oRequestedModule && oEntry.name === oRequestedModule.name ) {
					if ( sModuleName == null && !strictModuleDefinitions ) {
						log.error(
							"Duplicate module definition: both, an unnamed module and a module with the expected name exist." +
							"This use case will fail in future releases or when standard AMD loaders are used. ");
					}
					sModuleName = null;
				}
			});
			if ( sModuleName && aQueueCopy.length > 0 ) {
				if ( bLoggable ) {
					log.debug(
						"No queued module definition matches the ID of the request. " +
						"Now assuming that the first definition '" + aQueueCopy[0].name + "' is an alias of '" + sModuleName + "'");
				}
				Module.get(aQueueCopy[0].name).addAlias(sModuleName);
				sModuleName = null;
			}
			if ( bLoggable ) {
				log.debug(sLogPrefix + "[" + sInitiator + "] "
					+ "processing define queue #" + iCurrentRun
					+ (oRequestedModule ? " for '" + oRequestedModule.name + "'" : "")
					+ " with entries [" + aQueueCopy.map(function(entry) { return "'" + entry.name + "'"; }) + "]");
			}
			aQueueCopy.forEach(function(oEntry) {
				executeModuleDefinition(oEntry.name, oEntry.deps, oEntry.factory, oEntry._export,  true);
			});
			if ( sModuleName != null && !oRequestedModule.settled ) {
				if ( bLoggable ) {
					log.debug(sLogPrefix + "no queued module definition for the requested module found, assume the module to be ready");
				}
				oRequestedModule.data = undefined; 
				oRequestedModule.ready(); 
			}
			if ( bLoggable ) {
				log.debug(sLogPrefix + "processing define queue #" + iCurrentRun + " done");
			}
		};
	}
function ModuleDefinitionQueue ( ) { var aQueue = [ ] , iRun = 0 , vTimer ; this . push = function ( name , deps , factory , _export ) { if ( log . isLoggable ( ) ) { log . debug ( sLogPrefix + "pushing define() call" + ( document . currentScript ? " from " + document . currentScript . src : "" ) + " to define queue #" + iRun ) ; } aQueue . push ( { name : name , deps : deps , factory : factory , _export : _export , guess : document . currentScript && document . currentScript . getAttribute ( 'data-sap-ui-module' ) } ) ; if ( ! vTimer ) { vTimer = setTimeout ( this . process . bind ( this , null , "timer" ) ) ; } } ; this . clear = function ( ) { aQueue = [ ] ; if ( vTimer ) { clearTimeout ( vTimer ) ; vTimer = null ; } } ; this . process = function ( oRequestedModule , sInitiator ) { var bLoggable = log . isLoggable ( ) , iCurrentRun = iRun ++ , aQueueCopy = aQueue , sModuleName = null ; this . clear ( ) ; if ( oRequestedModule ) { if ( oRequestedModule . execError ) { if ( bLoggable ) { log . debug ( "module execution error detected, ignoring queued define calls (" + aQueueCopy . length + ")" ) ; } oRequestedModule . fail ( oRequestedModule . execError ) ; return ; } } sModuleName = oRequestedModule && oRequestedModule . name ; aQueueCopy . forEach ( function ( oEntry ) { if ( oEntry . name == null ) { if ( sModuleName != null ) { oEntry . name = sModuleName ; sModuleName = null ; } else { if ( strictModuleDefinitions ) { var oError = new Error ( "Modules that use an anonymous define() call must be loaded with a require() call; " + "they must not be executed via script tag or nested into other modules. " ) ; if ( oRequestedModule ) { oRequestedModule . fail ( oError ) ; } else { throw oError ; } } oEntry . name = '~anonymous~' + ( ++ iAnonymousModuleCount ) + '.js' ; log . error ( "Modules that use an anonymous define() call must be loaded with a require() call; " + "they must not be executed via script tag or nested into other modules. " + "All other usages will fail in future releases or when standard AMD loaders are used. " + "Now using substitute name " + oEntry . name ) ; } } else if ( oRequestedModule && oEntry . name === oRequestedModule . name ) { if ( sModuleName == null && ! strictModuleDefinitions ) { log . error ( "Duplicate module definition: both, an unnamed module and a module with the expected name exist." + "This use case will fail in future releases or when standard AMD loaders are used. " ) ; } sModuleName = null ; } } ) ; if ( sModuleName && aQueueCopy . length > 0 ) { if ( bLoggable ) { log . debug ( "No queued module definition matches the ID of the request. " + "Now assuming that the first definition '" + aQueueCopy [ 0 ] . name + "' is an alias of '" + sModuleName + "'" ) ; } Module . get ( aQueueCopy [ 0 ] . name ) . addAlias ( sModuleName ) ; sModuleName = null ; } if ( bLoggable ) { log . debug ( sLogPrefix + "[" + sInitiator + "] " + "processing define queue #" + iCurrentRun + ( oRequestedModule ? " for '" + oRequestedModule . name + "'" : "" ) + " with entries [" + aQueueCopy . map ( function ( entry ) { return "'" + entry . name + "'" ; } ) + "]" ) ; } aQueueCopy . forEach ( function ( oEntry ) { executeModuleDefinition ( oEntry . name , oEntry . deps , oEntry . factory , oEntry . _export , true ) ; } ) ; if ( sModuleName != null && ! oRequestedModule . settled ) { if ( bLoggable ) { log . debug ( sLogPrefix + "no queued module definition for the requested module found, assume the module to be ready" ) ; } oRequestedModule . data = undefined ; oRequestedModule . ready ( ) ; } if ( bLoggable ) { log . debug ( sLogPrefix + "processing define queue #" + iCurrentRun + " done" ) ; } } ; }
Queue of modules for which sap.ui.define has been called (in async mode), but which have not been executed yet.
Queue of modules for which sap . ui . define has been called ( in async mode ) but which have not been executed yet .
// trigger queue processing via a timer in case the currently executing script is not managed by the loader /**
		 * Process the queue of module definitions, assuming that the original request was for
		 * <code>oRequestedModule</code>. If there is an unnamed module definition, it is assumed to be
		 * the one for the requested module.
		 *
		 * When called via timer, <code>oRequestedModule</code> will be undefined.
		 *
		 * @param {Module} [oRequestedModule] Module for which the current script was loaded.
		 * @param {string} [sInitiator] A string describing the caller of <code>process</code>
		 */ // clear the queue and timer early, we've already taken a copy of the queue // if a module execution error was detected, stop processing the queue /*
			 * Name of the requested module, null when unknown or already consumed.
			 *
			 *  - when no module request is known (e.g. script was embedded in the page as an unmanaged script tag),
			 *    then no name is known and unnamed module definitions will be reported as an error
			 *  - multiple unnamed module definitions also are reported as an error
			 *  - when the name of a named module definition matches the name of requested module, the name is 'consumed'.
			 *    Any later unnamed module definition will be reported as an error, too
			 */ // check whether there's a module definition for the requested module // multiple modules have been queued, but only one module can inherit the name from the require call // give anonymous modules a unique pseudo ID // if 'strictModuleDefinitions' is active, double execution will be reported anyhow // if not, assign an alias if there's at least one queued module definition // start to resolve the dependencies /* bAsync = */ // module name still not consumed, might be a non-UI5 module (e.g. in 'global' format) // allow GC // no export known, has to be retrieved via global name