From 7a0d9d33d05b4649c4a989c37f8d3a156fafe4f6 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 c3cad0e2f49d18..6ec27b9d1d9c05 100644 --- a/lib/internal/util/inspect.js +++ b/lib/internal/util/inspect.js @@ -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) {