aboutsummaryrefslogtreecommitdiff
path: root/src/js/builtins/ReadableStream.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/js/builtins/ReadableStream.ts')
-rw-r--r--src/js/builtins/ReadableStream.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/js/builtins/ReadableStream.ts b/src/js/builtins/ReadableStream.ts
index 08131130d..5a5b7e119 100644
--- a/src/js/builtins/ReadableStream.ts
+++ b/src/js/builtins/ReadableStream.ts
@@ -24,7 +24,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-export function initializeReadableStream(this: any, underlyingSource: UnderlyingSource, strategy: any) {
+export function initializeReadableStream(
+ this: ReadableStream,
+ underlyingSource: UnderlyingSource,
+ strategy: QueuingStrategy,
+) {
if (underlyingSource === undefined)
underlyingSource = { $bunNativeType: 0, $bunNativePtr: 0, $lazy: false } as UnderlyingSource;
if (strategy === undefined) strategy = {};
@@ -47,6 +51,8 @@ export function initializeReadableStream(this: any, underlyingSource: Underlying
$putByIdDirectPrivate(this, "bunNativeType", $getByIdDirectPrivate(underlyingSource, "bunNativeType") ?? 0);
$putByIdDirectPrivate(this, "bunNativePtr", $getByIdDirectPrivate(underlyingSource, "bunNativePtr") ?? 0);
+ $putByIdDirectPrivate(this, "asyncContext", $getInternalField($asyncContext, 0));
+
const isDirect = underlyingSource.type === "direct";
// direct streams are always lazy
const isUnderlyingSourceLazy = !!underlyingSource.$lazy;