| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7ddd853 commit 6bd15b2
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -701,15 +701,18 @@ function writerReadyPromise(writer) { | |||
| 701 | 701 | } | |
| 702 | 702 | ||
| 703 | 703 | function writableStreamAbort(stream, reason) { | |
| 704 | - const { | ||
| 705 | - state, | ||
| 706 | - controller, | ||
| 707 | - } = stream[kState]; | ||
| 704 | + const { controller } = stream[kState]; | ||
| 705 | + | ||
| 706 | + let state = stream[kState].state; | ||
| 708 | 707 | if (state === 'closed' || state === 'errored') | |
| 709 | 708 | return PromiseResolve(); | |
| 710 | 709 | ||
| 711 | 710 | controller[kState].abortController.abort(reason); | |
| 712 | 711 | ||
| 712 | + state = stream[kState].state; | ||
| 713 | + if (state === 'closed' || state === 'errored') | ||
| 714 | + return PromiseResolve(); | ||
| 715 | + | ||
| 713 | 716 | if (stream[kState].pendingAbortRequest.abort.promise !== undefined) | |
| 714 | 717 | return stream[kState].pendingAbortRequest.abort.promise; | |
| 715 | 718 | ||
@@ -807,7 +810,7 @@ function writableStreamRejectCloseAndClosedPromiseIfNeeded(stream) { | |||
| 807 | 810 | } | |
| 808 | 811 | ||
| 809 | 812 | const closedPromiseCache = stream[kState].closedPromise; | |
| 810 | - if (closedPromiseCache !== undefined) { | ||
| 813 | + if (closedPromiseCache !== undefined && isPromisePending(closedPromiseCache.promise)) { | ||
| 811 | 814 | setPromiseHandled(closedPromiseCache.promise); | |
| 812 | 815 | closedPromiseCache.reject(stream[kState].storedError); | |
| 813 | 816 | } | |
@@ -817,7 +820,7 @@ function writableStreamRejectCloseAndClosedPromiseIfNeeded(stream) { | |||
| 817 | 820 | } = stream[kState]; | |
| 818 | 821 | if (writer !== undefined) { | |
| 819 | 822 | const closeCache = writer[kState].close; | |
| 820 | - if (closeCache !== undefined) { | ||
| 823 | + if (closeCache !== undefined && isPromisePending(closeCache.promise)) { | ||
| 821 | 824 | setPromiseHandled(closeCache.promise); | |
| 822 | 825 | closeCache.reject(stream[kState].storedError); | |
| 823 | 826 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -43,13 +43,5 @@ | |||
| 43 | 43 | }, | |
| 44 | 44 | "transform-streams/invalid-realm.tentative.window.js": { | |
| 45 | 45 | "skip": "Browser-specific test" | |
| 46 | - }, | ||
| 47 | - "writable-streams/aborting.any.js": { | ||
| 48 | - "fail": { | ||
| 49 | - "note": "Recursive abort() call from within an abort algorithm triggers ERR_INTERNAL_ASSERTION", | ||
| 50 | - "expected": [ | ||
| 51 | - "recursive abort() call from abort() aborting signal" | ||
| 52 | - ] | ||
| 53 | - } | ||
| 54 | 46 | } | |
| 55 | 47 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments