35 |
35 |
36 "Created: / 25-04-2013 / 15:28:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
36 "Created: / 25-04-2013 / 15:28:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
37 ! |
37 ! |
38 |
38 |
39 assertSendersSendersMethodIsIdenticalTo: thisMethod |
39 assertSendersSendersMethodIsIdenticalTo: thisMethod |
40 | ctx m | |
40 | ctx methodSlotIndex method | |
41 |
41 |
42 ctx := thisContext sender sender. |
42 ctx := thisContext sender sender. |
|
43 methodSlotIndex := Context instVarIndexFor: #method. |
|
44 |
|
45 [ ctx isBlockContext ] whileTrue:[ |
|
46 | block | |
|
47 |
|
48 block := ctx instVarAt: methodSlotIndex. |
|
49 self assert: block isBlock. |
|
50 self assert: block home == ctx home. |
|
51 ctx := ctx home. |
|
52 ]. |
|
53 |
43 "/ Now, DO NOT USE Context>>method as it searches for the method |
54 "/ Now, DO NOT USE Context>>method as it searches for the method |
44 "/ if it is not set!! |
55 "/ if it is not set!! |
45 |
56 |
46 m := ctx instVarAt: (Context instVarIndexFor: #method). |
57 method := ctx instVarAt: methodSlotIndex. |
47 self assert: m == thisMethod |
58 self assert: method == thisMethod |
48 |
59 |
49 "Created: / 25-04-2013 / 15:30:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
60 "Created: / 25-04-2013 / 15:30:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
61 "Modified: / 08-09-2016 / 11:15:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
50 ! |
62 ! |
51 |
63 |
52 compile: source mode: mode |
64 compile: source mode: mode |
53 "Compile given source and returns the new method. |
65 "Compile given source and returns the new method. |
54 The from the source is prepended the mode + underscore |
66 The from the source is prepended the mode + underscore |