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

Array.from doesn't work with some iterables #359

Open
ecolui opened this issue Apr 25, 2023 · 1 comment
Open

Array.from doesn't work with some iterables #359

ecolui opened this issue Apr 25, 2023 · 1 comment

Comments

@ecolui
Copy link

ecolui commented Apr 25, 2023

Consider the following code.

const l_array = ['a', 'b', 'c'];
const l_it = l_array[Symbol.iterator]();            //convert to iterator
var result = Array.from(l_it);

When that code is called from JavaScript's native Array.from, the result is ['a', 'b', 'c']

When that function is called from prototype.js Array.from, the result is []
https://github.com/prototypejs/prototype/blob/master/src/prototype/lang/array.js

@timkingman
Copy link

This also breaks Google Maps (new today or very recently?). Removing the Array.from = $A line fixes Google Maps, but I'm not sure if I've broken any of my other ancient Prototype code.

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

No branches or pull requests

2 participants