pharo-spec / ScriptableDebugger

3 stars 12 forks source link

outerMostContext seems to be wrongly used #86

Open MarcusDenker opened 1 year ago

MarcusDenker commented 1 year ago

Sindarin is the only user of #outerMostContext, a method that does not really seem to make sense... especially if one looks at the code that uses is:

SindarinDebugger>>#canStillExecute:

    rightContext == rightContext outerMostContext or: [
        rightContext method ast allChildren identityIncludes: aProgramNode ] ]
        whileFalse: [ rightContext := rightContext sender ].

So this check if the right context is the outerMostContext (defined by walking up the outerContext chain), but what it then does it to walk up the sender chain.

outerMostContext 
    ^ self outerContext
        ifNil: [ self ]
        ifNotNil: [ self outerContext ]