@@ -77,7 +77,8 @@ class Response {
77
77
78
78
webidl . argumentLengthCheck ( arguments , 1 , { header : 'Response.redirect' } )
79
79
80
- url = webidl . converters . USVString ( url )
80
+ // DOMString is used because the value is converted to a USVString in `new URL()`.
81
+ url = webidl . converters . DOMString ( url )
81
82
status = webidl . converters [ 'unsigned short' ] ( status )
82
83
83
84
// 1. Let parsedURL be the result of parsing url with current settings
@@ -120,7 +121,7 @@ class Response {
120
121
}
121
122
122
123
if ( body !== null ) {
123
- body = webidl . converters . BodyInit ( body )
124
+ body = webidl . converters . BodyInit_DOMString ( body )
124
125
}
125
126
126
127
init = webidl . converters . ResponseInit ( init )
@@ -516,9 +517,10 @@ webidl.converters.URLSearchParams = webidl.interfaceConverter(
516
517
)
517
518
518
519
// https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit
519
- webidl . converters . XMLHttpRequestBodyInit = function ( V ) {
520
+
521
+ webidl . converters . XMLHttpRequestBodyInit_DOMString = function ( V ) {
520
522
if ( typeof V === 'string' ) {
521
- return webidl . converters . USVString ( V )
523
+ return webidl . converters . DOMString ( V )
522
524
}
523
525
524
526
if ( isBlobLike ( V ) ) {
@@ -541,7 +543,7 @@ webidl.converters.XMLHttpRequestBodyInit = function (V) {
541
543
}
542
544
543
545
// https://fetch.spec.whatwg.org/#bodyinit
544
- webidl . converters . BodyInit = function ( V ) {
546
+ webidl . converters . BodyInit_DOMString = function ( V ) {
545
547
if ( V instanceof ReadableStream ) {
546
548
return webidl . converters . ReadableStream ( V )
547
549
}
@@ -552,7 +554,7 @@ webidl.converters.BodyInit = function (V) {
552
554
return V
553
555
}
554
556
555
- return webidl . converters . XMLHttpRequestBodyInit ( V )
557
+ return webidl . converters . XMLHttpRequestBodyInit_DOMString ( V )
556
558
}
557
559
558
560
webidl . converters . ResponseInit = webidl . dictionaryConverter ( [
0 commit comments