src/sap.ui.core/src/sap/ui/core/XMLTemplateProcessor.js
function getHandleChildrenStrategy(bAsync, fnCallback) {

		// sync strategy ensures processing order by just being sync
		function syncStrategy(node, oAggregation, mAggregations) {
			var childNode,
				vChild,
				aChildren = [];

			for (childNode = node.firstChild; childNode; childNode = childNode.nextSibling) {
				vChild = fnCallback(node, oAggregation, mAggregations, childNode);
				if (vChild) {
					aChildren.push(unwrapSyncPromise(vChild));
				}
			}
			return SyncPromise.resolve(aChildren);
		}

		// async strategy ensures processing order by chaining the callbacks
		function asyncStrategy(node, oAggregation, mAggregations) {
			var childNode,
				pChain = Promise.resolve(),
				aChildPromises = [];

			for (childNode = node.firstChild; childNode; childNode = childNode.nextSibling) {
				pChain = pChain.then(fnCallback.bind(null, node, oAggregation, mAggregations, childNode));
				aChildPromises.push(pChain);
			}
			return Promise.all(aChildPromises);
		}

		return bAsync ? asyncStrategy : syncStrategy;
	}
function getHandleChildrenStrategy(bAsync, fnCallback) {

		// sync strategy ensures processing order by just being sync
		function syncStrategy(node, oAggregation, mAggregations) {
			var childNode,
				vChild,
				aChildren = [];

			for (childNode = node.firstChild; childNode; childNode = childNode.nextSibling) {
				vChild = fnCallback(node, oAggregation, mAggregations, childNode);
				if (vChild) {
					aChildren.push(unwrapSyncPromise(vChild));
				}
			}
			return SyncPromise.resolve(aChildren);
		}

		// async strategy ensures processing order by chaining the callbacks
		function asyncStrategy(node, oAggregation, mAggregations) {
			var childNode,
				pChain = Promise.resolve(),
				aChildPromises = [];

			for (childNode = node.firstChild; childNode; childNode = childNode.nextSibling) {
				pChain = pChain.then(fnCallback.bind(null, node, oAggregation, mAggregations, childNode));
				aChildPromises.push(pChain);
			}
			return Promise.all(aChildPromises);
		}

		return bAsync ? asyncStrategy : syncStrategy;
	}
function getHandleChildrenStrategy ( bAsync , fnCallback ) { // sync strategy ensures processing order by just being sync function syncStrategy ( node , oAggregation , mAggregations ) { var childNode , vChild , aChildren = [ ] ; for ( childNode = node . firstChild ; childNode ; childNode = childNode . nextSibling ) { vChild = fnCallback ( node , oAggregation , mAggregations , childNode ) ; if ( vChild ) { aChildren . push ( unwrapSyncPromise ( vChild ) ) ; } } return SyncPromise . resolve ( aChildren ) ; } // async strategy ensures processing order by chaining the callbacks function asyncStrategy ( node , oAggregation , mAggregations ) { var childNode , pChain = Promise . resolve ( ) , aChildPromises = [ ] ; for ( childNode = node . firstChild ; childNode ; childNode = childNode . nextSibling ) { pChain = pChain . then ( fnCallback . bind ( null , node , oAggregation , mAggregations , childNode ) ) ; aChildPromises . push ( pChain ) ; } return Promise . all ( aChildPromises ) ; } return bAsync ? asyncStrategy : syncStrategy ; }
Creates a function based on the passed mode and callback which applies a callback to each child of a node.
@param {boolean} bAsync The strategy to choose
@param {function} fnCallback The callback to apply
@returns {function} The created function
@private
Creates a function based on the passed mode and callback which applies a callback to each child of a node .