Skip to content

assert: remove dead code #58760

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

assert: remove dead code #58760

wants to merge 2 commits into from

Conversation

kt3k
Copy link
Contributor

@kt3k kt3k commented Jun 19, 2025

code variable in getErrMessage util is not initialized anymore since this commit 43c380e and the handling of it is now dead code. This PR removes them.

@nodejs-github-bot nodejs-github-bot added assert Issues and PRs related to the assert subsystem. needs-ci PRs that need a full CI run. labels Jun 19, 2025
@@ -199,7 +198,7 @@ function getErrMessage(message, fn) {
// errors are handled faster.
if (errorStackTraceLimitIsWritable) Error.stackTraceLimit = 0;

if (filename) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is if (filename) { ... } else { return ... } structure above, and this check is unnecessary.

@kt3k kt3k force-pushed the remove-dead-code branch from 74fee45 to b1563bd Compare June 19, 2025 04:35
@kt3k kt3k changed the title refactor(assert): remove dead code assert: remove dead code Jun 19, 2025
Copy link

codecov bot commented Jun 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.12%. Comparing base (214e4db) to head (54b5152).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #58760      +/-   ##
==========================================
- Coverage   90.13%   90.12%   -0.01%     
==========================================
  Files         639      639              
  Lines      188192   188184       -8     
  Branches    36911    36911              
==========================================
- Hits       169634   169608      -26     
- Misses      11287    11318      +31     
+ Partials     7271     7258      -13     
Files with missing lines Coverage Δ
lib/internal/assert/utils.js 92.11% <100.00%> (+2.21%) ⬆️

... and 40 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@legendecas legendecas added the request-ci Add this label to start a Jenkins CI on a PR. label Jun 19, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 19, 2025
@nodejs-github-bot
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assert Issues and PRs related to the assert subsystem. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants