ContextInspectorView.st
changeset 45 950b84ba89e6
parent 37 50f59bad66b1
child 49 6fe62433cfa3
--- a/ContextInspectorView.st	Mon Oct 10 04:15:21 1994 +0100
+++ b/ContextInspectorView.st	Mon Oct 10 04:16:24 1994 +0100
@@ -2,7 +2,7 @@
 
 "
  COPYRIGHT (c) 1993 by Claus Gittinger
-              All Rights Reserved
+	      All Rights Reserved
 
  This software is furnished under a license and may be used
  only in accordance with the terms of that license and with the
@@ -13,17 +13,17 @@
 "
 
 InspectorView subclass:#ContextInspectorView
-         instanceVariableNames:'inspectedContext'
-         classVariableNames:''
-         poolDictionaries:''
-         category:'Interface-Inspector'
+	 instanceVariableNames:'inspectedContext'
+	 classVariableNames:''
+	 poolDictionaries:''
+	 category:'Interface-Inspector'
 !
 
 ContextInspectorView comment:'
 COPYRIGHT (c) 1993 by Claus Gittinger
-              All Rights Reserved
+	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libtool/ContextInspectorView.st,v 1.2 1994-08-22 18:07:00 claus Exp $
+$Header: /cvs/stx/stx/libtool/ContextInspectorView.st,v 1.3 1994-10-10 03:15:23 claus Exp $
 '!
 
 !ContextInspectorView class methodsFor:'documentation'!
@@ -31,7 +31,7 @@
 copyright
 "
  COPYRIGHT (c) 1993 by Claus Gittinger
-              All Rights Reserved
+	      All Rights Reserved
 
  This software is furnished under a license and may be used
  only in accordance with the terms of that license and with the
@@ -44,7 +44,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libtool/ContextInspectorView.st,v 1.2 1994-08-22 18:07:00 claus Exp $
+$Header: /cvs/stx/stx/libtool/ContextInspectorView.st,v 1.3 1994-10-10 03:15:23 claus Exp $
 "
 !
 
@@ -66,30 +66,36 @@
     inspectedObject := nil.
     inspectedContext := con.
     con isNil ifTrue:[
-        inspectedValues := nil.
-        listView contents:nil.
-        ^ self
+	inspectedValues := nil.
+	listView contents:nil.
+	^ self
     ].
 
     homeContext := con methodHome.
+homeContext isNil ifTrue:[
+    "its a cheap blocks context"
+    rec := con receiver.
+    sel := con selector.
+    names := OrderedCollection new.
+] ifFalse:[
     rec := homeContext receiver.
     sel := homeContext selector.
 
     implementorClass := homeContext searchClass whichClassImplements:sel.
     implementorClass notNil ifTrue:[
-        method := implementorClass compiledMethodAt:sel.
-        names := method methodArgAndVarNames
+	method := implementorClass compiledMethodAt:sel.
+	names := method methodArgAndVarNames
     ].
-
+].
     "create dummy names (if there is no source available)"
     names isNil ifTrue:[
-        names := OrderedCollection new.
-        1 to:homeContext nargs do:[:index |
-            names add:('mArg' , index printString)
-        ].
-        1 to:homeContext nvars do:[:index |
-            names add:('mVar' , index printString)
-        ].
+	names := OrderedCollection new.
+	1 to:homeContext numArgs do:[:index |
+	    names add:('mArg' , index printString)
+	].
+	1 to:homeContext nvars do:[:index |
+	    names add:('mVar' , index printString)
+	].
     ].
 
     aList := OrderedCollection new.
@@ -99,15 +105,19 @@
      method-home and put real names in here
     "
     con isBlockContext ifTrue:[
-        argNames := (1 to:(con nargs)) collect:[:i | 'arg' , i printString].
-        aList addAll:argNames.
-        varNames := (1 to:(con nvars)) collect:[:i | 'var' , i printString].
-        aList addAll:varNames.
-        aList addAll:names.
-        inspectedValues := (Array withAll:(con argsAndVars)) , homeContext argsAndVars
+	argNames := (1 to:(con numArgs)) collect:[:i | 'arg' , i printString].
+	aList addAll:argNames.
+	varNames := (1 to:(con nvars)) collect:[:i | 'var' , i printString].
+	aList addAll:varNames.
+	aList addAll:names.
+	homeContext isNil ifTrue:[
+	    inspectedValues := Array withAll:(con argsAndVars)
+	] ifFalse:[
+	    inspectedValues := (Array withAll:(con argsAndVars)) , homeContext argsAndVars
+	]
     ] ifFalse:[
-        aList addAll:names.
-        inspectedValues := homeContext argsAndVars
+	aList addAll:names.
+	inspectedValues := homeContext argsAndVars
     ].
     listView contents:aList.
 
@@ -126,12 +136,12 @@
 
 setDoitActionIn:aWorkspace for:aContext
     aWorkspace doItAction:[:theCode |
-        Compiler evaluate:theCode
-                       in:aContext
-                 receiver:nil
-                notifying:aWorkspace
-                   logged:true 
-                   ifFail:nil
+	Compiler evaluate:theCode
+		       in:aContext
+		 receiver:nil
+		notifying:aWorkspace
+		   logged:true 
+		   ifFail:nil
     ]
 ! !
 
@@ -141,11 +151,11 @@
     |value|
 
     selectedLine notNil ifTrue:[
-        value := Compiler evaluate:theText
-                          receiver:inspectedObject 
-                         notifying:workspace.
+	value := Compiler evaluate:theText
+			  receiver:inspectedObject 
+			 notifying:workspace.
 
-        "yes, you can do that with a context"
-        inspectedContext at:selectedLine put:value.
+	"yes, you can do that with a context"
+	inspectedContext at:selectedLine put:value.
     ].
 ! !