Skip to content

Commit

Permalink
errors: pass missing message parameter to internalAssert
Browse files Browse the repository at this point in the history
Passes the `message` parameter to `internalAssert` when
`ERR_INVALID_ARG_TYPE` is thrown with invalid arguments.

PR-URL: #19908
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
AyushG3112 authored and jasnell committed Apr 16, 2018
1 parent 17deb5f commit 2a3a66a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/internal/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -959,8 +959,8 @@ E('ERR_VM_MODULE_STATUS', 'Module status %s', Error);
E('ERR_ZLIB_INITIALIZATION_FAILED', 'Initialization failed', Error);

function invalidArgType(name, expected, actual) {
internalAssert(typeof name === 'string');
internalAssert(arguments.length === 3);
internalAssert(arguments.length === 3, 'Exactly 3 arguments are required');
internalAssert(typeof name === 'string', 'name must be a string');

// determiner: 'must be' or 'must not be'
let determiner;
Expand Down

0 comments on commit 2a3a66a

Please sign in to comment.