[squeak-dev] The Inbox: System-fbs.410.mcz

commits at source.squeak.org commits at source.squeak.org
Sun Jan 9 19:05:15 UTC 2011


A new version of System was added to project The Inbox:
http://source.squeak.org/inbox/System-fbs.410.mcz

==================== Summary ====================

Name: System-fbs.410
Author: fbs
Time: 9 January 2011, 7:04:30.976 pm
UUID: 5c92be57-a803-8a41-89f4-c5655001ef11
Ancestors: System-ul.409

Ensure that classOrTraitNamed: doesn't return globals.

=============== Diff against System-ul.409 ===============

Item was changed:
  ----- Method: SystemDictionary>>classOrTraitNamed: (in category 'classes and traits') -----
  classOrTraitNamed: aString 
  	"aString is either a class or trait name or a class or trait name followed by ' class' or 'classTrait' respectively.
  	Answer the class or metaclass it names."
  
+ 	| meta baseName |
- 	| meta baseName baseClass |
  	(aString endsWith: ' class')
  		ifTrue: [meta := true.
  				baseName := aString copyFrom: 1 to: aString size - 6]
  		ifFalse: [
  			(aString endsWith: ' classTrait')
  				ifTrue: [
  					meta := true.
  					baseName := aString copyFrom: 1 to: aString size - 11]
  				ifFalse: [
  					meta := false.
  					baseName := aString]].
+ 
+ 	^self at: baseName asSymbol ifPresent:
+ 		[ :global |
+  		global isBehavior ifTrue:
+ 			[ meta
+ 				ifFalse: [ global ]
+ 				ifTrue: [ global classSide ]]]!
- 	baseClass := Smalltalk at: baseName asSymbol ifAbsent: [^ nil].
- 	meta
- 		ifTrue: [^ baseClass classSide]
- 		ifFalse: [^ baseClass]!




More information about the Squeak-dev mailing list