Browse Source

Helios debugger uses ASTDebugger

Nicolas Petton 10 years ago
parent
commit
d577a71105
6 changed files with 458 additions and 416 deletions
  1. 163 121
      src/Compiler-Interpreter.js
  2. 14 5
      src/Compiler-Interpreter.st
  3. 120 151
      src/Helios-Debugger.js
  4. 22 34
      src/Helios-Debugger.st
  5. 132 104
      src/Kernel-Methods.js
  6. 7 1
      src/Kernel-Methods.st

File diff suppressed because it is too large
+ 163 - 121
src/Compiler-Interpreter.js


+ 14 - 5
src/Compiler-Interpreter.st

@@ -268,6 +268,10 @@ ast
 	^ ast
 !
 
+basicReceiver
+	^ self localAt: 'self'
+!
+
 interpreter
 	interpreter ifNil: [ self initializeInterpreter ].
 	^ interpreter
@@ -277,10 +281,6 @@ interpreter: anInterpreter
 	interpreter := anInterpreter
 !
 
-receiver
-	^ self localAt: 'self'
-!
-
 receiver: anObject
 	self localAt: 'self' put: anObject
 !
@@ -388,6 +388,10 @@ method
 
 nextNode
 	^ self interpreter nextNode
+!
+
+node
+	^ self interpreter node
 ! !
 
 !ASTDebugger methodsFor: 'private'!
@@ -556,7 +560,7 @@ step
 stepOver
 	self step.
 	
-	[ self node isSteppingNode ] whileFalse: [ 
+	[ self node isNil or: [ self node isSteppingNode ] ] whileFalse: [ 
 		self step ]
 ! !
 
@@ -682,6 +686,11 @@ visitBlockNode: aNode
 	self push: block
 !
 
+visitBlockSequenceNode: aNode
+	super visitBlockSequenceNode: aNode.
+	returned := true
+!
+
 visitDynamicArrayNode: aNode
 	| array |
 	

+ 120 - 151
src/Helios-Debugger.js

@@ -15,7 +15,7 @@ return $1;
 },
 args: [],
 source: "context\x0a\x09^ context",
-messageSends: ["context"],
+messageSends: ["context", "context"],
 referencedClasses: []
 }),
 globals.HLContextInspectorDecorator);
@@ -33,7 +33,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"evaluate:on:",{aString:aString,anEvaluator:anEvaluator},globals.HLContextInspectorDecorator)})},
 args: ["aString", "anEvaluator"],
 source: "evaluate: aString on: anEvaluator\x0a\x09^ self context evaluate: aString on: anEvaluator",
-messageSends: ["evaluate:on:", "context", "evaluate:on:"],
+messageSends: ["evaluate:on:", "context", "evaluate:on:", "evaluate:on:"],
 referencedClasses: []
 }),
 globals.HLContextInspectorDecorator);
@@ -48,7 +48,7 @@ self["@context"]=aContext;
 return self},
 args: ["aContext"],
 source: "initializeFromContext: aContext\x0a\x09context := aContext",
-messageSends: ["initializeFromContext:"],
+messageSends: ["initializeFromContext:", "initializeFromContext:"],
 referencedClasses: []
 }),
 globals.HLContextInspectorDecorator);
@@ -92,7 +92,7 @@ $4=_st(anInspector)._setVariables_(variables);
 return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables,inspectedContext:inspectedContext},globals.HLContextInspectorDecorator)})},
 args: ["anInspector"],
 source: "inspectOn: anInspector\x0a\x09| variables inspectedContext |\x0a\x09\x0a\x09variables := Dictionary new.\x0a\x09inspectedContext := self context.\x0a\x09\x0a\x09variables addAll: inspectedContext locals.\x0a\x09\x0a\x09[ inspectedContext notNil and: [ inspectedContext isBlockContext ] ] whileTrue: [\x0a\x09\x09inspectedContext := inspectedContext outerContext.\x0a\x09\x09inspectedContext ifNotNil: [\x0a\x09\x09\x09variables addAll: inspectedContext locals ] ].\x0a\x09\x0a\x09anInspector\x0a\x09\x09setLabel: 'Context';\x0a\x09\x09setVariables: variables",
-messageSends: ["new", "context", "addAll:", "locals", "whileTrue:", "and:", "notNil", "isBlockContext", "outerContext", "ifNotNil:", "setLabel:", "setVariables:", "inspectOn:"],
+messageSends: ["new", "context", "addAll:", "locals", "whileTrue:", "and:", "notNil", "isBlockContext", "outerContext", "ifNotNil:", "setLabel:", "setVariables:", "inspectOn:", "inspectOn:"],
 referencedClasses: ["Dictionary"]
 }),
 globals.HLContextInspectorDecorator);
@@ -114,7 +114,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"on:",{aContext:aContext},globals.HLContextInspectorDecorator.klass)})},
 args: ["aContext"],
 source: "on: aContext\x0a\x09^ self new\x0a\x09\x09initializeFromContext: aContext;\x0a\x09\x09yourself",
-messageSends: ["initializeFromContext:", "new", "yourself", "on:"],
+messageSends: ["initializeFromContext:", "new", "yourself", "on:", "on:"],
 referencedClasses: []
 }),
 globals.HLContextInspectorDecorator.klass);
@@ -157,7 +157,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"codeWidget",{},globals.HLDebugger)})},
 args: [],
 source: "codeWidget\x0a\x09^ codeWidget ifNil: [ codeWidget := HLDebuggerCodeWidget new\x0a\x09\x09model: (HLDebuggerCodeModel new\x0a\x09\x09\x09debuggerModel: self model;\x0a\x09\x09\x09yourself);\x0a\x09\x09browserModel: self model;\x0a\x09\x09yourself ]",
-messageSends: ["ifNil:", "model:", "new", "debuggerModel:", "model", "yourself", "browserModel:", "codeWidget"],
+messageSends: ["ifNil:", "model:", "new", "debuggerModel:", "model", "yourself", "browserModel:", "codeWidget", "codeWidget"],
 referencedClasses: ["HLDebuggerCodeWidget", "HLDebuggerCodeModel"]
 }),
 globals.HLDebugger);
@@ -175,7 +175,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"cssClass",{},globals.HLDebugger)})},
 args: [],
 source: "cssClass\x0a\x09^ super cssClass, ' hl_debugger'",
-messageSends: [",", "cssClass", "cssClass"],
+messageSends: [",", "cssClass", "cssClass", "cssClass"],
 referencedClasses: []
 }),
 globals.HLDebugger);
@@ -191,7 +191,7 @@ _st(self._stackListWidget())._focus();
 return self}, function($ctx1) {$ctx1.fill(self,"focus",{},globals.HLDebugger)})},
 args: [],
 source: "focus\x0a\x09self stackListWidget focus",
-messageSends: ["focus", "stackListWidget", "focus"],
+messageSends: ["focus", "stackListWidget", "focus", "focus"],
 referencedClasses: []
 }),
 globals.HLDebugger);
@@ -209,7 +209,7 @@ self._observeModel();
 return self}, function($ctx1) {$ctx1.fill(self,"initializeFromError:",{anError:anError},globals.HLDebugger)})},
 args: ["anError"],
 source: "initializeFromError: anError\x0a\x09model := HLDebuggerModel on: anError.\x0a\x09self observeModel",
-messageSends: ["on:", "observeModel", "initializeFromError:"],
+messageSends: ["on:", "observeModel", "initializeFromError:", "initializeFromError:"],
 referencedClasses: ["HLDebuggerModel"]
 }),
 globals.HLDebugger);
@@ -234,7 +234,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"inspectorWidget",{},globals.HLDebugger)})},
 args: [],
 source: "inspectorWidget\x0a\x09^ inspectorWidget ifNil: [ \x0a\x09\x09inspectorWidget := HLInspectorWidget new ]",
-messageSends: ["ifNil:", "new", "inspectorWidget"],
+messageSends: ["ifNil:", "new", "inspectorWidget", "inspectorWidget"],
 referencedClasses: ["HLInspectorWidget"]
 }),
 globals.HLDebugger);
@@ -259,7 +259,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"model",{},globals.HLDebugger)})},
 args: [],
 source: "model\x0a\x09^ model ifNil: [ model := HLDebuggerModel new ]",
-messageSends: ["ifNil:", "new", "model"],
+messageSends: ["ifNil:", "new", "model", "model"],
 referencedClasses: ["HLDebuggerModel"]
 }),
 globals.HLDebugger);
@@ -284,7 +284,7 @@ _st(_st(self._model())._announcer())._on_send_to_($HLDebuggerStepped(),"onContex
 return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},globals.HLDebugger)})},
 args: [],
 source: "observeModel\x0a\x09self model announcer \x0a\x09\x09on: HLDebuggerContextSelected\x0a\x09\x09send: #onContextSelected:\x0a\x09\x09to: self.\x0a\x09\x09\x0a\x09self model announcer \x0a\x09\x09on: HLDebuggerStepped\x0a\x09\x09send: #onContextSelected:\x0a\x09\x09to: self",
-messageSends: ["on:send:to:", "announcer", "model", "observeModel"],
+messageSends: ["on:send:to:", "announcer", "model", "observeModel", "observeModel"],
 referencedClasses: ["HLDebuggerContextSelected", "HLDebuggerStepped"]
 }),
 globals.HLDebugger);
@@ -301,7 +301,7 @@ _st(self._inspectorWidget())._inspect_(_st($HLContextInspectorDecorator())._on_(
 return self}, function($ctx1) {$ctx1.fill(self,"onContextSelected:",{anAnnouncement:anAnnouncement},globals.HLDebugger)})},
 args: ["anAnnouncement"],
 source: "onContextSelected: anAnnouncement\x0a\x09self inspectorWidget inspect: (HLContextInspectorDecorator on: anAnnouncement context)",
-messageSends: ["inspect:", "inspectorWidget", "on:", "context", "onContextSelected:"],
+messageSends: ["inspect:", "inspectorWidget", "on:", "context", "onContextSelected:", "onContextSelected:"],
 referencedClasses: ["HLContextInspectorDecorator"]
 }),
 globals.HLDebugger);
@@ -318,7 +318,7 @@ _st($HLToolCommand())._registerConcreteClassesOn_for_(aBindingGroup,self._model(
 return self}, function($ctx1) {$ctx1.fill(self,"registerBindingsOn:",{aBindingGroup:aBindingGroup},globals.HLDebugger)})},
 args: ["aBindingGroup"],
 source: "registerBindingsOn: aBindingGroup\x0a\x09HLToolCommand \x0a\x09\x09registerConcreteClassesOn: aBindingGroup \x0a\x09\x09for: self model",
-messageSends: ["registerConcreteClassesOn:for:", "model", "registerBindingsOn:"],
+messageSends: ["registerConcreteClassesOn:for:", "model", "registerBindingsOn:", "registerBindingsOn:"],
 referencedClasses: ["HLToolCommand"]
 }),
 globals.HLDebugger);
@@ -343,7 +343,7 @@ $ctx1.sendIdx["with:"]=1;
 return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},globals.HLDebugger)})},
 args: ["html"],
 source: "renderContentOn: html\x0a\x09self renderHeadOn: html.\x0a\x09html with: (HLContainer with: (HLHorizontalSplitter\x0a\x09\x09with: self stackListWidget\x0a\x09\x09with: (HLVerticalSplitter\x0a\x09\x09\x09with: self codeWidget\x0a\x09\x09\x09with: self inspectorWidget)))",
-messageSends: ["renderHeadOn:", "with:", "with:with:", "stackListWidget", "codeWidget", "inspectorWidget", "renderContentOn:"],
+messageSends: ["renderHeadOn:", "with:", "with:with:", "stackListWidget", "codeWidget", "inspectorWidget", "renderContentOn:", "renderContentOn:"],
 referencedClasses: ["HLContainer", "HLHorizontalSplitter", "HLVerticalSplitter"]
 }),
 globals.HLDebugger);
@@ -366,7 +366,7 @@ $ctx1.sendIdx["with:"]=1;
 return self}, function($ctx1) {$ctx1.fill(self,"renderHeadOn:",{html:html},globals.HLDebugger)})},
 args: ["html"],
 source: "renderHeadOn: html\x0a\x09html div \x0a\x09\x09class: 'head'; \x0a\x09\x09with: [ html h2 with: self model error messageText ]",
-messageSends: ["class:", "div", "with:", "h2", "messageText", "error", "model", "renderHeadOn:"],
+messageSends: ["class:", "div", "with:", "h2", "messageText", "error", "model", "renderHeadOn:", "renderHeadOn:"],
 referencedClasses: []
 }),
 globals.HLDebugger);
@@ -394,7 +394,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"stackListWidget",{},globals.HLDebugger)})},
 args: [],
 source: "stackListWidget\x0a\x09^ stackListWidget ifNil: [ \x0a\x09\x09stackListWidget := (HLStackListWidget on: self model)\x0a\x09\x09\x09next: self codeWidget;\x0a\x09\x09\x09yourself ]",
