Herbert Vojčík пре 11 година
родитељ
комит
5e603d3e39
3 измењених фајлова са 47 додато и 0 уклоњено
  1. 18 0
      js/Kernel-Classes.deploy.js
  2. 23 0
      js/Kernel-Classes.js
  3. 6 0
      st/Kernel-Classes.st

+ 18 - 0
js/Kernel-Classes.deploy.js

@@ -55,6 +55,24 @@ return $2;
 messageSends: ["copy", "instanceVariableNames", "ifNotNil:", "addAll:", "allInstanceVariableNames", "superclass"]}),
 smalltalk.Behavior);
 
+smalltalk.addMethod(
+"_allSelectors",
+smalltalk.method({
+selector: "allSelectors",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $2,$3,$1;
+$1=_st(_st(self)._allSuperclasses())._inject_into_(_st(self)._selectors(),(function(soFar,aBehavior){
+return smalltalk.withContext(function($ctx2) {
$2=soFar;
+_st($2)._addAll_(_st(aBehavior)._selectors());
+$3=_st($2)._yourself();
+return $3;
+}, function($ctx2) {$ctx2.fillBlock({soFar:soFar,aBehavior:aBehavior},$ctx1)})}));
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"allSelectors",{}, smalltalk.Behavior)})},
+messageSends: ["inject:into:", "selectors", "addAll:", "yourself", "allSuperclasses"]}),
+smalltalk.Behavior);
+
 smalltalk.addMethod(
 "_allSubclasses",
 smalltalk.method({

+ 23 - 0
js/Kernel-Classes.js

@@ -66,6 +66,29 @@ referencedClasses: []
 }),
 smalltalk.Behavior);
 
+smalltalk.addMethod(
+"_allSelectors",
+smalltalk.method({
+selector: "allSelectors",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
var $2,$3,$1;
+$1=_st(_st(self)._allSuperclasses())._inject_into_(_st(self)._selectors(),(function(soFar,aBehavior){
+return smalltalk.withContext(function($ctx2) {
$2=soFar;
+_st($2)._addAll_(_st(aBehavior)._selectors());
+$3=_st($2)._yourself();
+return $3;
+}, function($ctx2) {$ctx2.fillBlock({soFar:soFar,aBehavior:aBehavior},$ctx1)})}));
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"allSelectors",{}, smalltalk.Behavior)})},
+args: [],
+source: "allSelectors\x0a\x09^self allSuperclasses\x0a\x09\x09inject: self selectors\x0a\x09\x09into: [ :soFar :aBehavior | soFar addAll: aBehavior selectors; yourself ]",
+messageSends: ["inject:into:", "selectors", "addAll:", "yourself", "allSuperclasses"],
+referencedClasses: []
+}),
+smalltalk.Behavior);
+
 smalltalk.addMethod(
 "_allSubclasses",
 smalltalk.method({

+ 6 - 0
st/Kernel-Classes.st

@@ -21,6 +21,12 @@ allInstanceVariableNames
 	^result
 !
 
+allSelectors
+	^self allSuperclasses
+		inject: self selectors
+		into: [ :soFar :aBehavior | soFar addAll: aBehavior selectors; yourself ]
+!
+
 allSubclasses
 	| result |
 	result := self subclasses.