1
0
Quellcode durchsuchen

IndexableCollection created, HashedCollection reparented.

Herbert Vojčík vor 12 Jahren
Ursprung
Commit
5ab1c8e3cc
3 geänderte Dateien mit 15 neuen und 5 gelöschten Zeilen
  1. 5 2
      js/Kernel-Collections.deploy.js
  2. 5 2
      js/Kernel-Collections.js
  3. 5 1
      st/Kernel-Collections.st

+ 5 - 2
js/Kernel-Collections.deploy.js

@@ -724,7 +724,10 @@ messageSends: ["addAll:", "new", "yourself"]}),
 smalltalk.Collection.klass);
 
 
-smalltalk.addClass('HashedCollection', smalltalk.Collection, [], 'Kernel-Collections');
+smalltalk.addClass('IndexableCollection', smalltalk.Collection, [], 'Kernel-Collections');
+
+
+smalltalk.addClass('HashedCollection', smalltalk.IndexableCollection, [], 'Kernel-Collections');
 smalltalk.addMethod(
 "__comma",
 smalltalk.method({
@@ -775,7 +778,7 @@ selector: "addAll:",
 fn: function (aHashedCollection){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
-smalltalk.Collection.fn.prototype._addAll_.apply(_st(self), [_st(aHashedCollection)._associations()]);
+smalltalk.IndexedCollection.fn.prototype._addAll_.apply(_st(self), [_st(aHashedCollection)._associations()]);
 $1=aHashedCollection;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"addAll:",{aHashedCollection:aHashedCollection}, smalltalk.HashedCollection)})},

+ 5 - 2
js/Kernel-Collections.js

@@ -964,7 +964,10 @@ referencedClasses: []
 smalltalk.Collection.klass);
 
 
-smalltalk.addClass('HashedCollection', smalltalk.Collection, [], 'Kernel-Collections');
+smalltalk.addClass('IndexableCollection', smalltalk.Collection, [], 'Kernel-Collections');
+
+
+smalltalk.addClass('HashedCollection', smalltalk.IndexableCollection, [], 'Kernel-Collections');
 smalltalk.HashedCollection.comment="A HashedCollection is a traditional JavaScript object, or a Smalltalk Dictionary.\x0a\x0aUnlike a Dictionary, it can only have strings as keys."
 smalltalk.addMethod(
 "__comma",
@@ -1032,7 +1035,7 @@ category: 'adding/removing',
 fn: function (aHashedCollection){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
-smalltalk.Collection.fn.prototype._addAll_.apply(_st(self), [_st(aHashedCollection)._associations()]);
+smalltalk.IndexedCollection.fn.prototype._addAll_.apply(_st(self), [_st(aHashedCollection)._associations()]);
 $1=aHashedCollection;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"addAll:",{aHashedCollection:aHashedCollection}, smalltalk.HashedCollection)})},

+ 5 - 1
st/Kernel-Collections.st

@@ -302,7 +302,11 @@ withAll: aCollection
 		yourself
 ! !
 
-Collection subclass: #HashedCollection
+Collection subclass: #IndexableCollection
+	instanceVariableNames: ''
+	package: 'Kernel-Collections'!
+
+IndexableCollection subclass: #HashedCollection
 	instanceVariableNames: ''
 	package: 'Kernel-Collections'!
 !HashedCollection commentStamp!