-messageSends: ["ifNil:", "next:", "on:", "model", "codeWidget", "yourself", "stackListWidget"],
+messageSends: ["ifNil:", "next:", "on:", "model", "codeWidget", "yourself", "stackListWidget", "stackListWidget"],
 referencedClasses: ["HLStackListWidget"]
 }),
 globals.HLDebugger);
@@ -412,7 +412,7 @@ _st(self._inspectorWidget())._unregister();
 return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},globals.HLDebugger)})},
 args: [],
 source: "unregister\x0a\x09super unregister.\x0a\x09self inspectorWidget unregister",
-messageSends: ["unregister", "inspectorWidget", "unregister"],
+messageSends: ["unregister", "inspectorWidget", "unregister", "unregister"],
 referencedClasses: []
 }),
 globals.HLDebugger);
@@ -434,7 +434,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"on:",{anError:anError},globals.HLDebugger.klass)})},
 args: ["anError"],
 source: "on: anError\x0a\x09^ self new\x0a\x09\x09initializeFromError: anError;\x0a\x09\x09yourself",
-messageSends: ["initializeFromError:", "new", "yourself", "on:"],
+messageSends: ["initializeFromError:", "new", "yourself", "on:", "on:"],
 referencedClasses: []
 }),
 globals.HLDebugger.klass);
@@ -449,7 +449,7 @@ return "debugger";
 },
 args: [],
 source: "tabClass\x0a\x09^ 'debugger'",
-messageSends: ["tabClass"],
+messageSends: ["tabClass", "tabClass"],
 referencedClasses: []
 }),
 globals.HLDebugger.klass);
@@ -464,7 +464,7 @@ return "Debugger";
 },
 args: [],
 source: "tabLabel\x0a\x09^ 'Debugger'",
-messageSends: ["tabLabel"],
+messageSends: ["tabLabel", "tabLabel"],
 referencedClasses: []
 }),
 globals.HLDebugger.klass);
@@ -483,7 +483,7 @@ return $1;
 },
 args: [],
 source: "debuggerModel\x0a\x09^ debuggerModel",
-messageSends: ["debuggerModel"],
+messageSends: ["debuggerModel", "debuggerModel"],
 referencedClasses: []
 }),
 globals.HLDebuggerCodeModel);
@@ -498,7 +498,7 @@ self["@debuggerModel"]=anObject;
 return self},
 args: ["anObject"],
 source: "debuggerModel: anObject\x0a\x09debuggerModel := anObject",
-messageSends: ["debuggerModel:"],
+messageSends: ["debuggerModel:", "debuggerModel:"],
 referencedClasses: []
 }),
 globals.HLDebuggerCodeModel);
@@ -524,7 +524,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"doIt:",{aString:aString},globals.HLDebuggerCodeModel)})},
 args: ["aString"],
 source: "doIt: aString\x0a\x09^ [ self debuggerModel evaluate: aString ]\x0a\x09\x09tryCatch: [ :e | \x0a\x09\x09\x09ErrorHandler handleError: e.\x0a\x09\x09\x09nil ]",
-messageSends: ["tryCatch:", "evaluate:", "debuggerModel", "handleError:", "doIt:"],
+messageSends: ["tryCatch:", "evaluate:", "debuggerModel", "handleError:", "doIt:", "doIt:"],
 referencedClasses: ["ErrorHandler"]
 }),
 globals.HLDebuggerCodeModel);
@@ -543,7 +543,7 @@ _st(self["@editor"])._setGutterMarker_gutter_value_(anInteger,"stops",_st(_st("<
 return self}, function($ctx1) {$ctx1.fill(self,"addStopAt:",{anInteger:anInteger},globals.HLDebuggerCodeWidget)})},
 args: ["anInteger"],
 source: "addStopAt: anInteger\x0a\x09editor\x0a\x09\x09setGutterMarker: anInteger\x0a\x09\x09gutter: 'stops'\x0a\x09\x09value: '<div class=\x22stop\x22></stop>' asJQuery toArray first",
-messageSends: ["setGutterMarker:gutter:value:", "first", "toArray", "asJQuery", "addStopAt:"],
+messageSends: ["setGutterMarker:gutter:value:", "first", "toArray", "asJQuery", "addStopAt:", "addStopAt:"],
 referencedClasses: []
 }),
 globals.HLDebuggerCodeWidget);
@@ -559,7 +559,7 @@ _st(self._editor())._clearGutter_("stops");
 return self}, function($ctx1) {$ctx1.fill(self,"clearHighlight",{},globals.HLDebuggerCodeWidget)})},
 args: [],
 source: "clearHighlight\x0a\x09self editor clearGutter: 'stops'",
-messageSends: ["clearGutter:", "editor", "clearHighlight"],
+messageSends: ["clearGutter:", "editor", "clearHighlight", "clearHighlight"],
 referencedClasses: []
 }),
 globals.HLDebuggerCodeWidget);
@@ -576,7 +576,7 @@ globals.HLDebuggerCodeWidget.superclass.fn.prototype._contents_.apply(_st(self),
 return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString},globals.HLDebuggerCodeWidget)})},
 args: ["aString"],
 source: "contents: aString\x0a\x09self clearHighlight.\x0a\x09super contents: aString",
-messageSends: ["clearHighlight", "contents:", "contents:"],
+messageSends: ["clearHighlight", "contents:", "contents:", "contents:"],
 referencedClasses: []
 }),
 globals.HLDebuggerCodeWidget);
@@ -597,7 +597,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"editorOptions",{},globals.HLDebuggerCodeWidget)})},
 args: [],
 source: "editorOptions\x0a\x09^ super editorOptions\x0a\x09\x09at: 'gutters' put: #('CodeMirror-linenumbers' 'stops');\x0a\x09\x09yourself",
-messageSends: ["at:put:", "editorOptions", "yourself", "editorOptions"],
+messageSends: ["at:put:", "editorOptions", "yourself", "editorOptions", "editorOptions"],
 referencedClasses: []
 }),
 globals.HLDebuggerCodeWidget);
@@ -613,7 +613,7 @@ self._highlightNode_(_st(self._browserModel())._nextNode());
 return self}, function($ctx1) {$ctx1.fill(self,"highlight",{},globals.HLDebuggerCodeWidget)})},
 args: [],
 source: "highlight\x0a\x09self highlightNode: self browserModel nextNode",
-messageSends: ["highlightNode:", "nextNode", "browserModel", "highlight"],
+messageSends: ["highlightNode:", "nextNode", "browserModel", "highlight", "highlight"],
 referencedClasses: []
 }),
 globals.HLDebuggerCodeWidget);
@@ -661,7 +661,7 @@ _st($5)._setSelection_to_($6,$12);
 return self}, function($ctx1) {$ctx1.fill(self,"highlightNode:",{aNode:aNode,token:token},globals.HLDebuggerCodeWidget)})},
 args: ["aNode"],
 source: "highlightNode: aNode\x0a\x09| token |\x0a\x09\x0a\x09aNode ifNotNil: [\x0a\x09\x09self\x0a\x09\x09\x09clearHighlight;\x0a\x09\x09\x09addStopAt: aNode positionStart x - 1.\x0a\x0a\x09\x09self editor \x0a\x09\x09\x09setSelection: #{ 'line' -> (aNode positionStart x - 1). 'ch' -> (aNode positionStart y - 1) }\x0a\x09\x09\x09to: #{ 'line' -> (aNode positionEnd x - 1). 'ch' -> (aNode positionEnd y) } ]",
-messageSends: ["ifNotNil:", "clearHighlight", "addStopAt:", "-", "x", "positionStart", "setSelection:to:", "editor", "y", "positionEnd", "highlightNode:"],
+messageSends: ["ifNotNil:", "clearHighlight", "addStopAt:", "-", "x", "positionStart", "setSelection:to:", "editor", "y", "positionEnd", "highlightNode:", "highlightNode:"],
 referencedClasses: []
 }),
 globals.HLDebuggerCodeWidget);
@@ -694,7 +694,7 @@ _st(_st(self._browserModel())._announcer())._on_send_to_($HLDebuggerWhere(),"onC
 return self}, function($ctx1) {$ctx1.fill(self,"observeBrowserModel",{},globals.HLDebuggerCodeWidget)})},
 args: [],
 source: "observeBrowserModel\x0a\x09super observeBrowserModel.\x0a\x09\x0a\x09self browserModel announcer \x0a\x09\x09on: HLDebuggerContextSelected\x0a\x09\x09send: #onContextSelected\x0a\x09\x09to: self.\x0a\x09\x0a\x09self browserModel announcer \x0a\x09\x09on: HLDebuggerStepped\x0a\x09\x09send: #onContextSelected\x0a\x09\x09to: self.\x0a\x09\x0a\x09self browserModel announcer \x0a\x09\x09on: HLDebuggerWhere\x0a\x09\x09send: #onContextSelected\x0a\x09\x09to: self",
-messageSends: ["observeBrowserModel", "on:send:to:", "announcer", "browserModel", "observeBrowserModel"],
+messageSends: ["observeBrowserModel", "on:send:to:", "announcer", "browserModel", "observeBrowserModel", "observeBrowserModel"],
 referencedClasses: ["HLDebuggerContextSelected", "HLDebuggerStepped", "HLDebuggerWhere"]
 }),
 globals.HLDebuggerCodeWidget);
@@ -710,29 +710,43 @@ self._highlight();
 return self}, function($ctx1) {$ctx1.fill(self,"onContextSelected",{},globals.HLDebuggerCodeWidget)})},
 args: [],
 source: "onContextSelected\x0a\x09self highlight",
-messageSends: ["highlight", "onContextSelected"],
+messageSends: ["highlight", "onContextSelected", "onContextSelected"],
 referencedClasses: []
 }),
 globals.HLDebuggerCodeWidget);
 
 
 
-smalltalk.addClass('HLDebuggerModel', globals.HLToolModel, ['rootContext', 'currentContext', 'contexts', 'error'], 'Helios-Debugger');
-globals.HLDebuggerModel.comment="I am a model for debugging Amber code in Helios.\x0a\x0aMy instances hold a reference to an `AIContext` instance, built from a `MethodContext`. The context should be the root of the context stack.";
+smalltalk.addClass('HLDebuggerModel', globals.HLToolModel, ['rootContext', 'debugger', 'error'], 'Helios-Debugger');
+globals.HLDebuggerModel.comment="I am a model for debugging Amber code in Helios.\x0a\x0aMy instances hold a reference to an `ASTDebugger` instance, itself referencing the current `context`. The context should be the root of the context stack.";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "contexts",
 protocol: 'accessing',
 fn: function (){
 var self=this;
+var contexts,context;
+function $OrderedCollection(){return globals.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
+return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=self["@contexts"];
+contexts=_st($OrderedCollection())._new();
+context=self._rootContext();
+_st((function(){
+return smalltalk.withContext(function($ctx2) {
+return _st(context)._notNil();
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._whileTrue_((function(){
+return smalltalk.withContext(function($ctx2) {
+_st(contexts)._add_(context);
+context=_st(context)._outerContext();
+return context;
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
+$1=contexts;
 return $1;
-},
+}, function($ctx1) {$ctx1.fill(self,"contexts",{contexts:contexts,context:context},globals.HLDebuggerModel)})},
 args: [],
-source: "contexts\x0a\x09^ contexts",
-messageSends: ["contexts"],
-referencedClasses: []
+source: "contexts\x0a\x09| contexts context |\x0a\x09\x0a\x09contexts := OrderedCollection new.\x0a\x09context := self rootContext.\x0a\x09\x0a\x09[ context notNil ] whileTrue: [\x0a\x09\x09contexts add: context.\x0a\x09\x09context := context outerContext ].\x0a\x09\x09\x0a\x09^ contexts",
+messageSends: ["new", "rootContext", "whileTrue:", "notNil", "add:", "outerContext", "contexts"],
+referencedClasses: ["OrderedCollection"]
 }),
 globals.HLDebuggerModel);
 
@@ -743,19 +757,13 @@ protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
-$1=self["@currentContext"];
-if(($receiver = $1) == nil || $receiver == null){
-self._currentContext_(self._rootContext());
-} else {
-$1;
-};
-$2=self["@currentContext"];
-return $2;
+var $1;
+$1=_st(self._debugger())._context();
+return $1;
 }, function($ctx1) {$ctx1.fill(self,"currentContext",{},globals.HLDebuggerModel)})},
 args: [],
-source: "currentContext\x0a\x09currentContext ifNil: [ self currentContext: self rootContext ].\x0a\x09^ currentContext",
-messageSends: ["ifNil:", "currentContext:", "rootContext", "currentContext"],
+source: "currentContext\x0a\x09^ self debugger context",
+messageSends: ["context", "debugger", "currentContext", "currentContext"],
 referencedClasses: []
 }),
 globals.HLDebuggerModel);
