src/sap.ui.core/src/sap/ui/base/ExpressionParser.js
function saveBindingAsPart(oBinding, iStart, bTargetTypeAny) {
			var bHasNonPrimitiveValue = false,
				sKey,
				oPrimitiveValueBinding,
				i;

			/*
			 * Sets the target type of the given binding to the default "any", if applicable.
			 *
			 * @param {object} oBinding
			 *   A binding
			 */
			function setTargetType(oBinding) {
				if (bTargetTypeAny) {
					if (oBinding.parts) {
						oBinding.parts.forEach(setTargetType);
						// Note: targetType not allowed here, see BindingParser.mergeParts
					} else {
						oBinding.targetType = oBinding.targetType || "any";
					}
				}
			}

			for (sKey in oBinding) {
				switch (typeof oBinding[sKey]) {
					case "boolean":
					case "number":
					case "string":
					case "undefined":
						break;
					default:
						// binding has at least one property of non-primitive value
						bHasNonPrimitiveValue = true;
				}
			}
			setTargetType(oBinding);
			if (bHasNonPrimitiveValue) {
				// the binding must be a complex binding; property "type" (and poss. others) are
				// newly created objects and thus incomparable -> parse again to have the names
				oPrimitiveValueBinding = JSTokenizer.parseJS(sInput, iStart).result;
				setTargetType(oPrimitiveValueBinding);
			} else {
				// only primitive values; easily comparable
				oPrimitiveValueBinding = oBinding;
			}
			for (i = 0; i < aParts.length; i += 1) {
				// Note: order of top-level properties must not matter for equality!
				if (deepEqual(aPrimitiveValueBindings[i], oPrimitiveValueBinding)) {
					return i;
				}
			}
			aPrimitiveValueBindings[i] = oPrimitiveValueBinding;
			aParts[i] = oBinding;
			return i;
		}
function saveBindingAsPart(oBinding, iStart, bTargetTypeAny) {
			var bHasNonPrimitiveValue = false,
				sKey,
				oPrimitiveValueBinding,
				i;

			/*
			 * Sets the target type of the given binding to the default "any", if applicable.
			 *
			 * @param {object} oBinding
			 *   A binding
			 */
			function setTargetType(oBinding) {
				if (bTargetTypeAny) {
					if (oBinding.parts) {
						oBinding.parts.forEach(setTargetType);
						// Note: targetType not allowed here, see BindingParser.mergeParts
					} else {
						oBinding.targetType = oBinding.targetType || "any";
					}
				}
			}

			for (sKey in oBinding) {
				switch (typeof oBinding[sKey]) {
					case "boolean":
					case "number":
					case "string":
					case "undefined":
						break;
					default:
						// binding has at least one property of non-primitive value
						bHasNonPrimitiveValue = true;
				}
			}
			setTargetType(oBinding);
			if (bHasNonPrimitiveValue) {
				// the binding must be a complex binding; property "type" (and poss. others) are
				// newly created objects and thus incomparable -> parse again to have the names
				oPrimitiveValueBinding = JSTokenizer.parseJS(sInput, iStart).result;
				setTargetType(oPrimitiveValueBinding);
			} else {
				// only primitive values; easily comparable
				oPrimitiveValueBinding = oBinding;
			}
			for (i = 0; i < aParts.length; i += 1) {
				// Note: order of top-level properties must not matter for equality!
				if (deepEqual(aPrimitiveValueBindings[i], oPrimitiveValueBinding)) {
					return i;
				}
			}
			aPrimitiveValueBindings[i] = oPrimitiveValueBinding;
			aParts[i] = oBinding;
			return i;
		}
function saveBindingAsPart ( oBinding , iStart , bTargetTypeAny ) { var bHasNonPrimitiveValue = false , sKey , oPrimitiveValueBinding , i ; /*
			 * Sets the target type of the given binding to the default "any", if applicable.
			 *
			 * @param {object} oBinding
			 *   A binding
			 */ function setTargetType ( oBinding ) { if ( bTargetTypeAny ) { if ( oBinding . parts ) { oBinding . parts . forEach ( setTargetType ) ; // Note: targetType not allowed here, see BindingParser.mergeParts } else { oBinding . targetType = oBinding . targetType || "any" ; } } } for ( sKey in oBinding ) { switch ( typeof oBinding [ sKey ] ) { case "boolean" : case "number" : case "string" : case "undefined" : break ; default : // binding has at least one property of non-primitive value bHasNonPrimitiveValue = true ; } } setTargetType ( oBinding ) ; if ( bHasNonPrimitiveValue ) { // the binding must be a complex binding; property "type" (and poss. others) are // newly created objects and thus incomparable -> parse again to have the names oPrimitiveValueBinding = JSTokenizer . parseJS ( sInput , iStart ) . result ; setTargetType ( oPrimitiveValueBinding ) ; } else { // only primitive values; easily comparable oPrimitiveValueBinding = oBinding ; } for ( i = 0 ; i < aParts . length ; i += 1 ) { // Note: order of top-level properties must not matter for equality! if ( deepEqual ( aPrimitiveValueBindings [ i ] , oPrimitiveValueBinding ) ) { return i ; } } aPrimitiveValueBindings [ i ] = oPrimitiveValueBinding ; aParts [ i ] = oBinding ; return i ; }
Saves the binding as a part. Reuses an existing part if the binding is identical.
@param {object} oBinding
the binding to save
@param {int} iStart
the binding's start index in the input string
@param {boolean} [bTargetTypeAny=false]
whether the binding's "targetType" should default to "any" (recursively, for all parts)
@returns {int}
the index at which it has been saved/found in aParts
Saves the binding as a part . Reuses an existing part if the binding is identical .