Hello,
The browser uses an API on CompiledMethod to e.g. display a button for running
example methods.
So even though for execution you just need run:with:in:, for other uses of
methods
you need to implement more.
(e.g. imagine “senders of”: it asks all methods for the literals).
Therefore, the best is to store the original method in the Interceptee and
implement
a DNU handler to forward all message send to it.
Marcus
> On 12 Jan 2015, at 18:28, Atlas wrote:
>
> Hi,
>
> After replacing the method of a class with an object of a class implementing
> the /run:with:in/ method, the context menu of the System Browser stops
> appearing, a debug context menu "Why you see this menu. Debug" pops up
> instead.
>
> After putting the original method back, the browser works again.
>
> Code:
>
> o := Interceptee new.
>
> m := Interceptee methodDict at: #method.
> Interceptee methodDict at: #method put: Interceptor new. o method. "Breaks
> context menu?"
> Interceptee methodDict at: #method put: m. "Browser works again"
>
>
> Is anyone else having this problem? Or am I doing anything wrong?
>
> Thanks
>
>
>
>
>
>
> --
> View this message in context:
> http://forum.world.st/Modifying-methodDict-breaks-System-Browser-tp4799147.html
> Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
>