[squeak-dev] The Trunk: Kernel-jar.1446.mcz
marcel.taeumel at hpi.de
Fri May 6 13:44:43 UTC 2022
This one needs an extra merge commit. :-)
Am 06.05.2022 15:24:58 schrieb commits at source.squeak.org <commits at source.squeak.org>:
Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
==================== Summary ====================
Time: 6 February 2022, 11:37:44.367834 am
fix Exception >> signal behavior when signaling an already signaled exception; see discussion in http://lists.squeakfoundation.org/pipermail/squeak-dev/2022-February/218861.html
Originally there was no check if the receiver has already been signaled which was a bug (subsequent #signal sends to an already signaled exception lead to weird errors); last year I suggested making such a send equivalent to sending #outer but that's a poor fix which is not even compliant with ANSI; this latest approach is both compliant and makes the following example work and pick up the ZeroDivide handler as one might expect:
[1/0] on: Error do: [:ex |
[ex signal] on: ZeroDivide do: [Transcript show: #ZeroDivide]
=============== Diff against Kernel-mt.1443 ===============
Item was changed:
----- Method: Exception>>signal (in category 'signaling') -----
+ "Ask ContextHandlers in the sender chain to handle this signal. The default is to execute and return my defaultAction.
+ Sending #signal to an already signaled exception generates a new exception of the same type with the same messageText"
- "Ask ContextHandlers in the sender chain to handle this signal. The default is to execute and return my defaultAction."
+ signalContext ifNotNil: [^self class signal: messageText].
- signalContext ifNotNil: [^self outer]. "re-signalling an already signalled exception is equivalent to sending #outer"
signalContext := thisContext contextTag.
^(thisContext nextHandlerContextForSignal: self) handleSignal: self!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Squeak-dev