src/sap.ui.rta/src/sap/ui/rta/ControlTreeModifier.js
function (sClassName, oAppComponent, oView, oSelector, mSettings, bAsync) {
			var oExistingControl = this.bySelector(oSelector, oAppComponent);
			var fnCreateUndoOperation = function() {
				if (!oExistingControl) {
					var oCreatedControl = this.bySelector(oSelector, oAppComponent);
					RtaControlTreeModifier._saveUndoOperation("destroy", [oCreatedControl]);
				}
			}.bind(this);

			var vReturnValue = JsControlTreeModifier.createControl.apply(this, arguments);

			if (bAsync) {
				return vReturnValue.then(function(oReturnedControl) {
					fnCreateUndoOperation();
					return oReturnedControl;
				});
			}

			fnCreateUndoOperation();
			return vReturnValue;
		}
function (sClassName, oAppComponent, oView, oSelector, mSettings, bAsync) {
			var oExistingControl = this.bySelector(oSelector, oAppComponent);
			var fnCreateUndoOperation = function() {
				if (!oExistingControl) {
					var oCreatedControl = this.bySelector(oSelector, oAppComponent);
					RtaControlTreeModifier._saveUndoOperation("destroy", [oCreatedControl]);
				}
			}.bind(this);

			var vReturnValue = JsControlTreeModifier.createControl.apply(this, arguments);

			if (bAsync) {
				return vReturnValue.then(function(oReturnedControl) {
					fnCreateUndoOperation();
					return oReturnedControl;
				});
			}

			fnCreateUndoOperation();
			return vReturnValue;
		}
function ( sClassName , oAppComponent , oView , oSelector , mSettings , bAsync ) { var oExistingControl = this . bySelector ( oSelector , oAppComponent ) ; var fnCreateUndoOperation = function ( ) { if ( ! oExistingControl ) { var oCreatedControl = this . bySelector ( oSelector , oAppComponent ) ; RtaControlTreeModifier . _saveUndoOperation ( "destroy" , [ oCreatedControl ] ) ; } } . bind ( this ) ; var vReturnValue = JsControlTreeModifier . createControl . apply ( this , arguments ) ; if ( bAsync ) { return vReturnValue . then ( function ( oReturnedControl ) { fnCreateUndoOperation ( ) ; return oReturnedControl ; } ) ; } fnCreateUndoOperation ( ) ; return vReturnValue ; }
Record destroy as undo operation
@override
Record destroy as undo operation