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

detect and throw on cyclic references #55

Open
skeggse opened this issue Apr 1, 2020 · 0 comments
Open

detect and throw on cyclic references #55

skeggse opened this issue Apr 1, 2020 · 0 comments

Comments

@skeggse
Copy link

skeggse commented Apr 1, 2020

For example:

const cyclic = {};
cyclic.cyclic = cyclic;

// RangeError: Maximum call stack size exceeded
jsesc(cyclic);

I think this is typically done by tracking an array of seen values and pushing/popping when entering/exiting a recursive jsesc call. I might be able to implement if acceptable.

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