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

Use of Number.isInteger limits browser support #350

Closed
jeff-phillips-18 opened this issue Aug 9, 2017 · 7 comments
Closed

Use of Number.isInteger limits browser support #350

jeff-phillips-18 opened this issue Aug 9, 2017 · 7 comments
Labels

Comments

@jeff-phillips-18
Copy link
Contributor

The Number.isInteger() method is not supported in Internet Explorer 11 and earlier versions. Looks like the use was added in version 1.18.11

@spadgett
Copy link

spadgett commented Aug 9, 2017

MDN has this as a polyfill

  return typeof value === 'number' && 
    isFinite(value) && 
    Math.floor(value) === value;

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger#Polyfill

@rodneyrehm
Copy link
Member

This was introduced in #345 and I'm sorry to say that the last couple of months doing ES6-only has made me completely oblivious to this - sorry.

@jeff-phillips-18 @spadgett does either one of you want to send a PR for this?

@rodneyrehm rodneyrehm added the Bug label Aug 9, 2017
@jeff-phillips-18
Copy link
Contributor Author

@rodneyrehm I will send a PR shortly

jeff-phillips-18 added a commit to jeff-phillips-18/URI.js that referenced this issue Aug 9, 2017
jeff-phillips-18 added a commit to jeff-phillips-18/URI.js that referenced this issue Aug 9, 2017
@maiamcc
Copy link

maiamcc commented Aug 9, 2017

(...for anyone who cares (probably very few folks), also experiencing this problem on phantomjs 2.1.1.)

@rodneyrehm
Copy link
Member

fixed in v1.18.12

@ArmorDarks
Copy link

To be honest, not sure this is right thing to do. Support of older browsers should be concern of consumer. I'd rather maintained list of required polyfills for some older (but still used) browsers.

Adding polyfill in own script isn't that hard, and if developer supporting older browsers, he will have file with other IE-related polyfills anyway.

In foresight, I agree that this is very small change, but in future more and more such changes can occur and we might end up with something bloated, like jQuery, packed with dozens of workarounds.

@dreamalligator
Copy link

Thanks @rodneyrehm! Needed this fix for phantomjs as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants