Browse Source

- Added MethodContext >> method
- Fixed the debugger with block contexts

Nicolas Petton 12 years ago
parent
commit
744ebb56eb
6 changed files with 40 additions and 5 deletions
  1. 1 1
      js/IDE.deploy.js
  2. 3 3
      js/IDE.js
  3. 13 0
      js/Kernel-Methods.deploy.js
  4. 18 0
      js/Kernel-Methods.js
  5. 1 1
      st/IDE.st
  6. 4 0
      st/Kernel-Methods.st

+ 1 - 1
js/IDE.deploy.js

@@ -3060,7 +3060,7 @@ selector: "method",
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
-$1=_st(_st(_st(self["@selectedContext"])._receiver())._class())._lookupSelector_(_st(self["@selectedContext"])._selector());
+$1=_st(self["@selectedContext"])._method();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"method", [], {}, smalltalk.Debugger)})}
 }),

+ 3 - 3
js/IDE.js

@@ -3851,12 +3851,12 @@ category: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
-$1=_st(_st(_st(self["@selectedContext"])._receiver())._class())._lookupSelector_(_st(self["@selectedContext"])._selector());
+$1=_st(self["@selectedContext"])._method();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"method", [], {}, smalltalk.Debugger)})},
 args: [],
-source: "method\x0a\x09^selectedContext receiver class lookupSelector: selectedContext selector",
-messageSends: ["lookupSelector:", "selector", "class", "receiver"],
+source: "method\x0a\x09^selectedContext method",
+messageSends: ["method"],
 referencedClasses: []
 }),
 smalltalk.Debugger);

+ 13 - 0
js/Kernel-Methods.deploy.js

@@ -778,6 +778,19 @@ return self}, function($ctx1) {$ctx1.fill(self,"locals", [], {}, smalltalk.Metho
 }),
 smalltalk.MethodContext);
 
+smalltalk.addMethod(
+"_method",
+smalltalk.method({
+selector: "method",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=_st(_st(_st(_st(self)._methodContext())._receiver())._class())._lookupSelector_(_st(_st(self)._methodContext())._selector());
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"method", [], {}, smalltalk.MethodContext)})}
+}),
+smalltalk.MethodContext);
+
 smalltalk.addMethod(
 "_methodContext",
 smalltalk.method({

+ 18 - 0
js/Kernel-Methods.js

@@ -1068,6 +1068,24 @@ referencedClasses: []
 }),
 smalltalk.MethodContext);
 
+smalltalk.addMethod(
+"_method",
+smalltalk.method({
+selector: "method",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $1;
+$1=_st(_st(_st(_st(self)._methodContext())._receiver())._class())._lookupSelector_(_st(_st(self)._methodContext())._selector());
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"method", [], {}, smalltalk.MethodContext)})},
+args: [],
+source: "method\x0a\x09^self methodContext receiver class lookupSelector: self methodContext selector",
+messageSends: ["lookupSelector:", "selector", "methodContext", "class", "receiver"],
+referencedClasses: []
+}),
+smalltalk.MethodContext);
+
 smalltalk.addMethod(
 "_methodContext",
 smalltalk.method({

+ 1 - 1
st/IDE.st

@@ -1345,7 +1345,7 @@ label
 !
 
 method
-	^selectedContext receiver class lookupSelector: selectedContext selector
+	^selectedContext method
 !
 
 receiver

+ 4 - 0
st/Kernel-Methods.st

@@ -373,6 +373,10 @@ locals
 	<return self.locals>
 !
 
+method
+	^self methodContext receiver class lookupSelector: self methodContext selector
+!
+
 methodContext
 	self isBlockContext ifFalse: [ ^ self ].