@@ -349,12 +349,21 @@ function computeNewHighWaterMark(n) {
349349 return n ;
350350}
351351
352+ // IE11 lacks Number.isNaN
353+ function properIsNaN ( value ) {
354+ if ( typeof Number . isNaN === 'function' ) {
355+ return Number . isNaN ( value ) ;
356+ } else {
357+ return value !== value ;
358+ }
359+ }
360+
352361// This function is designed to be inlinable, so please take care when making
353362// changes to the function body.
354363function howMuchToRead ( n , state ) {
355364 if ( n <= 0 || state . length === 0 && state . ended ) return 0 ;
356365 if ( state . objectMode ) return 1 ;
357- if ( Number . isNaN ( n ) ) {
366+ if ( properIsNaN ( n ) ) {
358367 // Only flow one buffer at a time
359368 if ( state . flowing && state . length ) return state . buffer . head . data . length ; else return state . length ;
360369 }
@@ -941,11 +950,14 @@ Readable.prototype.wrap = function (stream) {
941950 return this ;
942951} ;
943952
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- } ;
953+ // Only add asyncIterator if Symbol is available
954+ if ( typeof Symbol === 'function' ) {
955+ Readable . prototype [ Symbol . asyncIterator ] = function ( ) {
956+ emitExperimentalWarning ( 'Readable[Symbol.asyncIterator]' ) ;
957+ if ( ReadableAsyncIterator === undefined ) ReadableAsyncIterator = require ( './internal/streams/async_iterator' ) ;
958+ return new ReadableAsyncIterator ( this ) ;
959+ } ;
960+ }
949961
950962Object . defineProperty ( Readable . prototype , 'readableHighWaterMark' , {
951963 // making it explicit this property is not enumerable
0 commit comments