File tree 2 files changed +1
-29
lines changed
2 files changed +1
-29
lines changed Original file line number Diff line number Diff line change @@ -31,10 +31,7 @@ const getStreamIterable = async function * (stream) {
31
31
handleStreamEnd ( stream , controller , state ) ;
32
32
33
33
try {
34
- for await ( const [ chunk ] of nodeImports . events . on ( stream , 'data' , {
35
- signal : controller . signal ,
36
- highWatermark : stream . readableHighWaterMark ,
37
- } ) ) {
34
+ for await ( const [ chunk ] of nodeImports . events . on ( stream , 'data' , { signal : controller . signal } ) ) {
38
35
yield chunk ;
39
36
}
40
37
} catch ( error ) {
Original file line number Diff line number Diff line change 1
1
import { once } from 'node:events' ;
2
- import { version } from 'node:process' ;
3
2
import { Readable , Duplex } from 'node:stream' ;
4
3
import { scheduler , setTimeout as pSetTimeout } from 'node:timers/promises' ;
5
4
import test from 'ava' ;
@@ -267,30 +266,6 @@ const testMultipleReads = async (t, wait) => {
267
266
test ( 'Handles multiple successive fast reads' , testMultipleReads , ( ) => scheduler . yield ( ) ) ;
268
267
test ( 'Handles multiple successive slow reads' , testMultipleReads , ( ) => pSetTimeout ( 100 ) ) ;
269
268
270
- // The `highWaterMark` option was added to `once()` by Node 20.
271
- // See https://github.com/nodejs/node/pull/41276
272
- const nodeMajor = version . split ( '.' ) [ 0 ] . slice ( 1 ) ;
273
- if ( nodeMajor >= 20 ) {
274
- test ( 'Pause stream when too much data at once' , async t => {
275
- const stream = new Readable ( {
276
- read : onetime ( function ( ) {
277
- this . push ( '.' ) ;
278
- this . push ( '.' ) ;
279
- this . push ( '.' ) ;
280
- this . push ( '.' ) ;
281
- this . push ( null ) ;
282
- } ) ,
283
- highWaterMark : 2 ,
284
- } ) ;
285
- const [ result ] = await Promise . all ( [
286
- getStream ( stream ) ,
287
- once ( stream , 'pause' ) ,
288
- ] ) ;
289
- t . is ( result , '....' ) ;
290
- assertSuccess ( t , stream , Readable ) ;
291
- } ) ;
292
- }
293
-
294
269
test ( 'Can call twice at the same time' , async t => {
295
270
const stream = Readable . from ( fixtureMultiString ) ;
296
271
const [ result , secondResult ] = await Promise . all ( [
You can’t perform that action at this time.
0 commit comments