File tree Expand file tree Collapse file tree 3 files changed +10
-17
lines changed Expand file tree Collapse file tree 3 files changed +10
-17
lines changed Original file line number Diff line number Diff line change @@ -1132,16 +1132,7 @@ class ReadableByteStreamController {
11321132 enqueue ( chunk ) {
11331133 if ( ! isReadableByteStreamController ( this ) )
11341134 throw new ERR_INVALID_THIS ( 'ReadableByteStreamController' ) ;
1135- if ( ! isArrayBufferView ( chunk ) ) {
1136- throw new ERR_INVALID_ARG_TYPE (
1137- 'chunk' ,
1138- [
1139- 'Buffer' ,
1140- 'TypedArray' ,
1141- 'DataView' ,
1142- ] ,
1143- chunk ) ;
1144- }
1135+ validateBuffer ( chunk ) ;
11451136 const chunkByteLength = ArrayBufferViewGetByteLength ( chunk ) ;
11461137 const chunkBuffer = ArrayBufferViewGetBuffer ( chunk ) ;
11471138 const chunkBufferByteLength = ArrayBufferPrototypeGetByteLength ( chunkBuffer ) ;
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ const {
2626const {
2727 createDeferredPromise,
2828 customInspectSymbol : kInspect ,
29+ kEmptyObject,
2930 kEnumerableProperty,
3031} = require ( 'internal/util' ) ;
3132
@@ -117,8 +118,8 @@ class TransformStream {
117118 */
118119 constructor (
119120 transformer = null ,
120- writableStrategy = { } ,
121- readableStrategy = { } ) {
121+ writableStrategy = kEmptyObject ,
122+ readableStrategy = kEmptyObject ) {
122123 const readableType = transformer ?. readableType ;
123124 const writableType = transformer ?. writableType ;
124125 const start = transformer ?. start ;
@@ -292,7 +293,7 @@ class TransformStreamDefaultController {
292293 }
293294
294295 /**
295- * @param {any } chunk
296+ * @param {any } [ chunk]
296297 */
297298 enqueue ( chunk = undefined ) {
298299 if ( ! isTransformStreamDefaultController ( this ) )
@@ -301,7 +302,7 @@ class TransformStreamDefaultController {
301302 }
302303
303304 /**
304- * @param {any } reason
305+ * @param {any } [ reason]
305306 */
306307 error ( reason = undefined ) {
307308 if ( ! isTransformStreamDefaultController ( this ) )
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ const {
3333const {
3434 createDeferredPromise,
3535 customInspectSymbol : kInspect ,
36+ kEmptyObject,
3637 kEnumerableProperty,
3738 SideEffectFreeRegExpPrototypeSymbolReplace,
3839} = require ( 'internal/util' ) ;
@@ -148,7 +149,7 @@ class WritableStream {
148149 * @param {UnderlyingSink } [sink]
149150 * @param {QueuingStrategy } [strategy]
150151 */
151- constructor ( sink = null , strategy = { } ) {
152+ constructor ( sink = null , strategy = kEmptyObject ) {
152153 const type = sink ?. type ;
153154 if ( type !== undefined )
154155 throw new ERR_INVALID_ARG_VALUE . RangeError ( 'type' , type ) ;
@@ -217,7 +218,7 @@ class WritableStream {
217218 }
218219
219220 /**
220- * @param {any } reason
221+ * @param {any } [ reason]
221222 * @returns {Promise<void> }
222223 */
223224 abort ( reason = undefined ) {
@@ -475,7 +476,7 @@ class WritableStreamDefaultWriter {
475476 }
476477
477478 /**
478- * @param {any } chunk
479+ * @param {any } [ chunk]
479480 * @returns {Promise<void> }
480481 */
481482 write ( chunk = undefined ) {
You can’t perform that action at this time.
0 commit comments