@@ -772,8 +780,8 @@ var $1,$2;
 self._withChangesDo_((function(){
 return smalltalk.withContext(function($ctx2) {
 self._selectedMethod_(_st(aContext)._method());
-self["@currentContext"]=aContext;
-self["@currentContext"];
+_st(self._debugger())._context_(aContext);
+$ctx2.sendIdx["context:"]=1;
 $1=_st($HLDebuggerContextSelected())._new();
 _st($1)._context_(aContext);
 $2=_st($1)._yourself();
@@ -781,40 +789,50 @@ return _st(self._announcer())._announce_($2);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"currentContext:",{aContext:aContext},globals.HLDebuggerModel)})},
 args: ["aContext"],
-source: "currentContext: aContext\x0a\x09self withChangesDo: [ \x0a\x09\x09self selectedMethod: aContext method.\x0a\x09\x09currentContext := aContext.\x0a\x09\x09self announcer announce: (HLDebuggerContextSelected new\x0a\x09\x09\x09context: aContext;\x0a\x09\x09\x09yourself) ]",
-messageSends: ["withChangesDo:", "selectedMethod:", "method", "announce:", "announcer", "context:", "new", "yourself", "currentContext:"],
+source: "currentContext: aContext\x0a\x09self withChangesDo: [ \x0a\x09\x09self selectedMethod: aContext method.\x0a\x09\x09self debugger context: aContext.\x0a\x09\x09self announcer announce: (HLDebuggerContextSelected new\x0a\x09\x09\x09context: aContext;\x0a\x09\x09\x09yourself) ]",
+messageSends: ["withChangesDo:", "selectedMethod:", "method", "context:", "debugger", "announce:", "announcer", "new", "yourself", "currentContext:", "currentContext:"],
 referencedClasses: ["HLDebuggerContextSelected"]
 }),
 globals.HLDebuggerModel);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "error",
+selector: "debugger",
 protocol: 'accessing',
 fn: function (){
 var self=this;
-var $1;
-$1=self["@error"];
+function $ASTDebugger(){return globals.ASTDebugger||(typeof ASTDebugger=="undefined"?nil:ASTDebugger)}
+return smalltalk.withContext(function($ctx1) { 
+var $2,$1;
+$2=self["@debugger"];
+if(($receiver = $2) == nil || $receiver == null){
+self["@debugger"]=_st($ASTDebugger())._new();
+$1=self["@debugger"];
+} else {
+$1=$2;
+};
 return $1;
-},
+}, function($ctx1) {$ctx1.fill(self,"debugger",{},globals.HLDebuggerModel)})},
 args: [],
-source: "error\x0a\x09^ error",
-messageSends: ["error"],
-referencedClasses: []
+source: "debugger\x0a\x09^ debugger ifNil: [ debugger := ASTDebugger new ]",
+messageSends: ["ifNil:", "new", "debugger", "debugger"],
+referencedClasses: ["ASTDebugger"]
 }),
 globals.HLDebuggerModel);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "error:",
+selector: "error",
 protocol: 'accessing',
-fn: function (anError){
+fn: function (){
 var self=this;
-self["@error"]=anError;
-return self},
-args: ["anError"],
-source: "error: anError\x0a\x09error := anError",
-messageSends: ["error:"],
+var $1;
+$1=self["@error"];
+return $1;
+},
+args: [],
+source: "error\x0a\x09^ error",
+messageSends: ["error", "error"],
 referencedClasses: []
 }),
 globals.HLDebuggerModel);
@@ -832,7 +850,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"evaluate:",{aString:aString},globals.HLDebuggerModel)})},
 args: ["aString"],
 source: "evaluate: aString\x0a\x09^ self environment \x0a\x09\x09evaluate: aString \x0a\x09\x09for: self currentContext",
-messageSends: ["evaluate:for:", "environment", "currentContext", "evaluate:"],
+messageSends: ["evaluate:for:", "environment", "currentContext", "evaluate:", "evaluate:"],
 referencedClasses: []
 }),
 globals.HLDebuggerModel);
@@ -853,39 +871,11 @@ self._initializeContexts();
 return self}, function($ctx1) {$ctx1.fill(self,"flushInnerContexts",{},globals.HLDebuggerModel)})},
 args: [],
 source: "flushInnerContexts\x0a\x09\x22When stepping, the inner contexts are not relevent anymore,\x0a\x09and can be flushed\x22\x0a\x09\x0a\x09self currentContext innerContext: nil.\x0a\x09rootContext := self currentContext.\x0a\x09self initializeContexts",
-messageSends: ["innerContext:", "currentContext", "initializeContexts", "flushInnerContexts"],
+messageSends: ["innerContext:", "currentContext", "initializeContexts", "flushInnerContexts", "flushInnerContexts"],
 referencedClasses: []
 }),
 globals.HLDebuggerModel);
 
-smalltalk.addMethod(
-smalltalk.method({
-selector: "initializeContexts",
-protocol: 'initialization',
-fn: function (){
-var self=this;
-var context;
-function $OrderedCollection(){return globals.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
-return smalltalk.withContext(function($ctx1) { 
-self["@contexts"]=_st($OrderedCollection())._new();
-context=self._rootContext();
-_st((function(){
-return smalltalk.withContext(function($ctx2) {
-return _st(context)._notNil();
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._whileTrue_((function(){
-return smalltalk.withContext(function($ctx2) {
-_st(self["@contexts"])._add_(context);
-context=_st(context)._outerContext();
-return context;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"initializeContexts",{context:context},globals.HLDebuggerModel)})},
-args: [],
-source: "initializeContexts\x0a\x09\x22Flatten the context stack into an OrderedCollection\x22\x0a\x09\x0a\x09| context |\x0a\x09\x0a\x09contexts := OrderedCollection new.\x0a\x09context := self rootContext.\x0a\x09\x0a\x09[ context notNil ] whileTrue: [\x0a\x09\x09contexts add: context.\x0a\x09\x09context := context outerContext ]",
-messageSends: ["new", "rootContext", "whileTrue:", "notNil", "add:", "outerContext", "initializeContexts"],
-referencedClasses: ["OrderedCollection"]
-}),
-globals.HLDebuggerModel);
-
 smalltalk.addMethod(
 smalltalk.method({
 selector: "initializeFromError:",
@@ -896,33 +886,15 @@ function $AIContext(){return globals.AIContext||(typeof AIContext=="undefined"?n
 return smalltalk.withContext(function($ctx1) { 
 self["@error"]=anError;
 self["@rootContext"]=_st($AIContext())._fromMethodContext_(_st(self["@error"])._context());
-self._initializeContexts();
+_st(self._debugger())._context_(self["@rootContext"]);
 return self}, function($ctx1) {$ctx1.fill(self,"initializeFromError:",{anError:anError},globals.HLDebuggerModel)})},
 args: ["anError"],
-source: "initializeFromError: anError\x0a\x09error := anError.\x0a\x09rootContext := (AIContext fromMethodContext: error context).\x0a\x09self initializeContexts",
-messageSends: ["fromMethodContext:", "context", "initializeContexts", "initializeFromError:"],
+source: "initializeFromError: anError\x0a\x09error := anError.\x0a\x09rootContext := (AIContext fromMethodContext: error context).\x0a\x09self debugger context: rootContext",
+messageSends: ["fromMethodContext:", "context", "context:", "debugger", "initializeFromError:", "initializeFromError:"],
 referencedClasses: ["AIContext"]
 }),
 globals.HLDebuggerModel);
 
-smalltalk.addMethod(
-smalltalk.method({
-selector: "interpreter",
-protocol: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st(self._currentContext())._interpreter();
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"interpreter",{},globals.HLDebuggerModel)})},
-args: [],
-source: "interpreter\x0a\x09^ self currentContext interpreter",
-messageSends: ["interpreter", "currentContext", "interpreter"],
-referencedClasses: []
-}),
-globals.HLDebuggerModel);
-
 smalltalk.addMethod(
 smalltalk.method({
 selector: "nextNode",
@@ -931,12 +903,12 @@ fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st(self._interpreter())._node();
+$1=_st(self._debugger())._node();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"nextNode",{},globals.HLDebuggerModel)})},
 args: [],
-source: "nextNode\x0a\x09^ self interpreter node",
-messageSends: ["node", "interpreter", "nextNode"],
+source: "nextNode\x0a\x09^ self debugger node",
+messageSends: ["node", "debugger", "nextNode", "nextNode"],
 referencedClasses: []
 }),
 globals.HLDebuggerModel);
@@ -950,16 +922,15 @@ var self=this;
 function $HLDebuggerStepped(){return globals.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
-_st(self._interpreter())._restart();
-self._flushInnerContexts();
+_st(self._debugger())._restart();
 $1=_st($HLDebuggerStepped())._new();
 _st($1)._context_(self._currentContext());
 $2=_st($1)._yourself();
 _st(self._announcer())._announce_($2);
 return self}, function($ctx1) {$ctx1.fill(self,"restart",{},globals.HLDebuggerModel)})},
 args: [],
-source: "restart\x0a\x09self interpreter restart.\x0a\x09self flushInnerContexts.\x0a\x09\x0a\x09self announcer announce: (HLDebuggerStepped new\x0a\x09\x09context: self currentContext;\x0a\x09\x09yourself)",
-messageSends: ["restart", "interpreter", "flushInnerContexts", "announce:", "announcer", "context:", "new", "currentContext", "yourself", "restart"],
+source: "restart\x0a\x09self debugger restart.\x0a\x09\x0a\x09self announcer announce: (HLDebuggerStepped new\x0a\x09\x09context: self currentContext;\x0a\x09\x09yourself)",
+messageSends: ["restart", "debugger", "announce:", "announcer", "context:", "new", "currentContext", "yourself", "restart", "restart"],
 referencedClasses: ["HLDebuggerStepped"]
 }),
 globals.HLDebuggerModel);
@@ -976,7 +947,7 @@ return $1;
 },
 args: [],
 source: "rootContext\x0a\x09^ rootContext",
-messageSends: ["rootContext"],
+messageSends: ["rootContext", "rootContext"],
 referencedClasses: []
 }),
 globals.HLDebuggerModel);
@@ -990,16 +961,15 @@ var self=this;
 function $HLDebuggerStepped(){return globals.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
-_st(self._interpreter())._skip();
-self._flushInnerContexts();
+_st(self._debugger())._skip();
 $1=_st($HLDebuggerStepped())._new();
 _st($1)._context_(self._currentContext());
 $2=_st($1)._yourself();
 _st(self._announcer())._announce_($2);
 return self}, function($ctx1) {$ctx1.fill(self,"skip",{},globals.HLDebuggerModel)})},
 args: [],
-source: "skip\x0a\x09self interpreter skip.\x0a\x09self flushInnerContexts.\x0a\x09\x0a\x09self announcer announce: (HLDebuggerStepped new\x0a\x09\x09context: self currentContext;\x0a\x09\x09yourself)",
-messageSends: ["skip", "interpreter", "flushInnerContexts", "announce:", "announcer", "context:", "new", "currentContext", "yourself", "skip"],
+source: "skip\x0a\x09self debugger skip.\x0a\x09\x0a\x09self announcer announce: (HLDebuggerStepped new\x0a\x09\x09context: self currentContext;\x0a\x09\x09yourself)",
+messageSends: ["skip", "debugger", "announce:", "announcer", "context:", "new", "currentContext", "yourself", "skip", "skip"],
 referencedClasses: ["HLDebuggerStepped"]
 }),
 globals.HLDebuggerModel);
@@ -1013,16 +983,15 @@ var self=this;
 function $HLDebuggerStepped(){return globals.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
-_st(self._interpreter())._stepOver();
-self._flushInnerContexts();
+_st(self._debugger())._stepOver();
 $1=_st($HLDebuggerStepped())._new();
 _st($1)._context_(self._currentContext());
 $2=_st($1)._yourself();
 _st(self._announcer())._announce_($2);
 return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{},globals.HLDebuggerModel)})},
 args: [],
-source: "stepOver\x0a\x09self interpreter stepOver.\x0a\x09self flushInnerContexts.\x0a\x09\x0a\x09self announcer announce: (HLDebuggerStepped new\x0a\x09\x09context: self currentContext;\x0a\x09\x09yourself)",
-messageSends: ["stepOver", "interpreter", "flushInnerContexts", "announce:", "announcer", "context:", "new", "currentContext", "yourself", "stepOver"],
+source: "stepOver\x0a\x09self debugger stepOver.\x0a\x09\x0a\x09self announcer announce: (HLDebuggerStepped new\x0a\x09\x09context: self currentContext;\x0a\x09\x09yourself)",
+messageSends: ["stepOver", "debugger", "announce:", "announcer", "context:", "new", "currentContext", "yourself", "stepOver", "stepOver"],
 referencedClasses: ["HLDebuggerStepped"]
 }),
 globals.HLDebuggerModel);
