You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xap-commits@incubator.apache.org by mt...@apache.org on 2006/08/06 05:54:37 UTC

svn commit: r429107 - /incubator/xap/trunk/src/xap/Xap.js

Author: mturyn
Date: Sat Aug  5 22:54:37 2006
New Revision: 429107

URL: http://svn.apache.org/viewvc?rev=429107&view=rev
Log:
Altered setupClassAsSubclassOf() so that it's simpler, doesn't call dojo.inherit(), and doesn't perform the require(<superclass>), since on reflexion we're better off if that's explicitly in the source file rather than done algorithmically here.

Modified:
    incubator/xap/trunk/src/xap/Xap.js

Modified: incubator/xap/trunk/src/xap/Xap.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/Xap.js?rev=429107&r1=429106&r2=429107&view=diff
==============================================================================
--- incubator/xap/trunk/src/xap/Xap.js (original)
+++ incubator/xap/trunk/src/xap/Xap.js Sat Aug  5 22:54:37 2006
@@ -457,15 +457,17 @@
 Xap.setupClassAsSubclassOf = function(subclassName,superclassName,sub,sup){
 	var subclassConstructor = Xap.resolveConstructor( subclassName ) ;
 	var superclassConstructor = Xap.resolveConstructor( superclassName ) ;	
-	
-	if(superclassName){
-		Xap.require(superclassName) ;
-	}
-	dojo.inherits(subclassConstructor, superclassConstructor) ;
+
+
+	subclassConstructor.prototype = new superclassConstructor();
+	subclassConstructor.prototype.superclass = 	superclassConstructor.prototype ;
+
+	// This can by default the same for all objects; can overwrite this definition in
+	// the source file, if desired...
 	subclassConstructor.prototype.toString = function(){
 		return subclassName ;	
 	}
-	subclassConstructor.prototype.superclass = 	superclassConstructor.prototype ;
+
 	subclassConstructor.s_log = xap.util.LogFactory.getLog( subclassName ) ;
 }