Skip to content
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

Remove unused variables #7316

Merged
merged 1 commit into from
May 21, 2016
Merged

Conversation

timvandermeij
Copy link
Contributor

These have been found using gulp lint in combination with the unused: true parameter for JSHint. Unfortunately there are too many false positives to enable this feature, but now that most globals have been removed because of the conversion to UMD the results are much more useful than before.

@timvandermeij
Copy link
Contributor Author

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://107.21.233.14:8877/5a7b1e44b77c039/output.txt

@timvandermeij
Copy link
Contributor Author

/botio test

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://107.22.172.223:8877/30d99a107f82b06/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

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

Live output at: http://107.21.233.14:8877/8892b91c7e5fedf/output.txt

@@ -295,7 +295,6 @@ var PDFViewer = (function pdfViewer() {
var onePageRendered = new Promise(function (resolve) {
resolveOnePageRendered = resolve;
});
this.onePageRendered = onePageRendered;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure I agree with removing this one completely, since there might still be cases where it could be useful. Note that this property is currently available in e.g. viewer components.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright, let's keep this one then. I have updated the commit to put this line back. Note that the test run should still be fine because only this file changed (in /web, outside of the tests).

These have been found using `gulp lint` in combination with the `unused:
true` parameter for JSHint. Unfortunately there are too many false
positives to enable this feature, but now that most globals have been
removed because of the conversion to UMD the results are much more
useful than before.
@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://107.22.172.223:8877/30d99a107f82b06/output.txt

Total script time: 21.48 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/8892b91c7e5fedf/output.txt

Total script time: 27.60 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

@@ -322,10 +322,9 @@ var PDFFindController = (function PDFFindControllerClosure() {
* @param {number} index - match index.
* @param {Array} elements - text layer div elements array.
* @param {number} beginIdx - start index of the div array for the match.
* @param {number} endIdx - end index of the div array for the match.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This was added in commit 2ac7ac4, but never appears to actually have been used, I wonder what the intention was?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yurydelendik Could you comment on this? Was it supposed to be used or can we remove it safely here?

Copy link
Contributor

Choose a reason for hiding this comment

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

We basically want to show entire match. If scrollIntoView would accept multiple elements then showing something elements[beginIdx] through elements[endIdx] will be a better choice. Not sure what will be a right call here. I'll let you decide :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since there is currently no support for that, I would say we remove the unused parameter for now. Once there is support for that, we can re-add it and actually use it in this method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Snuffleupagus Do you agree with the above or do you want me to keep this variable?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't have a strong opinion either way, so do what you want here :-)

@Snuffleupagus
Copy link
Collaborator

r=me, feel free to land this once you've made a decision on #7316 (comment).

@timvandermeij timvandermeij merged commit db46829 into mozilla:master May 21, 2016
@timvandermeij timvandermeij deleted the remove-unused branch May 21, 2016 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants