[New] stringify: throw on cycles, instead of an infinite loop#393
Merged
ljharb merged 2 commits intoljharb:masterfrom Mar 17, 2021
Poyoman39:master
Merged
[New] stringify: throw on cycles, instead of an infinite loop#393ljharb merged 2 commits intoljharb:masterfrom Poyoman39:master
stringify: throw on cycles, instead of an infinite loop#393ljharb merged 2 commits intoljharb:masterfrom
Poyoman39:master
Conversation
Codecov Report
@@ Coverage Diff @@
## master #393 +/- ##
==========================================
- Coverage 99.85% 98.98% -0.87%
==========================================
Files 8 8
Lines 1363 1378 +15
Branches 166 167 +1
==========================================
+ Hits 1361 1364 +3
- Misses 2 14 +12
Continue to review full report at Codecov.
|
ljharb
previously requested changes
Jan 27, 2021
Owner
ljharb
left a comment
There was a problem hiding this comment.
Thanks!
We'd definitely need tests for this; but i'm not sure a max depth is a proper fix for the solution - typically it's done by recognizing "seen objects" in some kind of WeakMap/Map/array solution.
Author
|
Ok i will provide a Map solution ;) |
Fixes #367. Co-authored-by: Jordan Harband <[email protected]> Co-authored-by: Johan <[email protected]>
stringify: throw on cycles, instead of an infinite loop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix issue #367 with "maxDepth" option.