From e6e76c5c409d97b036d37a92dc7245b14ea3ac4c Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 24 Dec 2020 14:16:52 -0800 Subject: [PATCH] util: remove dead code from inspect() It is not possible for a ECMAScript class to have a prototype that isn't either a function or null. Test coverage statistics seem to bear out that the code removed here is unreachable. --- lib/internal/util/inspect.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/internal/util/inspect.js b/lib/internal/util/inspect.js index 17ca3f3d2b39ce..4c9def9feaabe0 100644 --- a/lib/internal/util/inspect.js +++ b/lib/internal/util/inspect.js @@ -1078,9 +1078,6 @@ function getClassBase(value, constructor, tag) { const hasName = ObjectPrototypeHasOwnProperty(value, 'name'); const name = (hasName && value.name) || '(anonymous)'; let base = `class ${name}`; - if (constructor !== 'Function' && constructor !== null) { - base += ` [${constructor}]`; - } if (tag !== '' && constructor !== tag) { base += ` [${tag}]`; }