Skip to content

Remove unnecessary class constructors in the src folder#20684

Merged
calixteman merged 1 commit intomozilla:masterfrom
Snuffleupagus:src-rm-constructors
Feb 20, 2026
Merged

Remove unnecessary class constructors in the src folder#20684
calixteman merged 1 commit intomozilla:masterfrom
Snuffleupagus:src-rm-constructors

Conversation

@Snuffleupagus
Copy link
Collaborator

There's a number of classes where the constructors can be removed completely by instead using class fields, which help to slightly shorten the code.

It seems that unicorn/prefer-class-fields ESLint plugin, see PR #20657, unfortunately isn't able to detect all of these cases.

@codecov-commenter
Copy link

codecov-commenter commented Feb 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.66%. Comparing base (74ab1a9) to head (7fd9397).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #20684   +/-   ##
=======================================
  Coverage   62.66%   62.66%           
=======================================
  Files         169      169           
  Lines      119865   119867    +2     
=======================================
+ Hits        75111    75116    +5     
+ Misses      44754    44751    -3     
Flag Coverage Δ
unittestcli 62.66% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

@mozilla mozilla deleted a comment from moz-tools-bot Feb 18, 2026
@mozilla mozilla deleted a comment from moz-tools-bot Feb 18, 2026
@mozilla mozilla deleted a comment from moz-tools-bot Feb 18, 2026
@mozilla mozilla deleted a comment from moz-tools-bot Feb 18, 2026
@Snuffleupagus
Copy link
Collaborator Author

/botio-linux test

@mozilla mozilla deleted a comment from moz-tools-bot Feb 18, 2026
@mozilla mozilla deleted a comment from moz-tools-bot Feb 18, 2026
There's a number of classes where the constructors can be removed completely by instead using class fields, which help to slightly shorten the code.

It seems that `unicorn/prefer-class-fields` ESLint plugin, see PR 20657, unfortunately isn't able to detect all of these cases.
@Snuffleupagus
Copy link
Collaborator Author

/botio test

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.193.163.58:8877/738841e752ffbad/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/9ec5ec03c2d68e3/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/9ec5ec03c2d68e3/output.txt

Total script time: 42.00 mins

  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 1

Image differences available at: http://54.241.84.105:8877/9ec5ec03c2d68e3/reftest-analyzer.html#web=eq.log

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/738841e752ffbad/output.txt

Total script time: 85.15 mins

  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 1

Image differences available at: http://54.193.163.58:8877/738841e752ffbad/reftest-analyzer.html#web=eq.log

Copy link
Contributor

@calixteman calixteman left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you.

@calixteman calixteman merged commit 970717a into mozilla:master Feb 20, 2026
12 checks passed
@Snuffleupagus Snuffleupagus deleted the src-rm-constructors branch February 20, 2026 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants