[FIX] Re: [BUG][Modules] Beware! Pool constants visible globally
Henrik Gedenryd
h.gedenryd at open.ac.uk
Sun Feb 3 12:15:33 UTC 2002
Henrik Gedenryd wrote:
> Ok, the attached small change should solve this. Pool variables aren't visible
> any more.
>
> Try it and notify me about any problems.
>
> Henrik
Here's a cs version that actually files in ok... Sorry 'bout that!
Henrik
-------------- next part --------------
'From Squeak3.3alpha of 30 January 2002 [latest update: #4735] on 2 February 2002 at 9:32:05 pm'!
"Change Set: nameLookupFixes-hg
Date: 2 February 2002
Author: Henrik Gedenryd"
(Preferences preferenceAt: #lenientScopeForGlobals) name: #lenientScopeForGlobals defaultValue: true helpString: 'Should global name lookup check in Smalltalk if not found during ''proper'' module name lookup? (Should be on until module dependencies are fully declared in the image.)' localToProject: false categoryList: #(modules) changeInformee: nil changeSelector: nil.
(Module @ #(Squeak VMConstruction Plugins Balloon) externalModule: #(Squeak Media Balloon Drawing BalloonEngineConstants) alias: nil version: nil importNames: false) resolveModule.
(Module @ #(Squeak VMConstruction Plugins Balloon3D) externalModule: #(Squeak Media Balloon3D Engine B3DEngineConstants) alias: nil version: nil importNames: false) resolveModule.
(Module @ #(Squeak VMConstruction Plugins Sound) externalModule: #(Squeak Media Speech Klatt KlattResonatorIndices) alias: nil version: nil importNames: false) resolveModule.
(Module @ #(Squeak EToy UserObjects) externalModule: #(Squeak EToy Scripting References) alias: nil version: nil importNames: false) resolveModule !
!Module methodsFor: 'name lookup schemes' stamp: 'hg 2/2/2002 21:04'!
lenientDefinesName: varName ifTrue: assocBlock
"extra check to allows unrestricted use of global names."
"Look it up in Smalltalk to allow references to all global names (except modules)."
self class smalltalk associationFor: varName ifPresent: [:a :mod |
assocBlock value: a.
^ true].
"another lookup just to catch what were formerly Pool variables"
"^self class root definesName: varName ifTrue: [:a |
assocBlock value: a]"
^false! !
More information about the Squeak-dev
mailing list
|