Closed
Bug 1040263
Opened 11 years ago
Closed 11 years ago
Make promises always have a wrapper
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla33
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
Details
Attachments
(1 file)
Then we can use it in their "report that we have no catch handlers" code.
| Assignee | ||
Comment 1•11 years ago
|
||
I assumed we wanted to actually throw on failure to wrap, as opposed to
MOZ_CRASHing, but doing the latter might also be a viable option.
Bobby, could you take a look at the jsapi shenanigans in Create?
Kyle, I think you're most familiar the widest range of the code this is
touching, but let me know if you want me to break up the reviews for this
somehow instead of just dumping it all on you.
Try run: https://tbpl.mozilla.org/?tree=Try&rev=506ad50d9217
| Assignee | ||
Updated•11 years ago
|
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
| Assignee | ||
Updated•11 years ago
|
Attachment #8458170 -
Flags: review?(khuey)
Attachment #8458170 -
Flags: review?(bobbyholley)
Comment 2•11 years ago
|
||
Comment on attachment 8458170 [details] [diff] [review]
Eagerly create and preserve Promise reflectors so we always have them available during unlink
Review of attachment 8458170 [details] [diff] [review]:
-----------------------------------------------------------------
r=me on Promise::Create. Thanks for doing this.
Attachment #8458170 -
Flags: review?(bobbyholley) → review+
Comment on attachment 8458170 [details] [diff] [review]
Eagerly create and preserve Promise reflectors so we always have them available during unlink
Review of attachment 8458170 [details] [diff] [review]:
-----------------------------------------------------------------
Stealing khuey's review per IRC discussion.
Would it make sense to modify the codegen to force Promise returning methods to be annotated with [Throws]?
::: dom/base/SubtleCrypto.cpp
@@ +112,5 @@
>
> already_AddRefed<Promise>
> SubtleCrypto::ExportKey(const nsAString& format,
> + CryptoKey& key,
> + ErrorResult& aRv)
Nit: Indentation.
::: dom/bluetooth2/BluetoothAdapter.cpp
@@ +422,5 @@
> }
> + nsRefPtr<Promise> promise = Promise::Create(global, aRv);
> + if (aRv.Failed()) {
> + return nullptr;
> + }
Nit: Trailing ws.
Attachment #8458170 -
Flags: review?(khuey)
Attachment #8458170 -
Flags: review?(bobbyholley)
Attachment #8458170 -
Flags: review+
Attachment #8458170 -
Flags: review?(bobbyholley)
| Assignee | ||
Comment 4•11 years ago
|
||
> Would it make sense to modify the codegen to force Promise returning methods to be
> annotated with [Throws]?
Hmm. Maybe, yes... Seems annoying. I keep hoping for a better world where we can fail-fatal instead of throwing here. ;)
| Assignee | ||
Comment 5•11 years ago
|
||
Comment 6•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•