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 <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
rahulshuklab4u authored and rvagg committed Nov 28, 2018
1 parent 9ab2bcf commit 9e8f91d
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 9e8f91d

Please sign in to comment.