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

Add Number.isNaN and Number.isInteger polyfills in compatibility.js, since the Streams polyfill relies on them #8643

Merged
merged 1 commit into from
Jul 13, 2017

Conversation

Snuffleupagus
Copy link
Collaborator

@Snuffleupagus Snuffleupagus commented Jul 13, 2017

Without this, the Streams polyfill will fail in Internet Explorer when the code-paths containing these methods are used.

Please note: This is something that I noticed when testing PR #8617 in IE (all versions). While, in the context of that PR, it would be sufficient to polyfill Number.isNaN I did a quick code search in the Streams polyfill and found Number.isInteger being used as well.

Edit: The patch was updated to remove a spurious blank line, however no functional code changes were made.

@Snuffleupagus
Copy link
Collaborator Author

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/4cc52ee0b041bd2/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/4cc52ee0b041bd2/output.txt

Total script time: 2.36 mins

Published

…js, since the Streams polyfill relies on them

Without this, the Streams polyfill will fail in Internet Explorer when the code-paths containing these methods are used.
Copy link
Contributor

@yurydelendik yurydelendik left a comment

Choose a reason for hiding this comment

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

Looks good. Can we also replace isInt by Number.isInteger and isNaN by Number.isNaN in our src/ code?

@Snuffleupagus
Copy link
Collaborator Author

Looks good. Can we also replace isInt by Number.isInteger and isNaN by Number.isNaN in our src/ code?

That ought to be possible, especially the part about replacing our existing isInt helper function.
However, given that isNaN has slightly different behaviour than Number.isNaN for non-numbers, this part will most likely require very careful analysis of each case to not accidentally alter the logic.

Since this is a blocker for PR #8617, I'm landing this as-is, and we can look into doing the conversion later on. Thank you for the review!

@Snuffleupagus Snuffleupagus merged commit a63015a into mozilla:master Jul 13, 2017
@Snuffleupagus Snuffleupagus deleted the polyfill-Number-isNaN branch July 13, 2017 17:46
movsb pushed a commit to movsb/pdf.js that referenced this pull request Jul 14, 2018
Add `Number.isNaN` and `Number.isInteger` polyfills in compatibility.js, since the Streams polyfill relies on them
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