|
@@ -1742,49 +1742,49 @@ smalltalk.HashedCollection);
|
|
|
|
|
|
smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
-selector: "fromPairs:",
|
|
|
+selector: "from:",
|
|
|
category: 'instance creation',
|
|
|
fn: function (aCollection){
|
|
|
var self=this;
|
|
|
-var dict;
|
|
|
+var newCollection;
|
|
|
return smalltalk.withContext(function($ctx1) {
|
|
|
var $1;
|
|
|
-_st(self)._deprecatedAPI();
|
|
|
-dict=_st(self)._new();
|
|
|
+newCollection=_st(self)._new();
|
|
|
_st(aCollection)._do_((function(each){
|
|
|
return smalltalk.withContext(function($ctx2) {
|
|
|
-return _st(dict)._add_(each);
|
|
|
+return _st(newCollection)._add_(each);
|
|
|
}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
|
|
|
-$1=dict;
|
|
|
+$1=newCollection;
|
|
|
return $1;
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"fromPairs:",{aCollection:aCollection,dict:dict},smalltalk.HashedCollection.klass)})},
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"from:",{aCollection:aCollection,newCollection:newCollection},smalltalk.HashedCollection.klass)})},
|
|
|
args: ["aCollection"],
|
|
|
-source: "fromPairs: aCollection\x0a\x09\x22This message is poorly named and has been replaced by #newFrom:\x22\x0a\x09| dict |\x0a\x09self deprecatedAPI.\x0a\x09dict := self new.\x0a\x09aCollection do: [:each | dict add: each].\x0a\x09^dict",
|
|
|
-messageSends: ["deprecatedAPI", "new", "do:", "add:"],
|
|
|
+source: "from: aCollection\x0a| newCollection |\x0anewCollection := self new.\x0aaCollection do: [:each | newCollection add: each].\x0a^ newCollection.",
|
|
|
+messageSends: ["new", "do:", "add:"],
|
|
|
referencedClasses: []
|
|
|
}),
|
|
|
smalltalk.HashedCollection.klass);
|
|
|
|
|
|
smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
-selector: "newFrom:",
|
|
|
+selector: "fromPairs:",
|
|
|
category: 'instance creation',
|
|
|
fn: function (aCollection){
|
|
|
var self=this;
|
|
|
-var newCollection;
|
|
|
+var dict;
|
|
|
return smalltalk.withContext(function($ctx1) {
|
|
|
var $1;
|
|
|
-newCollection=_st(self)._new();
|
|
|
+_st(self)._deprecatedAPI();
|
|
|
+dict=_st(self)._new();
|
|
|
_st(aCollection)._do_((function(each){
|
|
|
return smalltalk.withContext(function($ctx2) {
|
|
|
-return _st(newCollection)._add_(each);
|
|
|
+return _st(dict)._add_(each);
|
|
|
}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
|
|
|
-$1=newCollection;
|
|
|
+$1=dict;
|
|
|
return $1;
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"newFrom:",{aCollection:aCollection,newCollection:newCollection},smalltalk.HashedCollection.klass)})},
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"fromPairs:",{aCollection:aCollection,dict:dict},smalltalk.HashedCollection.klass)})},
|
|
|
args: ["aCollection"],
|
|
|
-source: "newFrom: aCollection\x0a| newCollection |\x0anewCollection := self new.\x0aaCollection do: [:each | newCollection add: each].\x0a^ newCollection.",
|
|
|
-messageSends: ["new", "do:", "add:"],
|
|
|
+source: "fromPairs: aCollection\x0a\x09\x22This message is poorly named and has been replaced by #newFrom:\x22\x0a\x09| dict |\x0a\x09self deprecatedAPI.\x0a\x09dict := self new.\x0a\x09aCollection do: [:each | dict add: each].\x0a\x09^dict",
|
|
|
+messageSends: ["deprecatedAPI", "new", "do:", "add:"],
|
|
|
referencedClasses: []
|
|
|
}),
|
|
|
smalltalk.HashedCollection.klass);
|