author | Jan Vrany <jan.vrany@labware.com> |
Wed, 05 Aug 2020 16:18:49 +0100 | |
branch | jv |
changeset 4565 | 85e90338785b |
parent 4166 | 66a7a47f9253 |
permissions | -rw-r--r-- |
9 | 1 |
" |
2 |
COPYRIGHT (c) 1994 by Claus Gittinger |
|
4565
85e90338785b
Make `WrappedMethod >> #dbgVariables` to answer original method's arguments
Jan Vrany <jan.vrany@labware.com>
parents:
4166
diff
changeset
|
3 |
COPYRIGHT (c) 2020 LabWare |
14 | 4 |
All Rights Reserved |
9 | 5 |
|
6 |
This software is furnished under a license and may be used |
|
7 |
only in accordance with the terms of that license and with the |
|
8 |
inclusion of the above copyright notice. This software may not |
|
9 |
be provided or otherwise made available to, or used by, any |
|
10 |
other person. No title to or ownership of the software is |
|
11 |
hereby transferred. |
|
12 |
" |
|
940
2ec011688c35
more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents:
839
diff
changeset
|
13 |
"{ Package: 'stx:libbasic3' }" |
2ec011688c35
more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents:
839
diff
changeset
|
14 |
|
3878 | 15 |
"{ NameSpace: Smalltalk }" |
16 |
||
729 | 17 |
Method variableSubclass:#WrappedMethod |
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
18 |
instanceVariableNames:'' |
2395
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
19 |
classVariableNames:'AllWrappedMethods' |
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
20 |
poolDictionaries:'' |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
21 |
category:'Kernel-Methods' |
8 | 22 |
! |
23 |
||
508 | 24 |
!WrappedMethod class methodsFor:'documentation'! |
9 | 25 |
|
26 |
copyright |
|
27 |
" |
|
28 |
COPYRIGHT (c) 1994 by Claus Gittinger |
|
4565
85e90338785b
Make `WrappedMethod >> #dbgVariables` to answer original method's arguments
Jan Vrany <jan.vrany@labware.com>
parents:
4166
diff
changeset
|
29 |
COPYRIGHT (c) 2020 LabWare |
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 |
|
4565
85e90338785b
Make `WrappedMethod >> #dbgVariables` to answer original method's arguments
Jan Vrany <jan.vrany@labware.com>
parents:
4166
diff
changeset
|
114 |
dbgVariables |
85e90338785b
Make `WrappedMethod >> #dbgVariables` to answer original method's arguments
Jan Vrany <jan.vrany@labware.com>
parents:
4166
diff
changeset
|
115 |
"Return a list of variables for this context (as collection |
85e90338785b
Make `WrappedMethod >> #dbgVariables` to answer original method's arguments
Jan Vrany <jan.vrany@labware.com>
parents:
4166
diff
changeset
|
116 |
of `DIVariable` instances) or nil if no debug info is recorded" |
85e90338785b
Make `WrappedMethod >> #dbgVariables` to answer original method's arguments
Jan Vrany <jan.vrany@labware.com>
parents:
4166
diff
changeset
|
117 |
|
85e90338785b
Make `WrappedMethod >> #dbgVariables` to answer original method's arguments
Jan Vrany <jan.vrany@labware.com>
parents:
4166
diff
changeset
|
118 |
^ self originalMethod dbgVariables select: [:var | var isArgument ] |
85e90338785b
Make `WrappedMethod >> #dbgVariables` to answer original method's arguments
Jan Vrany <jan.vrany@labware.com>
parents:
4166
diff
changeset
|
119 |
|
85e90338785b
Make `WrappedMethod >> #dbgVariables` to answer original method's arguments
Jan Vrany <jan.vrany@labware.com>
parents:
4166
diff
changeset
|
120 |
"Created: / 09-07-2020 / 20:26:40 / Jan Vrany <jan.vrany@labware.com>" |
85e90338785b
Make `WrappedMethod >> #dbgVariables` to answer original method's arguments
Jan Vrany <jan.vrany@labware.com>
parents:
4166
diff
changeset
|
121 |
! |
85e90338785b
Make `WrappedMethod >> #dbgVariables` to answer original method's arguments
Jan Vrany <jan.vrany@labware.com>
parents:
4166
diff
changeset
|
122 |
|
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
123 |
literals |
2931 | 124 |
"return the wrapped method's literals" |
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
125 |
|
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
126 |
^ self originalMethod literals |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
127 |
! |
8 | 128 |
|
644
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
129 |
literalsDetect:aBlock ifNone:exceptionBlock |
2931 | 130 |
"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
|
131 |
|
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
132 |
^ self originalMethod literalsDetect:aBlock ifNone:exceptionBlock |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
133 |
|
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
134 |
"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
|
135 |
! |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
136 |
|
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
137 |
literalsDo:aBlock |
2931 | 138 |
"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
|
139 |
|
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
140 |
^ self originalMethod literalsDo:aBlock |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
141 |
|
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
142 |
"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
|
143 |
"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
|
144 |
! |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
145 |
|
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
146 |
methodArgAndVarNames |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
147 |
"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
|
148 |
|
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
149 |
^ self originalMethod methodArgAndVarNames |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
150 |
! |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
151 |
|
3456 | 152 |
methodArgAndVarNamesInContext: context |
153 |
"return the names of the args and locals of the wrapped method. |
|
154 |
in given context (for Java, as in java local names differ by |
|
155 |
actual program counter)" |
|
156 |
||
157 |
^ self originalMethod methodArgAndVarNamesInContext: context |
|
158 |
||
159 |
"Created: / 18-12-2012 / 18:16:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
160 |
! |
|
161 |
||
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
162 |
methodVarNames |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
163 |
"return the names of the locals of the wrapped method." |
14 | 164 |
|
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
165 |
^ self originalMethod methodVarNames |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
166 |
! |
8 | 167 |
|
508 | 168 |
numVars |
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
169 |
"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
|
170 |
|
508 | 171 |
^ self originalMethod numVars |
172 |
||
173 |
"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
|
174 |
! |
8 | 175 |
|
176 |
originalMethod |
|
14 | 177 |
"return the method the receiver is wrapping" |
8 | 178 |
|
644
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
179 |
"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
|
180 |
super literalsDo:[:aLiteral | |
352
ac12b5bc2754
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
234
diff
changeset
|
181 |
aLiteral isMethod ifTrue:[ |
ac12b5bc2754
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
234
diff
changeset
|
182 |
^ aLiteral |
ac12b5bc2754
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
234
diff
changeset
|
183 |
] |
8 | 184 |
]. |
185 |
^ nil |
|
352
ac12b5bc2754
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
234
diff
changeset
|
186 |
|
644
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
187 |
"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
|
188 |
! |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
189 |
|
2293 | 190 |
originalMethodIfWrapped |
191 |
"return the method the receiver is wrapping" |
|
192 |
||
193 |
^ self originalMethod |
|
194 |
||
195 |
"Created: / 22-10-2010 / 11:45:42 / cg" |
|
196 |
! |
|
197 |
||
1367
00692bfc2516
care for category and package changes
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
198 |
package:aSymbol |
00692bfc2516
care for category and package changes
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
199 |
super package:aSymbol. |
00692bfc2516
care for category and package changes
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
200 |
self originalMethod package:aSymbol |
00692bfc2516
care for category and package changes
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
201 |
! |
00692bfc2516
care for category and package changes
Claus Gittinger <cg@exept.de>
parents:
971
diff
changeset
|
202 |
|
644
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
203 |
privacy |
2931 | 204 |
"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
|
205 |
|
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
206 |
^ self originalMethod privacy |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
207 |
|
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
208 |
"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
|
209 |
"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
|
210 |
! |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
211 |
|
1396 | 212 |
privacy:aSymbol |
2931 | 213 |
"set the wrapped method's privacy" |
1396 | 214 |
|
215 |
^ self originalMethod privacy:aSymbol |
|
216 |
! |
|
217 |
||
2182 | 218 |
programmingLanguage |
3392 | 219 |
^ (self originalMethod ? self mclass ? Smalltalk) programmingLanguage |
220 |
||
221 |
"Modified: / 29-08-2013 / 10:59:20 / cg" |
|
2182 | 222 |
! |
223 |
||
3306 | 224 |
replaceOriginalMethodWith:aNewMethod |
225 |
"change the original method which is going to be invoked by this wrapper. |
|
226 |
The only place where this makes sense is when the original method has to be |
|
227 |
replaced by a recompiled breakpointed method (in the debugger)." |
|
228 |
||
229 |
"a kludge: it is in my literal array somewhere" |
|
230 |
1 to:(super numLiterals) do:[:i | |
|
231 |
(super literalAt:i) isMethod ifTrue:[ |
|
232 |
super literalAt:i put:aNewMethod. |
|
233 |
^ self. |
|
234 |
] |
|
235 |
]. |
|
236 |
^ self |
|
237 |
! |
|
238 |
||
1396 | 239 |
restricted:aBoolean |
240 |
^ self originalMethod restricted:aBoolean |
|
241 |
! |
|
242 |
||
644
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
243 |
setPrivacy:aSymbol |
2931 | 244 |
"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
|
245 |
|
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
246 |
^ self originalMethod setPrivacy:aSymbol |
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
247 |
|
ffba6b23cc6d
Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
248 |
"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
|
249 |
"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
|
250 |
! |
a9c9794266b8
Redirect #source to the original method
Stefan Vogel <sv@exept.de>
parents:
2012
diff
changeset
|
251 |
|
3630 | 252 |
shadowedMethod |
253 |
^ self originalMethod shadowedMethod |
|
254 |
||
255 |
"Created: / 03-10-2014 / 15:23:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
256 |
! |
|
257 |
||
2101
a9c9794266b8
Redirect #source to the original method
Stefan Vogel <sv@exept.de>
parents:
2012
diff
changeset
|
258 |
source |
a9c9794266b8
Redirect #source to the original method
Stefan Vogel <sv@exept.de>
parents:
2012
diff
changeset
|
259 |
"return the source of the method" |
a9c9794266b8
Redirect #source to the original method
Stefan Vogel <sv@exept.de>
parents:
2012
diff
changeset
|
260 |
|
a9c9794266b8
Redirect #source to the original method
Stefan Vogel <sv@exept.de>
parents:
2012
diff
changeset
|
261 |
^ self originalMethod source |
3456 | 262 |
! |
263 |
||
264 |
sourceFilename |
|
265 |
"return the sourcefilename if source is extern; nil otherwise" |
|
266 |
||
267 |
^ self originalMethod sourceFilename |
|
268 |
||
269 |
"Created: / 16-10-2013 / 00:05:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
270 |
! |
|
271 |
||
272 |
sourcePosition |
|
273 |
"return the sourceposition if source is extern; nil otherwise" |
|
274 |
||
275 |
^ self originalMethod sourcePosition |
|
276 |
||
277 |
"Created: / 16-10-2013 / 00:05:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
8 | 278 |
! ! |
279 |
||
3509
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
280 |
!WrappedMethod methodsFor:'accessing-annotations'! |
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 |
annotateWith: annotation |
3516 | 283 |
"add a (hidden) annotation" |
284 |
||
3509
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
285 |
^ self originalMethod annotateWith: annotation |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
286 |
|
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
287 |
"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
|
288 |
! |
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 |
annotationAt: key |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
291 |
^ self originalMethod annotationAt: key |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
292 |
|
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
293 |
"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
|
294 |
! |
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 |
annotations |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
297 |
"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
|
298 |
|
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
299 |
^ self originalMethod annotations |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
300 |
|
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
301 |
"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
|
302 |
! |
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 |
annotations: anObject |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
305 |
self originalMethod annotations: anObject |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
306 |
|
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
307 |
"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
|
308 |
! |
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 |
annotationsAt: key |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
311 |
^ self originalMethod annotationAt: key |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
312 |
|
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
313 |
"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
|
314 |
! |
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 |
annotationsAt: key1 orAt: key2 |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
317 |
^ 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
|
318 |
|
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
319 |
"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
|
320 |
! |
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 |
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
|
323 |
^ 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
|
324 |
|
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
325 |
"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
|
326 |
! |
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 |
annotationsDo: aBlock |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
329 |
^ self originalMethod annotationsDo: aBlock |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
330 |
|
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
331 |
"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
|
332 |
! ! |
3ec710a1ba02
Delegate all annotation requests to original method.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3456
diff
changeset
|
333 |
|
2395
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
334 |
!WrappedMethod methodsFor:'misc'! |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
335 |
|
2869 | 336 |
makeLocalStringSource |
337 |
||
338 |
self originalMethod makeLocalStringSource |
|
339 |
||
340 |
"Created: / 11-02-2012 / 19:09:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
341 |
! |
|
342 |
||
2395
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
343 |
register |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
344 |
self class register:self |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
345 |
|
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
346 |
"Created: / 01-07-2011 / 10:03:26 / cg" |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
347 |
! |
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 |
unregister |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
350 |
self class unregister:self |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
351 |
|
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
352 |
"Created: / 01-07-2011 / 10:03:32 / cg" |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
353 |
! ! |
e9082ccc0d80
remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents:
2293
diff
changeset
|
354 |
|
3456 | 355 |
!WrappedMethod methodsFor:'printing & storing'! |
356 |
||
357 |
selectorPrintStringInBrowserFor:selector |
|
358 |
^ [ |
|
359 |
self originalMethod perform: #selectorPrintStringInBrowserFor: with: selector |
|
360 |
] on: Object messageNotUnderstoodSignal do:[ |
|
361 |
super selectorPrintStringInBrowserFor:selector |
|
362 |
]. |
|
363 |
||
364 |
"Created: / 16-10-2013 / 01:04:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
365 |
! |
|
366 |
||
367 |
selectorPrintStringInBrowserFor:selector class: class |
|
368 |
^ [ |
|
369 |
self originalMethod perform: #selectorPrintStringInBrowserFor:class: with: selector with: class |
|
370 |
] on: Object messageNotUnderstoodSignal do:[ |
|
371 |
super selectorPrintStringInBrowserFor:selector class: class |
|
372 |
]. |
|
373 |
||
374 |
"Created: / 16-10-2013 / 01:04:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
375 |
! ! |
|
376 |
||
3306 | 377 |
!WrappedMethod methodsFor:'printing and storing'! |
378 |
||
379 |
printOn:aStream |
|
380 |
"put a printed representation of the receiver onto aStream. |
|
381 |
Since methods do not store their class/selector, we have to search |
|
382 |
for it here." |
|
383 |
||
384 |
self basicPrintOn:aStream."/ aStream nextPutAll:(self classNameWithArticle). |
|
385 |
aStream nextPutAll:'(for '. |
|
386 |
aStream nextPutAll:self originalMethod whoString. |
|
387 |
aStream nextPutAll:')'. |
|
388 |
! ! |
|
389 |
||
2644 | 390 |
!WrappedMethod methodsFor:'private'! |
391 |
||
392 |
annotationAtIndex: index |
|
393 |
"return annotation at given index. |
|
3878 | 394 |
any raw annotation array is lazily initialized" |
2644 | 395 |
|
396 |
^self originalMethod annotationAtIndex: index |
|
397 |
||
398 |
"Created: / 16-12-2011 / 19:54:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
399 |
! |
|
400 |
||
401 |
annotationIndexOf: key |
|
402 |
||
403 |
"Returns index of annotation with given key |
|
404 |
or nil if there is no such annotation" |
|
405 |
||
406 |
^self originalMethod annotationIndexOf: key |
|
407 |
||
408 |
"Created: / 16-12-2011 / 19:53:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
409 |
! ! |
|
410 |
||
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
411 |
!WrappedMethod methodsFor:'queries'! |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
412 |
|
733 | 413 |
argSignature |
414 |
^ self originalMethod argSignature |
|
415 |
||
416 |
"Created: / 27.1.1999 / 20:23:17 / cg" |
|
417 |
! |
|
418 |
||
3296 | 419 |
hasAnnotation |
420 |
"Return true iff the method has any annotation" |
|
421 |
||
422 |
^ self originalMethod hasAnnotation |
|
423 |
! |
|
424 |
||
2012 | 425 |
hasResource |
426 |
"return the wrapped methods hasResource" |
|
427 |
||
428 |
^ self originalMethod hasResource |
|
429 |
! |
|
430 |
||
576
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
431 |
isBreakpointed |
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
432 |
"return true, if the receiver is a wrapped method for a breakpoint. |
4130 | 433 |
Ask the messageTracer, since I don't know if its a break or trace" |
576
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
434 |
|
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
435 |
^ (MessageTracer isTrapped:self) |
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
436 |
|
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
437 |
"Created: 7.4.1997 / 17:25:40 / cg" |
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
438 |
! |
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
439 |
|
3610
3d4bb9c61850
Initial support for simple method mocking (for tests, mainly)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3586
diff
changeset
|
440 |
isMocked |
3d4bb9c61850
Initial support for simple method mocking (for tests, mainly)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3586
diff
changeset
|
441 |
"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
|
442 |
|
3d4bb9c61850
Initial support for simple method mocking (for tests, mainly)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3586
diff
changeset
|
443 |
^ MessageTracer isMocking: self. |
3d4bb9c61850
Initial support for simple method mocking (for tests, mainly)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3586
diff
changeset
|
444 |
|
3d4bb9c61850
Initial support for simple method mocking (for tests, mainly)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3586
diff
changeset
|
445 |
"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
|
446 |
! |
3d4bb9c61850
Initial support for simple method mocking (for tests, mainly)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3586
diff
changeset
|
447 |
|
580 | 448 |
isTimed |
449 |
"return true, if the receiver is a wrapped method for a time measurement. |
|
4130 | 450 |
Ask the messageTracer, since I don't know if its a break or trace" |
580 | 451 |
|
452 |
^ (MessageTracer isTiming:self) |
|
453 |
||
454 |
"Created: 11.4.1997 / 17:06:14 / cg" |
|
455 |
! |
|
456 |
||
576
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
457 |
isTraced |
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
458 |
"return true, if the receiver is a wrapped method for a trace point. |
4130 | 459 |
Ask the messageTracer, since I don't know if its a break or trace" |
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 |
^ (MessageTracer isTrapped:self) not |
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
462 |
|
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
463 |
"Created: 7.4.1997 / 17:25:54 / cg" |
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
464 |
! |
9519831877b1
moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents:
551
diff
changeset
|
465 |
|
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
466 |
isWrapped |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
467 |
"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
|
468 |
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
|
469 |
|
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
470 |
^ true |
729 | 471 |
! |
472 |
||
971 | 473 |
messagesSent |
940
2ec011688c35
more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents:
839
diff
changeset
|
474 |
"return a collection of message selectors sent by this method" |
2ec011688c35
more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents:
839
diff
changeset
|
475 |
|
971 | 476 |
^ self originalMethod messagesSent |
940
2ec011688c35
more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents:
839
diff
changeset
|
477 |
! |
2ec011688c35
more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents:
839
diff
changeset
|
478 |
|
971 | 479 |
messagesSentToSelf |
480 |
"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
|
481 |
|
971 | 482 |
^ self originalMethod messagesSentToSelf |
483 |
! |
|
940
2ec011688c35
more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents:
839
diff
changeset
|
484 |
|
971 | 485 |
messagesSentToSuper |
486 |
"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
|
487 |
|
971 | 488 |
^ self originalMethod messagesSentToSuper |
940
2ec011688c35
more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents:
839
diff
changeset
|
489 |
! |
2ec011688c35
more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents:
839
diff
changeset
|
490 |
|
3366 | 491 |
parse:parseSelector with:arg2 return:accessSelector or:valueIfNoSource |
3392 | 492 |
|m| |
493 |
||
494 |
(m := self originalMethod) notNil ifTrue:[ |
|
495 |
^ m parse:parseSelector with:arg2 return:accessSelector or:valueIfNoSource |
|
496 |
]. |
|
497 |
^ valueIfNoSource |
|
3366 | 498 |
|
499 |
"Created: / 02-08-2013 / 10:57:02 / cg" |
|
500 |
! |
|
501 |
||
3296 | 502 |
refersToLiteral: anObject |
503 |
^ self originalMethod refersToLiteral: anObject |
|
504 |
! |
|
505 |
||
2012 | 506 |
resources |
507 |
"return the wrapped methods resources" |
|
508 |
||
509 |
^ self originalMethod resources |
|
510 |
! |
|
511 |
||
729 | 512 |
signature |
513 |
^ self originalMethod signature |
|
514 |
||
515 |
"Created: / 14.11.1998 / 00:01:50 / cg" |
|
733 | 516 |
! |
517 |
||
518 |
signatureNameWithoutReturnType |
|
519 |
^ self originalMethod signatureNameWithoutReturnType |
|
520 |
||
521 |
"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
|
522 |
! ! |
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
523 |
|
508 | 524 |
!WrappedMethod class methodsFor:'documentation'! |
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
525 |
|
3586 | 526 |
version |
4130 | 527 |
^ '$Header$' |
3586 | 528 |
! |
529 |
||
530 |
version_CVS |
|
4130 | 531 |
^ '$Header$' |
3586 | 532 |
! |
533 |
||
4565
85e90338785b
Make `WrappedMethod >> #dbgVariables` to answer original method's arguments
Jan Vrany <jan.vrany@labware.com>
parents:
4166
diff
changeset
|
534 |
version_HG |
85e90338785b
Make `WrappedMethod >> #dbgVariables` to answer original method's arguments
Jan Vrany <jan.vrany@labware.com>
parents:
4166
diff
changeset
|
535 |
|
85e90338785b
Make `WrappedMethod >> #dbgVariables` to answer original method's arguments
Jan Vrany <jan.vrany@labware.com>
parents:
4166
diff
changeset
|
536 |
^ '$Changeset: <not expanded> $' |
85e90338785b
Make `WrappedMethod >> #dbgVariables` to answer original method's arguments
Jan Vrany <jan.vrany@labware.com>
parents:
4166
diff
changeset
|
537 |
! |
85e90338785b
Make `WrappedMethod >> #dbgVariables` to answer original method's arguments
Jan Vrany <jan.vrany@labware.com>
parents:
4166
diff
changeset
|
538 |
|
2869 | 539 |
version_SVN |
4130 | 540 |
^ '$Id$' |
210
3638d229ce41
subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents:
68
diff
changeset
|
541 |
! ! |
3296 | 542 |