Просмотр исходного кода

Add missing Symbol>>asSelector

Nicolas Petton 12 лет назад
Родитель
Сommit
1fa9ac52db
3 измененных файлов с 31 добавлено и 0 удалено
  1. 11 0
      js/Kernel-Collections.deploy.js
  2. 16 0
      js/Kernel-Collections.js
  3. 4 0
      st/Kernel-Collections.st

+ 11 - 0
js/Kernel-Collections.deploy.js

@@ -1648,6 +1648,17 @@ return self;}
 }),
 smalltalk.Symbol);
 
+smalltalk.addMethod(
+'_asSelector',
+smalltalk.method({
+selector: 'asSelector',
+fn: function (){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_asString", []), "_asSelector", []);
+return self;}
+}),
+smalltalk.Symbol);
+
 
 smalltalk.addMethod(
 '_lookup_',

+ 16 - 0
js/Kernel-Collections.js

@@ -2348,6 +2348,22 @@ referencedClasses: []
 }),
 smalltalk.Symbol);
 
+smalltalk.addMethod(
+unescape('_asSelector'),
+smalltalk.method({
+selector: unescape('asSelector'),
+category: 'converting',
+fn: function (){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_asString", []), "_asSelector", []);
+return self;},
+args: [],
+source: unescape('asSelector%0A%09%5Eself%20asString%20asSelector'),
+messageSends: ["asSelector", "asString"],
+referencedClasses: []
+}),
+smalltalk.Symbol);
+
 
 smalltalk.addMethod(
 unescape('_lookup_'),

+ 4 - 0
st/Kernel-Collections.st

@@ -792,6 +792,10 @@ asSymbol
 
 asJavascript
 	^'smalltalk.symbolFor("', self asString, '")'
+!
+
+asSelector
+	^self asString asSelector
 ! !
 
 !Symbol methodsFor: 'copying'!