Closed
Bug 1176800
Opened 9 years ago
Closed 9 years ago
WebIDL compiler problems for function returning Promise<sequence<(File or Directory)>>
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla42
People
(Reporter: jwatt, Assigned: bzbarsky)
References
Details
Attachments
(4 files)
3.56 KB,
patch
|
Details | Diff | Splinter Review | |
9.13 KB,
text/plain
|
Details | |
4.66 KB,
patch
|
peterv
:
review+
|
Details | Diff | Splinter Review |
1.41 KB,
patch
|
peterv
:
review+
|
Details | Diff | Splinter Review |
I'm having some issues that I would guess are do to with the WebIDL compiler. If I add: Promise<sequence<(File or Directory)>> getFilesAndDirectories(); to HTMLInputElement.webidl and then implement that using: already_AddRefed<Promise> HTMLInputElement::GetFilesAndDirectories(ErrorResult& aRv) { ... Sequence<OwningFileOrDirectory> filesAndDirs; ... } I get a compiler error because OwningFileOrDirectory is not defined. If I add a bogus attribute to the webidl along the lines of: readonly attribute (File or Directory) dummy; then OwningFileOrDirectory gets defined, and the above code compiles. Or it gets further at least. At the point that I try to resolve a promise using: promise->MaybeResolve(filesAndDirs); I get a long compiler error due to "error: no matching function for call to 'ToJSValue'".
Reporter | ||
Comment 1•9 years ago
|
||
Reporter | ||
Comment 2•9 years ago
|
||
Flags: needinfo?(bzbarsky)
Assignee | ||
Comment 3•9 years ago
|
||
Attachment #8625419 -
Flags: review?(peterv)
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Assignee | ||
Comment 4•9 years ago
|
||
Attachment #8625420 -
Flags: review?(peterv)
Assignee | ||
Comment 5•9 years ago
|
||
Yeah, so there are two issues here: 1) We don't look at the types promises are parametrized over to find union types. 2) There is no ToJSValue implementation for unions. The above patches fix this at least for owning unions. If we decide we want a ToJSValue for non-owning ones, we can add that at that point.
Flags: needinfo?(bzbarsky)
Updated•9 years ago
|
Attachment #8625419 -
Flags: review?(peterv) → review+
Updated•9 years ago
|
Attachment #8625420 -
Flags: review?(peterv) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/af4c4a299351 https://hg.mozilla.org/integration/mozilla-inbound/rev/cdc662c32bb2
Comment 7•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/af4c4a299351 https://hg.mozilla.org/mozilla-central/rev/cdc662c32bb2
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox42:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
Updated•9 years ago
|
Target Milestone: mozilla41 → mozilla42
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•