diff --git a/ChangeLog b/ChangeLog index fefb73d..ebb9ebe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-04-08 Stephen Compall + + * kernel/Class.st: Never answer nil from #sharedPoolDictionaries. + * kernel/DeferBinding.st: Remove symmetric nil check. + * kernel/Metaclass.st: Likewise. + 2008-04-08 Paolo Bonzini * kernel/FilePath.st: Add more abstract methods. Implement diff --git a/kernel/Class.st b/kernel/Class.st index 3dd4b39..785f973 100644 --- a/kernel/Class.st +++ b/kernel/Class.st @@ -191,6 +191,7 @@ the class category.'> "Add the given shared pool to the list of the class' pool dictionaries" + sharedPools ifNil: [sharedPools := #()]. (sharedPools includes: aDictionary) ifFalse: [sharedPools := sharedPools copyWith: aDictionary] ] @@ -199,6 +200,7 @@ the class category.'> "Remove the given dictionary to the list of the class' pool dictionaries" + sharedPools ifNil: [sharedPools := #()]. sharedPools := sharedPools copyWithout: aDictionary ] @@ -208,7 +210,7 @@ the class category.'> | s | s := Set new. - sharedPools notNil + (sharedPools notNil and: [sharedPools notEmpty]) ifTrue: [self environment associationsDo: [:each | @@ -604,14 +606,14 @@ the class category.'> "Private - Set the receiver's shared pools to be those in anArray" - sharedPools := anArray + sharedPools := anArray ifNil: [#()] ] sharedPoolDictionaries [ "Return the shared pools (not the names!) defined by the class" - ^sharedPools + ^sharedPools ifNil: [#()] ] metaclassFor: classNameString [ diff --git a/kernel/DeferBinding.st b/kernel/DeferBinding.st index e31e52c..c4f03c0 100644 --- a/kernel/DeferBinding.st +++ b/kernel/DeferBinding.st @@ -138,12 +138,9 @@ in the scope of a given class are used.'> assoc := env environment associationAt: self key ifAbsent: [nil]. assoc isNil ifFalse: [^assoc]. pools := env sharedPoolDictionaries. - pools isNil - ifFalse: - [pools do: - [:each | - assoc := each associationAt: self key ifAbsent: [nil]. - assoc isNil ifFalse: [^assoc]]]]. + pools do: [:each | + assoc := each associationAt: self key ifAbsent: [nil]. + assoc isNil ifFalse: [^assoc]]]. "Create it as a temporary." defaultDictionary at: self key ifAbsentPut: [nil]. diff --git a/kernel/Metaclass.st b/kernel/Metaclass.st index 4000952..bb991e3 100644 --- a/kernel/Metaclass.st +++ b/kernel/Metaclass.st @@ -285,7 +285,7 @@ it should be...the Smalltalk metaclass system is strange and complex.'> "Now add/remove pool dictionaries. FIXME: They may affect name binding, so we should probably recompile everything if they change." - aClass sharedPoolDictionaries isNil + aClass sharedPoolDictionaries isEmpty ifTrue: [aClass setSharedPools: sharedPoolNames] ifFalse: [sharedPoolNames do: