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 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.

None yet

1 participant