Method.st
changeset 12913 142c9566a768
parent 12900 4cda19285039
child 12948 f238e8b26110
--- a/Method.st	Mon May 03 15:20:52 2010 +0200
+++ b/Method.st	Tue May 04 17:49:48 2010 +0200
@@ -1968,6 +1968,18 @@
     ^ self literalsDetect:[:lit | lit isExternalLibraryFunction] ifNone:nil
 !
 
+hasAnyResource:aCollectionOfSymbols
+    "return true if the method has a <resource> definition for any symbol in aCollectionOfSymbols"
+
+    ^ self hasResource and:[ self resources keys includesAny:aCollectionOfSymbols ]
+
+    "
+     Method allInstancesDo:[:m |
+        (m hasAnyResource:#(image canvas)) ifTrue:[self halt]
+     ].
+    "
+!
+
 hasCanvasResource
     "return true, if this method is an image-resource method.
      This is done by looking for a #canvas key in the method's resources."
@@ -2033,7 +2045,7 @@
 !
 
 hasResource:aSymbol
-    "return true if the method had a <resource> definition for aSymbol."
+    "return true if the method has a <resource> definition for aSymbol."
 
     ^ self hasResource and:[ self resources includesKey:aSymbol ]
 
@@ -3000,11 +3012,11 @@
 !Method class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Method.st,v 1.349 2010-04-27 12:27:33 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Method.st,v 1.350 2010-05-04 15:49:48 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/Method.st,v 1.349 2010-04-27 12:27:33 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Method.st,v 1.350 2010-05-04 15:49:48 cg Exp $'
 ! !
 
 Method initialize!