[squeak-dev] CompiledMethodTest >> #testMethodClass

Colin Putney colin at wiresong.com
Fri Jan 10 20:41:38 UTC 2014


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20140110/0e89965c/attachment.htm


More information about the Squeak-dev mailing list