On 12.09.2011 23:11, Eliot Miranda wrote:
> Hi Phillipe,
> 
> On Mon, Sep 12, 2011 at 11:06 AM, Philippe Marschall
> <kus...@gmx.net <mailto:kus...@gmx.net>> wrote:
> 
>     Hi
> 
>     While trying to debug the debugger in Seaside (hi Mike) I stumbled on
>     something funny. Seaside the following code to work:
> 
>     Semaphore forMutualExclusion critical: [
>            | sender |
>            sender := thisContext sender.
>            sender tempAt: sender tempScopedNames size ]
> 
> 
> This just won't work with the Closure compiler.  This approach only
> worked with old blue-book blocks Squeak.   Instead you need to look at
> DebuggerMethodMap, tempNamesForContext:, namedTempAt: et al.

Ok, I tried implementing it in terms of #tempNamesForContext: (through
#tempNames) and #namedTempAt: this works sometimes and in other times I
get 'Instances of UndefinedObject are not indexable'. See the attached
unit test.

Cheers
Philippe

'From Pharo1.3 of 16 June 2011 [Latest update: #13300] on 13 September 2011 at 
6:40:43 pm'!
TestCase subclass: #TempsTest
        instanceVariableNames: ''
        classVariableNames: ''
        poolDictionaries: ''
        category: 'Temps-Test'!

!TempsTest methodsFor: 'private' stamp: 'pmm 9/13/2011 18:30'!
signalInterestingError
        Semaphore forMutualExclusion critical: [
                Error signal: 'foo' ]! !


!TempsTest methodsFor: 'testing' stamp: 'pmm 9/13/2011 18:40'!
testNamedTempAt
        | frames |
        frames := OrderedCollection new.
        [ self signalInterestingError ]
                on: Error
                do: [ :error |
                        | context |
                        context := error signalerContext.
                        [ context isNil ] whileFalse: [
                                frames add: context.
                                context := context sender ]. ].
        "self halt"
        frames do: [ :each |
                1 to: each tempNames size do: [ :i |
                        each namedTempAt: i ] ]! !

Reply via email to