Fix `BlockContext >> method` for cheap-block contexts jv
authorJan Vrany <jan.vrany@labware.com>
Thu, 09 Jul 2020 21:12:19 +0100
branchjv
changeset 25396 d6cc2bdc7773
parent 25395 b5d6963fe4a9
child 25397 c63508b2bbe0
Fix `BlockContext >> method` for cheap-block contexts Cheap blocks have no home context but they hold on their method directly, so use that. This fixes source code display for cheap blocks in debugger.
BlockContext.st
--- a/BlockContext.st	Thu Jul 09 20:20:20 2020 +0100
+++ b/BlockContext.st	Thu Jul 09 21:12:19 2020 +0100
@@ -1,5 +1,6 @@
 "
  COPYRIGHT (c) 1993 by Claus Gittinger
+ COPYRIGHT (c) 2020 LabWare
 	      All Rights Reserved
 
  This software is furnished under a license and may be used
@@ -25,6 +26,7 @@
 copyright
 "
  COPYRIGHT (c) 1993 by Claus Gittinger
+ COPYRIGHT (c) 2020 LabWare
 	      All Rights Reserved
 
  This software is furnished under a license and may be used
@@ -119,9 +121,16 @@
     "return the method in which the current contexts block was created."
 
     home notNil ifTrue:[^ home method].
+
+    "/ Note: for BlockContext, `method` instvar holds
+    "/ on Block (or CheapBlock) instead...
+    method isBlock ifTrue: [
+        ^ method homeMethod
+    ].      
     ^ super method
 
     "Modified: / 19-07-2012 / 10:58:55 / cg"
+    "Modified: / 09-07-2020 / 21:06:53 / Jan Vrany <jan.vrany@labware.com>"
 !
 
 methodHome
@@ -279,5 +288,10 @@
 
 version_CVS
     ^ '$Header$'
+!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
 ! !