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 refack committed Nov 20, 2018
1 parent b32c5f0 commit fbc2916
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 @@ -475,7 +475,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 fbc2916

Please sign in to comment.