--- a/Block.st Sat Jul 31 14:37:36 1999 +0200
+++ b/Block.st Sat Jul 31 14:41:08 1999 +0200
@@ -10,8 +10,6 @@
hereby transferred.
"
-'From Smalltalk/X, Version:3.5.3 on 26-jul-1999 at 15:32:05' !
-
CompiledCode variableSubclass:#Block
instanceVariableNames:'home nargs sourcePos initialPC'
classVariableNames:'InvalidNewSignal'
@@ -1040,7 +1038,13 @@
theContext selector == #on:do: ifTrue:[
sig := theContext argAt:1.
(sig accepts:signal) ifTrue:[
- ^ theContext argAt:2.
+ handler := theContext argAt:2.
+ "/ this is for backward compatibility when no ex-arg
+ "/ is expected in the block. Is it worth the effort ?
+ handler numArgs == 0 ifTrue:[
+ ^ [:ex | handler value]
+ ].
+ ^ handler
].
] ifFalse:[
"must be #valueWithExceptionHandler:"
@@ -1054,6 +1058,18 @@
"Modified: / 26.7.1999 / 14:30:42 / stefan"
!
+handlingSignalInContext:theContext
+ "answer the handling signal from aContext."
+
+ theContext selector == #on:do: ifTrue:[
+ ^ theContext argAt:1.
+ ] ifFalse:[
+ "must be #valueWithExceptionHandler:"
+ ^ theContext argAt:1.
+ ].
+
+!
+
on:aSignal do:exceptionBlock
"added for ST/V compatibility; evaluate the receiver,
handling aSignal. The argument, exceptionBlock is evaluated
@@ -1588,6 +1604,6 @@
!Block class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Block.st,v 1.85 1999-07-28 07:53:21 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Block.st,v 1.86 1999-07-31 12:41:08 cg Exp $'
! !
Block initialize!