[squeak-dev] The Trunk: Compiler-eem.447.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Oct 9 19:11:09 UTC 2020


Eliot Miranda uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-eem.447.mcz

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

Name: Compiler-eem.447
Author: eem
Time: 9 October 2020, 12:11:07.767302 pm
UUID: aee4bc8a-7732-41ee-a2e8-d793572b08a4
Ancestors: Compiler-eem.446

Initialize source correctly in CompilationCue and answer it if available in stringToLog.

=============== Diff against Compiler-eem.446 ===============

Item was changed:
  ----- Method: CompilationCue>>initializeWithSource:context:receiver:class:environment:requestor: (in category 'initialization') -----
+ initializeWithSource: aTextOrStringOrStream context: aContext receiver: recObject class: aClass environment: anEnvironment requestor: reqObject
- initializeWithSource: aTextOrString context: aContext receiver: recObject class: aClass environment: anEnvironment requestor: reqObject
  	self initialize.
+ 	aTextOrStringOrStream isStream
+ 		ifTrue: [sourceStream := aTextOrStringOrStream]
+ 		ifFalse:
+ 			[source := aTextOrStringOrStream.
+ 			 sourceStream := ReadStream on: aTextOrStringOrStream asString].
- 	source := aTextOrString.
- 	sourceStream := aTextOrString isStream
- 					ifTrue: [aTextOrString]
- 					ifFalse: [ReadStream on: aTextOrString asString].
  	context := aContext.
  	receiver := recObject.
  	class := aClass.
  	environment := anEnvironment.
  	requestor := reqObject!

Item was changed:
  ----- Method: CompilationCue>>stringToLog (in category 'accessing') -----
  stringToLog
  	"Answer a string to be logged in a change log.
  	Implementation note:
  	If the requestor is a TextEditor, preferably take its selection.
  	This convoluted code is presumably crafted to avoid broken contents
  	(ReadStream on: '123456' from: 3 to: 4) contents -> '1234'
  	As long as selectionAsStream is using such construct this might be required."
  	| itsSelection itsSelectionString |
+ 	source ifNotNil:
+ 		[^source].
+ 	((requestor respondsTo: #selection)  
+ 	 and:[(itsSelection := requestor selection) notNil
+ 	 and:[(itsSelectionString := itsSelection asString) isEmptyOrNil not]]) ifTrue:
+ 		[^itsSelectionString].
+ 	^sourceStream contents!
- 	^((requestor respondsTo: #selection)  
- 			and:[(itsSelection := requestor selection) notNil
- 			and:[(itsSelectionString := itsSelection asString) isEmptyOrNil not]])
- 				ifTrue:[itsSelectionString]
- 				ifFalse:[self sourceStream contents]!



More information about the Squeak-dev mailing list