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

forEach / map is not a function #451

Open
theboredfish opened this issue Sep 28, 2020 · 1 comment
Open

forEach / map is not a function #451

theboredfish opened this issue Sep 28, 2020 · 1 comment

Comments

@theboredfish
Copy link

This one I feel is bordering on help/feature request than an issue, so apologies in advance..

If I pass an iterable into the JS world (in my case, an instance of a class that extends ArrayIterator) then attempting to get forEach or map functions on it throws an error

TypeError: users.forEach is not a function

meaning that i can't have an interoperable lazy loader that works with the same JS code.

Is this actually do-able? I appreciate i can process and pass the items as a 'true' array, but these are database records and could be plentiful. If there are any hooks / magic methods / tricks that can be used to fool V8 into allowing this to work, that'd be awesome.

@stesie
Copy link
Member

stesie commented Oct 2, 2020

Oh, nice catch that the ES6 features are still missing.

And yes, this should be do-able. I haven't (yet) tried whether it'd be even possible to simply reuse the implementations on Array.prototype

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants