@@ -42,8 +42,7 @@ import {
4242 finished ,
4343 kOnConstructed ,
4444} from 'node-internal:streams_util' ;
45-
46- import process from 'node:process' ;
45+ import { nextTick } from 'node-internal:internal_process' ;
4746
4847import { EventEmitter } from 'node-internal:events' ;
4948
@@ -547,7 +546,7 @@ function emitReadable(stream) {
547546 state . needReadable = false ;
548547 if ( ! state . emittedReadable ) {
549548 state . emittedReadable = true ;
550- process . nextTick ( emitReadable_ , stream ) ;
549+ nextTick ( emitReadable_ , stream ) ;
551550 }
552551}
553552
@@ -578,7 +577,7 @@ function emitReadable_(stream) {
578577function maybeReadMore ( stream , state ) {
579578 if ( ! state . readingMore && state . constructed ) {
580579 state . readingMore = true ;
581- process . nextTick ( maybeReadMore_ , stream , state ) ;
580+ nextTick ( maybeReadMore_ , stream , state ) ;
582581 }
583582}
584583
@@ -643,7 +642,7 @@ Readable.prototype.pipe = function (dest, pipeOpts) {
643642 state . pipes . push ( dest ) ;
644643 const doEnd = ! pipeOpts || pipeOpts . end !== false ;
645644 const endFn = doEnd ? onend : unpipe ;
646- if ( state . endEmitted ) process . nextTick ( endFn ) ;
645+ if ( state . endEmitted ) nextTick ( endFn ) ;
647646 else src . once ( 'end' , endFn ) ;
648647 dest . on ( 'unpipe' , onunpipe ) ;
649648 function onunpipe ( readable , unpipeInfo ) {
@@ -835,7 +834,7 @@ Readable.prototype.on = function (ev, fn) {
835834 if ( state . length ) {
836835 emitReadable ( this ) ;
837836 } else if ( ! state . reading ) {
838- process . nextTick ( nReadingNextTick , this ) ;
837+ nextTick ( nReadingNextTick , this ) ;
839838 }
840839 }
841840 }
@@ -851,7 +850,7 @@ Readable.prototype.removeListener = function (ev, fn) {
851850 // support once('readable', fn) cycles. This means that calling
852851 // resume within the same tick will have no
853852 // effect.
854- process . nextTick ( updateReadableListening , this ) ;
853+ nextTick ( updateReadableListening , this ) ;
855854 }
856855 return res ;
857856} ;
@@ -865,7 +864,7 @@ Readable.prototype.removeAllListeners = function (ev) {
865864 // support once('readable', fn) cycles. This means that calling
866865 // resume within the same tick will have no
867866 // effect.
868- process . nextTick ( updateReadableListening , this ) ;
867+ nextTick ( updateReadableListening , this ) ;
869868 }
870869 return res ;
871870} ;
@@ -908,7 +907,7 @@ Readable.prototype.resume = function () {
908907function resume ( stream , state ) {
909908 if ( ! state . resumeScheduled ) {
910909 state . resumeScheduled = true ;
911- process . nextTick ( resume_ , stream , state ) ;
910+ nextTick ( resume_ , stream , state ) ;
912911 }
913912}
914913
@@ -1225,7 +1224,7 @@ function endReadable(stream) {
12251224 const state = stream . _readableState ;
12261225 if ( ! state . endEmitted ) {
12271226 state . ended = true ;
1228- process . nextTick ( endReadableNT , state , stream ) ;
1227+ nextTick ( endReadableNT , state , stream ) ;
12291228 }
12301229}
12311230
@@ -1240,7 +1239,7 @@ function endReadableNT(state, stream) {
12401239 state . endEmitted = true ;
12411240 stream . emit ( 'end' ) ;
12421241 if ( stream . writable && stream . allowHalfOpen === false ) {
1243- process . nextTick ( endWritableNT , stream ) ;
1242+ nextTick ( endWritableNT , stream ) ;
12441243 } else if ( state . autoDestroy ) {
12451244 // In case of duplex streams we need a way to detect
12461245 // if the writable side is ready for autoDestroy as well.
@@ -1344,8 +1343,8 @@ export function from(Readable, iterable, opts) {
13441343 } ;
13451344 readable . _destroy = function ( error , cb ) {
13461345 close ( error ) . then (
1347- ( ) => process . nextTick ( cb , error ) ,
1348- ( err ) => process . nextTick ( cb , err || error )
1346+ ( ) => nextTick ( cb , error ) ,
1347+ ( err ) => nextTick ( cb , err || error )
13491348 ) ;
13501349 } ;
13511350 async function close ( error ) {
0 commit comments