Skip to content
This repository has been archived by the owner on Apr 7, 2021. It is now read-only.

This is a polyfill as opposed to a ponyfill #4

Closed
xenyal opened this issue Sep 9, 2019 · 2 comments
Closed

This is a polyfill as opposed to a ponyfill #4

xenyal opened this issue Sep 9, 2019 · 2 comments

Comments

@xenyal
Copy link

xenyal commented Sep 9, 2019

In https://github.com/sindresorhus/ponyfill, it says that the distinction between polyfill and ponyfill is that the former falls back from the native implementation should it not exist, and use some fallback function. In the case of this library, that seems to still hold true.

I can make a PR to update the README.md to reflect that if you're ok with that

@xenyal xenyal changed the title How is this a ponyfill? This is a polyfill as opposed to a ponyfill Sep 9, 2019
@kevva
Copy link

kevva commented Sep 10, 2019

This is a ponyfill in the sense that it doesn't patch any globals. However, as stated in https://github.com/sindresorhus/ponyfill, it shouldn't use the native API either which we're doing here https://github.com/sindresorhus/is-finite/blob/master/index.js#L4.

Ponyfills should never use the native API, even if available, as it might have slightly different behavior between environments, which can cause bugs.

@xenyal
Copy link
Author

xenyal commented Nov 6, 2019

Ahh touche!

@xenyal xenyal closed this as completed Nov 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants