Method.st
changeset 19739 5f6b9dbd32c6
parent 19732 171048f57a34
child 19782 41efda05474e
equal deleted inserted replaced
19738:8ac31aac9eb6 19739:5f6b9dbd32c6
  3460     ^ false
  3460     ^ false
  3461 
  3461 
  3462     "Created: / 08-08-2011 / 18:53:24 / cg"
  3462     "Created: / 08-08-2011 / 18:53:24 / cg"
  3463 !
  3463 !
  3464 
  3464 
       
  3465 sendsMessageForWhich:aCheckBlock
       
  3466     "return true, if this method contains a message-send
       
  3467      for which aCheckBlock returns true, when given the selector."
       
  3468 
       
  3469     self literalsDo:[:each |
       
  3470         each isSymbol ifTrue:[
       
  3471             "/ first check if the selector matches
       
  3472             (aCheckBlock value:each) ifTrue:[
       
  3473                 "/ then, if this is really a message send
       
  3474                 (self messagesSent includes:each) ifTrue:[^ true].
       
  3475             ]
       
  3476         ]
       
  3477     ].    
       
  3478     ^ false
       
  3479 
       
  3480     "
       
  3481      (self compiledMethodAt:#sendsAnyForWhich:) 
       
  3482         sendsAnyForWhich:[:sel | sel startsWith:'message']
       
  3483      (self compiledMethodAt:#sendsAnyForWhich:) 
       
  3484         sendsAnyForWhich:[:sel | sel startsWith:'foo']
       
  3485     "
       
  3486 !
       
  3487 
  3465 shadowedMethod
  3488 shadowedMethod
  3466     "Return the shadowed method if this method is an extension (i.e. package ~= classes' package)
  3489     "Return the shadowed method if this method is an extension (i.e. package ~= classes' package)
  3467      AND it shadows (redefines) an existing method from the method's class.
  3490      AND it shadows (redefines) an existing method from the method's class.
  3468      If this method does not shadow any other method, return nil."
  3491      If this method does not shadow any other method, return nil."
  3469 
  3492