diff options
author | Rich Trott <rtrott@gmail.com> | 2019-03-22 20:07:29 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-03-25 00:58:18 +0300 |
commit | 26f8af9feba624c418be1ec270c8de30bf6ee512 (patch) | |
tree | 7f19b92dfc984114d1e90219229359723364aef1 /lib/internal/console | |
parent | 4a40ea6894ec758fe7ede70439aaddee20cf398b (diff) |
console: remove unreachable code
The current version of lib/internal/console/constructor.js includes this
as part of line 470:
setlike ? iterKey : indexKey
However, `setlike` is guaranteed to be true because we are inside of an
`if` block (starting on line 463) that explicitly checks that `setlike`
is true.
Coverage reporting confirms that `setliked` is always true when it is
reached in our tests.
Remove the ternary as the value provided will always be `iterKey`.
PR-URL: https://github.com/nodejs/node/pull/26863
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Diffstat (limited to 'lib/internal/console')
-rw-r--r-- | lib/internal/console/constructor.js | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/internal/console/constructor.js b/lib/internal/console/constructor.js index 7c141ce8987..0b73d384267 100644 --- a/lib/internal/console/constructor.js +++ b/lib/internal/console/constructor.js @@ -468,10 +468,7 @@ const consoleMethods = { values.push(inspect(v)); length++; } - return final([setlike ? iterKey : indexKey, valuesKey], [ - getIndexArray(length), - values, - ]); + return final([iterKey, valuesKey], [getIndexArray(length), values]); } const map = {}; |