Bug 1582348 - Allow an Erroring->Closed transition in assertions, as this can happen in WritableStreamFinishInFlightClose. r=arai
authorJeff Walden <jwalden@mit.edu>
Thu, 07 Nov 2019 00:19:39 +0000
changeset 501034 8caeb3eb603ccd6ed3540823f56516b093408a0b
parent 501033 3ba2ca38372d8e90caf3bc186ebdf0408931aa87
child 501035 182220a74df1c5bf85a5f733bf923c5b005d3563
push id99940
push userjwalden@mit.edu
push dateThu, 07 Nov 2019 00:41:19 +0000
treeherderautoland@8caeb3eb603c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersarai
bugs1582348
milestone72.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 1582348 - Allow an Erroring->Closed transition in assertions, as this can happen in WritableStreamFinishInFlightClose. r=arai Differential Revision: https://phabricator.services.mozilla.com/D51969
js/src/builtin/streams/WritableStream.h
--- a/js/src/builtin/streams/WritableStream.h
+++ b/js/src/builtin/streams/WritableStream.h
@@ -169,17 +169,17 @@ class WritableStream : public NativeObje
     MOZ_ASSERT(newState <= Errored);
 
 #ifdef DEBUG
     {
       auto current = state();
       if (current == Writable) {
         MOZ_ASSERT(newState == Closed || newState == Erroring);
       } else if (current == Erroring) {
-        MOZ_ASSERT(newState == Errored);
+        MOZ_ASSERT(newState == Errored || newState == Closed);
       } else if (current == Closed || current == Errored) {
         MOZ_ASSERT_UNREACHABLE(
             "closed/errored stream shouldn't undergo state transitions");
       } else {
         MOZ_ASSERT_UNREACHABLE("smashed state bits?");
       }
     }
 #endif