From 7576a518b8035a074d2a7a5392673f6693bfe520 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 094240c694ea53..12f7cb9e53ce6b 100644 --- a/lib/internal/util/inspect.js +++ b/lib/internal/util/inspect.js @@ -259,9 +259,8 @@ function strEscape(str) { last = i + 1; } } - if (last === 0) { - result = str; - } else if (last !== i) { + + if (last !== i) { result += str.slice(last); } return `'${result}'`;