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

Allow rest/spread on polyfilled or builtin iterables without Symbol support #11268

Merged
merged 2 commits into from Mar 17, 2020

Commits on Mar 16, 2020

  1. Allow rest/spread on polyfilled or builtin iterables when Symbol un…

    …supported
    
    Currently, when `Symbol` is not supported, we allow using rest/spread with:
    - arrays
    - strings
    - arguments
    
    With this PR, it will be also possible to use it with
    - maps
    - sets
    - binary arrays
    
    While in old browsers es6 builtins would still need to be polyfilled, it's way
    easier to polyfill them because `Symbol` cannot be reliably polyfilled.
    
    I didn't use `instanceof` becase:
    - it doesn't work with polyfills not attatched to the global scope
    - when using Babel to load polyfills, it would force the inclusion of `Map` and `Set` polyfills even if they are not used
    
    Downside: the current approach of relying on `toString || construcor.name` doesn't work with subclasses.
    nicolo-ribaudo committed Mar 16, 2020
    Copy the full SHA
    3e4f3bd View commit details
    Browse the repository at this point in the history

Commits on Mar 17, 2020

  1. Copy the full SHA
    4bbc468 View commit details
    Browse the repository at this point in the history