# HG changeset patch # User Claus Gittinger # Date 1350658802 -7200 # Node ID b56f22e69448b96cc4a627e1594bbf12f9ee666e # Parent bdfdcb8d0386d47db6e5dc7cf512d1cf0ce9686b added: #messagesPossiblySent #possiblySends: diff -r bdfdcb8d0386 -r b56f22e69448 Method.st --- a/Method.st Fri Oct 19 14:03:06 2012 +0200 +++ b/Method.st Fri Oct 19 17:00:02 2012 +0200 @@ -2684,6 +2684,19 @@ ^ self messagesSent do:aBlock ! +messagesPossiblySent + "return a collection with the message selectors possibly sent to by the receiver. + Uses Parser to parse methods source and extract the names. + The returned collection includes perform-like and possibly performed messages" + + ^ self parse:#'parseMethodSilent:in:' with:self mclass return:#messagesPossiblySent or:#() + + " + (Method compiledMethodAt:#printOn:) messagesSent + (Point compiledMethodAt:#x:) messagesSent + " +! + messagesSent "return a collection with the message selectors sent to by the receiver. Uses Parser to parse methods source and extract the names. @@ -2985,6 +2998,16 @@ ^ parser primitiveResources. ! +possiblySends:aSelectorSymbol + "return true, if this method contains an indirect message-send + (such as perform) with aSelectorSymbol as selector." + + (self referencesLiteral:aSelectorSymbol) ifTrue:[ + ^ self messagesPossiblySent includesIdentical:aSelectorSymbol + ]. + ^ false +! + previousVersion "return the receivers previous version's source code" @@ -3721,11 +3744,11 @@ !Method class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libbasic/Method.st,v 1.396 2012-10-02 15:20:21 cg Exp $' + ^ '$Header: /cvs/stx/stx/libbasic/Method.st,v 1.397 2012-10-19 15:00:02 cg Exp $' ! version_CVS - ^ '$Header: /cvs/stx/stx/libbasic/Method.st,v 1.396 2012-10-02 15:20:21 cg Exp $' + ^ '$Header: /cvs/stx/stx/libbasic/Method.st,v 1.397 2012-10-19 15:00:02 cg Exp $' ! version_SVN