GenericException.st
changeset 15261 a4b1efbb3750
parent 15237 661c2ad1edb8
child 15271 47f747e8a854
child 18060 3708e12e9aa8
--- a/GenericException.st	Tue May 21 22:18:45 2013 +0200
+++ b/GenericException.st	Tue May 21 22:26:48 2013 +0200
@@ -1800,8 +1800,18 @@
     |con|
 
     con := handlerContext.
+    "/ cg: moving the following clearing of the handlerContext
+    "/ to before the evalUnwindActions allows for the exception
+    "/ to be handled during the unwind.
+    "/ It can be discussed, whether this is correct or not;
+    "/ I think, that the unwind actions should behave just the same as
+    "/ when a normal return is done. As unwind actions are called,
+    "/ these are unmarkedForUnwind anyway, so there should be no danger
+    "/ for endless recursion here... (i.e. each unwind action can at most
+    "/ reraise that exception once).
+    handlerContext := suspendedContext := raiseContext := nil.
     thisContext evaluateUnwindActionsUpTo:con.
-    handlerContext := suspendedContext := raiseContext := nil.
+    "/ handlerContext := suspendedContext := raiseContext := nil.
     con return:(self defaultReturnValue)
 
     "Modified: / 7.9.2001 / 13:29:34 / cg"
@@ -1813,8 +1823,18 @@
     |con|
 
     con := handlerContext.
+    "/ cg: moving the following clearing of the handlerContext
+    "/ to before the evalUnwindActions allows for the exception
+    "/ to be handled during the unwind.
+    "/ It can be discussed, whether this is correct or not;
+    "/ I think, that the unwind actions should behave just the same as
+    "/ when a normal return is done. As unwind actions are called,
+    "/ these are unmarkedForUnwind anyway, so there should be no danger
+    "/ for endless recursion here... (i.e. each unwind action can at most
+    "/ reraise that exception once).
+    handlerContext := suspendedContext := raiseContext := nil.
     thisContext evaluateUnwindActionsUpTo:con.
-    handlerContext := suspendedContext := raiseContext := nil.
+    "/ handlerContext := suspendedContext := raiseContext := nil.
     con return:value.
 
     "Modified: 27.3.1997 / 16:46:51 / cg"
@@ -1828,8 +1848,18 @@
     |con|
 
     con := handlerContext.
+    "/ cg: moving the following clearing of the handlerContext
+    "/ to before the evalUnwindActions allows for the exception
+    "/ to be handled during the unwind.
+    "/ It can be discussed, whether this is correct or not;
+    "/ I think, that the unwind actions should behave just the same as
+    "/ when a normal return is done. As unwind actions are called,
+    "/ these are unmarkedForUnwind anyway, so there should be no danger
+    "/ for endless recursion here... (i.e. each unwind action can at most
+    "/ reraise that exception once).
+    handlerContext := suspendedContext := raiseContext := nil.
     thisContext evaluateUnwindActionsUpTo:con.
-    handlerContext := suspendedContext := raiseContext := nil.
+    "/ handlerContext := suspendedContext := raiseContext := nil.
     con returnDoing:aBlock
 
     "
@@ -2320,11 +2350,11 @@
 !GenericException class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/GenericException.st,v 1.138 2013-05-13 13:47:00 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/GenericException.st,v 1.139 2013-05-21 20:26:48 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/GenericException.st,v 1.138 2013-05-13 13:47:00 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/GenericException.st,v 1.139 2013-05-21 20:26:48 cg Exp $'
 ! !