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

Document and test the recursion limit #46

Open
GrosSacASac opened this issue Feb 18, 2020 · 4 comments
Open

Document and test the recursion limit #46

GrosSacASac opened this issue Feb 18, 2020 · 4 comments

Comments

@GrosSacASac
Copy link
Owner

deepCopy and others are recursive functions, in theory the maximum call stack can be reached if the object is very deep.

Add a warning in the comments. Make manual tests to find out the limits on various engines.

@GrosSacASac
Copy link
Owner Author

I am not interested in implementing a user land iterative approach for performance or complexity reasons

@Raene Raene self-assigned this Mar 11, 2020
@Raene
Copy link
Collaborator

Raene commented Mar 18, 2020

Can i get an example of what is expected. e.g the object it'll take since different objects depth would give different outputs.
So how deep are we going?

@GrosSacASac
Copy link
Owner Author

Object of depth 1

{a:1}

Object of depth 4

{{{{a:1}}}}

The goal is to find when the depth increases too much it could crash depending on the JS engine

@GrosSacASac
Copy link
Owner Author

So you have to generate different inputs programmatically and call deepCopy and see if it crashes

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