http: remove pointless use of arguments
PR-URL: https://github.com/nodejs/node/pull/10664 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Родитель
022b53c9de
Коммит
a73ab9de0d
|
@ -382,8 +382,8 @@ OutgoingMessage.prototype.setHeader = function setHeader(name, value) {
|
|||
|
||||
|
||||
OutgoingMessage.prototype.getHeader = function getHeader(name) {
|
||||
if (arguments.length < 1) {
|
||||
throw new Error('"name" argument is required for getHeader(name)');
|
||||
if (typeof name !== 'string') {
|
||||
throw new TypeError('"name" argument must be a string');
|
||||
}
|
||||
|
||||
if (!this._headers) return;
|
||||
|
@ -393,8 +393,8 @@ OutgoingMessage.prototype.getHeader = function getHeader(name) {
|
|||
|
||||
|
||||
OutgoingMessage.prototype.removeHeader = function removeHeader(name) {
|
||||
if (arguments.length < 1) {
|
||||
throw new Error('"name" argument is required for removeHeader(name)');
|
||||
if (typeof name !== 'string') {
|
||||
throw new TypeError('"name" argument must be a string');
|
||||
}
|
||||
|
||||
if (this._header) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче