Browse Source

Deprecate #copyWithAll: in favour of #,.

Herby Vojčík 5 years ago
parent
commit
cd88d48535
3 changed files with 7 additions and 7 deletions
  1. 1 0
      lang/API-CHANGES.txt
  2. 4 6
      lang/src/Kernel-Collections.js
  3. 2 1
      lang/src/Kernel-Collections.st

+ 1 - 0
lang/API-CHANGES.txt

@@ -3,6 +3,7 @@
 * Remove class IndexableCollection, trait TKeyValueCollection.
 * Merge CharacterArray class into String class
 * Remove CharacterArray class
+* Deprecate Collection >> copyWithAll:, #, is enough.
 
 - Array >>
   - numericallyIndexable

+ 4 - 6
lang/src/Kernel-Collections.js

@@ -794,20 +794,18 @@ var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $1;
-$1=$self._copy();
-$recv($1)._addAll_(aCollection);
-return $recv($1)._yourself();
+$self._deprecatedAPI_("Use #, instead.");
+return $self.__comma(aCollection);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"copyWithAll:",{aCollection:aCollection},$globals.Collection)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aCollection"],
-source: "copyWithAll: aCollection\x0a\x09^ self copy addAll: aCollection; yourself",
+source: "copyWithAll: aCollection\x0a\x09self deprecatedAPI: 'Use #, instead.'.\x0a\x09^ self, aCollection",
 referencedClasses: [],
 //>>excludeEnd("ide");
-messageSends: ["addAll:", "copy", "yourself"]
+messageSends: ["deprecatedAPI:", ","]
 }),
 $globals.Collection);
 

+ 2 - 1
lang/src/Kernel-Collections.st

@@ -234,7 +234,8 @@ copyWith: anObject
 !
 
 copyWithAll: aCollection
-	^ self copy addAll: aCollection; yourself
+	self deprecatedAPI: 'Use #, instead.'.
+	^ self, aCollection
 !
 
 copyWithout: anObject