Bug 1581278 part 2. Add convenience methods for rejecting promises with various types of spec exceptions. r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D46383
This commit is contained in:
Boris Zbarsky
2019-09-19 13:02:39 +00:00
parent d10fd99e3a
commit b92f406f4d
9 changed files with 95 additions and 27 deletions

View File

@@ -7421,11 +7421,9 @@ already_AddRefed<Promise> HTMLMediaElement::SetSinkId(const nsAString& aSinkId,
promise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
break;
case NS_ERROR_NOT_AVAILABLE: {
ErrorResult notFoundError;
notFoundError.ThrowDOMException(
promise->MaybeRejectWithDOMException(
NS_ERROR_DOM_NOT_FOUND_ERR,
NS_LITERAL_CSTRING("The object can not be found here."));
promise->MaybeReject(notFoundError);
"The object can not be found here.");
break;
}
case NS_ERROR_DOM_MEDIA_NOT_ALLOWED_ERR: