Explorar o código

Trait >> theMetaClass ^ nil

Herbert Vojčík %!s(int64=7) %!d(string=hai) anos
pai
achega
5d8e2ec831
Modificáronse 2 ficheiros con 26 adicións e 26 borrados
  1. 21 20
      src/IDE.js
  2. 5 6
      src/IDE.st

+ 21 - 20
src/IDE.js

@@ -3731,32 +3731,32 @@ var klass;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $1,$2,$receiver;
+var $1,$2,$3,$receiver;
 var $early={};
 try {
 $1=self["@selectedClass"];
 if(($receiver = $1) == null || $receiver.isNil){
-$1;
+return [];
 } else {
+$1;
+}
 $2=$recv(self["@selectedTab"]).__eq("comment");
 if($core.assert($2)){
 return [];
 }
 klass=self._selectedClassOrMetaClass();
-klass;
+$3=klass;
+if(($receiver = $3) == null || $receiver.isNil){
+return [];
+} else {
+$3;
+}
 $recv($recv(klass)._methodDictionary())._ifEmpty_((function(){
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx2) {
-//>>excludeEnd("ctx");
-throw $early=[$recv($globals.Array)._with_("not yet classified")];
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
-//>>excludeEnd("ctx");
+throw $early=[["not yet classified"]];
+
 }));
 return $recv(klass)._protocols();
 }
-return $recv($globals.Array)._new();
-}
 catch(e) {if(e===$early)return e[0]; throw e}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"protocols",{klass:klass},$globals.Browser)});
@@ -3764,10 +3764,10 @@ catch(e) {if(e===$early)return e[0]; throw e}
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "protocols\x0a\x09| klass |\x0a\x09selectedClass ifNotNil: [\x0a\x09selectedTab = #comment ifTrue: [ ^ #() ].\x0a\x09klass := self selectedClassOrMetaClass.\x0a\x09klass methodDictionary ifEmpty: [\x0a\x09\x09^ Array with: 'not yet classified' ].\x0a\x09^ klass protocols ].\x0a\x09^ Array new",
-referencedClasses: ["Array"],
+source: "protocols\x0a\x09| klass |\x0a\x09selectedClass ifNil: [ ^ #() ].\x0a\x09selectedTab = #comment ifTrue: [ ^ #() ].\x0a\x09klass := self selectedClassOrMetaClass.\x0a\x09klass ifNil: [ ^ #() ].\x0a\x09klass methodDictionary ifEmpty: [ ^ {'not yet classified'} ].\x0a\x09^ klass protocols",
+referencedClasses: [],
 //>>excludeEnd("ide");
-messageSends: ["ifNotNil:", "ifTrue:", "=", "selectedClassOrMetaClass", "ifEmpty:", "methodDictionary", "with:", "protocols", "new"]
+messageSends: ["ifNil:", "ifTrue:", "=", "selectedClassOrMetaClass", "ifEmpty:", "methodDictionary", "protocols"]
 }),
 $globals.Browser);
 
@@ -7926,12 +7926,12 @@ var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $1;
-$1=$recv($globals.Smalltalk)._classes();
+var $2,$1;
+$2=$recv($globals.Smalltalk)._classes();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["classes"]=1;
 //>>excludeEnd("ctx");
-return $recv($1).__comma($recv($recv($globals.Smalltalk)._classes())._collect_((function(each){
+$1=$recv($2).__comma($recv($recv($globals.Smalltalk)._classes())._collect_((function(each){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
@@ -7940,16 +7940,17 @@ return $recv(each)._theMetaClass();
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
 //>>excludeEnd("ctx");
 })));
+return $recv($1)._copyWithout_(nil);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"classesAndMetaclasses",{},$globals.ReferencesBrowser)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "classesAndMetaclasses\x0a\x09^ Smalltalk classes, (Smalltalk classes collect: [ :each | each theMetaClass ])",
+source: "classesAndMetaclasses\x0a\x09^ Smalltalk classes, (Smalltalk classes collect: [ :each | each theMetaClass ]) copyWithout: nil",
 referencedClasses: ["Smalltalk"],
 //>>excludeEnd("ide");
-messageSends: [",", "classes", "collect:", "theMetaClass"]
+messageSends: ["copyWithout:", ",", "classes", "collect:", "theMetaClass"]
 }),
 $globals.ReferencesBrowser);
 

+ 5 - 6
src/IDE.st

@@ -713,13 +713,12 @@ packages
 
 protocols
 	| klass |
-	selectedClass ifNotNil: [
+	selectedClass ifNil: [ ^ #() ].
 	selectedTab = #comment ifTrue: [ ^ #() ].
 	klass := self selectedClassOrMetaClass.
-	klass methodDictionary ifEmpty: [
-		^ Array with: 'not yet classified' ].
-	^ klass protocols ].
-	^ Array new
+	klass ifNil: [ ^ #() ].
+	klass methodDictionary ifEmpty: [ ^ {'not yet classified'} ].
+	^ klass protocols
 !
 
 selectedClass
@@ -1758,7 +1757,7 @@ TabWidget subclass: #ReferencesBrowser
 !ReferencesBrowser methodsFor: 'accessing'!
 
 classesAndMetaclasses
-	^ Smalltalk classes, (Smalltalk classes collect: [ :each | each theMetaClass ])
+	^ Smalltalk classes, (Smalltalk classes collect: [ :each | each theMetaClass ]) copyWithout: nil
 !
 
 implementors