Bug 1503901 - Cleanup exceptions during the shutdown of FetchStreamReader, r=bz
authorAndrea Marchesini <amarchesini@mozilla.com>
Thu, 01 Nov 2018 17:57:38 +0100
changeset 500427 5c7f510cbcf4a1d42510860f6174e7813eb3d2b3
parent 500426 36cce9ce1de9b932e88a934981963e5b7091dcce
child 500428 5a2bec53f188bbae37b3a9f1dca68dc96f401930
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1503901
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1503901 - Cleanup exceptions during the shutdown of FetchStreamReader, r=bz
dom/fetch/FetchStreamReader.cpp
--- a/dom/fetch/FetchStreamReader.cpp
+++ b/dom/fetch/FetchStreamReader.cpp
@@ -126,16 +126,19 @@ FetchStreamReader::CloseAndRelease(JSCon
     if (ToJSValue(aCx, error, &errorValue)) {
       JS::Rooted<JSObject*> reader(aCx, mReader);
       // It's currently safe to cancel an already closed reader because, per the
       // comments in ReadableStream::cancel() conveying the spec, step 2 of
       // 3.4.3 that specified ReadableStreamCancel is: If stream.[[state]] is
       // "closed", return a new promise resolved with undefined.
       JS::ReadableStreamReaderCancel(aCx, reader, errorValue);
     }
+
+    // We don't want to propagate exceptions during the cleanup.
+    JS_ClearPendingException(aCx);
   }
 
   mStreamClosed = true;
 
   mGlobal = nullptr;
 
   mPipeOut->CloseWithStatus(aStatus);
   mPipeOut = nullptr;