<div dir="ltr">This breaks compiling EToys scripts when those refer to global classes. I probably don't understand something here, but for context, EToys players are not in the global environment, they create their own otherwise empty environment.</div><br><div class="gmail_quote"><div dir="ltr">On Thu, 29 Sep 2016 at 10:19 <<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Nicolas Cellier uploaded a new version of Kernel to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Kernel-nice.1042.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/trunk/Kernel-nice.1042.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Kernel-nice.1042<br>
Author: nice<br>
Time: 29 September 2016, 10:15:16.009388 am<br>
UUID: 8923b113-72cf-414e-802c-cef7c50f8ad1<br>
Ancestors: Kernel-tfel.1041, Kernel-nice.798<br>
<br>
Merge Kernel-nice.798 (variable scope fix, don't resolve name in superclass environment)<br>
<br>
Reminder: this requires some Smalltalk exportSelf.<br>
<br>
=============== Diff against Kernel-tfel.1041 ===============<br>
<br>
Item was changed:<br>
----- Method: Class>>bindingOf:environment: (in category 'compiling') -----<br>
bindingOf: varName environment: anEnvironment<br>
"Answer the binding of some variable resolved in the scope of the receiver"<br>
| aSymbol binding |<br>
aSymbol := varName asSymbol.<br>
<br>
+ "First look in local classVar dictionary."<br>
+ binding := self classPool bindingOf: aSymbol.<br>
+ binding ifNotNil:[^binding].<br>
- "First look in classVar dictionary."<br>
- (self classThatDefinesClassVariable: aSymbol) ifNotNil:<br>
- [:x | ^x classPool bindingOf: aSymbol].<br>
<br>
+ "Next look in local shared pools."<br>
- "Next look in shared pools."<br>
self sharedPools do:[:pool |<br>
binding := pool bindingOf: aSymbol.<br>
binding ifNotNil:[^binding].<br>
].<br>
<br>
+ "Next look into superclass pools"<br>
+ superclass ifNotNil: [^ superclass bindingOf: aSymbol environment: anEnvironment].<br>
+<br>
+ "No more superclass... Last look in declared environment."<br>
+ ^anEnvironment bindingOf: aSymbol<br>
- "Next look in declared environment."<br>
- binding := anEnvironment bindingOf: aSymbol.<br>
- binding ifNotNil:[^binding].<br>
<br>
- "Finally look higher up the superclass chain and fail at the end."<br>
- superclass == nil<br>
- ifTrue: [^ nil]<br>
- ifFalse: [^ superclass bindingOf: aSymbol].<br>
-<br>
!<br>
<br>
<br>
</blockquote></div>