@@ -110,10 +110,10 @@ util.inherits(OutgoingMessage, Stream);
110110
111111
112112Object . defineProperty ( OutgoingMessage . prototype , '_headers' , {
113- get : function ( ) {
113+ get : util . deprecate ( function ( ) {
114114 return this . getHeaders ( ) ;
115- } ,
116- set : function ( val ) {
115+ } , 'OutgoingMessage.prototype._headers is deprecated' , 'DEP0066' ) ,
116+ set : util . deprecate ( function ( val ) {
117117 if ( val == null ) {
118118 this [ outHeadersKey ] = null ;
119119 } else if ( typeof val === 'object' ) {
@@ -124,11 +124,11 @@ Object.defineProperty(OutgoingMessage.prototype, '_headers', {
124124 headers [ name . toLowerCase ( ) ] = [ name , val [ name ] ] ;
125125 }
126126 }
127- }
127+ } , 'OutgoingMessage.prototype._headers is deprecated' , 'DEP0066' )
128128} ) ;
129129
130130Object . defineProperty ( OutgoingMessage . prototype , '_headerNames' , {
131- get : function ( ) {
131+ get : util . deprecate ( function ( ) {
132132 const headers = this [ outHeadersKey ] ;
133133 if ( headers !== null ) {
134134 const out = Object . create ( null ) ;
@@ -141,8 +141,8 @@ Object.defineProperty(OutgoingMessage.prototype, '_headerNames', {
141141 return out ;
142142 }
143143 return null ;
144- } ,
145- set : function ( val ) {
144+ } , 'OutgoingMessage.prototype._headerNames is deprecated' , 'DEP0066' ) ,
145+ set : util . deprecate ( function ( val ) {
146146 if ( typeof val === 'object' && val !== null ) {
147147 const headers = this [ outHeadersKey ] ;
148148 if ( ! headers )
@@ -154,7 +154,7 @@ Object.defineProperty(OutgoingMessage.prototype, '_headerNames', {
154154 header [ 0 ] = val [ keys [ i ] ] ;
155155 }
156156 }
157- }
157+ } , 'OutgoingMessage.prototype._headerNames is deprecated' , 'DEP0066' )
158158} ) ;
159159
160160
0 commit comments