[squeak-dev] The Trunk: Kernel-nice.1042.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Sep 29 08:18:58 UTC 2016

Nicolas Cellier uploaded a new version of Kernel to project The Trunk:

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

Name: Kernel-nice.1042
Author: nice
Time: 29 September 2016, 10:15:16.009388 am
UUID: 8923b113-72cf-414e-802c-cef7c50f8ad1
Ancestors: Kernel-tfel.1041, Kernel-nice.798

Merge Kernel-nice.798 (variable scope fix, don't resolve name in superclass environment)

Reminder: this requires some Smalltalk exportSelf.

=============== Diff against Kernel-tfel.1041 ===============

Item was changed:
  ----- Method: Class>>bindingOf:environment: (in category 'compiling') -----
  bindingOf: varName environment: anEnvironment
  	"Answer the binding of some variable resolved in the scope of the receiver"
  	| aSymbol binding |
  	aSymbol := varName asSymbol.
+ 	"First look in local classVar dictionary."
+ 	binding := self classPool bindingOf: aSymbol.
+ 	binding ifNotNil:[^binding].
- 	"First look in classVar dictionary."
- 	(self classThatDefinesClassVariable: aSymbol) ifNotNil:
- 		[:x | ^x classPool bindingOf: aSymbol].
+ 	"Next look in local shared pools."
- 	"Next look in shared pools."
  	self sharedPools do:[:pool | 
  		binding := pool bindingOf: aSymbol.
  		binding ifNotNil:[^binding].
+ 	"Next look into superclass pools"
+ 	superclass ifNotNil: [^ superclass bindingOf: aSymbol environment: anEnvironment].
+ 	"No more superclass... Last look in declared environment."
+ 	^anEnvironment bindingOf: aSymbol
- 	"Next look in declared environment."
- 	binding := anEnvironment bindingOf: aSymbol.
- 	binding ifNotNil:[^binding].
- 	"Finally look higher up the superclass chain and fail at the end."
- 	superclass == nil
- 		ifTrue: [^ nil]
- 		ifFalse: [^ superclass bindingOf: aSymbol].

More information about the Squeak-dev mailing list