Skip to content
Browse files

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: #26863
Reviewed-By: Colin Ihrig <>
Reviewed-By: Beth Griggs <>
Reviewed-By: Luigi Pinca <>
Reviewed-By: Yongsheng Zhang <>
  • Loading branch information...
Trott authored and targos committed Mar 22, 2019
1 parent 3cae010 commit f263f98d5a9b4fbcffa45c0217c69213ea36781c
Showing with 1 addition and 4 deletions.
  1. +1 −4 lib/internal/console/constructor.js
@@ -466,10 +466,7 @@ const consoleMethods = {
return final([setlike ? iterKey : indexKey, valuesKey], [
return final([iterKey, valuesKey], [getIndexArray(length), values]);

const map = {};

0 comments on commit f263f98

Please sign in to comment.
You can’t perform that action at this time.