Browse Source

ProtoObject >> perform:with:. Fixes #1180.

Herby Vojčík 3 years ago
parent
commit
08ed09dfcb
3 changed files with 30 additions and 0 deletions
  1. 2 0
      lang/API-CHANGES.txt
  2. 24 0
      lang/src/Kernel-Objects.js
  3. 4 0
      lang/src/Kernel-Objects.st

+ 2 - 0
lang/API-CHANGES.txt

@@ -14,6 +14,8 @@
 + ClassBuilder >>
   + addSubclass:named:slots:package:
   + migrateClassNamed:superclass:slots:package:
++ ProtoObject >>
+  + perform:with:
 + SequenceableCollection >>
   + pairsCollect:
   + pairsDo:

+ 24 - 0
lang/src/Kernel-Objects.js

@@ -464,6 +464,30 @@ return $self._perform_withArguments_(aString,[]);
 }; }),
 $globals.ProtoObject);
 
+$core.addMethod(
+$core.method({
+selector: "perform:with:",
+protocol: "message handling",
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aString", "anObject"],
+source: "perform: aString with: anObject\x0a\x09<inlineJS: 'return $core.send2(self, aString, [anObject])'>",
+referencedClasses: [],
+//>>excludeEnd("ide");
+pragmas: [["inlineJS:", ["return $core.send2(self, aString, [anObject])"]]],
+messageSends: []
+}, function ($methodClass){ return function (aString,anObject){
+var self=this,$self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+return $core.send2(self, aString, [anObject]);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"perform:with:",{aString:aString,anObject:anObject})});
+//>>excludeEnd("ctx");
+}; }),
+$globals.ProtoObject);
+
 $core.addMethod(
 $core.method({
 selector: "perform:withArguments:",

+ 4 - 0
lang/src/Kernel-Objects.st

@@ -95,6 +95,10 @@ perform: aString
 	^ self perform: aString withArguments: #()
 !
 
+perform: aString with: anObject
+	<inlineJS: 'return $core.send2(self, aString, [anObject])'>
+!
+
 perform: aString withArguments: aCollection
 	<inlineJS: 'return $core.send2(self, aString, aCollection)'>
 ! !