Behavior.st
changeset 23240 ac2201656af9
parent 23164 f10a2071eb51
child 23278 dbe7d04af1a2
equal deleted inserted replaced
23239:d04302832bfb 23240:ac2201656af9
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "
     3 "
     2  COPYRIGHT (c) 1988 by Claus Gittinger
     4  COPYRIGHT (c) 1988 by Claus Gittinger
     3 	      All Rights Reserved
     5 	      All Rights Reserved
     4 
     6 
     5  This software is furnished under a license and may be used
     7  This software is furnished under a license and may be used
  1244 
  1246 
  1245     "Created: / 01-06-2012 / 20:37:46 / cg"
  1247     "Created: / 01-06-2012 / 20:37:46 / cg"
  1246 ! !
  1248 ! !
  1247 
  1249 
  1248 
  1250 
  1249 
       
  1250 !Behavior methodsFor:'Compatibility-Dolphin'!
  1251 !Behavior methodsFor:'Compatibility-Dolphin'!
  1251 
  1252 
  1252 allSubinstances
  1253 allSubinstances
  1253     "Compatibility method - do not use in new code.
  1254     "Compatibility method - do not use in new code.
  1254      Same as allSubInstances; added for Dolphin compatibility"
  1255      Same as allSubInstances; added for Dolphin compatibility"
  4928      Return the method, or nil if instances do not understand aSelector.
  4929      Return the method, or nil if instances do not understand aSelector.
  4929      EXPERIMENTAL: take care of multiple superclasses."
  4930      EXPERIMENTAL: take care of multiple superclasses."
  4930 
  4931 
  4931     |l m cls|
  4932     |l m cls|
  4932 
  4933 
  4933     "JV @ 2010-08-22: Rewritten to respect lookup object."
  4934     Error handle:[:ex |
  4934     (l := self lookupObject) notNil ifTrue:[
  4935     ] do:[        
  4935 	^ (l
  4936         "JV @ 2010-08-22: Rewritten to respect lookup object."
  4936 	    lookupMethodForSelector:aSelector
  4937         (l := self lookupObject) notNil ifTrue:[
  4937 	    directedTo:self
  4938             ^ (l
  4938 	    for: nil "Fake receiver"
  4939                 lookupMethodForSelector:aSelector
  4939 	    withArguments: nil "Fake arguments"
  4940                 directedTo:self
  4940 	    from: thisContext methodHome sender
  4941                 for: nil "Fake receiver"
  4941 	    ilc: nil "fake ilc")
  4942                 withArguments: nil "Fake arguments"
       
  4943                 from: thisContext methodHome sender
       
  4944                 ilc: nil "fake ilc")
       
  4945         ].
  4942     ].
  4946     ].
  4943 
  4947 
  4944     cls := self.
  4948     cls := self.
  4945     [
  4949     [
  4946 	m := cls compiledMethodAt:aSelector.
  4950         m := cls compiledMethodAt:aSelector.
  4947 	m notNil ifTrue:[^ m].
  4951         m notNil ifTrue:[^ m].
  4948 	cls hasMultipleSuperclasses ifTrue:[
  4952         cls hasMultipleSuperclasses ifTrue:[
  4949 	    cls superclasses do:[:aSuperClass |
  4953             cls superclasses do:[:aSuperClass |
  4950 		m := aSuperClass lookupMethodFor:aSelector.
  4954                 m := aSuperClass lookupMethodFor:aSelector.
  4951 		m notNil ifTrue:[^ m].
  4955                 m notNil ifTrue:[^ m].
  4952 	    ].
  4956             ].
  4953 	    ^ nil
  4957             ^ nil
  4954 	] ifFalse:[
  4958         ] ifFalse:[
  4955 	    cls := cls superclass
  4959             cls := cls superclass
  4956 	]
  4960         ]
  4957     ] doWhile:[cls notNil].
  4961     ] doWhile:[cls notNil].
  4958     ^ nil
  4962     ^ nil
  4959 !
  4963 !
  4960 
  4964 
  4961 responseTo:aSelector
  4965 responseTo:aSelector