File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -450,7 +450,7 @@ export function Response(bodyInit, options) {
450450 this . type = 'default'
451451 this . status = options . status === undefined ? 200 : options . status
452452 this . ok = this . status >= 200 && this . status < 300
453- this . statusText = ' statusText' in options ? options . statusText : ''
453+ this . statusText = options . statusText === undefined ? '' : '' + options . statusText
454454 this . headers = new Headers ( options . headers )
455455 this . url = options . url || ''
456456 this . _initBody ( bodyInit )
Original file line number Diff line number Diff line change @@ -694,6 +694,16 @@ exercise.forEach(function(exerciseMode) {
694694 assert . equal ( r . headers . get ( 'content-type' ) , 'text/plain' )
695695 } )
696696
697+ test ( 'construct with undefined statusText' , function ( ) {
698+ var r = new Response ( '' , { statusText : undefined } )
699+ assert . equal ( r . statusText , '' )
700+ } )
701+
702+ test ( 'construct with null statusText' , function ( ) {
703+ var r = new Response ( '' , { statusText : null } )
704+ assert . equal ( r . statusText , 'null' )
705+ } )
706+
697707 test ( 'init object as first argument' , function ( ) {
698708 var r = new Response ( {
699709 status : 201 ,
You can’t perform that action at this time.
0 commit comments