Opened 9 years ago

Closed 9 years ago

#15754 closed defect (duplicate)

model.js unreachable code

Reported by: bill Owned by: Ed Chatelain
Priority: undecided Milestone: tbd
Component: DojoX App Version: 1.8.0rc1
Keywords: Cc:
Blocked By: Blocking:


Final return statement in this function is meaningless:

return function(/*Object*/ config, /*Object*/ parent, /*Object*/ app){
	// summary:
	//		model is called to create all of the models for the app, and all models for a view, it will
	//		create and call the appropriate model utility based upon the modelLoader set in the model in the config
	// description:
	//		Called for each view or for the app.  For each model in the config, it will  
	//		create the model utility based upon the modelLoader and call it to create and load the model. 
	// config: Object
	//		The models section of the config for this view or for the app.
	// parent: Object
	//		The parent of this view or the app itself, so that models from the parent will be 
	//		available to the view.
	// returns: loadedModels 
	//		 loadedModels is an object holding all of the available loaded models for this view.

	//var config = params.config;
	//var parent = params.parent; = app || parent;
	this.defCount = 0;
	var loadedModels = {};
	var allModelsLoadedDeferred = new Deferred();
		lang.mixin(loadedModels, parent.loadedModels);
		var loadModelDeferred = loadedModels;
		for(var test in config){
			if(test.charAt(0) !== "_"){
		if(this.defCount == 0){
			return loadedModels;
		for(var item in config){
			if(item.charAt(0) !== "_"){
				setupModel(config, item, parent, allModelsLoadedDeferred, loadedModels);
		return allModelsLoadedDeferred;
		return loadedModels;
	return allModelsLoadedDeferred;

Change History (1)

comment:1 Changed 9 years ago by Ed Chatelain

Resolution: duplicate
Status: newclosed

Duplicate of #15340.
Hi Bill, thanks for taking another look at dojox/app, but I think you had removed the unreachable return in your patch for ticket #15340. Once again, I am sorry I did not get that in for 1.8.

Note: See TracTickets for help on using tickets.