mirror of
https://github.com/nodejs/node.git
synced 2026-10-28 10:15:07 +08:00
util: remove unreachable inspect code
Convert invariant from if statement to an assertion. The condition is believed to be impossible to trigger. PR-URL: https://github.com/nodejs/node/pull/37941 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
f7b82de993
commit
45cdc134cd
1 file changed
+1
-3
@@ -1412,9 +1412,7 @@ function formatNamespaceObject(keys, ctx, value, recurseTimes) {
|
||||
output[i] = formatProperty(ctx, value, recurseTimes, keys[i],
|
||||
kObjectType);
|
||||
} catch (err) {
|
||||
if (!(isNativeError(err) && err.name === 'ReferenceError')) {
|
||||
throw err;
|
||||
}
|
||||
assert(isNativeError(err) && err.name === 'ReferenceError');
|
||||
// Use the existing functionality. This makes sure the indentation and
|
||||
// line breaks are always correct. Otherwise it is very difficult to keep
|
||||
// this aligned, even though this is a hacky way of dealing with this.
|
||||
|
||||
Reference in new issue
Block a user