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

Improve node.js support #9588

Merged
merged 1 commit into from
Apr 1, 2018
Merged

Improve node.js support #9588

merged 1 commit into from
Apr 1, 2018

Conversation

swftvsn
Copy link
Contributor

@swftvsn swftvsn commented Mar 20, 2018

This change fixes "Unhandled rejection ReferenceError: HTMLElement is not defined" issue that is discussed in more detail in #8489.

Copy link
Contributor

@brendandahl brendandahl left a comment

Choose a reason for hiding this comment

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

You have some lint failures.

@swftvsn
Copy link
Contributor Author

swftvsn commented Mar 21, 2018

Second commit should fix that. On a side note, we all have wide screens even on laptops, so imho capping the line length to 80 chars only makes the code harder to read in most cases. But that's just a matter of personal preference of course, I use 200 on my projects and still have ample space on any display.

// typeof check is needed due to node.js support, see issue #8489
if ((typeof HTMLElement === 'function' &&
imgData instanceof HTMLElement) ||
!imgData.data) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This line is indented with one space too many; let's re-format it like this instead:

if ((typeof HTMLElement === 'function' &&
     imgData instanceof HTMLElement) || !imgData.data) {

Also, please squash the commits; refer to https://github.com/mozilla/pdf.js/wiki/Squashing-Commits.

This change fixes "Unhandled rejection ReferenceError: HTMLElement is not defined" issue that is discussed in more detail in mozilla#8489.
@swftvsn
Copy link
Contributor Author

swftvsn commented Mar 21, 2018

@Snuffleupagus The if is now formatted per spec you gave, and the commits are squashed. Thanks for the excellent squash tutorial! (https://github.com/mozilla/pdf.js/wiki/Squashing-Commits)

@timvandermeij
Copy link
Contributor

/botio test

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://54.215.176.217:8877/8992c86e9aae040/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/2f0d10986e92fac/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/2f0d10986e92fac/output.txt

Total script time: 18.12 mins

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://54.215.176.217:8877/8992c86e9aae040/output.txt

Total script time: 24.27 mins

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

@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

pdfjsbot commented Apr 1, 2018

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/e099d4627e41068/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Apr 1, 2018

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/e099d4627e41068/output.txt

Total script time: 2.63 mins

Published

@timvandermeij timvandermeij merged commit 8887a09 into mozilla:master Apr 1, 2018
@timvandermeij
Copy link
Contributor

Thank you for fixing this!

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.

5 participants