ClassBuilder.st
branchjv
changeset 17732 a1892eeca6c0
parent 17729 4187f74d2df8
child 17734 406b1590afe8
--- a/ClassBuilder.st	Fri Aug 28 12:38:51 2009 +0100
+++ b/ClassBuilder.st	Sat Oct 24 16:48:19 2009 +0100
@@ -12,12 +12,12 @@
 "{ Package: 'stx:libbasic' }"
 
 Object subclass:#ClassBuilder
-	instanceVariableNames:'metaclass className environment superClass instanceVariableNames
-		flags classVariableNames poolDictionaries category comment
-		changed classInstanceVariableNames oldMetaClass oldClass
-		oldPoolDictionaries oldSuperClass oldClassVars oldInstVars
-		realNewName buildPrivateClass buildingPrivateClass nameKey
-		newSuperClass superClassChange newClassVars newInstVars
+	instanceVariableNames:'metaclass classClass className environment superClass
+		instanceVariableNames flags classVariableNames poolDictionaries
+		category comment changed classInstanceVariableNames oldMetaClass
+		oldClass oldPoolDictionaries oldSuperClass oldClassVars
+		oldInstVars realNewName buildPrivateClass buildingPrivateClass
+		nameKey newSuperClass superClassChange newClassVars newInstVars
 		classVarChange instVarChange recompileGlobalAccessTo
 		oldClassToBecomeNew oldClassInstVars newClassInstVars'
 	classVariableNames:''
@@ -277,7 +277,11 @@
 !ClassBuilder methodsFor:'accessing'!
 
 classClass
-    ^ Class
+    ^ classClass ? Class
+!
+
+classClass:aClass
+    classClass := aClass.
 !
 
 metaclass:metaclassOrASubclassOfIt
@@ -386,7 +390,7 @@
     ].
 
     (superClass notNil and:[realNewName = superClass name]) ifTrue:[
-        self error:'trying to create circular class definition'.
+        ClassBuildError raiseErrorString:'trying to create circular class definition'.
         ^ nil
     ].
 
@@ -403,7 +407,7 @@
     oldClass notNil ifTrue:[
         (oldClass isRealNameSpace) ifTrue:[
             (superClass == NameSpace or:[superClass isNamespace]) ifFalse:[
-                self error:'class exists as namespace'.
+                ClassBuildError raiseErrorString:'class exists as namespace'.
                 ^ nil.
             ].
             ^ oldClass
@@ -428,7 +432,7 @@
             oldClass := nil
         ] ifFalse:[
             (self checkForCircularDefinitionFrom:oldClass) ifTrue:[
-                self error:'trying to create circular class definition'.
+                ClassBuildError raiseErrorString:'trying to create circular class definition'.
                 ^ nil
             ].
 
@@ -929,7 +933,7 @@
             "/ dont allow built-in classes to be modified
 
             (oldClass notNil and:[oldClass isBuiltInClass and:[instVarChange]]) ifTrue:[
-                self error:'the layout of this class is fixed - you cannot change it'.
+                ClassBuildError raiseErrorString:'the layout of this class is fixed - you cannot change it'.
                 AbortSignal raise
             ].
 
@@ -1132,7 +1136,7 @@
 
     "/ dont allow built-in classes to be modified this way
     (oldClass notNil and:[oldClass isBuiltInClass and:[superClassChange]]) ifTrue:[
-        self error:'the inheritance of this class is fixed - you cannot change it'.
+        ClassBuildError raiseErrorString:'the inheritance of this class is fixed - you cannot change it'.
         ^ oldClass
     ].
 
@@ -1498,7 +1502,7 @@
     newClass classVariableString:(oldClass classVariableString).
     newClass setComment:(oldClass comment).
     newClass setCategory:(oldClass category).
-    (t := oldClass classAttributes) notNil ifTrue:[
+    (t := oldClass attributes) notNil ifTrue:[
         newClass classAttributes:t.
     ].        
     newClass setClassFilename:(oldClass getClassFilename).
@@ -1643,7 +1647,7 @@
         newSub setName:(aSubclass name).
         newSub setClassVariableString:(aSubclass classVariableString).
         newSub setInstanceVariableString:(aSubclass instanceVariableString).
-        (t := aSubclass classAttributes) notNil ifTrue:[
+        (t := aSubclass attributes) notNil ifTrue:[
             newSub classAttributes:t.
         ].        
         newSub package:(aSubclass package).
@@ -1818,7 +1822,7 @@
             ] ifFalse:[
                 pkg := Class packageQuerySignal query.
                 oldPkg ~= pkg ifTrue:[
-                    pkg == Project noProjectID ifTrue:[
+                    pkg == PackageId noProjectID ifTrue:[
                         pkg := oldPkg.
                     ] ifFalse:[ 
                         answer := Class classRedefinitionNotification
@@ -1921,10 +1925,10 @@
 
     (className isSymbol not
     or:[className size == 0]) ifTrue:[
-        self error:'invalid class name (must be a nonEmpty symbol)'.
+        ClassBuildError raiseErrorString:'invalid class name (must be a nonEmpty symbol)'.
     ].
     className first isLetter ifFalse:[
-        self error:'invalid class name (must start with a letter)'.
+        ClassBuildError raiseErrorString:'invalid class name (must start with a letter)'.
     ].
 
     "Modified: / 11-08-2006 / 12:46:54 / cg"
@@ -2133,7 +2137,7 @@
     "check for invalid subclassing of UndefinedObject and SmallInteger"
     superClass notNil ifTrue:[
         superClass canBeSubclassed ifFalse:[
-            self error:('it is not possible to subclass ' , superClass name).
+            ClassBuildError raiseErrorString:('it is not possible to subclass ' , superClass name).
         ]
     ].
 !
@@ -2178,5 +2182,10 @@
 !ClassBuilder class methodsFor:'documentation'!
 
 version
-    ^ '$Id: ClassBuilder.st 10468 2009-08-22 08:34:50Z vranyj1 $'
+    ^ '$Id: ClassBuilder.st 10473 2009-10-24 15:48:19Z vranyj1 $'
+!
+
+version_CVS
+    ^ '§Header: /cvs/stx/stx/libbasic/ClassBuilder.st,v 1.83 2009/10/13 15:43:32 cg Exp §'
 ! !
+