src/sap.ui.core/src/sap/ui/core/Core.js
function preloadLibrarySync(libConfig) {

		libConfig = evalLibConfig(libConfig);

		var lib = libConfig.name,
			fileType = libConfig.fileType,
			libPackage = lib.replace(/\./g, '/'),
			libLoaded = !!sap.ui.loader._.getModuleState(libPackage + '/library.js');

		if ( fileType === 'none' || libLoaded ) {
			return;
		}

		var libInfo = mLibraryPreloadBundles[lib] || (mLibraryPreloadBundles[lib] = { });

		// already preloaded?
		if ( libInfo.pending === false ) {
			return;
		}

		// currently loading
		if ( libInfo.pending ) {
			if ( libInfo.async ) {
				Log.warning("request to load " + lib + " synchronously while async loading is pending; this causes a duplicate request and should be avoided by caller");
				// fall through and preload synchronously
			} else {
				// sync cycle -> ignore nested call (would nevertheless be a dependency cycle)
				Log.warning("request to load " + lib + " synchronously while sync loading is pending (cycle, ignored)");
				return;
			}
		}

		libInfo.pending = true;
		libInfo.async = false;

		var resolve;
		libInfo.promise = new Promise(function(_resolve, _reject) {
			resolve = _resolve;
		});

		var dependencies;
		if ( fileType !== 'json' /* 'js' or 'both', not forced to JSON */ ) {
			var sPreloadModule = libPackage + '/library-preload';
			try {
				sap.ui.requireSync(sPreloadModule);
				dependencies = dependenciesFromManifest(lib);
			} catch (e) {
				Log.error("failed to load '" + sPreloadModule + "' (" + (e && e.message || e) + ")");
				if ( e && e.loadError && fileType !== 'js' ) {
					dependencies = loadJSONSync(lib);
				} // ignore other errors (preload shouldn't fail)
			}
		} else {
			dependencies = loadJSONSync(lib);
		}

		if ( dependencies && dependencies.length ) {
			dependencies.forEach(preloadLibrarySync);
		}

		libInfo.pending = false;
		resolve();

	}
function preloadLibrarySync(libConfig) {

		libConfig = evalLibConfig(libConfig);

		var lib = libConfig.name,
			fileType = libConfig.fileType,
			libPackage = lib.replace(/\./g, '/'),
			libLoaded = !!sap.ui.loader._.getModuleState(libPackage + '/library.js');

		if ( fileType === 'none' || libLoaded ) {
			return;
		}

		var libInfo = mLibraryPreloadBundles[lib] || (mLibraryPreloadBundles[lib] = { });

		// already preloaded?
		if ( libInfo.pending === false ) {
			return;
		}

		// currently loading
		if ( libInfo.pending ) {
			if ( libInfo.async ) {
				Log.warning("request to load " + lib + " synchronously while async loading is pending; this causes a duplicate request and should be avoided by caller");
				// fall through and preload synchronously
			} else {
				// sync cycle -> ignore nested call (would nevertheless be a dependency cycle)
				Log.warning("request to load " + lib + " synchronously while sync loading is pending (cycle, ignored)");
				return;
			}
		}

		libInfo.pending = true;
		libInfo.async = false;

		var resolve;
		libInfo.promise = new Promise(function(_resolve, _reject) {
			resolve = _resolve;
		});

		var dependencies;
		if ( fileType !== 'json' /* 'js' or 'both', not forced to JSON */ ) {
			var sPreloadModule = libPackage + '/library-preload';
			try {
				sap.ui.requireSync(sPreloadModule);
				dependencies = dependenciesFromManifest(lib);
			} catch (e) {
				Log.error("failed to load '" + sPreloadModule + "' (" + (e && e.message || e) + ")");
				if ( e && e.loadError && fileType !== 'js' ) {
					dependencies = loadJSONSync(lib);
				} // ignore other errors (preload shouldn't fail)
			}
		} else {
			dependencies = loadJSONSync(lib);
		}

		if ( dependencies && dependencies.length ) {
			dependencies.forEach(preloadLibrarySync);
		}

		libInfo.pending = false;
		resolve();

	}
function preloadLibrarySync ( libConfig ) { libConfig = evalLibConfig ( libConfig ) ; var lib = libConfig . name , fileType = libConfig . fileType , libPackage = lib . replace ( / \. / g , '/' ) , libLoaded = ! ! sap . ui . loader . _ . getModuleState ( libPackage + '/library.js' ) ; if ( fileType === 'none' || libLoaded ) { return ; } var libInfo = mLibraryPreloadBundles [ lib ] || ( mLibraryPreloadBundles [ lib ] = { } ) ; // already preloaded? if ( libInfo . pending === false ) { return ; } // currently loading if ( libInfo . pending ) { if ( libInfo . async ) { Log . warning ( "request to load " + lib + " synchronously while async loading is pending; this causes a duplicate request and should be avoided by caller" ) ; // fall through and preload synchronously } else { // sync cycle -> ignore nested call (would nevertheless be a dependency cycle) Log . warning ( "request to load " + lib + " synchronously while sync loading is pending (cycle, ignored)" ) ; return ; } } libInfo . pending = true ; libInfo . async = false ; var resolve ; libInfo . promise = new Promise ( function ( _resolve , _reject ) { resolve = _resolve ; } ) ; var dependencies ; if ( fileType !== 'json' /* 'js' or 'both', not forced to JSON */ ) { var sPreloadModule = libPackage + '/library-preload' ; try { sap . ui . requireSync ( sPreloadModule ) ; dependencies = dependenciesFromManifest ( lib ) ; } catch ( e ) { Log . error ( "failed to load '" + sPreloadModule + "' (" + ( e && e . message || e ) + ")" ) ; if ( e && e . loadError && fileType !== 'js' ) { dependencies = loadJSONSync ( lib ) ; } // ignore other errors (preload shouldn't fail) } } else { dependencies = loadJSONSync ( lib ) ; } if ( dependencies && dependencies . length ) { dependencies . forEach ( preloadLibrarySync ) ; } libInfo . pending = false ; resolve ( ) ; }
Preloads a library synchronously.

@param {string|object} libConfig Name of the library to preload or settings object describing library.
@param {string} [libConfig.name] Name of the library to preload
@param {boolean|undefined} [libConfig.json] Whether library supports only JSON (<code>true</code>) or only JS (<code>false</code>)
or whether both should be tried (undefined)
@private
Preloads a library synchronously .