From 531d854458ed01d8c80f5ecbfc3837759b7fee11 Mon Sep 17 00:00:00 2001 From: kiyomizumia Date: Tue, 6 Nov 2018 16:57:19 +0000 Subject: [PATCH] util: deleted unreachable code from util.inspect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/24187 Reviewed-By: Сковорода Никита Андреевич Reviewed-By: James M Snell Reviewed-By: Anna Henningsen --- lib/internal/util/inspect.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/internal/util/inspect.js b/lib/internal/util/inspect.js index ca06064085422c..bd35c4bb3b80f4 100644 --- a/lib/internal/util/inspect.js +++ b/lib/internal/util/inspect.js @@ -297,9 +297,8 @@ function strEscape(str) { last = i + 1; } } - if (last === 0) { - result = str; - } else if (last !== i) { + + if (last !== i) { result += str.slice(last); } return addQuotes(result, singleQuote);