Skip to content

Commit

Permalink
util: remove unreachable branch
Browse files Browse the repository at this point in the history
Re-defining the array length will always set to 0.
Hence, the code branch can not be covered.

PR-URL: #24447
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Weijia Wang <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
rahulshuklab4u authored and codebytere committed Jan 29, 2019
1 parent 6bd055f commit eeb4715
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/internal/util/inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ function noPrototypeIterator(ctx, value, recurseTimes) {
} else if (Array.isArray(value)) {
const clazz = Object.getPrototypeOf(value) ||
clazzWithNullPrototype(Array, 'Array');
newVal = new clazz(value.length || 0);
newVal = new clazz(value.length);
} else if (isTypedArray(value)) {
let clazz = Object.getPrototypeOf(value);
if (!clazz) {
Expand Down

0 comments on commit eeb4715

Please sign in to comment.