@@ -1039,7 +1008,7 @@ _st(self._announcer())._announce_(_st($HLDebuggerWhere())._new());
 return self}, function($ctx1) {$ctx1.fill(self,"where",{},globals.HLDebuggerModel)})},
 args: [],
 source: "where\x0a\x09self announcer announce: HLDebuggerWhere new",
-messageSends: ["announce:", "announcer", "new", "where"],
+messageSends: ["announce:", "announcer", "new", "where", "where"],
 referencedClasses: ["HLDebuggerWhere"]
 }),
 globals.HLDebuggerModel);
@@ -1061,7 +1030,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"on:",{anError:anError},globals.HLDebuggerModel.klass)})},
 args: ["anError"],
 source: "on: anError\x0a\x09^ self new\x0a\x09\x09initializeFromError: anError;\x0a\x09\x09yourself",
-messageSends: ["initializeFromError:", "new", "yourself", "on:"],
+messageSends: ["initializeFromError:", "new", "yourself", "on:", "on:"],
 referencedClasses: []
 }),
 globals.HLDebuggerModel.klass);
@@ -1089,7 +1058,7 @@ $2=_st($1)._show();
 return self}, function($ctx1) {$ctx1.fill(self,"confirmDebugError:",{anError:anError},globals.HLErrorHandler)})},
 args: ["anError"],
 source: "confirmDebugError: anError\x0a\x09HLConfirmationWidget new\x0a\x09\x09confirmationString: anError messageText;\x0a\x09\x09actionBlock: [ self debugError: anError ];\x0a\x09\x09cancelButtonLabel: 'Abandon';\x0a\x09\x09confirmButtonLabel: 'Debug';\x0a\x09\x09show",
-messageSends: ["confirmationString:", "new", "messageText", "actionBlock:", "debugError:", "cancelButtonLabel:", "confirmButtonLabel:", "show", "confirmDebugError:"],
+messageSends: ["confirmationString:", "new", "messageText", "actionBlock:", "debugError:", "cancelButtonLabel:", "confirmButtonLabel:", "show", "confirmDebugError:", "confirmDebugError:"],
 referencedClasses: ["HLConfirmationWidget"]
 }),
 globals.HLErrorHandler);
@@ -1114,7 +1083,7 @@ return _st(_st($ConsoleErrorHandler())._new())._handleError_(error);
 return self}, function($ctx1) {$ctx1.fill(self,"debugError:",{anError:anError},globals.HLErrorHandler)})},
 args: ["anError"],
 source: "debugError: anError\x0a\x0a\x09[ \x0a\x09\x09(HLDebugger on: anError) openAsTab \x0a\x09] \x0a\x09\x09on: Error \x0a\x09\x09do: [ :error | ConsoleErrorHandler new handleError: error ]",
-messageSends: ["on:do:", "openAsTab", "on:", "handleError:", "new", "debugError:"],
+messageSends: ["on:do:", "openAsTab", "on:", "handleError:", "new", "debugError:", "debugError:"],
 referencedClasses: ["HLDebugger", "Error", "ConsoleErrorHandler"]
 }),
 globals.HLErrorHandler);
@@ -1130,7 +1099,7 @@ self._confirmDebugError_(anError);
 return self}, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},globals.HLErrorHandler)})},
 args: ["anError"],
 source: "handleError: anError\x0a\x09self confirmDebugError: anError",
-messageSends: ["confirmDebugError:", "handleError:"],
+messageSends: ["confirmDebugError:", "handleError:", "handleError:"],
 referencedClasses: []
 }),
 globals.HLErrorHandler);
@@ -1150,7 +1119,7 @@ $2=_st($1)._remove();
 return self}, function($ctx1) {$ctx1.fill(self,"onErrorHandled",{},globals.HLErrorHandler)})},
 args: [],
 source: "onErrorHandled\x0a\x09\x22when an error is handled, we need to make sure that\x0a\x09any progress bar widget gets removed. Because HLProgressBarWidget is asynchronous,\x0a\x09it has to be done here.\x22\x0a\x09\x0a\x09HLProgressWidget default \x0a\x09\x09flush; \x0a\x09\x09remove",
-messageSends: ["flush", "default", "remove", "onErrorHandled"],
+messageSends: ["flush", "default", "remove", "onErrorHandled", "onErrorHandled"],
 referencedClasses: ["HLProgressWidget"]
 }),
 globals.HLErrorHandler);
@@ -1177,7 +1146,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"items",{},globals.HLStackListWidget)})},
 args: [],
 source: "items\x0a\x09^ items ifNil: [ items := self model contexts ]",
-messageSends: ["ifNil:", "contexts", "model", "items"],
+messageSends: ["ifNil:", "contexts", "model", "items", "items"],
 referencedClasses: []
 }),
 globals.HLStackListWidget);
@@ -1192,7 +1161,7 @@ return "Call stack";
 },
 args: [],
 source: "label\x0a\x09^ 'Call stack'",
-messageSends: ["label"],
+messageSends: ["label", "label"],
 referencedClasses: []
 }),
 globals.HLStackListWidget);
@@ -1210,7 +1179,7 @@ _st(_st(self._model())._announcer())._on_send_to_($HLDebuggerStepped(),"onDebugg
 return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},globals.HLStackListWidget)})},
 args: [],
 source: "observeModel\x0a\x09super observeModel.\x0a\x09\x0a\x09self model announcer \x0a\x09\x09on: HLDebuggerStepped\x0a\x09\x09send: #onDebuggerStepped:\x0a\x09\x09to: self",
-messageSends: ["observeModel", "on:send:to:", "announcer", "model", "observeModel"],
+messageSends: ["observeModel", "on:send:to:", "announcer", "model", "observeModel", "observeModel"],
 referencedClasses: ["HLDebuggerStepped"]
 }),
 globals.HLStackListWidget);
@@ -1227,7 +1196,7 @@ self._refresh();
 return self}, function($ctx1) {$ctx1.fill(self,"onDebuggerStepped:",{anAnnouncement:anAnnouncement},globals.HLStackListWidget)})},
 args: ["anAnnouncement"],
 source: "onDebuggerStepped: anAnnouncement\x0a\x09items := nil.\x0a\x09self refresh",
-messageSends: ["refresh", "onDebuggerStepped:"],
+messageSends: ["refresh", "onDebuggerStepped:", "onDebuggerStepped:"],
 referencedClasses: []
 }),
 globals.HLStackListWidget);
@@ -1294,7 +1263,7 @@ $ctx1.sendIdx["with:"]=1;
 return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},globals.HLStackListWidget)})},
 args: ["html"],
 source: "renderButtonsOn: html\x0a\x09html div \x0a\x09\x09class: 'debugger_bar'; \x0a\x09\x09with: [\x0a\x09\x09\x09html button \x0a\x09\x09\x09\x09class: 'btn restart';\x0a\x09\x09\x09\x09with: 'Restart';\x0a\x09\x09\x09\x09onClick: [ self restart ].\x0a\x09\x09\x09html button \x0a\x09\x09\x09\x09class: 'btn where';\x0a\x09\x09\x09\x09with: 'Where';\x0a\x09\x09\x09\x09onClick: [ self where ].\x0a\x09\x09\x09html button \x0a\x09\x09\x09\x09class: 'btn stepOver';\x0a\x09\x09\x09\x09with: 'Step over';\x0a\x09\x09\x09\x09onClick: [ self stepOver ].\x0a\x09\x09\x09html button \x0a\x09\x09\x09\x09class: 'btn skip';\x0a\x09\x09\x09\x09with: 'Skip';\x0a\x09\x09\x09\x09onClick: [ self skip ] ]",
-messageSends: ["class:", "div", "with:", "button", "onClick:", "restart", "where", "stepOver", "skip", "renderButtonsOn:"],
+messageSends: ["class:", "div", "with:", "button", "onClick:", "restart", "where", "stepOver", "skip", "renderButtonsOn:", "renderButtonsOn:"],
 referencedClasses: []
 }),
 globals.HLStackListWidget);
@@ -1310,7 +1279,7 @@ _st(self._model())._restart();
 return self}, function($ctx1) {$ctx1.fill(self,"restart",{},globals.HLStackListWidget)})},
 args: [],
 source: "restart\x0a\x09self model restart",
-messageSends: ["restart", "model", "restart"],
+messageSends: ["restart", "model", "restart", "restart"],
 referencedClasses: []
 }),
 globals.HLStackListWidget);
@@ -1327,7 +1296,7 @@ globals.HLStackListWidget.superclass.fn.prototype._selectItem_.apply(_st(self),
 return self}, function($ctx1) {$ctx1.fill(self,"selectItem:",{aContext:aContext},globals.HLStackListWidget)})},
 args: ["aContext"],
 source: "selectItem: aContext\x0a   \x09self model currentContext: aContext.\x0a\x09super selectItem: aContext",
-messageSends: ["currentContext:", "model", "selectItem:", "selectItem:"],
+messageSends: ["currentContext:", "model", "selectItem:", "selectItem:", "selectItem:"],
 referencedClasses: []
 }),
 globals.HLStackListWidget);
@@ -1343,7 +1312,7 @@ _st(self._model())._skip();
 return self}, function($ctx1) {$ctx1.fill(self,"skip",{},globals.HLStackListWidget)})},
 args: [],
 source: "skip\x0a\x09self model skip",
-messageSends: ["skip", "model", "skip"],
+messageSends: ["skip", "model", "skip", "skip"],
 referencedClasses: []
 }),
 globals.HLStackListWidget);
@@ -1359,7 +1328,7 @@ _st(self._model())._stepOver();
 return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{},globals.HLStackListWidget)})},
 args: [],
 source: "stepOver\x0a\x09self model stepOver",
-messageSends: ["stepOver", "model", "stepOver"],
+messageSends: ["stepOver", "model", "stepOver", "stepOver"],
 referencedClasses: []
 }),
 globals.HLStackListWidget);
@@ -1375,7 +1344,7 @@ _st(self._model())._where();
 return self}, function($ctx1) {$ctx1.fill(self,"where",{},globals.HLStackListWidget)})},
 args: [],
 source: "where\x0a\x09self model where",
-messageSends: ["where", "model", "where"],
+messageSends: ["where", "model", "where", "where"],
 referencedClasses: []
 }),
 globals.HLStackListWidget);

+ 22 - 34
src/Helios-Debugger.st

@@ -263,47 +263,51 @@ onContextSelected
 ! !
 
 HLToolModel subclass: #HLDebuggerModel
-	instanceVariableNames: 'rootContext currentContext contexts error'
+	instanceVariableNames: 'rootContext debugger error'
 	package: 'Helios-Debugger'!
 !HLDebuggerModel commentStamp!
 I am a model for debugging Amber code in Helios.
 
-My instances hold a reference to an `AIContext` instance, built from a `MethodContext`. The context should be the root of the context stack.!
+My instances hold a reference to an `ASTDebugger` instance, itself referencing the current `context`. The context should be the root of the context stack.!
 
 !HLDebuggerModel methodsFor: 'accessing'!
 
 contexts
+	| contexts context |
+	
+	contexts := OrderedCollection new.
+	context := self rootContext.
+	
+	[ context notNil ] whileTrue: [
+		contexts add: context.
+		context := context outerContext ].
+		
 	^ contexts
 !
 
 currentContext
-	currentContext ifNil: [ self currentContext: self rootContext ].
-	^ currentContext
+	^ self debugger context
 !
 
 currentContext: aContext
 	self withChangesDo: [ 
 		self selectedMethod: aContext method.
-		currentContext := aContext.
+		self debugger context: aContext.
 		self announcer announce: (HLDebuggerContextSelected new
 			context: aContext;
 			yourself) ]
 !
 
-error
-	^ error
-!
-
-error: anError
-	error := anError
+debugger
+	^ debugger ifNil: [ debugger := ASTDebugger new ]
 !
 
-interpreter
-	^ self currentContext interpreter
+error
+	^ error
 !
 
 nextNode
-	^ self interpreter node
+	^ self debugger node
 !
 
 rootContext
@@ -313,8 +317,7 @@ rootContext
 !HLDebuggerModel methodsFor: 'actions'!
 
 restart
-	self interpreter restart.
-	self flushInnerContexts.
+	self debugger restart.
 	
 	self announcer announce: (HLDebuggerStepped new
 		context: self currentContext;
@@ -322,8 +325,7 @@ restart
 !
 
 skip
-	self interpreter skip.
-	self flushInnerContexts.
+	self debugger skip.
 	
 	self announcer announce: (HLDebuggerStepped new
 		context: self currentContext;
@@ -331,8 +333,7 @@ skip
 !
 
 stepOver
-	self interpreter stepOver.
-	self flushInnerContexts.
+	self debugger stepOver.
 	
 	self announcer announce: (HLDebuggerStepped new
 		context: self currentContext;
@@ -353,23 +354,10 @@ evaluate: aString
 
 !HLDebuggerModel methodsFor: 'initialization'!
 
-initializeContexts
-	"Flatten the context stack into an OrderedCollection"
-	
-	| context |
-	
-	contexts := OrderedCollection new.
-	context := self rootContext.
-	
-	[ context notNil ] whileTrue: [
-		contexts add: context.
-		context := context outerContext ]
-!
-
 initializeFromError: anError
 	error := anError.
 	rootContext := (AIContext fromMethodContext: error context).
-	self initializeContexts
+	self debugger context: rootContext
 ! !
 
 !HLDebuggerModel methodsFor: 'private'!

+ 132 - 104
src/Kernel-Methods.js

@@ -15,7 +15,7 @@ return self.apply(anObject, aCollection);
 return self}, function($ctx1) {$ctx1.fill(self,"applyTo:arguments:",{anObject:anObject,aCollection:aCollection},globals.BlockClosure)})},
 args: ["anObject", "aCollection"],
 source: "applyTo: anObject arguments: aCollection\x0a\x09<return self.apply(anObject, aCollection)>",
