зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1243001 part 4. Switch to using MaybeResolve/MaybeReject instead of ResolveInternal/RejectInternal for PromiseWorkerProxy. r=peterv
This is the one part of this set of patches that is actually a substantive change even without SPIDERMONKEY_PROMISE defined. This is being done because I don't want to create ResolveInternal/RejectInternal methods on dom::Promise in the new world. In practice, the difference between MaybeResolve/Reject and ResolveInternal/RejectInternal is that the former will do nothing if the Promise is "resolved" in terms of spec terminology: either settled or locked in to track another Promise. A resolved but still pending Promise can still get fulfilled (what we call ResolveInternal) or rejected when the promise it's tracking settles. So the difference only matters if PromiseWorkerProxy can be working with a "resolved" Promise (in which case what it's doing now would settle it, while what I'm switching to would not). But I don't believe PromiseWorkerProxy ever points to a "resolved" Promise.
This commit is contained in:
Родитель
a1f6df215a
Коммит
a78653548f
|
@ -2547,14 +2547,14 @@ void
|
|||
PromiseWorkerProxy::ResolvedCallback(JSContext* aCx,
|
||||
JS::Handle<JS::Value> aValue)
|
||||
{
|
||||
RunCallback(aCx, aValue, &Promise::ResolveInternal);
|
||||
RunCallback(aCx, aValue, &Promise::MaybeResolve);
|
||||
}
|
||||
|
||||
void
|
||||
PromiseWorkerProxy::RejectedCallback(JSContext* aCx,
|
||||
JS::Handle<JS::Value> aValue)
|
||||
{
|
||||
RunCallback(aCx, aValue, &Promise::RejectInternal);
|
||||
RunCallback(aCx, aValue, &Promise::MaybeReject);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
Загрузка…
Ссылка в новой задаче