Context>>copyTo: doesn't update closure home

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Context>>copyTo: doesn't update closure home

Max Leske
Hi,

Is anybody aware of a reason for why Context>>copyTo: should not update the home of closures (which is currently the case)? This behaviour becomes a problem when I want to simulate #stepThrough: on a copied stack, since the home of a closure will never be found on the stack.

My proposal is to implement

Context>>postCopy
        closureOrNil ifNil: [ ^ self ].

        closureOrNil outerContext: self

and

BlockClosure>>outerContext: aContext
        outerContext := aContext


Thoughts?

Cheers,
Max