Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e22b8d0

Browse files
starkwangjasnell
authored andcommittedNov 12, 2017
lib: improve the usage of TypeError[INVALID_ARG_TYPE]
The initials of expected in TypeError[ERR_INVALID_ARG_TYPE] are inconsistent. This change is to unify them. PR-URL: #16401 Fixes: #16383 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
1 parent e0113ab commit e22b8d0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+96
-96
lines changed
 

‎lib/_http_client.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ function ClientRequest(options, cb) {
105105
// when createConnection is provided.
106106
} else if (typeof agent.addRequest !== 'function') {
107107
throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'Agent option',
108-
['Agent-like object', 'undefined', 'false']);
108+
['Agent-like Object', 'undefined', 'false']);
109109
}
110110
this.agent = agent;
111111

‎lib/_http_outgoing.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ function write_(msg, chunk, encoding, callback, fromEnd) {
650650

651651
if (!fromEnd && typeof chunk !== 'string' && !(chunk instanceof Buffer)) {
652652
throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'first argument',
653-
['string', 'buffer']);
653+
['string', 'Buffer']);
654654
}
655655

656656

@@ -748,7 +748,7 @@ OutgoingMessage.prototype.end = function end(chunk, encoding, callback) {
748748
if (chunk) {
749749
if (typeof chunk !== 'string' && !(chunk instanceof Buffer)) {
750750
throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'first argument',
751-
['string', 'buffer']);
751+
['string', 'Buffer']);
752752
}
753753
if (!this._header) {
754754
if (typeof chunk === 'string')

0 commit comments

Comments
 (0)
Please sign in to comment.