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

_unsupportedIterableToArray is broken #11494

Closed
1 task done
umanghome opened this issue Apr 27, 2020 · 7 comments · Fixed by #11495
Closed
1 task done

_unsupportedIterableToArray is broken #11494

umanghome opened this issue Apr 27, 2020 · 7 comments · Fixed by #11495
Assignees
Labels
i: bug outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@umanghome
Copy link

Bug Report

  • I would like to work on a fix!

Current Behavior
_unsupportedIterableToArray has a bug where if the iterable is of type Map or Set, it does Array.from on iterable.constructor.name instead of the iterable itself.

Broken Code

if (n === "Map" || n === "Set") return Array.from(n);

This was introduced in #11268.

Expected behavior/code
Array.from should be called on o and not on n.

Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)
N/A

Environment

  • Babel version(s): v7.9.0
  • Node/npm version: v12.15.0
  • OS: macOS 10.15.2
  • Monorepo: no
  • How you are using Babel: loader

Possible Solution
Replace

if (n === "Map" || n === "Set") return Array.from(n);

with

if (n === "Map" || n === "Set") return Array.from(o);
@babel-bot
Copy link
Collaborator

Hey @umanghome! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite."

@nicolo-ribaudo
Copy link
Member

Wow good catch! If you want to open a PR, we can release it in the next patch.

@umanghome
Copy link
Author

@nicolo-ribaudo: My colleague @ChintanAcharya would be working on the fix. Can you assign this to him?

@nicolo-ribaudo
Copy link
Member

Sure! But he has to leave a comment here first. Otherwise, GitHub doesn't show me his username in the assignees dropdown 😛

@ChintanAcharya
Copy link
Contributor

Hey @nicolo-ribaudo! I'll be picking this up.

@umanghome
Copy link
Author

@nicolo-ribaudo When will this be released?

@nicolo-ribaudo
Copy link
Member

I'll release later today.

@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Jul 30, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
i: bug outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants