[squeak-dev] The Inbox: Kernel-nice.856.mcz

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Thu Jun 5 22:17:07 UTC 2014


2014-06-05 23:27 GMT+02:00 Nicolas Cellier <
nicolas.cellier.aka.nice at gmail.com>:

> This change resolved the failing test for me, and I did not yet find what
> else it may break...
> In this danger zone, more eyes are required, so up to you to refute the
> method :)
>
> I think I have a refutation (theoretically): if an outer handler resumes
execution in signalContext, then the inner handler context won't be
re-activated and will miss the next exceptions...

Unfortunately, resuming is the default behavior for any unhandled exception
(see UndefinedObject>>#handleSignal:).
So every un-caught exception (even the most harmless Notification) will
deactivate all the enclosing handlers!

Definitely not a good change, I must find another way...


> 2014-06-05 23:11 GMT+02:00 <commits at source.squeak.org>:
>
> A new version of Kernel was added to project The Inbox:
>> http://source.squeak.org/inbox/Kernel-nice.856.mcz
>>
>> ==================== Summary ====================
>>
>> Name: Kernel-nice.856
>> Author: nice
>> Time: 5 June 2014, 11:11:07.752 pm
>> UUID: 44668d33-00c2-4e36-b95b-69d83b0d7544
>> Ancestors: Kernel-cmm.855
>>
>> Attempt to fix ExceptionTests>>#testHandlerFromAction.
>> When the handler does not handle an Exception, simply mark the handler
>> context as inactive (self tempAt: 3 put: false).
>>
>> =============== Diff against Kernel-cmm.855 ===============
>>
>> Item was changed:
>>   ----- Method: ContextPart>>handleSignal: (in category
>> 'private-exceptions') -----
>>   handleSignal: exception
>>         "Sent to handler (on:do:) contexts only.  If my exception class
>> (first arg) handles exception then execute my handle block (second arg),
>> otherwise forward this message to the next handler context.  If none left,
>> execute exception's defaultAction (see nil>>handleSignal:)."
>>
>>         | val |
>> +       ((((self tempAt: 1) handles: exception) or: [self tempAt: 3 put:
>> false])
>> +                and: [self tempAt: 3]) ifFalse: [
>> -       (((self tempAt: 1) handles: exception) and: [self tempAt: 3])
>> ifFalse: [
>>                 ^ self nextHandlerContext handleSignal: exception].
>>
>>         exception privHandlerContext: self contextTag.
>>         self tempAt: 3 put: false.  "disable self while executing handle
>> block"
>>         val := [(self tempAt: 2) cull: exception ]
>>                 ensure: [self tempAt: 3 put: true].
>>         self return: val.  "return from self if not otherwise directed in
>> handle block"
>>   !
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20140606/660e94f2/attachment.htm


More information about the Squeak-dev mailing list