author | Claus Gittinger <cg@exept.de> |
Sun, 23 Feb 2020 16:35:34 +0100 | |
changeset 4557 | 069040b49bec |
parent 4512 | 70acad3387b4 |
permissions | -rw-r--r-- |
4431 | 1 |
"{ Encoding: utf8 }" |
2 |
||
9 | 3 |
" |
4 |
COPYRIGHT (c) 1994 by Claus Gittinger |
|
14 | 5 |
All Rights Reserved |
9 | 6 |
|
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
940
2ec011688c35
more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents:
839
diff
changeset
|
14 |
"{ Package: 'stx:libbasic3' }" |
2ec011688c35
more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents:
839
diff
changeset
|
15 |
|
3878 | 16 |
"{ NameSpace: Smalltalk }" |
17 |
||
729 | 18 |
Method variableSubclass:#WrappedMethod |
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
19 |
instanceVariableNames:'' |
2395
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
20 |
classVariableNames:'AllWrappedMethods' |
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
21 |
poolDictionaries:'' |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
22 |
category:'Kernel-Methods' |
8 | 23 |
! |
24 |
||
508 | 25 |
!WrappedMethod class methodsFor:'documentation'! |
9 | 26 |
|
27 |
copyright |
|
28 |
" |
|
29 |
COPYRIGHT (c) 1994 by Claus Gittinger |
|
14 | 30 |
All Rights Reserved |
9 | 31 |
|
32 |
This software is furnished under a license and may be used |
|
33 |
only in accordance with the terms of that license and with the |
|
34 |
inclusion of the above copyright notice. This software may not |
|
35 |
be provided or otherwise made available to, or used by, any |
|
36 |
other person. No title to or ownership of the software is |
|
37 |
hereby transferred. |
|
38 |
" |
|
39 |
! |
|
40 |
||
41 |
documentation |
|
42 |
" |
|
43 |
support for MessageTracer |
|
234 | 44 |
|
2395
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
45 |
notice: remembers wrappers in a weak classvar, because finding the wrapper for a |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
46 |
method is required for single stepping, and used to take a long time when using allInstances. |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
47 |
Therefore, wrappers are remembered. |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
48 |
|
234 | 49 |
[author:] |
50 |
Claus Gittinger |
|
51 |
||
52 |
[see also:] |
|
53 |
MessageTracer |
|
9 | 54 |
" |
55 |
! ! |
|
56 |
||
2395
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
57 |
!WrappedMethod class methodsFor:'registration'! |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
58 |
|
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
59 |
allInstancesDo:aBlock |
3585 | 60 |
self allWrappedMethodsDo:aBlock |
61 |
! |
|
2395
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
62 |
|
3585 | 63 |
allWrappedMethods |
64 |
AllWrappedMethods isNil ifTrue:[^ #() ]. |
|
65 |
^ AllWrappedMethods |
|
66 |
select:[:m | |
|
3586 | 67 |
"/ must double check - as this is a weak set, it gets cleaned up with a delay. |
3585 | 68 |
m mclass notNil |
69 |
] |
|
70 |
as:OrderedCollection |
|
71 |
||
72 |
" |
|
73 |
self allWrappedMethods |
|
74 |
" |
|
75 |
! |
|
76 |
||
77 |
allWrappedMethodsDo:aBlock |
|
78 |
AllWrappedMethods isNil ifTrue:[^ self ]. |
|
79 |
self allWrappedMethods do:aBlock |
|
2395
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
80 |
! |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
81 |
|
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
82 |
register:aWrappedMethod |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
83 |
AllWrappedMethods isNil ifTrue:[ |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
84 |
AllWrappedMethods := WeakIdentitySet new. |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
85 |
]. |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
86 |
AllWrappedMethods add:aWrappedMethod |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
87 |
|
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
88 |
"Created: / 01-07-2011 / 09:44:56 / cg" |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
89 |
! |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
90 |
|
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
91 |
unregister:aWrappedMethod |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
92 |
AllWrappedMethods notNil ifTrue:[ |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
93 |
AllWrappedMethods remove:aWrappedMethod ifAbsent:[] |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
94 |
]. |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
95 |
|
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
96 |
"Created: / 01-07-2011 / 10:03:55 / cg" |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
97 |
! ! |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
98 |
|
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
99 |
!WrappedMethod methodsFor:'accessing'! |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
100 |
|
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
101 |
basicLiterals |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
102 |
"return my literals" |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
103 |
|
352
ac12b5bc2754
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
234
diff
changeset
|
104 |
^ super literals |
ac12b5bc2754
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
234
diff
changeset
|
105 |
|
ac12b5bc2754
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
234
diff
changeset
|
106 |
"Modified: 24.6.1996 / 14:10:34 / stefan" |
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
107 |
! |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
108 |
|
1367
00692bfc2516
care for category and package changes
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
109 |
category:newCategory |
00692bfc2516
care for category and package changes
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
110 |
super category:newCategory. |
00692bfc2516
care for category and package changes
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
111 |
self originalMethod category:newCategory |
00692bfc2516
care for category and package changes
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
112 |
! |
00692bfc2516
care for category and package changes
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
113 |
|
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
114 |
literals |
2931 | 115 |
"return the wrapped method's literals" |
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
116 |
|
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
117 |
^ self originalMethod literals |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
118 |
! |
8 | 119 |
|
644
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
120 |
literalsDetect:aBlock ifNone:exceptionBlock |
2931 | 121 |
"access the wrapped method's literals" |
644
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
122 |
|
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
123 |
^ self originalMethod literalsDetect:aBlock ifNone:exceptionBlock |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
124 |
|
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
125 |
"Created: / 23.1.1998 / 13:23:15 / stefan" |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
126 |
! |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
127 |
|
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
128 |
literalsDo:aBlock |
2931 | 129 |
"access the wrapped method's literals" |
644
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
130 |
|
4474 | 131 |
self originalMethod literalsDo:aBlock |
644
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
132 |
|
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
133 |
"Created: / 23.1.1998 / 13:09:36 / stefan" |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
134 |
"Modified: / 23.1.1998 / 13:22:38 / stefan" |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
135 |
! |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
136 |
|
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
137 |
methodArgAndVarNames |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
138 |
"return the names of the args and locals of the wrapped method." |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
139 |
|
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
140 |
^ self originalMethod methodArgAndVarNames |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
141 |
! |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
142 |
|
3456 | 143 |
methodArgAndVarNamesInContext: context |
144 |
"return the names of the args and locals of the wrapped method. |
|
145 |
in given context (for Java, as in java local names differ by |
|
146 |
actual program counter)" |
|
147 |
||
148 |
^ self originalMethod methodArgAndVarNamesInContext: context |
|
149 |
||
150 |
"Created: / 18-12-2012 / 18:16:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
151 |
! |
|
152 |
||
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
153 |
methodVarNames |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
154 |
"return the names of the locals of the wrapped method." |
14 | 155 |
|
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
156 |
^ self originalMethod methodVarNames |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
157 |
! |
8 | 158 |
|
508 | 159 |
numVars |
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
160 |
"return the number of locals in the wrapped method." |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
161 |
|
508 | 162 |
^ self originalMethod numVars |
163 |
||
164 |
"Created: 4.11.1996 / 21:40:10 / cg" |
|
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
165 |
! |
8 | 166 |
|
167 |
originalMethod |
|
14 | 168 |
"return the method the receiver is wrapping" |
8 | 169 |
|
644
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
170 |
"a kludge: it must be in my literal array somewhere" |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
171 |
super literalsDo:[:aLiteral | |
352
ac12b5bc2754
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
234
diff
changeset
|
172 |
aLiteral isMethod ifTrue:[ |
ac12b5bc2754
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
234
diff
changeset
|
173 |
^ aLiteral |
ac12b5bc2754
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
234
diff
changeset
|
174 |
] |
8 | 175 |
]. |
176 |
^ nil |
|
352
ac12b5bc2754
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
234
diff
changeset
|
177 |
|
644
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
178 |
"Modified: / 23.1.1998 / 13:08:25 / stefan" |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
179 |
! |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
180 |
|
2293 | 181 |
originalMethodIfWrapped |
182 |
"return the method the receiver is wrapping" |
|
183 |
||
4499 | 184 |
^ self originalMethod ? self |
2293 | 185 |
|
186 |
"Created: / 22-10-2010 / 11:45:42 / cg" |
|
187 |
! |
|
188 |
||
1367
00692bfc2516
care for category and package changes
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
189 |
package:aSymbol |
00692bfc2516
care for category and package changes
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
190 |
super package:aSymbol. |
00692bfc2516
care for category and package changes
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
191 |
self originalMethod package:aSymbol |
00692bfc2516
care for category and package changes
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
192 |
! |
00692bfc2516
care for category and package changes
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
193 |
|
644
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
194 |
privacy |
2931 | 195 |
"return the wrapped method's privacy" |
644
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
196 |
|
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
197 |
^ self originalMethod privacy |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
198 |
|
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
199 |
"Created: / 23.1.1998 / 13:09:17 / stefan" |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
200 |
"Modified: / 23.1.1998 / 13:20:59 / stefan" |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
201 |
! |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
202 |
|
1396 | 203 |
privacy:aSymbol |
2931 | 204 |
"set the wrapped method's privacy" |
1396 | 205 |
|
206 |
^ self originalMethod privacy:aSymbol |
|
207 |
! |
|
208 |
||
2182 | 209 |
programmingLanguage |
3392 | 210 |
^ (self originalMethod ? self mclass ? Smalltalk) programmingLanguage |
211 |
||
212 |
"Modified: / 29-08-2013 / 10:59:20 / cg" |
|
2182 | 213 |
! |
214 |
||
3306 | 215 |
replaceOriginalMethodWith:aNewMethod |
216 |
"change the original method which is going to be invoked by this wrapper. |
|
217 |
The only place where this makes sense is when the original method has to be |
|
218 |
replaced by a recompiled breakpointed method (in the debugger)." |
|
219 |
||
220 |
"a kludge: it is in my literal array somewhere" |
|
221 |
1 to:(super numLiterals) do:[:i | |
|
222 |
(super literalAt:i) isMethod ifTrue:[ |
|
223 |
super literalAt:i put:aNewMethod. |
|
224 |
^ self. |
|
225 |
] |
|
226 |
]. |
|
227 |
^ self |
|
228 |
! |
|
229 |
||
1396 | 230 |
restricted:aBoolean |
231 |
^ self originalMethod restricted:aBoolean |
|
232 |
! |
|
233 |
||
644
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
234 |
setPrivacy:aSymbol |
2931 | 235 |
"set the wrapped method's privacy" |
644
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
236 |
|
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
237 |
^ self originalMethod setPrivacy:aSymbol |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
238 |
|
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
239 |
"Modified: / 23.1.1998 / 13:21:26 / stefan" |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
240 |
"Created: / 23.1.1998 / 15:26:26 / stefan" |
2101
a9c9794266b8
Redirect #source to the original method
Stefan Vogel <sv@exept.de>
parents:
2012
diff
changeset
|
241 |
! |
a9c9794266b8
Redirect #source to the original method
Stefan Vogel <sv@exept.de>
parents:
2012
diff
changeset
|
242 |
|
3630 | 243 |
shadowedMethod |
4431 | 244 |
"return true, if this method is an extension (i.e. package ~= classes' package) |
245 |
which shadows an existing method from another package (i.e. a package conflict)" |
|
246 |
||
3630 | 247 |
^ self originalMethod shadowedMethod |
248 |
||
249 |
"Created: / 03-10-2014 / 15:23:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4431 | 250 |
"Modified (comment): / 27-05-2019 / 20:50:08 / Claus Gittinger" |
3630 | 251 |
! |
252 |
||
2101
a9c9794266b8
Redirect #source to the original method
Stefan Vogel <sv@exept.de>
parents:
2012
diff
changeset
|
253 |
source |
a9c9794266b8
Redirect #source to the original method
Stefan Vogel <sv@exept.de>
parents:
2012
diff
changeset
|
254 |
"return the source of the method" |
a9c9794266b8
Redirect #source to the original method
Stefan Vogel <sv@exept.de>
parents:
2012
diff
changeset
|
255 |
|
a9c9794266b8
Redirect #source to the original method
Stefan Vogel <sv@exept.de>
parents:
2012
diff
changeset
|
256 |
^ self originalMethod source |
3456 | 257 |
! |
258 |
||
259 |
sourceFilename |
|
260 |
"return the sourcefilename if source is extern; nil otherwise" |
|
261 |
||
262 |
^ self originalMethod sourceFilename |
|
263 |
||
264 |
"Created: / 16-10-2013 / 00:05:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
265 |
! |
|
266 |
||
267 |
sourcePosition |
|
268 |
"return the sourceposition if source is extern; nil otherwise" |
|
269 |
||
270 |
^ self originalMethod sourcePosition |
|
271 |
||
272 |
"Created: / 16-10-2013 / 00:05:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
8 | 273 |
! ! |
274 |
||
3509
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
275 |
!WrappedMethod methodsFor:'accessing-annotations'! |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
276 |
|
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
277 |
annotateWith: annotation |
3516 | 278 |
"add a (hidden) annotation" |
279 |
||
3509
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
280 |
^ self originalMethod annotateWith: annotation |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
281 |
|
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
282 |
"Created: / 24-02-2014 / 22:47:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
283 |
! |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
284 |
|
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
285 |
annotationAt: key |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
286 |
^ self originalMethod annotationAt: key |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
287 |
|
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
288 |
"Created: / 24-02-2014 / 22:49:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
289 |
! |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
290 |
|
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
291 |
annotations |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
292 |
"return the wrapped method's annotations" |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
293 |
|
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
294 |
^ self originalMethod annotations |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
295 |
|
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
296 |
"Created: / 04-12-2011 / 11:22:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
297 |
! |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
298 |
|
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
299 |
annotations: anObject |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
300 |
self originalMethod annotations: anObject |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
301 |
|
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
302 |
"Created: / 24-02-2014 / 22:49:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
303 |
! |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
304 |
|
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
305 |
annotationsAt: key |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
306 |
^ self originalMethod annotationAt: key |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
307 |
|
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
308 |
"Created: / 24-02-2014 / 22:49:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
309 |
! |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
310 |
|
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
311 |
annotationsAt: key1 orAt: key2 |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
312 |
^ self originalMethod annotationsAt: key1 orAt: key2 |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
313 |
|
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
314 |
"Created: / 24-02-2014 / 22:50:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
315 |
! |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
316 |
|
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
317 |
annotationsAt: key1 orAt: key2 do: block |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
318 |
^ self originalMethod annotationsAt: key1 orAt: key2 do: block |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
319 |
|
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
320 |
"Created: / 24-02-2014 / 22:50:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
321 |
! |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
322 |
|
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
323 |
annotationsDo: aBlock |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
324 |
^ self originalMethod annotationsDo: aBlock |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
325 |
|
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
326 |
"Created: / 24-02-2014 / 22:50:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
327 |
! ! |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
328 |
|
2395
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
329 |
!WrappedMethod methodsFor:'misc'! |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
330 |
|
2869 | 331 |
makeLocalStringSource |
332 |
||
333 |
self originalMethod makeLocalStringSource |
|
334 |
||
335 |
"Created: / 11-02-2012 / 19:09:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
336 |
! |
|
337 |
||
2395
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
338 |
register |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
339 |
self class register:self |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
340 |
|
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
341 |
"Created: / 01-07-2011 / 10:03:26 / cg" |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
342 |
! |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
343 |
|
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
344 |
unregister |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
345 |
self class unregister:self |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
346 |
|
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
347 |
"Created: / 01-07-2011 / 10:03:32 / cg" |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
348 |
! ! |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
349 |
|
3456 | 350 |
!WrappedMethod methodsFor:'printing & storing'! |
351 |
||
4392 | 352 |
printOn:aStream |
353 |
"put a printed representation of the receiver onto aStream. |
|
354 |
Since methods do not store their class/selector, we have to search |
|
355 |
for it here." |
|
356 |
||
357 |
self basicPrintOn:aStream."/ aStream nextPutAll:(self classNameWithArticle). |
|
358 |
aStream nextPutAll:'(for '. |
|
359 |
aStream nextPutAll:self originalMethod whoString. |
|
360 |
aStream nextPutAll:')'. |
|
361 |
! |
|
362 |
||
3456 | 363 |
selectorPrintStringInBrowserFor:selector |
364 |
^ [ |
|
365 |
self originalMethod perform: #selectorPrintStringInBrowserFor: with: selector |
|
366 |
] on: Object messageNotUnderstoodSignal do:[ |
|
367 |
super selectorPrintStringInBrowserFor:selector |
|
368 |
]. |
|
369 |
||
370 |
"Created: / 16-10-2013 / 01:04:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
371 |
! |
|
372 |
||
373 |
selectorPrintStringInBrowserFor:selector class: class |
|
374 |
^ [ |
|
375 |
self originalMethod perform: #selectorPrintStringInBrowserFor:class: with: selector with: class |
|
376 |
] on: Object messageNotUnderstoodSignal do:[ |
|
377 |
super selectorPrintStringInBrowserFor:selector class: class |
|
378 |
]. |
|
379 |
||
380 |
"Created: / 16-10-2013 / 01:04:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
381 |
! ! |
|
382 |
||
2644 | 383 |
!WrappedMethod methodsFor:'private'! |
384 |
||
385 |
annotationAtIndex: index |
|
386 |
"return annotation at given index. |
|
3878 | 387 |
any raw annotation array is lazily initialized" |
2644 | 388 |
|
389 |
^self originalMethod annotationAtIndex: index |
|
390 |
||
391 |
"Created: / 16-12-2011 / 19:54:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
392 |
! |
|
393 |
||
394 |
annotationIndexOf: key |
|
395 |
||
396 |
"Returns index of annotation with given key |
|
397 |
or nil if there is no such annotation" |
|
398 |
||
399 |
^self originalMethod annotationIndexOf: key |
|
400 |
||
401 |
"Created: / 16-12-2011 / 19:53:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
402 |
! ! |
|
403 |
||
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
404 |
!WrappedMethod methodsFor:'queries'! |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
405 |
|
733 | 406 |
argSignature |
407 |
^ self originalMethod argSignature |
|
408 |
||
409 |
"Created: / 27.1.1999 / 20:23:17 / cg" |
|
410 |
! |
|
411 |
||
3296 | 412 |
hasAnnotation |
413 |
"Return true iff the method has any annotation" |
|
414 |
||
415 |
^ self originalMethod hasAnnotation |
|
416 |
! |
|
417 |
||
2012 | 418 |
hasResource |
419 |
"return the wrapped methods hasResource" |
|
420 |
||
421 |
^ self originalMethod hasResource |
|
422 |
! |
|
423 |
||
576
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
424 |
isBreakpointed |
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
425 |
"return true, if the receiver is a wrapped method for a breakpoint. |
4213 | 426 |
Ask the messageTracer, since I don't know if it's a break or trace" |
576
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
427 |
|
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
428 |
^ (MessageTracer isTrapped:self) |
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
429 |
|
4213 | 430 |
"Created: / 07-04-1997 / 17:25:40 / cg" |
431 |
"Modified (comment): / 13-02-2017 / 20:35:11 / cg" |
|
576
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
432 |
! |
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
433 |
|
3610
3d4bb9c61850
Initial support for simple method mocking (for tests, mainly)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3586
diff
changeset
|
434 |
isMocked |
3d4bb9c61850
Initial support for simple method mocking (for tests, mainly)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3586
diff
changeset
|
435 |
"Return true, if the method has been mocked (by means of MessageTracer>>mockMethod:do:" |
3d4bb9c61850
Initial support for simple method mocking (for tests, mainly)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3586
diff
changeset
|
436 |
|
3d4bb9c61850
Initial support for simple method mocking (for tests, mainly)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3586
diff
changeset
|
437 |
^ MessageTracer isMocking: self. |
3d4bb9c61850
Initial support for simple method mocking (for tests, mainly)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3586
diff
changeset
|
438 |
|
3d4bb9c61850
Initial support for simple method mocking (for tests, mainly)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3586
diff
changeset
|
439 |
"Created: / 29-07-2014 / 09:50:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3d4bb9c61850
Initial support for simple method mocking (for tests, mainly)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3586
diff
changeset
|
440 |
! |
3d4bb9c61850
Initial support for simple method mocking (for tests, mainly)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3586
diff
changeset
|
441 |
|
580 | 442 |
isTimed |
443 |
"return true, if the receiver is a wrapped method for a time measurement. |
|
4213 | 444 |
Ask the messageTracer, since I don't know if it's a break or trace" |
580 | 445 |
|
446 |
^ (MessageTracer isTiming:self) |
|
447 |
||
4213 | 448 |
"Created: / 11-04-1997 / 17:06:14 / cg" |
449 |
"Modified (comment): / 13-02-2017 / 20:35:15 / cg" |
|
580 | 450 |
! |
451 |
||
576
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
452 |
isTraced |
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
453 |
"return true, if the receiver is a wrapped method for a trace point. |
4213 | 454 |
Ask the messageTracer, since I don't know if it's a break or trace" |
576
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
455 |
|
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
456 |
^ (MessageTracer isTrapped:self) not |
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
457 |
|
4213 | 458 |
"Created: / 07-04-1997 / 17:25:54 / cg" |
459 |
"Modified (comment): / 13-02-2017 / 20:35:20 / cg" |
|
576
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
460 |
! |
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
461 |
|
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
462 |
isWrapped |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
463 |
"return true, if the receiver is a wrapped method. |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
464 |
True is returned here, since the receiver is always a wrapped one" |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
465 |
|
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
466 |
^ true |
729 | 467 |
! |
468 |
||
971 | 469 |
messagesSent |
4457 | 470 |
"return a set-like collection with the message selectors sent by the receiver. |
4512 | 471 |
Uses Parser to parse method's source and extract the names. |
4457 | 472 |
The returned collection includes all used message selectors |
473 |
(i.e. including super-send messages)" |
|
940
2ec011688c35
more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents:
839
diff
changeset
|
474 |
|
971 | 475 |
^ self originalMethod messagesSent |
940
2ec011688c35
more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents:
839
diff
changeset
|
476 |
! |
2ec011688c35
more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents:
839
diff
changeset
|
477 |
|
971 | 478 |
messagesSentToSelf |
479 |
"return a collection of message selectors sent to self by this method" |
|
940
2ec011688c35
more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents:
839
diff
changeset
|
480 |
|
971 | 481 |
^ self originalMethod messagesSentToSelf |
482 |
! |
|
940
2ec011688c35
more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents:
839
diff
changeset
|
483 |
|
971 | 484 |
messagesSentToSuper |
485 |
"return a collection of message selectors sent to super by this method" |
|
940
2ec011688c35
more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents:
839
diff
changeset
|
486 |
|
971 | 487 |
^ self originalMethod messagesSentToSuper |
940
2ec011688c35
more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents:
839
diff
changeset
|
488 |
! |
2ec011688c35
more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents:
839
diff
changeset
|
489 |
|
3366 | 490 |
parse:parseSelector with:arg2 return:accessSelector or:valueIfNoSource |
3392 | 491 |
|m| |
492 |
||
493 |
(m := self originalMethod) notNil ifTrue:[ |
|
494 |
^ m parse:parseSelector with:arg2 return:accessSelector or:valueIfNoSource |
|
495 |
]. |
|
496 |
^ valueIfNoSource |
|
3366 | 497 |
|
498 |
"Created: / 02-08-2013 / 10:57:02 / cg" |
|
499 |
! |
|
500 |
||
3296 | 501 |
refersToLiteral: anObject |
502 |
^ self originalMethod refersToLiteral: anObject |
|
503 |
! |
|
504 |
||
2012 | 505 |
resources |
506 |
"return the wrapped methods resources" |
|
507 |
||
508 |
^ self originalMethod resources |
|
509 |
! |
|
510 |
||
729 | 511 |
signature |
512 |
^ self originalMethod signature |
|
513 |
||
514 |
"Created: / 14.11.1998 / 00:01:50 / cg" |
|
733 | 515 |
! |
516 |
||
517 |
signatureNameWithoutReturnType |
|
518 |
^ self originalMethod signatureNameWithoutReturnType |
|
519 |
||
520 |
"Created: / 27.1.1999 / 20:52:25 / cg" |
|
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
521 |
! ! |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
522 |
|
508 | 523 |
!WrappedMethod class methodsFor:'documentation'! |
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
524 |
|
3586 | 525 |
version |
4130 | 526 |
^ '$Header$' |
3586 | 527 |
! |
528 |
||
529 |
version_CVS |
|
4130 | 530 |
^ '$Header$' |
3586 | 531 |
! |
532 |
||
2869 | 533 |
version_SVN |
4130 | 534 |
^ '$Id$' |
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
535 |
! ! |
3296 | 536 |