[Pkg] SystemEditor: SystemEditor-mtf.124.mcz

squeak-dev-noreply at lists.squeakfoundation.org squeak-dev-noreply at lists.squeakfoundation.org
Tue Oct 7 23:59:35 UTC 2008


A new version of SystemEditor was added to project SystemEditor:
http://www.squeaksource.com/SystemEditor/SystemEditor-mtf.124.mcz

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

Name: SystemEditor-mtf.124
Author: mtf
Time: 6 October 2008, 12:33:39 pm
UUID: 25458d7e-9457-4e14-be42-e583e0cb0a12
Ancestors: SystemEditor-mtf.123

fixed an atomicity violation in MethodDictionaryEditor, and documented the reason why it was changed in the first place (SystemEditor-mtf.108), namely to support SyntaxError dialogs

=============== Diff against SystemEditor-mtf.123 ===============

Item was changed:
  ----- Method: MetaclassEditor>>edBuild (in category 'building') -----
  edBuild
  	| result class |
  	class := self subject ifNil: [Metaclass] ifNotNilDo: [:subject | subject class].
  	result := class basicNew.
+ 	"Create a temporary MethodDictionary to catch code written by SyntaxError dialogs. MethodDictionaryEditor will overwrite this. See MethodEditor>>compileFor:"
  	result
  		superclass: self edSuperclass
  		methodDictionary: MethodDictionary new
  		format: self format;		
  		organization: self organization build.
  	result setInstVarNames: self instVarNames.
  	^ result!

Item was changed:
  ----- Method: MethodEditor>>compileFor: (in category 'building') -----
  compileFor: aClassEditor
  [
  	| node method |
  	node := aClassEditor compilerClass new
  				compile: source
  				in: aClassEditor product
  				notifying: requestor
  				ifFail: nil.
  	node encoder requestor: self.
  	method := node generate: #(0 0 0 0).
  	(method respondsTo: #selector:) "set selector on 3.9 and above"
  		ifTrue: [method selector: node selector].
  	^ method
  ] on: SyntaxErrorNotification do: [:ex |
  	"In 3.10, the class category needs to be set"
  	ex instVarNamed: #category put: aClassEditor category.
+ 	"Let the user fix and install the fixed code into the class's old or temporary MethodDictionary"
- 	"Let the user install the fixed code into the system"
  	ex outer.
  	"Now fetch and use that code instead"
  	source := aClassEditor product sourceCodeAt: self selector ifAbsent: [^ nil].
  	^ aClassEditor product compiledMethodAt: self selector
  ]!

Item was changed:
  ----- Method: OldMetaclassEditor>>edBuild (in category 'building') -----
  edBuild
  	| result class |
  	class := self subject ifNil: [Metaclass] ifNotNilDo: [:subject | subject class].
  	result := class basicNew.
+ 	"Create a temporary MethodDictionary to catch code written by SyntaxError dialogs. MethodDictionaryEditor will overwrite this. See MethodEditor>>compileFor:"
  	result
  		superclass: self edSuperclass
  		methodDictionary: MethodDictionary new
  		format: self format;		
  		organization: self organization build.
  	result setInstVarNames: self instVarNames.
  	^ result!

Item was changed:
  ----- Method: ClassEditor>>edBuild (in category 'building') -----
  edBuild
  	| meta |
  	meta := self class edBuild.
  	product := subject ifNil: [meta new]
  				ifNotNil: [meta adoptInstance: subject from: subject class].
  	product
  		superclass: self edSuperclass;
  		setFormat: self format;
  		setName: self name;
  		setInstVarNames: self instVarNames;
  		classPoolFrom: self;
  		instVarNamed: #sharedPools put: self sharedPools;
  		organization: self organization build.
+ 	"Create a temporary MethodDictionary to catch code written by SyntaxError dialogs. MethodDictionaryEditor will overwrite this. See MethodEditor>>compileFor:"
  	product methodDictionary: MethodDictionary new.
  	self decoratorsDo: [:ea | ea buildFor: self].
  
  	"Class methods should be compiled before instance methods,
  	since #compilerClass may be among the class methods"
  	self class methods buildFor: self class.
  	self methods buildFor: self.
  	^product!

Item was changed:
  ----- Method: MethodDictionaryEditor>>buildFor: (in category 'editing') -----
  buildFor: aClassEditor
  	| result old |
+ 	result := MethodDictionary new.
- 	result := aClassEditor product methodDictionary.
  	self subject keysAndValuesDo:
  		[:selector :cm |
  		(self selectorIsModified: selector)
  			ifFalse: [result at: selector put: (self recompile: selector from: cm for: aClassEditor)]].
  	additions keysAndValuesDo: 
  		[:selector :mm | 
  		old := self subject at: selector ifAbsent: [nil]. 
  		result at: selector put: (mm compileFrom: old for: aClassEditor)].
  	^ result
  !



More information about the Packages mailing list