-messageSends: [],
+messageSends: ["applyTo:arguments:"],
 referencedClasses: []
 }),
 globals.BlockClosure);
@@ -31,7 +31,7 @@ return smalltalk.method({selector:aString, fn:self});;
 return self}, function($ctx1) {$ctx1.fill(self,"asCompiledMethod:",{aString:aString},globals.BlockClosure)})},
 args: ["aString"],
 source: "asCompiledMethod: aString\x0a\x09<return smalltalk.method({selector:aString, fn:self});>",
-messageSends: [],
+messageSends: ["asCompiledMethod:"],
 referencedClasses: []
 }),
 globals.BlockClosure);
@@ -47,7 +47,7 @@ return self.toString();
 return self}, function($ctx1) {$ctx1.fill(self,"compiledSource",{},globals.BlockClosure)})},
 args: [],
 source: "compiledSource\x0a\x09<return self.toString()>",
-messageSends: [],
+messageSends: ["compiledSource"],
 referencedClasses: []
 }),
 globals.BlockClosure);
@@ -69,7 +69,7 @@ return smalltalk.withContext(function($ctx1) {
 return self}, function($ctx1) {$ctx1.fill(self,"currySelf",{},globals.BlockClosure)})},
 args: [],
 source: "currySelf\x0a\x09\x22Transforms [ :selfarg :x :y | stcode ] block\x0a\x09which represents JS function (selfarg, x, y, ...) {jscode}\x0a\x09into function (x, y, ...) {jscode} that takes selfarg from 'this'.\x0a\x09IOW, it is usable as JS method and first arg takes the receiver.\x22\x0a\x09\x0a\x09<\x0a\x09\x09return function () {\x0a\x09\x09\x09var args = [ this ];\x0a\x09\x09\x09args.push.apply(args, arguments);\x0a\x09\x09\x09return self.apply(null, args);\x0a\x09\x09}\x0a\x09>",
-messageSends: [],
+messageSends: ["currySelf"],
 referencedClasses: []
 }),
 globals.BlockClosure);
@@ -85,7 +85,7 @@ try{return self._value()}finally{aBlock._value()};
 return self}, function($ctx1) {$ctx1.fill(self,"ensure:",{aBlock:aBlock},globals.BlockClosure)})},
 args: ["aBlock"],
 source: "ensure: aBlock\x0a\x09<try{return self._value()}finally{aBlock._value()}>",
-messageSends: [],
+messageSends: ["ensure:"],
 referencedClasses: []
 }),
 globals.BlockClosure);
@@ -102,7 +102,7 @@ _st(_st($ForkPool())._default())._fork_(self);
 return self}, function($ctx1) {$ctx1.fill(self,"fork",{},globals.BlockClosure)})},
 args: [],
 source: "fork\x0a\x09ForkPool default fork: self",
-messageSends: ["fork:", "default"],
+messageSends: ["fork:", "default", "fork"],
 referencedClasses: ["ForkPool"]
 }),
 globals.BlockClosure);
@@ -118,7 +118,7 @@ return new self();
 return self}, function($ctx1) {$ctx1.fill(self,"new",{},globals.BlockClosure)})},
 args: [],
 source: "new\x0a\x09\x22Use the receiver as a JS constructor.\x0a\x09*Do not* use this method to instanciate Smalltalk objects!\x22\x0a\x09<return new self()>",
-messageSends: [],
+messageSends: ["new"],
 referencedClasses: []
 }),
 globals.BlockClosure);
@@ -136,7 +136,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"newValue:",{anObject:anObject},globals.BlockClosure)})},
 args: ["anObject"],
 source: "newValue: anObject\x0a\x09^ self newWithValues: { anObject }",
-messageSends: ["newWithValues:"],
+messageSends: ["newWithValues:", "newValue:"],
 referencedClasses: []
 }),
 globals.BlockClosure);
@@ -154,7 +154,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"newValue:value:",{anObject:anObject,anObject2:anObject2},globals.BlockClosure)})},
 args: ["anObject", "anObject2"],
 source: "newValue: anObject value: anObject2\x0a\x09^ self newWithValues: { anObject. anObject2 }.",
-messageSends: ["newWithValues:"],
+messageSends: ["newWithValues:", "newValue:value:"],
 referencedClasses: []
 }),
 globals.BlockClosure);
@@ -172,7 +172,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"newValue:value:value:",{anObject:anObject,anObject2:anObject2,anObject3:anObject3},globals.BlockClosure)})},
 args: ["anObject", "anObject2", "anObject3"],
 source: "newValue: anObject value: anObject2 value: anObject3\x0a\x09^ self newWithValues: { anObject. anObject2. anObject3 }.",
-messageSends: ["newWithValues:"],
+messageSends: ["newWithValues:", "newValue:value:value:"],
 referencedClasses: []
 }),
 globals.BlockClosure);
@@ -192,7 +192,7 @@ return smalltalk.withContext(function($ctx1) {
 return self}, function($ctx1) {$ctx1.fill(self,"newWithValues:",{aCollection:aCollection},globals.BlockClosure)})},
 args: ["aCollection"],
 source: "newWithValues: aCollection\x0a\x09\x22Simulates JS new operator by combination of Object.create and .apply\x22\x0a\x09<\x0a\x09\x09var object = Object.create(self.prototype);\x0a\x09\x09var result = self.apply(object, aCollection);\x0a\x09\x09return typeof result === \x22object\x22 ? result : object;\x0a\x09>",
-messageSends: [],
+messageSends: ["newWithValues:"],
 referencedClasses: []
 }),
 globals.BlockClosure);
@@ -208,7 +208,7 @@ return self.length;
 return self}, function($ctx1) {$ctx1.fill(self,"numArgs",{},globals.BlockClosure)})},
 args: [],
 source: "numArgs\x0a\x09<return self.length>",
-messageSends: [],
+messageSends: ["numArgs"],
 referencedClasses: []
 }),
 globals.BlockClosure);
@@ -238,7 +238,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"on:do:",{anErrorClass:anErrorClass,aBlock:aBlock},globals.BlockClosure)})},
 args: ["anErrorClass", "aBlock"],
 source: "on: anErrorClass do: aBlock\x0a\x09\x22All exceptions thrown in the Smalltalk stack are cought.\x0a\x09Convert all JS exceptions to JavaScriptException instances.\x22\x0a\x09\x0a\x09^ self tryCatch: [ :error | | smalltalkError |\x0a\x09\x09smalltalkError := Smalltalk asSmalltalkException: error.\x0a\x09\x09(smalltalkError isKindOf: anErrorClass)\x0a\x09\x09ifTrue: [ aBlock value: smalltalkError ]\x0a\x09\x09ifFalse: [ smalltalkError resignal ] ]",
-messageSends: ["tryCatch:", "asSmalltalkException:", "ifTrue:ifFalse:", "isKindOf:", "value:", "resignal"],
+messageSends: ["tryCatch:", "asSmalltalkException:", "ifTrue:ifFalse:", "isKindOf:", "value:", "resignal", "on:do:"],
 referencedClasses: ["Smalltalk"]
 }),
 globals.BlockClosure);
@@ -253,7 +253,7 @@ return nil;
 },
 args: [],
 source: "receiver\x0a\x09^ nil",
-messageSends: [],
+messageSends: ["receiver"],
 referencedClasses: []
 }),
 globals.BlockClosure);
@@ -272,7 +272,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"timeToRun",{},globals.BlockClosure)})},
 args: [],
 source: "timeToRun\x0a\x09\x22Answer the number of milliseconds taken to execute this block.\x22\x0a\x0a\x09^ Date millisecondsToRun: self",
-messageSends: ["millisecondsToRun:"],
+messageSends: ["millisecondsToRun:", "timeToRun"],
 referencedClasses: ["Date"]
 }),
 globals.BlockClosure);
@@ -294,7 +294,7 @@ return smalltalk.withContext(function($ctx1) {
 return self}, function($ctx1) {$ctx1.fill(self,"tryCatch:",{aBlock:aBlock},globals.BlockClosure)})},
 args: ["aBlock"],
 source: "tryCatch: aBlock\x0a\x09<\x0a\x09\x09try {\x0a\x09\x09\x09return self._value();\x0a\x09\x09} catch(error) {\x0a\x09\x09\x09return aBlock._value_(error);\x0a\x09\x09}\x0a\x09>",
-messageSends: [],
+messageSends: ["tryCatch:"],
 referencedClasses: []
 }),
 globals.BlockClosure);
@@ -310,7 +310,7 @@ return self();;
 return self}, function($ctx1) {$ctx1.fill(self,"value",{},globals.BlockClosure)})},
 args: [],
 source: "value\x0a\x09<return self();>",
-messageSends: [],
+messageSends: ["value"],
 referencedClasses: []
 }),
 globals.BlockClosure);
@@ -326,7 +326,7 @@ return self(anArg);;
 return self}, function($ctx1) {$ctx1.fill(self,"value:",{anArg:anArg},globals.BlockClosure)})},
 args: ["anArg"],
 source: "value: anArg\x0a\x09<return self(anArg);>",
-messageSends: [],
+messageSends: ["value:"],
 referencedClasses: []
 }),
 globals.BlockClosure);
@@ -342,7 +342,7 @@ return self(firstArg, secondArg);;
 return self}, function($ctx1) {$ctx1.fill(self,"value:value:",{firstArg:firstArg,secondArg:secondArg},globals.BlockClosure)})},
 args: ["firstArg", "secondArg"],
 source: "value: firstArg value: secondArg\x0a\x09<return self(firstArg, secondArg);>",
-messageSends: [],
+messageSends: ["value:value:"],
 referencedClasses: []
 }),
 globals.BlockClosure);
@@ -358,7 +358,7 @@ return self(firstArg, secondArg, thirdArg);;
 return self}, function($ctx1) {$ctx1.fill(self,"value:value:value:",{firstArg:firstArg,secondArg:secondArg,thirdArg:thirdArg},globals.BlockClosure)})},
 args: ["firstArg", "secondArg", "thirdArg"],
 source: "value: firstArg value: secondArg value: thirdArg\x0a\x09<return self(firstArg, secondArg, thirdArg);>",
-messageSends: [],
+messageSends: ["value:value:value:"],
 referencedClasses: []
 }),
 globals.BlockClosure);
@@ -377,7 +377,7 @@ return smalltalk.withContext(function($ctx1) {
 return self}, function($ctx1) {$ctx1.fill(self,"valueWithInterval:",{aNumber:aNumber},globals.BlockClosure)})},
 args: ["aNumber"],
 source: "valueWithInterval: aNumber\x0a\x09<\x0a\x09\x09var interval = setInterval(self, aNumber);\x0a\x09\x09return globals.Timeout._on_(interval);\x0a\x09>",
-messageSends: [],
+messageSends: ["valueWithInterval:"],
 referencedClasses: []
 }),
 globals.BlockClosure);
@@ -393,7 +393,7 @@ return self.apply(null, aCollection);;
 return self}, function($ctx1) {$ctx1.fill(self,"valueWithPossibleArguments:",{aCollection:aCollection},globals.BlockClosure)})},
 args: ["aCollection"],
 source: "valueWithPossibleArguments: aCollection\x0a\x09<return self.apply(null, aCollection);>",
-messageSends: [],
+messageSends: ["valueWithPossibleArguments:"],
 referencedClasses: []
 }),
 globals.BlockClosure);
@@ -412,7 +412,7 @@ return smalltalk.withContext(function($ctx1) {
 return self}, function($ctx1) {$ctx1.fill(self,"valueWithTimeout:",{aNumber:aNumber},globals.BlockClosure)})},
 args: ["aNumber"],
 source: "valueWithTimeout: aNumber\x0a\x09<\x0a\x09\x09var timeout = setTimeout(self, aNumber);\x0a\x09\x09return globals.Timeout._on_(timeout);\x0a\x09>",
-messageSends: [],
+messageSends: ["valueWithTimeout:"],
 referencedClasses: []
 }),
 globals.BlockClosure);
@@ -429,7 +429,7 @@ self._whileFalse_((function(){
 return self}, function($ctx1) {$ctx1.fill(self,"whileFalse",{},globals.BlockClosure)})},
 args: [],
 source: "whileFalse\x0a\x09self whileFalse: []",
