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 for-of on polyfilled or builtin iterables without Symbol support #11285

Merged

Conversation

nicolo-ribaudo
Copy link
Member

Q                       A
Patch: Bug Fix? Yes
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

This is basically what comes out by "merging" #11268 and #11263 together.

@nicolo-ribaudo nicolo-ribaudo added the PR: Bug Fix 🐛 A type of pull request used for our changelog categories label Mar 19, 2020
@nicolo-ribaudo nicolo-ribaudo added this to Ready for review in Iterables DX Mar 19, 2020

function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }

function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated to this PR: I am thinking if it is worthy to add external-helpers in fixture-runners, so when we update the codes of helpers, we don't have to update fixtures.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely yes. Maybe we should somehow enable external-helpers by default in out input/output tests.

@nicolo-ribaudo nicolo-ribaudo merged commit fa7ec81 into babel:master Mar 19, 2020
Iterables DX automation moved this from Ready for review to Done Mar 19, 2020
@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 Jun 19, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Bug Fix 🐛 A type of pull request used for our changelog categories
Projects
No open projects
Iterables DX
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants