From eeb4715a566435b69507ccec10984f328c899953 Mon Sep 17 00:00:00 2001 From: rahulshuklab4u Date: Sat, 17 Nov 2018 21:20:51 +0530 Subject: [PATCH] util: remove unreachable branch Re-defining the array length will always set to 0. Hence, the code branch can not be covered. PR-URL: https://github.com/nodejs/node/pull/24447 Reviewed-By: Anna Henningsen Reviewed-By: Refael Ackermann Reviewed-By: Weijia Wang Reviewed-By: James M Snell --- lib/internal/util/inspect.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/util/inspect.js b/lib/internal/util/inspect.js index 12f7cb9e53ce6b..444a07d23f7771 100644 --- a/lib/internal/util/inspect.js +++ b/lib/internal/util/inspect.js @@ -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) {