function viewFactory(sId, vView, bAsync) {
		var mSettings = {}, oView;

		if (vView && typeof (vView) == "string") { // instantiation sap.ui.jsview("id","name", [async])
			mSettings.viewName = vView;
			if (typeof arguments[2] == "boolean") {
				mSettings.async = bAsync;
			} else if (typeof arguments[2] == "object") { // arguments[2] is somehow a controller
				mSettings.controller = arguments[2];
				mSettings.async = !!arguments[3]; // optional
			}
			oView = new JSView(sId, mSettings);
			return oView;

		} else if (vView && typeof (vView) == "object") { // definition sap.ui.jsview("name",definitionObject)
			// sId is not given, but contains the desired value of sViewName
			mRegistry[sId] = vView;
			sap.ui.loader._.declareModule(sId.replace(/\./g, "/") + ".view.js");
			Log.info("For defining views use JSView.extend instead.");
		} else if (arguments.length == 1 && typeof sId == "string" ||
			arguments.length == 2 && typeof arguments[0] == "string" && typeof arguments[1] == "boolean") { // instantiation sap.ui.jsview("name", [async])
			mSettings.viewName = arguments[0];
			mSettings.async = !!arguments[1]; // optional
			/*** STEP 1: create View ***/
			oView = mSettings.id ? new JSView(mSettings.id, mSettings) : new JSView(mSettings);
			/*** Step 3B and 4B (create and connect controller) happen in View ***/
			return oView;

		} else {
			throw new Error("Wrong arguments ('" + sId + "', '" + vView + "')! Either call sap.ui.jsview([sId,] sViewName) to instantiate a View or sap.ui.jsview(sViewName, oViewImpl) to define a View type.");
		}
	}
function viewFactory(sId, vView, bAsync) {
		var mSettings = {}, oView;

		if (vView && typeof (vView) == "string") { // instantiation sap.ui.jsview("id","name", [async])
			mSettings.viewName = vView;
			if (typeof arguments[2] == "boolean") {
				mSettings.async = bAsync;
			} else if (typeof arguments[2] == "object") { // arguments[2] is somehow a controller
				mSettings.controller = arguments[2];
				mSettings.async = !!arguments[3]; // optional
			}
			oView = new JSView(sId, mSettings);
			return oView;

		} else if (vView && typeof (vView) == "object") { // definition sap.ui.jsview("name",definitionObject)
			// sId is not given, but contains the desired value of sViewName
			mRegistry[sId] = vView;
			sap.ui.loader._.declareModule(sId.replace(/\./g, "/") + ".view.js");
			Log.info("For defining views use JSView.extend instead.");
		} else if (arguments.length == 1 && typeof sId == "string" ||
			arguments.length == 2 && typeof arguments[0] == "string" && typeof arguments[1] == "boolean") { // instantiation sap.ui.jsview("name", [async])
			mSettings.viewName = arguments[0];
			mSettings.async = !!arguments[1]; // optional
			/*** STEP 1: create View ***/
			oView = mSettings.id ? new JSView(mSettings.id, mSettings) : new JSView(mSettings);
			/*** Step 3B and 4B (create and connect controller) happen in View ***/
			return oView;

		} else {
			throw new Error("Wrong arguments ('" + sId + "', '" + vView + "')! Either call sap.ui.jsview([sId,] sViewName) to instantiate a View or sap.ui.jsview(sViewName, oViewImpl) to define a View type.");
		}
	}
function viewFactory ( sId , vView , bAsync ) { var mSettings = { } , oView ; if ( vView && typeof ( vView ) == "string" ) { // instantiation sap.ui.jsview("id","name", [async]) mSettings . viewName = vView ; if ( typeof arguments [ 2 ] == "boolean" ) { mSettings . async = bAsync ; } else if ( typeof arguments [ 2 ] == "object" ) { // arguments[2] is somehow a controller mSettings . controller = arguments [ 2 ] ; mSettings . async = ! ! arguments [ 3 ] ; // optional } oView = new JSView ( sId , mSettings ) ; return oView ; } else if ( vView && typeof ( vView ) == "object" ) { // definition sap.ui.jsview("name",definitionObject) // sId is not given, but contains the desired value of sViewName mRegistry [ sId ] = vView ; sap . ui . loader . _ . declareModule ( sId . replace ( / \. / g , "/" ) + ".view.js" ) ; Log . info ( "For defining views use JSView.extend instead." ) ; } else if ( arguments . length == 1 && typeof sId == "string" || arguments . length == 2 && typeof arguments [ 0 ] == "string" && typeof arguments [ 1 ] == "boolean" ) { // instantiation sap.ui.jsview("name", [async]) mSettings . viewName = arguments [ 0 ] ; mSettings . async = ! ! arguments [ 1 ] ; // optional /*** STEP 1: create View ***/ oView = mSettings . id ? new JSView ( mSettings . id , mSettings ) : new JSView ( mSettings ) ; /*** Step 3B and 4B (create and connect controller) happen in View ***/ return oView ; } else { throw new Error ( "Wrong arguments ('" + sId + "', '" + vView + "')! Either call sap.ui.jsview([sId,] sViewName) to instantiate a View or sap.ui.jsview(sViewName, oViewImpl) to define a View type." ) ; } }
/*
The old view factory implementation
/ * The old view factory implementation
Creates a view instance