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

Cannot handle big arrays #26

Open
matthewp opened this issue Jan 13, 2017 · 0 comments
Open

Cannot handle big arrays #26

matthewp opened this issue Jan 13, 2017 · 0 comments

Comments

@matthewp
Copy link
Contributor

@rjgotten commented on Fri Jan 13 2017

new can.List( new Array( 10000 ))

results in Uncaught RangeError: Maximum call stack size exceeded

The problem is that array -> List conversion internally ends up using Function.prototype.apply to forward the operation to Array.prototype.push. Just like call, the apply method can only handle so many arguments and going over the limit results in the call stack size being exceeded because of all the arguments being pushed onto the call stack.

This could be resolved by internally splitting the operation into smaller, more managable chunks.
All the List methods that borrow from Array.prototype have this problem, actually.


@matthewp commented on Fri Jan 13 2017

Going to move this to canjs/can-list.

@matthewp matthewp changed the title can.List cannot handle big arrays Cannot handle big arrays Jan 13, 2017
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

1 participant