Cherry-picked `BlockContext` from a6b6dda4caff: jv
authorJan Vrany <jan.vrany@labware.com>
Mon, 21 Jun 2021 15:00:09 +0100
branchjv
changeset 25433 c46176ba6ce2
parent 25432 4064ba656818
child 25434 74d82599196a
Cherry-picked `BlockContext` from a6b6dda4caff: cherry-picked BlockContext.st from a6b6dda4caff: * 674ea83c00b9: #DOCUMENTATION by cg, Claus Gittinger <cg@exept.de> * 4af6ed4920e8: #REFACTORING by stefan, Stefan Vogel <sv@exept.de> * 8c4ef3c21488: #UI_ENHANCEMENT by cg, Claus Gittinger <cg@exept.de> * 7fdaf3987d8f: #UI_ENHANCEMENT by exept, Claus Gittinger <cg@exept.de> * d6cc2bdc7773: Fix `BlockContext >> method` for cheap-block contexts, Jan Vrany <jan.vrany@labware.com>
BlockContext.st
--- a/BlockContext.st	Fri Jun 18 17:43:50 2021 +0100
+++ b/BlockContext.st	Mon Jun 21 15:00:09 2021 +0100
@@ -141,13 +141,16 @@
     home isNil ifTrue:[^ nil].
     home isContext ifFalse:[^ nil]. "copying blocks have no method home"
 
-    con := self.
     h := home.
-    [h notNil] whileTrue:[
+    [
         con := h.
-        h := con home
-    ].
+        h := con home.
+        h notNil
+    ] whileTrue.
+
     ^ con
+
+    "Modified: / 02-02-2018 / 14:01:32 / stefan"
 !
 
 selector
@@ -175,7 +178,7 @@
 
 !BlockContext methodsFor:'printing & storing'!
 
-printReceiverOn:aStream
+printReceiverWithSeparator:sep on:aStream
     "print a string describing the receiver of the context on aStream
 
      Since this is also used by the debugger(s), be very careful to
@@ -195,7 +198,7 @@
         "
 
         "temporary kludge - peek into the sender context.
-         If its a do-like method and there is a single block variable
+         If it's a do-like method and there is a single block variable
          in the args or temporaries, that must be the one.
          This helps in some cases.
         "
@@ -216,8 +219,10 @@
                 className := cls name.
             ].
             className printOn:aStream. 
-            aStream nextPutAll:'>>'.
+            aStream nextPutAll:sep.
+            aStream bold.
             m selector printOn:aStream.
+            aStream normal.
         ].
         ^ self.
     ].
@@ -257,10 +262,14 @@
             className := '???(nameless class!!)'
         ]
     ].
-    aStream nextPutAll:'[] in '; nextPutAll:className; nextPutAll:'>>'.
+    aStream nextPutAll:'[] in '; nextPutAll:className; nextPutAll:sep.
+    aStream bold.
     homeSel printOn:aStream.
+    aStream normal.
 
     "Modified: / 19-07-2012 / 11:02:41 / cg"
+    "Modified (format): / 13-02-2017 / 19:56:14 / cg"
+    "Modified: / 26-06-2018 / 19:25:02 / Claus Gittinger"
 ! !
 
 !BlockContext methodsFor:'testing'!