Bug 1751917 - Indicate JS Exception handling to ErrorResult in FetchStreamReader r=saschanaz

Differential Revision: https://phabricator.services.mozilla.com/D136913
This commit is contained in:
Matthew Gaudet 2022-01-25 21:29:18 +00:00
parent 9d410ec1bb
commit a215c65d60

View File

@ -291,6 +291,11 @@ FetchStreamReader::OnOutputStreamReady(nsIAsyncOutputStream* aStream) {
ReadableStreamDefaultReaderRead(aes.cx(), MOZ_KnownLive(mReader), readRequest,
rv);
// We report the (potential) JS Exception via the AutoEntryScript above, as
// was done in the JS Streams implementation as well.
rv.WouldReportJSException();
if (NS_WARN_IF(rv.Failed())) {
// Let's close the stream.
CloseAndRelease(aes.cx(), NS_ERROR_DOM_INVALID_STATE_ERR);