Skip to content

Commit 9e8f91d

Browse files
rahulshuklab4urvagg
authored andcommitted
util: remove unreachable branch
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]>
1 parent 9ab2bcf commit 9e8f91d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/util/inspect.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ function noPrototypeIterator(ctx, value, recurseTimes) {
475475
} else if (Array.isArray(value)) {
476476
const clazz = Object.getPrototypeOf(value) ||
477477
clazzWithNullPrototype(Array, 'Array');
478-
newVal = new clazz(value.length || 0);
478+
newVal = new clazz(value.length);
479479
} else if (isTypedArray(value)) {
480480
let clazz = Object.getPrototypeOf(value);
481481
if (!clazz) {

0 commit comments

Comments
 (0)