File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -354,7 +354,8 @@ function computeNewHighWaterMark(n) {
354354function howMuchToRead ( n , state ) {
355355 if ( n <= 0 || state . length === 0 && state . ended ) return 0 ;
356356 if ( state . objectMode ) return 1 ;
357- if ( Number . isNaN ( n ) ) {
357+ // Equivalent to Number.isNaN() but works in IE11
358+ if ( n !== n ) {
358359 // Only flow one buffer at a time
359360 if ( state . flowing && state . length ) return state . buffer . head . data . length ; else return state . length ;
360361 }
@@ -941,11 +942,14 @@ Readable.prototype.wrap = function (stream) {
941942 return this ;
942943} ;
943944
944- Readable . prototype [ Symbol . asyncIterator ] = function ( ) {
945- emitExperimentalWarning ( 'Readable[Symbol.asyncIterator]' ) ;
946- if ( ReadableAsyncIterator === undefined ) ReadableAsyncIterator = require ( './internal/streams/async_iterator' ) ;
947- return new ReadableAsyncIterator ( this ) ;
948- } ;
945+ // Only add asyncIterator if Symbol is available
946+ if ( typeof Symbol === 'function' ) {
947+ Readable . prototype [ Symbol . asyncIterator ] = function ( ) {
948+ emitExperimentalWarning ( 'Readable[Symbol.asyncIterator]' ) ;
949+ if ( ReadableAsyncIterator === undefined ) ReadableAsyncIterator = require ( './internal/streams/async_iterator' ) ;
950+ return new ReadableAsyncIterator ( this ) ;
951+ } ;
952+ }
949953
950954Object . defineProperty ( Readable . prototype , 'readableHighWaterMark' , {
951955 // making it explicit this property is not enumerable
You can’t perform that action at this time.
0 commit comments