Closed
Bug 1486249
Opened 6 years ago
Closed 6 years ago
Allow JS iterators to act as nsISimpleEnumerators
Categories
(Core :: XPConnect, enhancement, P2)
Core
XPConnect
Tracking
()
RESOLVED
FIXED
mozilla64
Tracking | Status | |
---|---|---|
firefox64 | --- | fixed |
People
(Reporter: kmag, Assigned: kmag)
References
Details
Attachments
(2 files)
This is essentially the inverse of bug 1484496: That bug allows us to use C++-implemented nsISimpleEnumerator instances as JS iterators. This one should allow us to pass plain JS iterators to C++ callers expecting nsISimpleEnumerator instances. This should help to significantly decrease the impedance mismatch between JS and C++ callers of the relevante APIs, and make it much easier for us to move code from one language to the other as necessary.
Assignee | ||
Comment 1•6 years ago
|
||
This allows JS callers and C++ callers to both create and consumer iterators in their preferred style, while still presenting the appropriate interfaces to callers in the other language. When a C++ caller requires an nsISimpleEnumerator from an XPCWrappedJS object, if that class does not already have a QueryInterface method, it is assumed to be a JS enumerator, and an appropriate wrapper is created. JS callers who wish to implement nsISimpleEnumerator manually, or opt out of the automatic conversions, may implement a QueryInterface method, which automatically opts them out of this behavior.
Assignee | ||
Comment 2•6 years ago
|
||
Updated•6 years ago
|
Priority: -- → P2
Comment 3•6 years ago
|
||
Comment on attachment 9004047 [details] Bug 1486249: Part 1 - Automatically convert JS iterators to nsISimpleEnumerators at XPConnect boundary. r=mccr8 Andrew McCreight [:mccr8] has approved the revision.
Attachment #9004047 -
Flags: review+
Comment 4•6 years ago
|
||
Comment on attachment 9004048 [details] Bug 1486249: Part 2 - Convert JS nsISimpleEnumerator implements to JS enumerators. r=mccr8 Andrew McCreight [:mccr8] has approved the revision.
Attachment #9004048 -
Flags: review+
Assignee | ||
Comment 5•6 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/de02445193810e0fc97767036db4184742ceebac Bug 1486249: Part 1 - Automatically convert JS iterators to nsISimpleEnumerators at XPConnect boundary. r=mccr8 https://hg.mozilla.org/integration/mozilla-inbound/rev/11351ef0d0b0a92db8a26828412f3b6586cccb7a Bug 1486249: Part 2 - Convert JS nsISimpleEnumerator implements to JS enumerators. r=mccr8
Comment 6•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/de0244519381 https://hg.mozilla.org/mozilla-central/rev/11351ef0d0b0
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox64:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in
before you can comment on or make changes to this bug.
Description
•