http: change DEP0066 to a runtime deprecation · nodejs/node@91748dd (original) (raw)

`@@ -110,10 +110,10 @@ util.inherits(OutgoingMessage, Stream);

`

110

110

``

111

111

``

112

112

`Object.defineProperty(OutgoingMessage.prototype, '_headers', {

`

113

``

`-

get: function() {

`

``

113

`+

get: util.deprecate(function() {

`

114

114

`return this.getHeaders();

`

115

``

`-

},

`

116

``

`-

set: function(val) {

`

``

115

`+

}, 'OutgoingMessage.prototype._headers is deprecated', 'DEP0066'),

`

``

116

`+

set: util.deprecate(function(val) {

`

117

117

`if (val == null) {

`

118

118

`this[outHeadersKey] = null;

`

119

119

`} else if (typeof val === 'object') {

`

`@@ -124,11 +124,11 @@ Object.defineProperty(OutgoingMessage.prototype, '_headers', {

`

124

124

`headers[name.toLowerCase()] = [name, val[name]];

`

125

125

`}

`

126

126

`}

`

127

``

`-

}

`

``

127

`+

}, 'OutgoingMessage.prototype._headers is deprecated', 'DEP0066')

`

128

128

`});

`

129

129

``

130

130

`Object.defineProperty(OutgoingMessage.prototype, '_headerNames', {

`

131

``

`-

get: function() {

`

``

131

`+

get: util.deprecate(function() {

`

132

132

`const headers = this[outHeadersKey];

`

133

133

`if (headers !== null) {

`

134

134

`const out = Object.create(null);

`

`@@ -141,8 +141,8 @@ Object.defineProperty(OutgoingMessage.prototype, '_headerNames', {

`

141

141

`return out;

`

142

142

`}

`

143

143

`return null;

`

144

``

`-

},

`

145

``

`-

set: function(val) {

`

``

144

`+

}, 'OutgoingMessage.prototype._headerNames is deprecated', 'DEP0066'),

`

``

145

`+

set: util.deprecate(function(val) {

`

146

146

`if (typeof val === 'object' && val !== null) {

`

147

147

`const headers = this[outHeadersKey];

`

148

148

`if (!headers)

`

`@@ -154,7 +154,7 @@ Object.defineProperty(OutgoingMessage.prototype, '_headerNames', {

`

154

154

`header[0] = val[keys[i]];

`

155

155

`}

`

156

156

`}

`

157

``

`-

}

`

``

157

`+

}, 'OutgoingMessage.prototype._headerNames is deprecated', 'DEP0066')

`

158

158

`});

`

159

159

``

160

160

``