@@ -120,7 +120,7 @@ function Readable(options) {
120120// This returns true if the highWaterMark has not been hit yet,
121121// similar to how Writable.write() returns true if you should
122122// write() some more.
123- Readable . prototype . push = function ( chunk , encoding ) {
123+ Readable . prototype . push = function readablePush ( chunk , encoding ) {
124124 var state = this . _readableState ;
125125
126126 if ( ! state . objectMode && typeof chunk === 'string' ) {
@@ -135,12 +135,12 @@ Readable.prototype.push = function(chunk, encoding) {
135135} ;
136136
137137// Unshift should *always* be something directly out of read()
138- Readable . prototype . unshift = function ( chunk ) {
138+ Readable . prototype . unshift = function readableUnshift ( chunk ) {
139139 var state = this . _readableState ;
140140 return readableAddChunk ( this , state , chunk , '' , true ) ;
141141} ;
142142
143- Readable . prototype . isPaused = function ( ) {
143+ Readable . prototype . isPaused = function readableIsPaused ( ) {
144144 return this . _readableState . flowing === false ;
145145} ;
146146
@@ -213,7 +213,7 @@ function needMoreData(state) {
213213}
214214
215215// backwards compatibility.
216- Readable . prototype . setEncoding = function ( enc ) {
216+ Readable . prototype . setEncoding = function readableSetEncoding ( enc ) {
217217 if ( ! StringDecoder )
218218 StringDecoder = require ( 'string_decoder' ) . StringDecoder ;
219219 this . _readableState . decoder = new StringDecoder ( enc ) ;
@@ -268,7 +268,7 @@ function howMuchToRead(n, state) {
268268}
269269
270270// you can override either this method, or the async _read(n) below.
271- Readable . prototype . read = function ( n ) {
271+ Readable . prototype . read = function readableRead ( n ) {
272272 debug ( 'read' , n ) ;
273273 n = parseInt ( n , 10 ) ;
274274 var state = this . _readableState ;
@@ -466,11 +466,11 @@ function maybeReadMore_(stream, state) {
466466// call cb(er, data) where data is <= n in length.
467467// for virtual (non-string, non-buffer) streams, "length" is somewhat
468468// arbitrary, and perhaps not very meaningful.
469- Readable . prototype . _read = function ( n ) {
469+ Readable . prototype . _read = function readable_read ( n ) {
470470 this . emit ( 'error' , new Error ( '_read() is not implemented' ) ) ;
471471} ;
472472
473- Readable . prototype . pipe = function ( dest , pipeOpts ) {
473+ Readable . prototype . pipe = function readablePipe ( dest , pipeOpts ) {
474474 var src = this ;
475475 var state = this . _readableState ;
476476
@@ -613,7 +613,7 @@ Readable.prototype.pipe = function(dest, pipeOpts) {
613613} ;
614614
615615function pipeOnDrain ( src ) {
616- return function ( ) {
616+ return function onPipeOnDrain ( ) {
617617 var state = src . _readableState ;
618618 debug ( 'pipeOnDrain' , state . awaitDrain ) ;
619619 if ( state . awaitDrain )
@@ -626,7 +626,7 @@ function pipeOnDrain(src) {
626626}
627627
628628
629- Readable . prototype . unpipe = function ( dest ) {
629+ Readable . prototype . unpipe = function readableUnpipe ( dest ) {
630630 var state = this . _readableState ;
631631
632632 // if we're not piping anywhere, then do nothing.
@@ -683,7 +683,7 @@ Readable.prototype.unpipe = function(dest) {
683683
684684// set up data events if they are asked for
685685// Ensure readable listeners eventually get something
686- Readable . prototype . on = function ( ev , fn ) {
686+ Readable . prototype . on = function readableOn ( ev , fn ) {
687687 const res = Stream . prototype . on . call ( this , ev , fn ) ;
688688
689689 if ( ev === 'data' ) {
@@ -714,7 +714,7 @@ function nReadingNextTick(self) {
714714
715715// pause() and resume() are remnants of the legacy readable stream API
716716// If the user uses them, then switch into old mode.
717- Readable . prototype . resume = function ( ) {
717+ Readable . prototype . resume = function readableResume ( ) {
718718 var state = this . _readableState ;
719719 if ( ! state . flowing ) {
720720 debug ( 'resume' ) ;
@@ -745,7 +745,7 @@ function resume_(stream, state) {
745745 stream . read ( 0 ) ;
746746}
747747
748- Readable . prototype . pause = function ( ) {
748+ Readable . prototype . pause = function readablePause ( ) {
749749 debug ( 'call pause flowing=%j' , this . _readableState . flowing ) ;
750750 if ( false !== this . _readableState . flowing ) {
751751 debug ( 'pause' ) ;
@@ -764,12 +764,12 @@ function flow(stream) {
764764// wrap an old-style stream as the async data source.
765765// This is *not* part of the readable stream interface.
766766// It is an ugly unfortunate mess of history.
767- Readable . prototype . wrap = function ( stream ) {
767+ Readable . prototype . wrap = function readableWrap ( stream ) {
768768 var state = this . _readableState ;
769769 var paused = false ;
770770
771771 var self = this ;
772- stream . on ( 'end' , function ( ) {
772+ stream . on ( 'end' , function onEnd ( ) {
773773 debug ( 'wrapped end' ) ;
774774 if ( state . decoder && ! state . ended ) {
775775 var chunk = state . decoder . end ( ) ;
@@ -780,7 +780,7 @@ Readable.prototype.wrap = function(stream) {
780780 self . push ( null ) ;
781781 } ) ;
782782
783- stream . on ( 'data' , function ( chunk ) {
783+ stream . on ( 'data' , function onData ( chunk ) {
784784 debug ( 'wrapped data' ) ;
785785 if ( state . decoder )
786786 chunk = state . decoder . write ( chunk ) ;
@@ -802,8 +802,8 @@ Readable.prototype.wrap = function(stream) {
802802 // important when wrapping filters and duplexes.
803803 for ( var i in stream ) {
804804 if ( this [ i ] === undefined && typeof stream [ i ] === 'function' ) {
805- this [ i ] = function ( method ) {
806- return function ( ) {
805+ this [ i ] = function proxyMethods ( method ) {
806+ return function onProxyMethods ( ) {
807807 return stream [ method ] . apply ( stream , arguments ) ;
808808 } ;
809809 } ( i ) ;
@@ -812,13 +812,13 @@ Readable.prototype.wrap = function(stream) {
812812
813813 // proxy certain important events.
814814 const events = [ 'error' , 'close' , 'destroy' , 'pause' , 'resume' ] ;
815- events . forEach ( function ( ev ) {
816- stream . on ( ev , self . emit . bind ( self , ev ) ) ;
817- } ) ;
815+ for ( var ev = 0 ; ev < events . length ; ev ++ ) {
816+ stream . on ( events [ ev ] , self . emit . bind ( self , events [ ev ] ) ) ;
817+ }
818818
819819 // when we try to consume some more bytes, simply unpause the
820820 // underlying stream.
821- self . _read = function ( n ) {
821+ self . _read = function _read ( n ) {
822822 debug ( 'wrapped _read' , n ) ;
823823 if ( paused ) {
824824 paused = false ;
0 commit comments