File tree Expand file tree Collapse file tree 3 files changed +42
-21
lines changed
Expand file tree Collapse file tree 3 files changed +42
-21
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,13 @@ export default class Headers {
6161 this . append ( prop , headers [ prop ] ) ;
6262 }
6363 }
64+
65+ Object . defineProperty ( this , Symbol . toStringTag , {
66+ value : 'Headers' ,
67+ writable : false ,
68+ enumerable : false ,
69+ configurable : true
70+ } ) ;
6471 }
6572
6673 /**
@@ -222,13 +229,13 @@ export default class Headers {
222229 [ Symbol . iterator ] ( ) {
223230 return this . entries ( ) ;
224231 }
225-
226- /**
227- * Tag used by `Object.prototype.toString()`.
228- */
229- get [ Symbol . toStringTag ] ( ) {
230- return 'Headers' ;
231- }
232232}
233233
234+ Object . defineProperty ( Headers . prototype , Symbol . toStringTag , {
235+ value : 'HeadersPrototype' ,
236+ writable : false ,
237+ enumerable : false ,
238+ configurable : true
239+ } ) ;
240+
234241Headers . FOLLOW_SPEC = false ;
Original file line number Diff line number Diff line change @@ -58,6 +58,13 @@ export default class Request extends Body {
5858
5959 // server request options
6060 Object . assign ( this , parsedURL ) ;
61+
62+ Object . defineProperty ( this , Symbol . toStringTag , {
63+ value : 'Request' ,
64+ writable : false ,
65+ enumerable : false ,
66+ configurable : true
67+ } ) ;
6168 }
6269
6370 get url ( ) {
@@ -72,11 +79,11 @@ export default class Request extends Body {
7279 clone ( ) {
7380 return new Request ( this ) ;
7481 }
75-
76- /**
77- * Tag used by `Object.prototype.toString()`.
78- */
79- get [ Symbol . toStringTag ] ( ) {
80- return 'Request' ;
81- }
8282}
83+
84+ Object . defineProperty ( Request . prototype , Symbol . toStringTag , {
85+ value : 'RequestPrototype' ,
86+ writable : false ,
87+ enumerable : false ,
88+ configurable : true
89+ } ) ;
Original file line number Diff line number Diff line change @@ -24,6 +24,13 @@ export default class Response extends Body {
2424 this . status = opts . status || 200 ;
2525 this . statusText = opts . statusText || STATUS_CODES [ this . status ] ;
2626 this . headers = new Headers ( opts . headers ) ;
27+
28+ Object . defineProperty ( this , Symbol . toStringTag , {
29+ value : 'Response' ,
30+ writable : false ,
31+ enumerable : false ,
32+ configurable : true
33+ } ) ;
2734 }
2835
2936 /**
@@ -49,11 +56,11 @@ export default class Response extends Body {
4956 } ) ;
5057
5158 }
52-
53- /**
54- * Tag used by `Object.prototype.toString()`.
55- */
56- get [ Symbol . toStringTag ] ( ) {
57- return 'Response' ;
58- }
5959}
60+
61+ Object . defineProperty ( Response . prototype , Symbol . toStringTag , {
62+ value : 'ResponsePrototype' ,
63+ writable : false ,
64+ enumerable : false ,
65+ configurable : true
66+ } ) ;
You can’t perform that action at this time.
0 commit comments