Opened 15 years ago
Closed 15 years ago
#473 closed defect (duplicate)
serious but easy-to-fix bug in Collections.js
Reported by: | Owned by: | anonymous | |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Core | Version: | 0.2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
try to use the addRange method of ArrayList?, passing a 1-element ArrayList? as an argument. You'll see that it fails. Also, try to clone a 1-element SortedList? or Dictionary. Again, it will fail. I believe that the problem is the atEnd property of dojo.collections.Iterator and dojo.collections.DictionaryIterator?; change these to position>=obj.length instead of position>=obj.length-1.
Attachments (1)
Change History (3)
Changed 15 years ago by
Attachment: | Collections.js.patch added |
---|
comment:1 Changed 15 years ago by
I confirm the problem : Iterator doesn't work when the list has only one element. I think the correct fix is to use > instead >= when creating the iterator. (obj.length-1 is correct since the first element index is 0).
I've attached a patch to fix the problem in Collections.js.
comment:2 Changed 15 years ago by
Resolution: | → duplicate |
---|---|
Status: | new → closed |
This is a duplicate to bug #408; closing in favor of that.
Fix atEnd value.