src/sap.ui.core/src/sap/ui/core/util/XMLPreprocessor.js
function stopAndGo(aElements, fnCallback) {
		var i = -1;

		/*
		 * Visits the next element, taking the result of the previous callback into account.
		 *
		 * @param {boolean} bFound
		 *   Whether an element was approved by the corresponding callback
		 * @returns {sap.ui.base.SyncPromise|any}
		 *   First call returns a <code>sap.ui.base.SyncPromise</code> which resolves with a later
		 *   call's result.
		 */
		function next(bFound) {
			if (bFound) {
				return aElements[i];
			}
			i += 1;
			if (i < aElements.length) {
				return fnCallback(aElements[i], i, aElements).then(next);
			}
		}

		return aElements.length
			? next()
			: oSyncPromiseResolved;
	}
function stopAndGo(aElements, fnCallback) {
		var i = -1;

		/*
		 * Visits the next element, taking the result of the previous callback into account.
		 *
		 * @param {boolean} bFound
		 *   Whether an element was approved by the corresponding callback
		 * @returns {sap.ui.base.SyncPromise|any}
		 *   First call returns a <code>sap.ui.base.SyncPromise</code> which resolves with a later
		 *   call's result.
		 */
		function next(bFound) {
			if (bFound) {
				return aElements[i];
			}
			i += 1;
			if (i < aElements.length) {
				return fnCallback(aElements[i], i, aElements).then(next);
			}
		}

		return aElements.length
			? next()
			: oSyncPromiseResolved;
	}
function stopAndGo ( aElements , fnCallback ) { var i = - 1 ; /*
		 * Visits the next element, taking the result of the previous callback into account.
		 *
		 * @param {boolean} bFound
		 *   Whether an element was approved by the corresponding callback
		 * @returns {sap.ui.base.SyncPromise|any}
		 *   First call returns a <code>sap.ui.base.SyncPromise</code> which resolves with a later
		 *   call's result.
		 */ function next ( bFound ) { if ( bFound ) { return aElements [ i ] ; } i += 1 ; if ( i < aElements . length ) { return fnCallback ( aElements [ i ] , i , aElements ) . then ( next ) ; } } return aElements . length ? next ( ) : oSyncPromiseResolved ; }
Visits the given elements one-by-one, calls the given callback for each of them and stops
and waits for each sync promise returned by the callback before going on to the next element.
If a sync promise resolves with a truthy value, iteration stops and the corresponding element
becomes the result of the returned sync promise.

@param {any[]} aElements
Whatever elements we want to visit
@param {function} fnCallback
A function to be called with a single element and its index and the array (like
{@link Array#find} does it), returning a {@link sap.ui.base.SyncPromise}.
@returns {sap.ui.base.SyncPromise}
A sync promise which resolves with the first element where the callback's sync promise
resolved with a truthy value, or resolves with <code>undefined</code> as soon as the last
callback's sync promise has resolved, or is rejected with a corresponding error if any
callback returns a rejected sync promise or throws an error
@throws {Error}
If the first callback throws
Visits the given elements one - by - one calls the given callback for each of them and stops and waits for each sync promise returned by the callback before going on to the next element . If a sync promise resolves with a truthy value iteration stops and the corresponding element becomes the result of the returned sync promise .