aboutsummaryrefslogtreecommitdiff
path: root/src/javascript/jsc/bindings/builtins/js/ReadableByteStreamInternals.js
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-06-15 07:17:42 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-06-15 07:17:42 -0700
commit56e88fb4dd06e07569ddc3861e2e8e21f71e45b8 (patch)
treea355df05ffd4665916c3eefb8370e154d1128f72 /src/javascript/jsc/bindings/builtins/js/ReadableByteStreamInternals.js
parentd93f09331394148441d142930fea236a9fd73c5c (diff)
downloadbun-jarred/direct.tar.gz
bun-jarred/direct.tar.zst
bun-jarred/direct.zip
direct streams mostly workjarred/direct
Diffstat (limited to '')
-rw-r--r--src/javascript/jsc/bindings/builtins/js/ReadableByteStreamInternals.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/javascript/jsc/bindings/builtins/js/ReadableByteStreamInternals.js b/src/javascript/jsc/bindings/builtins/js/ReadableByteStreamInternals.js
index 372c980a1..f59a7bdbc 100644
--- a/src/javascript/jsc/bindings/builtins/js/ReadableByteStreamInternals.js
+++ b/src/javascript/jsc/bindings/builtins/js/ReadableByteStreamInternals.js
@@ -61,12 +61,20 @@ function privateInitializeReadableByteStreamController(stream, underlyingByteSou
@putByIdDirectPrivate(this, "cancel", @readableByteStreamControllerCancel);
@putByIdDirectPrivate(this, "pull", @readableByteStreamControllerPull);
+ if (@getByIdDirectPrivate(underlyingByteSource, "lazy") === true) {
+ @putByIdDirectPrivate(this, "start", () => @readableStreamByteStreamControllerStart(this));
+ } else {
+ @putByIdDirectPrivate(this, "start", @undefined);
+ @readableStreamByteStreamControllerStart(this);
+ }
+
return this;
}
function readableStreamByteStreamControllerStart(controller) {
"use strict";
-
+ @putByIdDirectPrivate(controller, "start", @undefined);
+
if (@getByIdDirectPrivate(controller, "started") !== -1)
return;
@@ -84,6 +92,7 @@ function readableStreamByteStreamControllerStart(controller) {
});
}
+
function privateInitializeReadableStreamBYOBRequest(controller, view)
{
"use strict";