Skip to content

Remove overridden/duplicated [$getChildren] methods - #21736

Open
Snuffleupagus wants to merge 1 commit into
mozilla:masterfrom
Snuffleupagus:XFAObject-getChildren
Open

Remove overridden/duplicated [$getChildren] methods#21736
Snuffleupagus wants to merge 1 commit into
mozilla:masterfrom
Snuffleupagus:XFAObject-getChildren

Conversation

@Snuffleupagus

Copy link
Copy Markdown
Collaborator

Note how the XFAObject class has two separate [$getChildren] methods, which means that the later one will override the former. Looking at the coverage data confirms that the former method is indeed unused.
Note that normally ESLint will catch that sort of thing, but I guess that the name being determined from a Symbol prevents that (since ESLint is only a static code analyser).

Furthermore the XmlObject class extends XFAObject, however it still defines its own [$getChildren] method that is identical to the one in the base class.

@codecov-commenter

codecov-commenter commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.08%. Comparing base (c2bbde1) to head (a611b78).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #21736      +/-   ##
==========================================
- Coverage   90.09%   90.08%   -0.02%     
==========================================
  Files         264      264              
  Lines       67194    67231      +37     
==========================================
+ Hits        60538    60563      +25     
- Misses       6656     6668      +12     
Flag Coverage Δ
browsertest 66.34% <ø> (-0.05%) ⬇️
fonttest 8.99% <ø> (ø)
integrationtest 69.28% <ø> (+<0.01%) ⬆️
unittest 58.23% <ø> (-0.04%) ⬇️
unittestcli 56.60% <ø> (-0.04%) ⬇️

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

☔ View full report in Codecov by Harness.
📢 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.

@Snuffleupagus

Copy link
Copy Markdown
Collaborator Author

/botio browsertest

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.241.84.105:8877/a776a2c5704fad5/output.txt

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/5c7efcb12ba07b5/output.txt

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/a776a2c5704fad5/output.txt

Total script time: 16.51 mins

  • Regression tests: Passed

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/5c7efcb12ba07b5/output.txt

Total script time: 23.48 mins

  • Regression tests: Passed

Note how the `XFAObject` class has *two separate* `[$getChildren]` methods, which means that the later one will override the former. Looking at [the coverage data](https://app.codecov.io/gh/mozilla/pdf.js/commit/022e9588728346cde58088a9925120293af1c8f4/blob/src/core/xfa/xfa_object.js?dropdown=coverage#L330) confirms that the former method is indeed unused.
Note that normally ESLint will catch that sort of thing, but I guess that the name being determined from a `Symbol` prevents that (since ESLint is only a static code analyser).

Furthermore the `XmlObject` class extends `XFAObject`, however it still defines its own `[$getChildren]` method that is *identical* to the one in the base class.
@Snuffleupagus

Copy link
Copy Markdown
Collaborator Author

Rebasing to master, no code changes made.

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.

3 participants