From 91e2ce25479df7294ebf50e1683cb71282ba160a Mon Sep 17 00:00:00 2001 From: Gerhard Stoebich <18708370+Flarna@users.noreply.github.com> Date: Sat, 11 Jan 2020 22:55:24 +0100 Subject: [PATCH] errors: remove dead code in ERR_INVALID_ARG_TYPE Remove unreachable code. As expected is converted to an Array the 'not ' check will be never executed. --- lib/internal/errors.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/internal/errors.js b/lib/internal/errors.js index ed03b8d47a53a7..f69a4cd82e353c 100644 --- a/lib/internal/errors.js +++ b/lib/internal/errors.js @@ -946,14 +946,7 @@ E('ERR_INVALID_ARG_TYPE', const type = name.includes('.') ? 'property' : 'argument'; msg += `"${name}" ${type} `; } - - // determiner: 'must be' or 'must not be' - if (typeof expected === 'string' && expected.startsWith('not ')) { - msg += 'must not be '; - expected = expected.replace(/^not /, ''); - } else { - msg += 'must be '; - } + msg += 'must be '; const types = []; const instances = [];