[squeak-dev] CompiledMethodTest >> #testMethodClass

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Sat Jan 11 18:55:51 UTC 2014


2014/1/11 Frank Shearar <frank.shearar at gmail.com>

> On 10 January 2014 20:41, Colin Putney <colin at wiresong.com> wrote:
> >
> >
> >
> > On Fri, Jan 10, 2014 at 4:56 AM, Frank Shearar <frank.shearar at gmail.com>
> > wrote:
> >>
> >> This fails because the CompiledMethod from a removed class returns nil
> >> for its #methodClass.
> >>
> >> The test implies that an orphaned method will still know its removed
> >> class.
> >>
> >> However, Environment >> #forgetClass:logged: clearly nils out the
> >> binding of a removed class:
> >>
> >>     "snip other stuff"
> >>     undeclared declare: aClass name from: declarations.
> >>     declarations removeKey: aClass name ifAbsent: [].
> >>     [undeclared at: aClass name put: nil]
> >>         on: AttemptToWriteReadOnlyGlobal
> >>         do: [:n | n resume: true].
> >>     self binding: binding removedFrom: self]
> >>
> >> So is this just an API change? Should the test be updated, or is this a
> >> bug?
> >
> >
> > It's not an API change, because SystemDictionary>>forgetClass:logged:
> does
> > the same thing. But I don't know if the test is right.
>
> In which case the test was passing by accident, until relatively
> recently: this used to pass, back in the day.
>
> frank
>
> No
Colin changed the SystemDictionary implementation to align behavior with
Environment, check the versions.
Then, I don't know what goal these tests serve...
Maybe if you have a block context hanging around created in a removed class?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20140111/07beb78d/attachment-0001.htm


More information about the Squeak-dev mailing list