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

support detecting locally defined polyfills #207

Merged
merged 2 commits into from
Mar 24, 2019

Conversation

amilajack
Copy link
Owner

@amilajack amilajack commented Mar 22, 2019

This PR recognizes locally defined polyfills by users and doesn't throw errors in those cases.

This is an error (when targeting IE):

const a = new Set();

This PR allows the above to not be an error:

Declaring polyfills:

class Set {} // A user defined polyfill
const a = new Set();

Importing polyfills:

import Set from 'set-polyfill';
const a = new Set();

This PR does not handle the following cases, which will be addressed in later PR's:

const n = navigator; // navigator is supported
n.serviceWorker // navigator.serviceWorker is supported and should throw
  • add open collective info to readme
  • allow users to locally define polyfills
  • add corresponding test cases

Fixes #192
Closes #195

@amilajack amilajack requested a review from ljharb March 22, 2019 01:41
@amilajack amilajack force-pushed the support-inline-polyfills branch from 4a84394 to a67fcf1 Compare March 22, 2019 01:44
@amilajack amilajack force-pushed the support-inline-polyfills branch from a67fcf1 to 842a271 Compare March 22, 2019 01:45
@amilajack amilajack requested a review from vikr01 March 22, 2019 03:58
@amilajack amilajack merged commit bb3be6e into master Mar 24, 2019
@amilajack amilajack mentioned this pull request Mar 24, 2019
@amilajack amilajack deleted the support-inline-polyfills branch April 6, 2019 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant