--- a/QuerySignal.st Tue Aug 28 11:18:46 2018 +0200
+++ b/QuerySignal.st Tue Aug 28 11:25:34 2018 +0200
@@ -366,23 +366,23 @@
!QuerySignal methodsFor:'queries'!
-accepts:aSignal
+accepts:aSignalOrExceptionClass
"return true, if the receiver accepts the argument, aSignal.
(i.e. the receiver is aSignal or a parent of it). False otherwise."
|s|
- self == aSignal ifTrue:[^ true].
- aSignal isQuerySignal ifFalse:[^ false].
+ self == aSignalOrExceptionClass ifTrue:[^ true].
+ aSignalOrExceptionClass isQuerySignal ifFalse:[^ false].
- s := aSignal parent.
- [s notNil] whileTrue:[
+ s := aSignalOrExceptionClass.
+ [(s := s parent) notNil] whileTrue:[
self == s ifTrue:[^ true].
- s := s parent
].
^ false
- "Modified: / 22.3.1999 / 12:45:32 / stefan"
+ "Modified: / 22-03-1999 / 12:45:32 / stefan"
+ "Modified: / 28-08-2018 / 11:16:18 / Claus Gittinger"
!
defaultAnswer
@@ -416,19 +416,23 @@
"return true, if the receiver handles the argument, anException.
(i.e. the receiver is anExceptions signal or a parent of it)"
- |signal|
-
- signal := anException creator.
+ ^ self accepts:(anException creator).
- self == signal ifTrue:[^ true]. "quick check"
- anException isQuery ifFalse:[^ false]. "speed up non-queries by not traversing the parent chain"
-
- [(signal := signal parent) notNil] whileTrue:[
- self == signal ifTrue:[^ true].
- ].
- ^ false
+"/ |signal|
+"/
+"/ signal := anException creator.
+"/ self == signal ifTrue:[^ true]. "quick check"
+"/ anException isQuery ifFalse:[^ false]. "speed up non-queries by not traversing the parent chain"
+"/
+"/ [(signal := signal parent) notNil] whileTrue:[
+"/ self == signal ifTrue:[^ true].
+"/ ].
+"/ ^ false
+"/
+"/
"Modified (format): / 25-07-2017 / 16:11:00 / stefan"
+ "Modified (comment): / 28-08-2018 / 11:24:51 / Claus Gittinger"
!
isQuery