aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bun.js/builtins/js/ReadableStreamInternals.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/bun.js/builtins/js/ReadableStreamInternals.js b/src/bun.js/builtins/js/ReadableStreamInternals.js
index fd99ab2ea..15042baa5 100644
--- a/src/bun.js/builtins/js/ReadableStreamInternals.js
+++ b/src/bun.js/builtins/js/ReadableStreamInternals.js
@@ -1866,6 +1866,14 @@ function lazyLoadStream(stream, autoAllocateChunkSize) {
handleResult(val, c, v);
}
+ function callClose(controller) {
+ try {
+ controller.close();
+ } catch(e) {
+ globalThis.reportError(e);
+ }
+ }
+
handleResult = function handleResult(result, controller, view) {
"use strict";
if (result && @isPromise(result)) {
@@ -1887,7 +1895,7 @@ function lazyLoadStream(stream, autoAllocateChunkSize) {
}
if (closer[0] || result === false) {
- @enqueueJob(() => controller.close());
+ @enqueueJob(callClose, controller);
closer[0] = false;
}
};