Closed Bug 559909 Opened 14 years ago Closed 14 years ago

Fix iteratorUtils.toArray's NodeList and Iterator checks

Categories

(MailNews Core :: Backend, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 3.3a1

People

(Reporter: bwinton, Assigned: rain1)

References

Details

Attachments

(1 file)

(Yeah, I know, this totally isn't the right place for this bug, but it seemed like the closest thing I could find.)

I would like to use the toArray function from mail/base/content/featureConfigurator.js, but NodeList doesn't seem to exist, so it fails with an exception.

I tried changing it to Ci.nsIDOMNodeList, but that didn't really help me, because it still returned null for the iterator I passed in.

I start with an [xpconnect wrapped nsISupportsArray @ 0x1b4e3530 (native @ 0x1b4e34f0)], pass that to fixIterator, which seems to return me "return { __iterator__: iter };" from line 116 in mailnews/base/util/iteratorUtils.jsm).  But, since that doesn't have Iterator.prototype in its prototype chain, the call to "aObj instanceof Iterator" on line 62 fails, and I get null back.

At least, I think that's what's happening.

Thanks,
Blake.
Attached patch patch + testsSplinter Review
Right, this fixes things. I had to add a hack similar to the one I removed in bug 603192. Oh well, you win some, you lose some.
Assignee: nobody → sid.bugzilla
Status: NEW → ASSIGNED
Attachment #482150 - Flags: review?(bugmail)
Comment on attachment 482150 [details] [diff] [review]
patch + tests

a most excellent and thorough test; thank you!
Attachment #482150 - Flags: review?(bugmail) → review+
I'll open a separate bug to fix featureConfigurator.js.
Summary: toArray fails in twice when called from featureConfigurator.js → Fix iteratorUtils.toArray's NodeList and Iterator checks
Blocks: 603253
http://hg.mozilla.org/comm-central/rev/6d7a363afbb9

(I added a couple of extra sanity checks to the test)
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Attachment #482150 - Flags: approval-thunderbird3.2a1?
Target Milestone: --- → Thunderbird 3.3a1
Attachment #482150 - Flags: approval-thunderbird3.2a1?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: