Bug 1522339 - Part 1: Do not assert the result of the delete operation when tracking unhandled promise rejections. r=jorendorff
authorTooru Fujisawa <arai_a@mac.com>
Wed, 30 Jan 2019 00:11:54 +0000
changeset 455990 4545916fd898e956b9dec4cdd627f8d22218609c
parent 455989 acdd17a4329e63220f8ce84658b585aeb7bc0d92
child 455991 8ea7e6bb566945f20133d0284bffd317cf2fa5e6
push id35465
push usershindli@mozilla.com
push dateWed, 30 Jan 2019 04:10:12 +0000
treeherdermozilla-central@9e919be867b3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs1522339
milestone67.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 1522339 - Part 1: Do not assert the result of the delete operation when tracking unhandled promise rejections. r=jorendorff Differential Revision: https://phabricator.services.mozilla.com/D17781
js/src/shell/js.cpp
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -1088,17 +1088,18 @@ static bool TrackUnhandledRejections(JSC
       }
       break;
     case JS::PromiseRejectionHandlingState::Handled:
       bool deleted = false;
       if (!SetObject::delete_(cx, sc->unhandledRejectedPromises, promiseVal,
                               &deleted)) {
         return false;
       }
-      MOZ_ASSERT(deleted);
+      // We can't MOZ_ASSERT(deleted) here, because it's possible we failed to
+      // add the promise in the first place, due to OOM.
       break;
   }
 
   return true;
 }
 
 static void ForwardingPromiseRejectionTrackerCallback(
     JSContext* cx, JS::HandleObject promise,