aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/builtins/js/ReadableStream.js
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-06-26 06:01:22 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-06-26 06:01:22 -0700
commit77a0f335cb0f18af4e03713583b98e0e1b024b33 (patch)
treef6ed90a992cb46677ab597bba4f6db2fbfcba3b1 /src/bun.js/builtins/js/ReadableStream.js
parent31cfcf2c9f40520dac72530ec62e765d3a0de221 (diff)
downloadbun-77a0f335cb0f18af4e03713583b98e0e1b024b33.tar.gz
bun-77a0f335cb0f18af4e03713583b98e0e1b024b33.tar.zst
bun-77a0f335cb0f18af4e03713583b98e0e1b024b33.zip
wip ReadableStream for HTTP(s) Server
Diffstat (limited to 'src/bun.js/builtins/js/ReadableStream.js')
-rw-r--r--src/bun.js/builtins/js/ReadableStream.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/bun.js/builtins/js/ReadableStream.js b/src/bun.js/builtins/js/ReadableStream.js
index db7cf85a8..f3c11728e 100644
--- a/src/bun.js/builtins/js/ReadableStream.js
+++ b/src/bun.js/builtins/js/ReadableStream.js
@@ -62,14 +62,17 @@ function initializeReadableStream(underlyingSource, strategy)
if (@getByIdDirectPrivate(underlyingSource, "pull") !== @undefined && !isLazy) {
const size = @getByIdDirectPrivate(strategy, "size");
const highWaterMark = @getByIdDirectPrivate(strategy, "highWaterMark");
+ @putByIdDirectPrivate(this, "underlyingSource", @undefined);
@setupReadableStreamDefaultController(this, underlyingSource, size, highWaterMark !== @undefined ? highWaterMark : 1, @getByIdDirectPrivate(underlyingSource, "start"), @getByIdDirectPrivate(underlyingSource, "pull"), @getByIdDirectPrivate(underlyingSource, "cancel"));
return this;
}
if (isDirect) {
+ @putByIdDirectPrivate(this, "underlyingSource", underlyingSource);
@putByIdDirectPrivate(this, "start", () => @createReadableStreamController(this, underlyingSource, strategy));
} else if (isLazy) {
const autoAllocateChunkSize = underlyingSource.autoAllocateChunkSize;
+ @putByIdDirectPrivate(this, "underlyingSource", @undefined);
@putByIdDirectPrivate(this, "start", () => {
@@ -79,6 +82,7 @@ function initializeReadableStream(underlyingSource, strategy)
}
});
} else {
+ @putByIdDirectPrivate(this, "underlyingSource", @undefined);
@putByIdDirectPrivate(this, "start", @undefined);
@createReadableStreamController(this, underlyingSource, strategy);
}