console: remove unreachable code · nodejs/node@f263f98 (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Commit f263f98
authored and
committed
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: #26863Reviewed-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
File tree
1 file changed
lines changed
1 file changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -466,10 +466,7 @@ const consoleMethods = { | ||
466 | 466 | values.push(inspect(v)); |
467 | 467 | length++; |
468 | 468 | } |
469 | -return final([setlike ? iterKey : indexKey, valuesKey], [ | |
470 | -getIndexArray(length), | |
471 | -values, | |
472 | -]); | |
469 | +return final([iterKey, valuesKey], [getIndexArray(length), values]); | |
473 | 470 | } |
474 | 471 | |
475 | 472 | const map = {}; |