<commit_before>define(["dojo","dojox/json/ref","dojox/json/schema","dojox/application/application","text!dojox/application/schema/application.json"],function(dojo,ref,schema, application,appSchema){
	return function(config){
		if (!config){
			throw Error("App Config Missing");
		}

		console.log("before resolve: ", appSchema);

		if (appSchema){
			var as = dojox.json.ref.resolveJson(appSchema);
		}

		console.log("as: ", as);	
		//TODO validate schema here
		//if (schema.validate(config,appSchema)){
			console.log("config.modules: ", config.modules);
			var modules = config.modules.concat(config.dependencies||[]);
			return define(modules, function(){
				var modules=[application];
				for(var i=0;i<config.modules.length;i++){
					modules.push(arguments[i]);
				}
				//console.log("declare: ",modules);	
				config = dojox.json.ref.resolveJson(config);<commit_msg>fix the calling of the call back since the define will not call back unless the defined module is required.<commit_after>define(["dojo","dojox/json/ref","dojox/json/schema","dojox/application/application","text!dojox/application/schema/application.json"],function(dojo,ref,schema, application,appSchema){
	return function(config){
		if (!config){
			throw Error("App Config Missing");
		}

		console.log("before resolve: ", appSchema);

		if (appSchema){
			var as = dojox.json.ref.resolveJson(appSchema);
		}

		console.log("as: ", as);	
		//TODO validate schema here
		//if (schema.validate(config,appSchema)){
			console.log("config.modules: ", config.modules);
			var modules = config.modules.concat(config.dependencies||[]);
			return require(modules, function(){
				var modules=[application];
				for(var i=0;i<config.modules.length;i++){
					modules.push(arguments[i]);
				}
				//console.log("declare: ",modules);	
				config = dojox.json.ref.resolveJson(config);
{'fraction_non_alphanumeric': 0.167835941716136, 'fraction_numerical': 0.0010793308148947653, 'mean_word_length': 4.848580441640379, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '293965', 'n_tokens_mistral': 660, 'n_tokens_neox': 573, 'n_words': 104}