-messageSends: ["whileFalse:"],
+messageSends: ["whileFalse:", "whileFalse"],
 referencedClasses: []
 }),
 globals.BlockClosure);
@@ -445,7 +445,7 @@ while(!smalltalk.assert(self._value())) {aBlock._value()};
 return self}, function($ctx1) {$ctx1.fill(self,"whileFalse:",{aBlock:aBlock},globals.BlockClosure)})},
 args: ["aBlock"],
 source: "whileFalse: aBlock\x0a\x09<while(!smalltalk.assert(self._value())) {aBlock._value()}>",
-messageSends: [],
+messageSends: ["whileFalse:"],
 referencedClasses: []
 }),
 globals.BlockClosure);
@@ -462,7 +462,7 @@ self._whileTrue_((function(){
 return self}, function($ctx1) {$ctx1.fill(self,"whileTrue",{},globals.BlockClosure)})},
 args: [],
 source: "whileTrue\x0a\x09self whileTrue: []",
-messageSends: ["whileTrue:"],
+messageSends: ["whileTrue:", "whileTrue"],
 referencedClasses: []
 }),
 globals.BlockClosure);
@@ -478,7 +478,7 @@ while(smalltalk.assert(self._value())) {aBlock._value()};
 return self}, function($ctx1) {$ctx1.fill(self,"whileTrue:",{aBlock:aBlock},globals.BlockClosure)})},
 args: ["aBlock"],
 source: "whileTrue: aBlock\x0a\x09<while(smalltalk.assert(self._value())) {aBlock._value()}>",
-messageSends: [],
+messageSends: ["whileTrue:"],
 referencedClasses: []
 }),
 globals.BlockClosure);
@@ -498,7 +498,7 @@ return self.args || [];
 return self}, function($ctx1) {$ctx1.fill(self,"arguments",{},globals.CompiledMethod)})},
 args: [],
 source: "arguments\x0a\x09<return self.args || []>",
-messageSends: [],
+messageSends: ["arguments"],
 referencedClasses: []
 }),
 globals.CompiledMethod);
@@ -515,7 +515,7 @@ _st($Finder())._findMethod_(self);
 return self}, function($ctx1) {$ctx1.fill(self,"browse",{},globals.CompiledMethod)})},
 args: [],
 source: "browse\x0a\x09Finder findMethod: self",
-messageSends: ["findMethod:"],
+messageSends: ["findMethod:", "browse"],
 referencedClasses: ["Finder"]
 }),
 globals.CompiledMethod);
@@ -533,7 +533,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"category",{},globals.CompiledMethod)})},
 args: [],
 source: "category\x0a\x09^ self protocol",
-messageSends: ["protocol"],
+messageSends: ["protocol", "category"],
 referencedClasses: []
 }),
 globals.CompiledMethod);
@@ -548,7 +548,7 @@ return "as yet unclassified";
 },
 args: [],
 source: "defaultProtocol\x0a\x09^ 'as yet unclassified'",
-messageSends: [],
+messageSends: ["defaultProtocol"],
 referencedClasses: []
 }),
 globals.CompiledMethod);
@@ -566,7 +566,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"fn",{},globals.CompiledMethod)})},
 args: [],
 source: "fn\x0a\x09^ self basicAt: 'fn'",
-messageSends: ["basicAt:"],
+messageSends: ["basicAt:", "fn"],
 referencedClasses: []
 }),
 globals.CompiledMethod);
@@ -582,7 +582,7 @@ self._basicAt_put_("fn",aBlock);
 return self}, function($ctx1) {$ctx1.fill(self,"fn:",{aBlock:aBlock},globals.CompiledMethod)})},
 args: ["aBlock"],
 source: "fn: aBlock\x0a\x09self basicAt: 'fn' put: aBlock",
-messageSends: ["basicAt:put:"],
+messageSends: ["basicAt:put:", "fn:"],
 referencedClasses: []
 }),
 globals.CompiledMethod);
@@ -597,7 +597,7 @@ return true;
 },
 args: [],
 source: "isCompiledMethod\x0a\x09^ true",
-messageSends: [],
+messageSends: ["isCompiledMethod"],
 referencedClasses: []
 }),
 globals.CompiledMethod);
@@ -627,7 +627,7 @@ catch(e) {if(e===$early)return e[0]; throw e}
 }, function($ctx1) {$ctx1.fill(self,"isOverridden",{selector:selector},globals.CompiledMethod)})},
 args: [],
 source: "isOverridden\x0a\x09| selector |\x0a    \x0a    selector := self selector.\x0a    self methodClass allSubclassesDo: [ :each |\x0a\x09    (each includesSelector: selector)\x0a        \x09ifTrue: [ ^ true ] ].\x0a\x09^ false",
-messageSends: ["selector", "allSubclassesDo:", "methodClass", "ifTrue:", "includesSelector:"],
+messageSends: ["selector", "allSubclassesDo:", "methodClass", "ifTrue:", "includesSelector:", "isOverridden"],
 referencedClasses: []
 }),
 globals.CompiledMethod);
@@ -656,7 +656,7 @@ return $3;
 }, function($ctx1) {$ctx1.fill(self,"isOverride",{superclass:superclass},globals.CompiledMethod)})},
 args: [],
 source: "isOverride\x0a\x09| superclass |\x0a    \x0a    superclass := self methodClass superclass.\x0a\x09superclass ifNil: [ ^ false ].\x0a\x09\x0a    ^ (self methodClass superclass lookupSelector: self selector) notNil",
-messageSends: ["superclass", "methodClass", "ifNil:", "notNil", "lookupSelector:", "selector"],
+messageSends: ["superclass", "methodClass", "ifNil:", "notNil", "lookupSelector:", "selector", "isOverride"],
 referencedClasses: []
 }),
 globals.CompiledMethod);
@@ -674,7 +674,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"messageSends",{},globals.CompiledMethod)})},
 args: [],
 source: "messageSends\x0a\x09^ self basicAt: 'messageSends'",
-messageSends: ["basicAt:"],
+messageSends: ["basicAt:", "messageSends"],
 referencedClasses: []
 }),
 globals.CompiledMethod);
@@ -692,7 +692,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"methodClass",{},globals.CompiledMethod)})},
 args: [],
 source: "methodClass\x0a\x09^ self basicAt: 'methodClass'",
-messageSends: ["basicAt:"],
+messageSends: ["basicAt:", "methodClass"],
 referencedClasses: []
 }),
 globals.CompiledMethod);
@@ -731,7 +731,7 @@ return $6;
 }, function($ctx1) {$ctx1.fill(self,"package",{},globals.CompiledMethod)})},
 args: [],
 source: "package\x0a\x09\x22Answer the package the receiver belongs to:\x0a\x09- if it is an extension method, answer the corresponding package\x0a\x09- else answer the `methodClass` package\x22\x0a\x09\x0a\x09self methodClass ifNil: [ ^ nil ].\x0a\x09\x0a\x09(self protocol beginsWith: '*') ifFalse: [\x0a\x09\x09^ self methodClass package ].\x0a\x09\x09\x0a\x09^ Package \x0a\x09\x09named: self protocol allButFirst\x0a\x09\x09ifAbsent: [ self methodClass package ]",
-messageSends: ["ifNil:", "methodClass", "ifFalse:", "beginsWith:", "protocol", "package", "named:ifAbsent:", "allButFirst"],
+messageSends: ["ifNil:", "methodClass", "ifFalse:", "beginsWith:", "protocol", "package", "named:ifAbsent:", "allButFirst", "package"],
 referencedClasses: ["Package"]
 }),
 globals.CompiledMethod);
@@ -754,7 +754,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"protocol",{},globals.CompiledMethod)})},
 args: [],
 source: "protocol\x0a\x09^ (self basicAt: 'protocol') ifNil: [ self defaultProtocol ]",
-messageSends: ["ifNil:", "basicAt:", "defaultProtocol"],
+messageSends: ["ifNil:", "basicAt:", "defaultProtocol", "protocol"],
 referencedClasses: []
 }),
 globals.CompiledMethod);
@@ -789,7 +789,7 @@ _st(methodClass)._removeProtocolIfEmpty_(oldProtocol);
 return self}, function($ctx1) {$ctx1.fill(self,"protocol:",{aString:aString,oldProtocol:oldProtocol},globals.CompiledMethod)})},
 args: ["aString"],
 source: "protocol: aString\x0a\x09| oldProtocol |\x0a\x09oldProtocol := self protocol.\x0a\x09self basicAt: 'protocol' put: aString.\x0a\x0a\x09SystemAnnouncer current announce: (MethodMoved new\x0a\x09\x09method: self;\x0a\x09\x09oldProtocol: oldProtocol;\x0a\x09\x09yourself).\x0a\x0a\x09self methodClass ifNotNil: [ :methodClass |\x0a\x09\x09methodClass organization addElement: aString.\x0a\x09\x09methodClass removeProtocolIfEmpty: oldProtocol ]",
-messageSends: ["protocol", "basicAt:put:", "announce:", "current", "method:", "new", "oldProtocol:", "yourself", "ifNotNil:", "methodClass", "addElement:", "organization", "removeProtocolIfEmpty:"],
+messageSends: ["protocol", "basicAt:put:", "announce:", "current", "method:", "new", "oldProtocol:", "yourself", "ifNotNil:", "methodClass", "addElement:", "organization", "removeProtocolIfEmpty:", "protocol:"],
 referencedClasses: ["SystemAnnouncer", "MethodMoved"]
 }),
 globals.CompiledMethod);
@@ -807,7 +807,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"referencedClasses",{},globals.CompiledMethod)})},
 args: [],
 source: "referencedClasses\x0a\x09^ self basicAt: 'referencedClasses'",
-messageSends: ["basicAt:"],
+messageSends: ["basicAt:", "referencedClasses"],
 referencedClasses: []
 }),
 globals.CompiledMethod);
@@ -825,7 +825,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"selector",{},globals.CompiledMethod)})},
 args: [],
 source: "selector\x0a\x09^ self basicAt: 'selector'",
-messageSends: ["basicAt:"],
+messageSends: ["basicAt:", "selector"],
 referencedClasses: []
 }),
 globals.CompiledMethod);
@@ -841,7 +841,7 @@ self._basicAt_put_("selector",aString);
 return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},globals.CompiledMethod)})},
 args: ["aString"],
 source: "selector: aString\x0a\x09self basicAt: 'selector' put: aString",
-messageSends: ["basicAt:put:"],
+messageSends: ["basicAt:put:", "selector:"],
 referencedClasses: []
 }),
 globals.CompiledMethod);
@@ -859,7 +859,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"sendTo:arguments:",{anObject:anObject,aCollection:aCollection},globals.CompiledMethod)})},
 args: ["anObject", "aCollection"],
 source: "sendTo: anObject arguments: aCollection\x0a\x09^ self fn applyTo: anObject arguments: aCollection",
-messageSends: ["applyTo:arguments:", "fn"],
+messageSends: ["applyTo:arguments:", "fn", "sendTo:arguments:"],
 referencedClasses: []
 }),
 globals.CompiledMethod);
@@ -882,7 +882,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"source",{},globals.CompiledMethod)})},
 args: [],
 source: "source\x0a\x09^ (self basicAt: 'source') ifNil: [ '' ]",
-messageSends: ["ifNil:", "basicAt:"],
+messageSends: ["ifNil:", "basicAt:", "source"],
 referencedClasses: []
 }),
 globals.CompiledMethod);
@@ -898,7 +898,7 @@ self._basicAt_put_("source",aString);
 return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString},globals.CompiledMethod)})},
 args: ["aString"],
 source: "source: aString\x0a\x09self basicAt: 'source' put: aString",
-messageSends: ["basicAt:put:"],
+messageSends: ["basicAt:put:", "source:"],
 referencedClasses: []
 }),
 globals.CompiledMethod);
@@ -919,7 +919,7 @@ self["@poolSize"]=_st(self["@poolSize"]).__plus((1));
 return self}, function($ctx1) {$ctx1.fill(self,"addWorker",{},globals.ForkPool)})},
 args: [],
 source: "addWorker\x0a\x09worker valueWithTimeout: 0.\x0a\x09poolSize := poolSize + 1",
-messageSends: ["valueWithTimeout:", "+"],
+messageSends: ["valueWithTimeout:", "+", "addWorker"],
 referencedClasses: []
 }),
 globals.ForkPool);
@@ -937,7 +937,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"defaultMaxPoolSize",{},globals.ForkPool)})},
 args: [],
 source: "defaultMaxPoolSize\x0a\x09^ self class defaultMaxPoolSize",
-messageSends: ["defaultMaxPoolSize", "class"],
+messageSends: ["defaultMaxPoolSize", "class", "defaultMaxPoolSize"],
 referencedClasses: []
 }),
 globals.ForkPool);
