[Pkg] The Trunk: SMBase-cmm.127.mcz

commits at source.squeak.org commits at source.squeak.org
Sun May 8 23:13:08 UTC 2011


Chris Muller uploaded a new version of SMBase to project The Trunk:
http://source.squeak.org/trunk/SMBase-cmm.127.mcz

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

Name: SMBase-cmm.127
Author: cmm
Time: 8 May 2011, 6:12:51.646 pm
UUID: c0b8bd09-815c-4f54-a16d-db405ce93550
Ancestors: SMBase-cmm.126

No sender of SMSqueakMap>>#packageWithName: is properly guarding for nil.  Therefore, change it to signal an appropriate error message.

=============== Diff against SMBase-cmm.126 ===============

Item was changed:
  ----- Method: SMSqueakMap>>packageWithName: (in category 'queries') -----
+ packageWithName: aName 
+ 	"Look up a package by exact match on name. Signal an exception if missing."
+ 	^ self
+ 		packageWithName: aName
+ 		ifAbsent: [ self error: aName , ' is not in the cached catalog.' ]!
- packageWithName: aName
- 	"Look up a package by exact match on name. Return nil if missing."
- 
- 	^self packages detect: [:package | package name = aName ] ifNone: [nil]!

Item was added:
+ ----- Method: SMSqueakMap>>packageWithName:ifAbsent: (in category 'queries') -----
+ packageWithName: aName ifAbsent: aBlock 
+ 	"Look up a package by exact match on name. Return nil if missing."
+ 	^ self packages
+ 		detect: [ : package | package name = aName ]
+ 		ifNone: aBlock!



More information about the Packages mailing list