From 4bb72eb4eecbe711cd3d91683c425600a8d67286 Mon Sep 17 00:00:00 2001 From: Raz Luvaton <16746759+rluvaton@users.noreply.github.com> Date: Thu, 10 Aug 2023 10:15:41 +0300 Subject: [PATCH] stream: cleanup --- lib/internal/webstreams/readablestream.js | 8 ++------ lib/internal/webstreams/transformstream.js | 4 +--- lib/internal/webstreams/writablestream.js | 4 +--- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/lib/internal/webstreams/readablestream.js b/lib/internal/webstreams/readablestream.js index 0fe98299446c02..c157595bfee040 100644 --- a/lib/internal/webstreams/readablestream.js +++ b/lib/internal/webstreams/readablestream.js @@ -1019,6 +1019,7 @@ ObjectDefineProperties(ReadableStreamBYOBReader.prototype, { class ReadableStreamDefaultController { [kType] = 'ReadableStreamDefaultController'; + [kState] = {}; constructor(skipThrowSymbol) { if (skipThrowSymbol !== kSkipThrow) { @@ -1080,12 +1081,7 @@ ObjectDefineProperties(ReadableStreamDefaultController.prototype, { }); function createReadableStreamDefaultController() { - const controller = new ReadableStreamDefaultController(kSkipThrow); - - controller[kType] = 'ReadableStreamDefaultController'; - controller[kState] = {}; - - return controller; + return new ReadableStreamDefaultController(kSkipThrow); } class ReadableByteStreamController { diff --git a/lib/internal/webstreams/transformstream.js b/lib/internal/webstreams/transformstream.js index 311f2ca50be66f..2f32f7d3354fd3 100644 --- a/lib/internal/webstreams/transformstream.js +++ b/lib/internal/webstreams/transformstream.js @@ -336,9 +336,7 @@ ObjectDefineProperties(TransformStreamDefaultController.prototype, { }); function createTransformStreamDefaultController() { - const controller = new TransformStreamDefaultController(kSkipThrow); - controller[kType] = 'TransformStreamDefaultController'; - return controller; + return new TransformStreamDefaultController(kSkipThrow); } const isTransformStream = diff --git a/lib/internal/webstreams/writablestream.js b/lib/internal/webstreams/writablestream.js index 0a83450fab4c2e..65b8e62e174894 100644 --- a/lib/internal/webstreams/writablestream.js +++ b/lib/internal/webstreams/writablestream.js @@ -573,9 +573,7 @@ ObjectDefineProperties(WritableStreamDefaultController.prototype, { }); function createWritableStreamDefaultController() { - const controller = new WritableStreamDefaultController(kSkipThrow); - controller[kType] = 'WritableStreamDefaultController'; - return controller; + return new WritableStreamDefaultController(kSkipThrow); } const isWritableStream =