@@ -958,7 +958,7 @@ _st(self["@queue"])._nextPut_(aBlock);
 return self}, function($ctx1) {$ctx1.fill(self,"fork:",{aBlock:aBlock},globals.ForkPool)})},
 args: ["aBlock"],
 source: "fork: aBlock\x0a\x09poolSize < self maxPoolSize ifTrue: [ self addWorker ].\x0a\x09queue nextPut: aBlock",
-messageSends: ["ifTrue:", "<", "maxPoolSize", "addWorker", "nextPut:"],
+messageSends: ["ifTrue:", "<", "maxPoolSize", "addWorker", "nextPut:", "fork:"],
 referencedClasses: []
 }),
 globals.ForkPool);
@@ -978,7 +978,7 @@ self["@worker"]=self._makeWorker();
 return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},globals.ForkPool)})},
 args: [],
 source: "initialize\x0a\x09super initialize.\x0a\x09\x0a\x09poolSize := 0.\x0a\x09queue := Queue new.\x0a\x09worker := self makeWorker",
-messageSends: ["initialize", "new", "makeWorker"],
+messageSends: ["initialize", "new", "makeWorker", "initialize"],
 referencedClasses: ["Queue"]
 }),
 globals.ForkPool);
@@ -1018,7 +1018,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"makeWorker",{sentinel:sentinel},globals.ForkPool)})},
 args: [],
 source: "makeWorker\x0a\x09| sentinel |\x0a\x09sentinel := Object new.\x0a\x09^ [ | block |\x0a\x09\x09poolSize := poolSize - 1.\x0a\x09\x09block := queue nextIfAbsent: [ sentinel ].\x0a\x09\x09block == sentinel ifFalse: [\x0a\x09\x09\x09[ block value ] ensure: [ self addWorker ] ]]",
-messageSends: ["new", "-", "nextIfAbsent:", "ifFalse:", "==", "ensure:", "value", "addWorker"],
+messageSends: ["new", "-", "nextIfAbsent:", "ifFalse:", "==", "ensure:", "value", "addWorker", "makeWorker"],
 referencedClasses: ["Object"]
 }),
 globals.ForkPool);
@@ -1041,7 +1041,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"maxPoolSize",{},globals.ForkPool)})},
 args: [],
 source: "maxPoolSize\x0a\x09^ maxPoolSize ifNil: [ self defaultMaxPoolSize ]",
-messageSends: ["ifNil:", "defaultMaxPoolSize"],
+messageSends: ["ifNil:", "defaultMaxPoolSize", "maxPoolSize"],
 referencedClasses: []
 }),
 globals.ForkPool);
@@ -1056,7 +1056,7 @@ self["@maxPoolSize"]=anInteger;
 return self},
 args: ["anInteger"],
 source: "maxPoolSize: anInteger\x0a\x09maxPoolSize := anInteger",
-messageSends: [],
+messageSends: ["maxPoolSize:"],
 referencedClasses: []
 }),
 globals.ForkPool);
@@ -1082,7 +1082,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"default",{},globals.ForkPool.klass)})},
 args: [],
 source: "default\x0a\x09^ default ifNil: [ default := self new ]",
-messageSends: ["ifNil:", "new"],
+messageSends: ["ifNil:", "new", "default"],
 referencedClasses: []
 }),
 globals.ForkPool.klass);
@@ -1097,7 +1097,7 @@ return (100);
 },
 args: [],
 source: "defaultMaxPoolSize\x0a\x09^ 100",
-messageSends: [],
+messageSends: ["defaultMaxPoolSize"],
 referencedClasses: []
 }),
 globals.ForkPool.klass);
@@ -1112,7 +1112,7 @@ self["@default"]=nil;
 return self},
 args: [],
 source: "resetDefault\x0a\x09default := nil",
-messageSends: [],
+messageSends: ["resetDefault"],
 referencedClasses: []
 }),
 globals.ForkPool.klass);
@@ -1132,7 +1132,7 @@ return $1;
 },
 args: [],
 source: "arguments\x0a\x09^ arguments",
-messageSends: [],
+messageSends: ["arguments"],
 referencedClasses: []
 }),
 globals.Message);
@@ -1147,7 +1147,7 @@ self["@arguments"]=anArray;
 return self},
 args: ["anArray"],
 source: "arguments: anArray\x0a\x09arguments := anArray",
-messageSends: [],
+messageSends: ["arguments:"],
 referencedClasses: []
 }),
 globals.Message);
@@ -1169,7 +1169,7 @@ $1=_st(aStream)._nextPutAll_(")");
 return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},globals.Message)})},
 args: ["aStream"],
 source: "printOn: aStream\x0a\x09super printOn: aStream.\x0a\x09aStream\x0a\x09\x09nextPutAll: '(';\x0a\x09\x09nextPutAll: self selector;\x0a\x09\x09nextPutAll: ')'",
-messageSends: ["printOn:", "nextPutAll:", "selector"],
+messageSends: ["printOn:", "nextPutAll:", "selector", "printOn:"],
 referencedClasses: []
 }),
 globals.Message);
@@ -1186,7 +1186,7 @@ return $1;
 },
 args: [],
 source: "selector\x0a\x09^ selector",
-messageSends: [],
+messageSends: ["selector"],
 referencedClasses: []
 }),
 globals.Message);
@@ -1201,7 +1201,7 @@ self["@selector"]=aString;
 return self},
 args: ["aString"],
 source: "selector: aString\x0a\x09selector := aString",
-messageSends: [],
+messageSends: ["selector:"],
 referencedClasses: []
 }),
 globals.Message);
@@ -1219,7 +1219,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"sendTo:",{anObject:anObject},globals.Message)})},
 args: ["anObject"],
 source: "sendTo: anObject\x0a\x09^ anObject perform: self selector withArguments: self arguments",
-messageSends: ["perform:withArguments:", "selector", "arguments"],
+messageSends: ["perform:withArguments:", "selector", "arguments", "sendTo:"],
 referencedClasses: []
 }),
 globals.Message);
@@ -1242,7 +1242,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"selector:arguments:",{aString:aString,anArray:anArray},globals.Message.klass)})},
 args: ["aString", "anArray"],
 source: "selector: aString arguments: anArray\x0a\x09^ self new\x0a\x09\x09selector: aString;\x0a\x09\x09arguments: anArray;\x0a\x09\x09yourself",
-messageSends: ["selector:", "new", "arguments:", "yourself"],
+messageSends: ["selector:", "new", "arguments:", "yourself", "selector:arguments:"],
 referencedClasses: []
 }),
 globals.Message.klass);
@@ -1263,7 +1263,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"arguments",{},globals.MessageSend)})},
 args: [],
 source: "arguments\x0a\x09^ message arguments",
-messageSends: ["arguments"],
+messageSends: ["arguments", "arguments"],
 referencedClasses: []
 }),
 globals.MessageSend);
@@ -1279,7 +1279,7 @@ _st(self["@message"])._arguments_(aCollection);
 return self}, function($ctx1) {$ctx1.fill(self,"arguments:",{aCollection:aCollection},globals.MessageSend)})},
 args: ["aCollection"],
 source: "arguments: aCollection\x0a\x09message arguments: aCollection",
-messageSends: ["arguments:"],
+messageSends: ["arguments:", "arguments:"],
 referencedClasses: []
 }),
 globals.MessageSend);
@@ -1297,7 +1297,7 @@ self["@message"]=_st($Message())._new();
 return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},globals.MessageSend)})},
 args: [],
 source: "initialize\x0a\x09super initialize.\x0a\x09message := Message new",
-messageSends: ["initialize", "new"],
+messageSends: ["initialize", "new", "initialize"],
 referencedClasses: ["Message"]
 }),
 globals.MessageSend);
@@ -1323,7 +1323,7 @@ $1=_st(aStream)._nextPutAll_(")");
 return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},globals.MessageSend)})},
 args: ["aStream"],
 source: "printOn: aStream\x0a\x09super printOn: aStream.\x0a\x09aStream\x0a\x09\x09nextPutAll: '(';\x0a\x09\x09nextPutAll: self receiver;\x0a\x09\x09nextPutAll: ' >> ';\x0a\x09\x09nextPutAll: self selector;\x0a\x09\x09nextPutAll: ')'",
-messageSends: ["printOn:", "nextPutAll:", "receiver", "selector"],
+messageSends: ["printOn:", "nextPutAll:", "receiver", "selector", "printOn:"],
 referencedClasses: []
 }),
 globals.MessageSend);
@@ -1340,7 +1340,7 @@ return $1;
 },
 args: [],
 source: "receiver\x0a\x09^ receiver",
-messageSends: [],
+messageSends: ["receiver"],
 referencedClasses: []
 }),
 globals.MessageSend);
@@ -1355,7 +1355,7 @@ self["@receiver"]=anObject;
 return self},
 args: ["anObject"],
 source: "receiver: anObject\x0a\x09receiver := anObject",
-messageSends: [],
+messageSends: ["receiver:"],
 referencedClasses: []
 }),
 globals.MessageSend);
@@ -1373,7 +1373,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"selector",{},globals.MessageSend)})},
 args: [],
 source: "selector\x0a\x09^ message selector",
-messageSends: ["selector"],
+messageSends: ["selector", "selector"],
 referencedClasses: []
 }),
 globals.MessageSend);
@@ -1389,7 +1389,7 @@ _st(self["@message"])._selector_(aString);
 return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},globals.MessageSend)})},
 args: ["aString"],
 source: "selector: aString\x0a\x09message selector: aString",
-messageSends: ["selector:"],
+messageSends: ["selector:", "selector:"],
 referencedClasses: []
 }),
 globals.MessageSend);
@@ -1407,7 +1407,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"value",{},globals.MessageSend)})},
 args: [],
 source: "value\x0a\x09^ message sendTo: self receiver",
-messageSends: ["sendTo:", "receiver"],
+messageSends: ["sendTo:", "receiver", "value"],
 referencedClasses: []
 }),
 globals.MessageSend);
@@ -1428,7 +1428,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"value:",{anObject:anObject},globals.MessageSend)})},
 args: ["anObject"],
 source: "value: anObject\x0a\x09^ message \x0a\x09\x09arguments: { anObject };\x0a\x09\x09sendTo: self receiver",
-messageSends: ["arguments:", "sendTo:", "receiver"],
+messageSends: ["arguments:", "sendTo:", "receiver", "value:"],
 referencedClasses: []
 }),
 globals.MessageSend);
@@ -1449,7 +1449,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"value:value:",{firstArgument:firstArgument,secondArgument:secondArgument},globals.MessageSend)})},
 args: ["firstArgument", "secondArgument"],
 source: "value: firstArgument value: secondArgument\x0a\x09^ message \x0a\x09\x09arguments: { firstArgument. secondArgument };\x0a\x09\x09sendTo: self receiver",
-messageSends: ["arguments:", "sendTo:", "receiver"],
+messageSends: ["arguments:", "sendTo:", "receiver", "value:value:"],
 referencedClasses: []
 }),
 globals.MessageSend);
@@ -1470,7 +1470,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"value:value:value:",{firstArgument:firstArgument,secondArgument:secondArgument,thirdArgument:thirdArgument},globals.MessageSend)})},
 args: ["firstArgument", "secondArgument", "thirdArgument"],
 source: "value: firstArgument value: secondArgument value: thirdArgument\x0a\x09^ message \x0a\x09\x09arguments: { firstArgument. secondArgument. thirdArgument };\x0a\x09\x09sendTo: self receiver",
-messageSends: ["arguments:", "sendTo:", "receiver"],
+messageSends: ["arguments:", "sendTo:", "receiver", "value:value:value:"],
 referencedClasses: []
 }),
 globals.MessageSend);
@@ -1489,7 +1489,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"valueWithPossibleArguments:",{aCollection:aCollection},globals.MessageSend)})},
 args: ["aCollection"],
 source: "valueWithPossibleArguments: aCollection\x0a\x09self arguments: aCollection.\x0a\x09^ self value",
-messageSends: ["arguments:", "value"],
+messageSends: ["arguments:", "value", "valueWithPossibleArguments:"],
 referencedClasses: []
 }),
 globals.MessageSend);
@@ -1520,7 +1520,23 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"asString",{},globals.MethodContext)})},
 args: [],
 source: "asString\x0a\x09^ self isBlockContext\x0a\x09\x09ifTrue: [ 'a block (in ', self methodContext asString, ')' ]\x0a\x09\x09ifFalse: [ self receiver class name, ' >> ', self selector ]",
-messageSends: ["ifTrue:ifFalse:", "isBlockContext", ",", "asString", "methodContext", "name", "class", "receiver", "selector"],
+messageSends: ["ifTrue:ifFalse:", "isBlockContext", ",", "asString", "methodContext", "name", "class", "receiver", "selector", "asString"],
+referencedClasses: []
+}),
+globals.MethodContext);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "basicReceiver",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return self.receiver;
+return self}, function($ctx1) {$ctx1.fill(self,"basicReceiver",{},globals.MethodContext)})},
+args: [],
+source: "basicReceiver\x0a\x09<return self.receiver>",
+messageSends: ["basicReceiver"],
 referencedClasses: []
 }),
 globals.MethodContext);
