@@ -348,14 +348,16 @@ var standaloneTests = [
348348 // verification that error event implies unpipe call
349349 assert . ok ( err ) ;
350350 assert . ok ( unpiped , 'req was unpiped' ) ;
351- assert . equal ( req . _readableState . flowing , false , 'req not flowing' ) ;
352- assert . equal ( req . _readableState . pipesCount , 0 , 'req has 0 pipes' ) ;
351+
352+ assert . ok ( ! isReadableStreamFlowing ( req ) , 'req not flowing' )
353+ assert . equal ( getReadableStreamPipeCount ( req ) , 0 , 'req has 0 pipes' )
353354 cb ( ) ;
354355 } )
355356
356357 form . parse ( req )
357- assert . equal ( req . _readableState . flowing , true , 'req flowing' ) ;
358- assert . equal ( req . _readableState . pipesCount , 1 , 'req has 1 pipe' ) ;
358+
359+ assert . ok ( isReadableStreamFlowing ( req ) , 'req flowing' )
360+ assert . equal ( getReadableStreamPipeCount ( req ) , 1 , 'req has 1 pipe' )
359361 }
360362 } ,
361363 {
@@ -1392,6 +1394,18 @@ function computeSha1(o) {
13921394 } ;
13931395}
13941396
1397+ function getReadableStreamPipeCount ( stream ) {
1398+ var count = stream . _readableState . pipesCount
1399+
1400+ return typeof count !== 'number'
1401+ ? stream . _readableState . pipes . length
1402+ : count
1403+ }
1404+
1405+ function isReadableStreamFlowing ( stream ) {
1406+ return Boolean ( stream . _readableState . flowing )
1407+ }
1408+
13951409function uploadFixture ( server , path , cb ) {
13961410 server . once ( 'request' , function ( req , res ) {
13971411 var done = false
0 commit comments