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/10/19 18:59:31 UTC

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

Author: mturyn
Date: Thu Oct 19 11:59:30 2006
New Revision: 465727

URL: http://svn.apache.org/viewvc?view=rev&rev=465727
Log:
1.) Changed resolveConstructor() so that it can handle xap.a.b.c.ClassName when all or some of that scoping hierarchy isn't yet defined---returns an undefined in that case, instead of bombing-out.  This is a good idea anyway, but was only noticed in the course of implementing JIT loading in the plugin registry and document classes.
2.) Removed unused arguments from the end of setupClassAsSubclassOf().

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?view=diff&rev=465727&r1=465726&r2=465727
==============================================================================
--- incubator/xap/trunk/src/xap/Xap.js (original)
+++ incubator/xap/trunk/src/xap/Xap.js Thu Oct 19 11:59:30 2006
@@ -346,6 +346,14 @@
 		var arr  = aString.split(".") ;
 		for( var kk=0; kk< arr.length - 1; ++kk ){
 			scoper = scoper[arr[kk]] ;
+			if( typeof scoper == "undefined"){
+				// We want to know if we haven't yet
+				// had the sort of provide() statement
+				// that would fill out the scoping hierarchy
+				// we'd expect---beside, it will throw an
+				// exception if we've haven't:
+				return scoper ;
+			}
 		}
 		result =  scoper[arr[arr.length-1]] ;
 	}
@@ -356,7 +364,7 @@
 /**
  * Handles common class set-up routines, assumes constructors for subclass and superclass already exist:
 **/ 
-Xap.setupClassAsSubclassOf = function(subclassName,superclassName,sub,sup){
+Xap.setupClassAsSubclassOf = function(subclassName,superclassName){
 	var subclassConstructor = Xap.resolveConstructor( subclassName ) ;
 	var superclassConstructor = Xap.resolveConstructor( superclassName ) ;