The Inbox: System-fbs.410.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: System-fbs.410.mcz

commits-2
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]!