Skip to content

Commit eeb4715

Browse files
rahulshuklab4ucodebytere
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 6bd055f commit eeb4715

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
@@ -437,7 +437,7 @@ function noPrototypeIterator(ctx, value, recurseTimes) {
437437
} else if (Array.isArray(value)) {
438438
const clazz = Object.getPrototypeOf(value) ||
439439
clazzWithNullPrototype(Array, 'Array');
440-
newVal = new clazz(value.length || 0);
440+
newVal = new clazz(value.length);
441441
} else if (isTypedArray(value)) {
442442
let clazz = Object.getPrototypeOf(value);
443443
if (!clazz) {

0 commit comments

Comments
 (0)