incubator-xap-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mtu...@apache.org
Subject svn commit: r494127 - /incubator/xap/trunk/src/xap/mco/McoNamespaceHandler.js
Date Mon, 08 Jan 2007 17:23:54 GMT
Author: mturyn
Date: Mon Jan  8 09:23:50 2007
New Revision: 494127

URL: http://svn.apache.org/viewvc?view=rev&rev=494127
Log:
Fixed Xap.require() behaviour when attempting to load given just the class name---we weren't
even giving it a chance before, as it turns out....

Modified:
    incubator/xap/trunk/src/xap/mco/McoNamespaceHandler.js

Modified: incubator/xap/trunk/src/xap/mco/McoNamespaceHandler.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/mco/McoNamespaceHandler.js?view=diff&rev=494127&r1=494126&r2=494127
==============================================================================
--- incubator/xap/trunk/src/xap/mco/McoNamespaceHandler.js (original)
+++ incubator/xap/trunk/src/xap/mco/McoNamespaceHandler.js Mon Jan  8 09:23:50 2007
@@ -137,25 +137,15 @@
 	//we STILL don't have an MCO constructor, try require() on the class name
 	if( !mcoConstructor ){
 		//Last-ditch:
-		// (Doesn't even seem to work well yet---some
-		// problem getting the proper path for the require()
-		// statement, doesn't get right root for (at least)
-		// "xap"
-		// TODO:  Get this right.
-		//right now it will look in src/dojo for stuff
+		//note that this is dependent on Xap/dojo.require's
+		//being able to find the source file.
 		var success = Xap.require(className) ;
 		if( !success ){
 			throw new xap.util.Exception("Cannot load constructor for "
-										+ " MCO object"
-										+ " using Xap.require('"+className+"')"
-										+ "'.") ;
-		}	
-	
-		throw new xap.util.Exception("Cannot create an MCO object"
-										+ " from the constructor '"
-										+ className
-										+ "'.") ;	
-	
+						+ "'.") ;
+		} else {
+			mcoConstructor = Xap.resolveConstructor(className) ;		
+		}			
 	}									 
 	try {
 		// We can do the following because we're argless:



Mime
View raw message