@@ -1536,7 +1552,7 @@ return self.evaluatedSelector;
 return self}, function($ctx1) {$ctx1.fill(self,"evaluatedSelector",{},globals.MethodContext)})},
 args: [],
 source: "evaluatedSelector\x0a\x09<return self.evaluatedSelector>",
-messageSends: [],
+messageSends: ["evaluatedSelector"],
 referencedClasses: []
 }),
 globals.MethodContext);
@@ -1552,7 +1568,7 @@ return self.homeContext;
 return self}, function($ctx1) {$ctx1.fill(self,"home",{},globals.MethodContext)})},
 args: [],
 source: "home\x0a\x09<return self.homeContext>",
-messageSends: [],
+messageSends: ["home"],
 referencedClasses: []
 }),
 globals.MethodContext);
@@ -1568,7 +1584,7 @@ return self.index || 0;
 return self}, function($ctx1) {$ctx1.fill(self,"index",{},globals.MethodContext)})},
 args: [],
 source: "index\x0a\x09<return self.index || 0>",
-messageSends: [],
+messageSends: ["index"],
 referencedClasses: []
 }),
 globals.MethodContext);
@@ -1586,7 +1602,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"isBlockContext",{},globals.MethodContext)})},
 args: [],
 source: "isBlockContext\x0a\x09\x22Block context do not have selectors.\x22\x0a\x09\x0a\x09^ self selector isNil",
-messageSends: ["isNil", "selector"],
+messageSends: ["isNil", "selector", "isBlockContext"],
 referencedClasses: []
 }),
 globals.MethodContext);
@@ -1602,7 +1618,7 @@ return self.locals || {};
 return self}, function($ctx1) {$ctx1.fill(self,"locals",{},globals.MethodContext)})},
 args: [],
 source: "locals\x0a\x09<return self.locals || {}>",
-messageSends: [],
+messageSends: ["locals"],
 referencedClasses: []
 }),
 globals.MethodContext);
@@ -1630,7 +1646,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"method",{},globals.MethodContext)})},
 args: [],
 source: "method\x0a\x09^ self methodContext ifNotNil: [\x0a\x09\x09self methodContext receiver class lookupSelector: self methodContext selector ]",
-messageSends: ["ifNotNil:", "methodContext", "lookupSelector:", "class", "receiver", "selector"],
+messageSends: ["ifNotNil:", "methodContext", "lookupSelector:", "class", "receiver", "selector", "method"],
 referencedClasses: []
 }),
 globals.MethodContext);
@@ -1659,7 +1675,7 @@ return $2;
 }, function($ctx1) {$ctx1.fill(self,"methodContext",{},globals.MethodContext)})},
 args: [],
 source: "methodContext\x0a\x09self isBlockContext ifFalse: [ ^ self ].\x0a\x09\x0a\x09^ self outerContext ifNotNil: [ :outer |\x0a\x09\x09outer methodContext ]",
-messageSends: ["ifFalse:", "isBlockContext", "ifNotNil:", "outerContext", "methodContext"],
+messageSends: ["ifFalse:", "isBlockContext", "ifNotNil:", "outerContext", "methodContext", "methodContext"],
 referencedClasses: []
 }),
 globals.MethodContext);
@@ -1675,7 +1691,7 @@ return self.outerContext || self.homeContext;
 return self}, function($ctx1) {$ctx1.fill(self,"outerContext",{},globals.MethodContext)})},
 args: [],
 source: "outerContext\x0a\x09<return self.outerContext || self.homeContext>",
-messageSends: [],
+messageSends: ["outerContext"],
 referencedClasses: []
 }),
 globals.MethodContext);
@@ -1697,7 +1713,7 @@ $1=_st(aStream)._nextPutAll_(")");
 return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},globals.MethodContext)})},
 args: ["aStream"],
 source: "printOn: aStream\x0a\x09super printOn: aStream.\x0a\x09aStream \x0a\x09\x09nextPutAll: '(';\x0a\x09\x09nextPutAll: self asString;\x0a\x09\x09nextPutAll: ')'",
-messageSends: ["printOn:", "nextPutAll:", "asString"],
+messageSends: ["printOn:", "nextPutAll:", "asString", "printOn:"],
 referencedClasses: []
 }),
 globals.MethodContext);
@@ -1709,11 +1725,23 @@ protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-return self.receiver;
-return self}, function($ctx1) {$ctx1.fill(self,"receiver",{},globals.MethodContext)})},
+var $3,$2,$1;
+$2=_st(self._isBlockContext())._and_((function(){
+return smalltalk.withContext(function($ctx2) {
+$3=self._outerContext();
+$ctx2.sendIdx["outerContext"]=1;
+return _st($3)._notNil();
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
+if(smalltalk.assert($2)){
+$1=_st(self._outerContext())._receiver();
+} else {
+$1=self._basicReceiver();
+};
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"receiver",{},globals.MethodContext)})},
 args: [],
-source: "receiver\x0a\x09<return self.receiver>",
-messageSends: [],
+source: "receiver\x0a\x09^ (self isBlockContext and: [ self outerContext notNil ])\x0a\x09\x09ifTrue: [ self outerContext receiver ]\x0a\x09\x09ifFalse: [ self basicReceiver ]",
+messageSends: ["ifTrue:ifFalse:", "and:", "isBlockContext", "notNil", "outerContext", "receiver", "basicReceiver", "receiver"],
 referencedClasses: []
 }),
 globals.MethodContext);
@@ -1735,7 +1763,7 @@ return smalltalk.withContext(function($ctx1) {
 return self}, function($ctx1) {$ctx1.fill(self,"selector",{},globals.MethodContext)})},
 args: [],
 source: "selector\x0a\x09<\x0a\x09\x09if(self.selector) {\x0a\x09\x09\x09return smalltalk.convertSelector(self.selector);\x0a\x09\x09} else {\x0a\x09\x09\x09return nil;\x0a\x09\x09}\x0a\x09>",
-messageSends: [],
+messageSends: ["selector"],
 referencedClasses: []
 }),
 globals.MethodContext);
@@ -1751,7 +1779,7 @@ return self.sendIdx[aSelector] || 0;
 return self}, function($ctx1) {$ctx1.fill(self,"sendIndexAt:",{aSelector:aSelector},globals.MethodContext)})},
 args: ["aSelector"],
 source: "sendIndexAt: aSelector\x0a\x09<return self.sendIdx[aSelector] || 0>",
-messageSends: [],
+messageSends: ["sendIndexAt:"],
 referencedClasses: []
 }),
 globals.MethodContext);
@@ -1767,7 +1795,7 @@ return self.sendIdx;
 return self}, function($ctx1) {$ctx1.fill(self,"sendIndexes",{},globals.MethodContext)})},
 args: [],
 source: "sendIndexes\x0a\x09<return self.sendIdx>",
-messageSends: [],
+messageSends: ["sendIndexes"],
 referencedClasses: []
 }),
 globals.MethodContext);
@@ -1786,7 +1814,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"temps",{},globals.MethodContext)})},
 args: [],
 source: "temps\x0a\x09self deprecatedAPI.\x0a\x09\x0a\x09^ self locals",
-messageSends: ["deprecatedAPI", "locals"],
+messageSends: ["deprecatedAPI", "locals", "temps"],
 referencedClasses: []
 }),
 globals.MethodContext);
@@ -1810,7 +1838,7 @@ return smalltalk.withContext(function($ctx1) {
 return self}, function($ctx1) {$ctx1.fill(self,"constructor:",{aString:aString},globals.NativeFunction.klass)})},
 args: ["aString"],
 source: "constructor: aString\x0a\x09<\x0a\x09\x09var native=eval(aString);\x0a\x09\x09return new native();\x0a\x09>",
-messageSends: [],
+messageSends: ["constructor:"],
 referencedClasses: []
 }),
 globals.NativeFunction.klass);
@@ -1829,7 +1857,7 @@ return smalltalk.withContext(function($ctx1) {
 return self}, function($ctx1) {$ctx1.fill(self,"constructor:value:",{aString:aString,anObject:anObject},globals.NativeFunction.klass)})},
 args: ["aString", "anObject"],
 source: "constructor: aString value:anObject\x0a\x09<\x0a\x09\x09var native=eval(aString);\x0a\x09\x09return new native(anObject);\x0a\x09>",
-messageSends: [],
+messageSends: ["constructor:value:"],
 referencedClasses: []
 }),
 globals.NativeFunction.klass);
@@ -1848,7 +1876,7 @@ return smalltalk.withContext(function($ctx1) {
 return self}, function($ctx1) {$ctx1.fill(self,"constructor:value:value:",{aString:aString,anObject:anObject,anObject2:anObject2},globals.NativeFunction.klass)})},
 args: ["aString", "anObject", "anObject2"],
 source: "constructor: aString value:anObject value: anObject2\x0a\x09<\x0a\x09\x09var native=eval(aString);\x0a\x09\x09return new native(anObject,anObject2);\x0a\x09>",
-messageSends: [],
+messageSends: ["constructor:value:value:"],
 referencedClasses: []
 }),
 globals.NativeFunction.klass);
@@ -1867,7 +1895,7 @@ return smalltalk.withContext(function($ctx1) {
 return self}, function($ctx1) {$ctx1.fill(self,"constructor:value:value:value:",{aString:aString,anObject:anObject,anObject2:anObject2,anObject3:anObject3},globals.NativeFunction.klass)})},
 args: ["aString", "anObject", "anObject2", "anObject3"],
 source: "constructor: aString value:anObject value: anObject2 value:anObject3\x0a\x09<\x0a\x09\x09var native=eval(aString);\x0a\x09\x09return new native(anObject,anObject2, anObject3);\x0a\x09>",
-messageSends: [],
+messageSends: ["constructor:value:value:value:"],
 referencedClasses: []
 }),
 globals.NativeFunction.klass);
@@ -1886,7 +1914,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"exists:",{aString:aString},globals.NativeFunction.klass)})},
 args: ["aString"],
 source: "exists: aString\x0a\x09^ PlatformInterface existsGlobal: aString",
-messageSends: ["existsGlobal:"],
+messageSends: ["existsGlobal:", "exists:"],
 referencedClasses: ["PlatformInterface"]
 }),
 globals.NativeFunction.klass);
@@ -1908,7 +1936,7 @@ return smalltalk.withContext(function($ctx1) {
 return self}, function($ctx1) {$ctx1.fill(self,"clearInterval",{},globals.Timeout)})},
 args: [],
 source: "clearInterval\x0a\x09<\x0a\x09\x09var interval = self[\x22@rawTimeout\x22];\x0a\x09\x09clearInterval(interval);\x0a\x09>",
-messageSends: [],
+messageSends: ["clearInterval"],
 referencedClasses: []
 }),
 globals.Timeout);
@@ -1927,7 +1955,7 @@ return smalltalk.withContext(function($ctx1) {
 return self}, function($ctx1) {$ctx1.fill(self,"clearTimeout",{},globals.Timeout)})},
 args: [],
 source: "clearTimeout\x0a\x09<\x0a\x09\x09var timeout = self[\x22@rawTimeout\x22];\x0a\x09\x09clearTimeout(timeout);\x0a\x09>",
-messageSends: [],
+messageSends: ["clearTimeout"],
 referencedClasses: []
 }),
 globals.Timeout);
@@ -1942,7 +1970,7 @@ self["@rawTimeout"]=anObject;
 return self},
 args: ["anObject"],
 source: "rawTimeout: anObject\x0a\x09rawTimeout := anObject",
-messageSends: [],
+messageSends: ["rawTimeout:"],
 referencedClasses: []
 }),
 globals.Timeout);
@@ -1964,7 +1992,7 @@ return $1;
 }, function($ctx1) {$ctx1.fill(self,"on:",{anObject:anObject},globals.Timeout.klass)})},
 args: ["anObject"],
 source: "on: anObject\x0a\x09^ self new rawTimeout: anObject; yourself",
-messageSends: ["rawTimeout:", "new", "yourself"],
+messageSends: ["rawTimeout:", "new", "yourself", "on:"],
 referencedClasses: []
 }),
 globals.Timeout.klass);

+ 7 - 1
src/Kernel-Methods.st

@@ -562,6 +562,10 @@ My instances are JavaScript `SmalltalkMethodContext` objects defined in `boot.js
 
 !MethodContext methodsFor: 'accessing'!
 
+basicReceiver
+	<return self.receiver>
+!
+
 evaluatedSelector
 	<return self.evaluatedSelector>
 !
@@ -595,7 +599,9 @@ outerContext
 !
 
 receiver
-	<return self.receiver>
+	^ (self isBlockContext and: [ self outerContext notNil ])
+		ifTrue: [ self outerContext receiver ]
+		ifFalse: [ self basicReceiver ]
 !
 
 selector

Some files were not shown because too many files changed in this diff