--- a/Method.st Sat May 07 12:32:29 2016 +0200
+++ b/Method.st Sat May 07 12:33:17 2016 +0200
@@ -3462,6 +3462,29 @@
"Created: / 08-08-2011 / 18:53:24 / cg"
!
+sendsMessageForWhich:aCheckBlock
+ "return true, if this method contains a message-send
+ for which aCheckBlock returns true, when given the selector."
+
+ self literalsDo:[:each |
+ each isSymbol ifTrue:[
+ "/ first check if the selector matches
+ (aCheckBlock value:each) ifTrue:[
+ "/ then, if this is really a message send
+ (self messagesSent includes:each) ifTrue:[^ true].
+ ]
+ ]
+ ].
+ ^ false
+
+ "
+ (self compiledMethodAt:#sendsAnyForWhich:)
+ sendsAnyForWhich:[:sel | sel startsWith:'message']
+ (self compiledMethodAt:#sendsAnyForWhich:)
+ sendsAnyForWhich:[:sel | sel startsWith:'foo']
+ "
+!
+
shadowedMethod
"Return the shadowed method if this method is an extension (i.e. package ~= classes' package)
AND it shadows (redefines) an existing method from the method's class.