Closed
Bug 1783664
Opened 2 years ago
Closed 2 years ago
Add a helper method to construct a rejected Promise
Categories
(Core :: DOM: Core & HTML, enhancement)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
105 Branch
Tracking | Status | |
---|---|---|
firefox105 | --- | fixed |
People
(Reporter: saschanaz, Assigned: saschanaz)
References
Details
Attachments
(1 file)
There are multiple lines in dom/streams that creates a rejected promise, e.g. https://searchfox.org/mozilla-central/rev/5644fae86d5122519a0e34ee03117c88c6ed9b47/dom/streams/ReadableStream.cpp#371-377.
RefPtr<Promise> promise = Promise::Create(aStream->GetParentObject(), aRv);
if (aRv.Failed()) {
return nullptr;
}
JS::Rooted<JS::Value> storedError(aCx, aStream->StoredError());
promise->MaybeReject(storedError);
return promise.forget();
A helper function can reduce this to:
JS::Rooted<JS::Value> storedError(aCx, aStream->StoredError());
return Promise::CreateRejected(storedError, aRv);
Assignee | ||
Comment 1•2 years ago
|
||
Pushed by krosylight@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f1587d55f66d Add Promise::CreateRejected r=smaug
Comment 3•2 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 2 years ago
status-firefox105:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 105 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•