Skip to content

Commit f263f98

Browse files
Trotttargos
authored andcommitted
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 <[email protected]> Reviewed-By: Beth Griggs <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]>
1 parent 3cae010 commit f263f98

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Diff for: lib/internal/console/constructor.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -466,10 +466,7 @@ const consoleMethods = {
466466
values.push(inspect(v));
467467
length++;
468468
}
469-
return final([setlike ? iterKey : indexKey, valuesKey], [
470-
getIndexArray(length),
471-
values,
472-
]);
469+
return final([iterKey, valuesKey], [getIndexArray(length), values]);
473470
}
474471

475472
const map = {};

0 commit comments

Comments
 (0)