зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1604889: Don't rethrow receiveMessage exceptions as NS_ERROR_UNEXPECTED. r=mccr8
When we let the WebIDL callback wrapper report exceptions, it returns an error result of NS_ERROR_UNEXPECTED, which winds up getting set as a promise rejection reason or re-reported to the console. This just causes unnecessary confusion for callers, especially since the error has no location information. Differential Revision: https://phabricator.services.mozilla.com/D57657 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
17ad11c1e1
Коммит
a737bd2c6a
|
@ -265,9 +265,7 @@ void JSWindowActor::ReceiveRawMessage(const JSWindowActorMessageMeta& aMetadata,
|
|||
MOZ_ASSERT_UNREACHABLE();
|
||||
}
|
||||
|
||||
if (NS_WARN_IF(error.Failed())) {
|
||||
MOZ_ALWAYS_TRUE(error.MaybeSetPendingException(cx));
|
||||
}
|
||||
Unused << error.MaybeSetPendingException(cx);
|
||||
}
|
||||
|
||||
void JSWindowActor::ReceiveMessageOrQuery(
|
||||
|
@ -304,7 +302,8 @@ void JSWindowActor::ReceiveMessageOrQuery(
|
|||
RefPtr<MessageListener> messageListener =
|
||||
new MessageListener(self, global, nullptr, nullptr);
|
||||
messageListener->ReceiveMessage(argument, &retval, aRv,
|
||||
"JSWindowActor receive message");
|
||||
"JSWindowActor receive message",
|
||||
MessageListener::eRethrowExceptions);
|
||||
|
||||
// If we have a promise, resolve or reject it respectively.
|
||||
if (promise) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче