Closed
Bug 977395
Opened 11 years ago
Closed 11 years ago
Add promise.catch
Categories
(Add-on SDK Graveyard :: General, defect, P2)
Add-on SDK Graveyard
General
Tracking
(Not tracked)
RESOLVED
WORKSFORME
People
(Reporter: bbenvie, Unassigned)
References
Details
(Whiteboard: [good first bug])
DOM Promises have a "catch" method on Promise.prototype. Despite add-on sdk promises being deprecated, we'd like to have API parity. We're also adding "catch" to Promise.jsm as part of bug 941920.
"catch" is simply implemented as `return this.then(undefined, onReject)`.
Priority: -- → P2
Updated•11 years ago
|
Comment 1•11 years ago
|
||
fixing this bug should include a test, and probably replacing uses of:
promise.then(undefined, onReject);
with:
promise.catch(onReject);
throughout the SDK code.
Whiteboard: [good first bug]
Comment 2•11 years ago
|
||
Due to bug Bug 881047, sdk/core/promise will use Promise.jsm promises, so this will be redundant once that lands.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
Reporter | ||
Comment 3•11 years ago
|
||
Don't we still need to do this, just not in the addon-sdk?
Flags: needinfo?(jsantell)
Comment 4•11 years ago
|
||
For Promise.jsm? Doesn't bug 941920 address that?
Flags: needinfo?(jsantell)
Reporter | ||
Comment 5•11 years ago
|
||
(In reply to Jordan Santell [:jsantell] [@jsantell] from comment #4)
> For Promise.jsm? Doesn't bug 941920 address that?
No, for the remaining devtools code that hasn't been ported to use Promise.jsm. Promises from that code will be missing a .catch method, so we can't reliably use it everywhere unless we're sure of the source of a promise.
Comment 6•11 years ago
|
||
Ah, in that case we should probably just do it in the copied promise code in devtools after bug 995184.
Comment 8•11 years ago
|
||
This would be referring to the old sync SDK promises which are no longer in the SDK, but still exist in some components of devtools:
https://github.com/mozilla/gecko-dev/blob/master/toolkit/devtools/deprecated-sync-thenables.js
Not sure it's worthwhile to add, although unsure where all these consumers of this are -- either way, this would be a dev tools bug, not an SDK bug.
Flags: needinfo?(jsantell)
Updated•11 years ago
|
Status: REOPENED → RESOLVED
Closed: 11 years ago → 11 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•