[squeak-dev] The Trunk: Tools-eem.1065.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Sep 27 00:09:29 UTC 2021

Eliot Miranda uploaded a new version of Tools to project The Trunk:

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

Name: Tools-eem.1065
Author: eem
Time: 26 September 2021, 5:09:26.74426 pm
UUID: a9290dc8-36cb-4526-a2f0-ed9e286ef3f7
Ancestors: Tools-eem.1064

Eliminate a shadowed variable warning.

=============== Diff against Tools-eem.1064 ===============

Item was changed:
  ----- Method: Browser>>defineMessageFrom:notifying: (in category 'message functions') -----
  defineMessageFrom: aString notifying: aController
  	"Compile the expressions in aString. Notify aController if a syntax error occurs. Install the compiled method in the selected class classified under  the currently selected message category name. Answer the selector obtained if compilation succeeds, nil otherwise."
+ 	| currentSelector selector category oldMessageList selectedClassOrMetaClass |
+ 	currentSelector := self selectedMessageName.
- 	| selectedMessageName selector category oldMessageList selectedClassOrMetaClass |
- 	selectedMessageName := self selectedMessageName.
  	oldMessageList := self messageList.
  	selectedClassOrMetaClass := self selectedClassOrMetaClass.
  	contents := nil.
  	selector := (selectedClassOrMetaClass newParser parseSelector: aString).
  	(self metaClassIndicated
  		and: [(selectedClassOrMetaClass includesSelector: selector) not
  		and: [Metaclass isScarySelector: selector]])
+ 		ifTrue: ["A first-time definition overlaps the protocol of Metaclasses"
- 		ifTrue: ["A frist-time definition overlaps the protocol of Metaclasses"
  				(self confirm: ((selector , ' is used in the existing class system.
  Overriding it could cause serious problems.
  Is this really what you want to do?') asText makeBoldFrom: 1 to: selector size))
  				ifFalse: [^nil]].
+ 	category := currentSelector
- 	category := selectedMessageName
  		ifNil: [ self selectedMessageCategoryName ]
  		ifNotNil: [ (selectedClassOrMetaClass >> selectedMessageName) methodReference ifNotNil: [ : ref | ref category ]].
  	selector := selectedClassOrMetaClass
  				compile: aString
  				classified: category
  				notifying: aController.
+ 	selector ifNil: [^ nil].
- 	selector == nil ifTrue: [^ nil].
  	contents := aString copy.
  	self changed: #messageCategoryList. "Because the 'as yet unclassified' might just appear."
  	self changed: #messageList. "Because we have code-dependent list formatting by now such as #isDeprecated."
+ 	selector ~~ currentSelector
- 	selector ~~ selectedMessageName
  			[category = ClassOrganizer nullCategory
  				ifTrue: [self changed: #classSelectionChanged.
  						self changed: #classList.
  						self messageCategoryListIndex: 1].
  			self setClassOrganizer.  "In case organization not cached"
  			(oldMessageList includes: selector)
  				ifFalse: [self changed: #messageList].
  			self messageListIndex: (self messageList indexOf: selector)].
  	^ selector!

More information about the Squeak-dev mailing list