#556 closed defect (fixed)
collections.Set.union function loops infinitely
Reported by: | anonymous | Owned by: | anonymous |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | General | Version: | 0.2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
the loop to add properties from the second array parameter is missing the line e.moveNext(); leading to an infinite loop.
Change History (5)
comment:1 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 Changed 16 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
I have just (30 March 2006) downloaded the 'kitchen sink' distribution 0.2.2 - the line is missing! dojo-0.2.2-kitchen_sink/src/collections/Set.js
... dojo.collections.Set = new function(){
this.union = function(setA, setB){
if (setA.constructor == Array) var setA = new dojo.collections.ArrayList?(setA); if (setB.constructor == Array) var setB = new dojo.collections.ArrayList?(setB);
if (!setA.toArray !setB.toArray) dojo.raise("Set operations can only be performed on array-based collections."); var result = new dojo.collections.ArrayList?(setA.toArray()); var e = setB.getIterator(); while (!e.atEnd){
if (!result.contains(e.current)) result.add(e.current);
} return result;
};
look at the while loop - how is e being iterated?
comment:3 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
The 0.2.2 release contained this bug; the trunk does not. If you are using the Set stuff, probably you should grab the nightly or fix it in your local copy.
It *is* fixed in the nightlies, therefore this is closed.
comment:4 Changed 16 years ago by
Milestone: | → 0.3release |
---|
Not sure what version of this code you are using but the line is there and passes unit tests.