[squeak-dev] The Trunk: Kernel-fbs.803.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Sep 2 17:09:18 UTC 2013


Frank Shearar uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-fbs.803.mcz

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

Name: Kernel-fbs.803
Author: fbs
Time: 2 September 2013, 6:07:43.531 pm
UUID: d195e09a-59f7-ce42-a9fd-1c4d7a774d02
Ancestors: Kernel-cmm.802

When adding a class var, use a #environment message send, because the environment instvar may be nil (when classes explicitly wish to defer the decision of containing environment to their superclass).

(I've been using this change for ages in my own images.)

=============== Diff against Kernel-cmm.802 ===============

Item was changed:
  ----- Method: Class>>addClassVarName: (in category 'class variables') -----
  addClassVarName: aString 
  	"Add the argument, aString, as a class variable of the receiver.
  	Signal an error if the first character of aString is not capitalized,
  	or if it is already a variable named in the class."
  	| symbol oldState |
  	oldState := self copy.
  	aString first canBeGlobalVarInitial
  		ifFalse: [^self error: aString, ' class variable name should be capitalized; proceed to include anyway.'].
  	symbol := aString asSymbol.
  	self withAllSubclasses do: 
  		[:subclass | 
  		(self canFindWithoutEnvironment: symbol) ifTrue: [
  			(DuplicateVariableError new)
  				superclass: superclass; "fake!!!!!!"
  				variable: aString;
  				signal: aString, ' is already defined']].
  	classPool == nil ifTrue: [classPool := Dictionary new].
  	(classPool includesKey: symbol) ifFalse: 
  		["Pick up any refs in Undeclared"
+ 		classPool declare: symbol from: self environment undeclared.
- 		classPool declare: symbol from: environment undeclared.
  		SystemChangeNotifier uniqueInstance classDefinitionChangedFrom: oldState to: self]!



More information about the Squeak-dev mailing list