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

ObjectHelper.isEqual fails if compared object has cyclic links #279

Closed
matsbryntse opened this issue Feb 10, 2020 · 0 comments
Closed

ObjectHelper.isEqual fails if compared object has cyclic links #279

matsbryntse opened this issue Feb 10, 2020 · 0 comments
Assignees
Labels
bug Something isn't working resolved Fixed but not yet released (available in the nightly builds)
Milestone

Comments

@matsbryntse
Copy link
Member

matsbryntse commented Feb 10, 2020

Such objects cannot be stringified:


case typeA === 'object' && a.constructor.prototype === b.constructor.prototype:
                    return useIsDeeply ? this.isDeeplyEqual(a, b, useIsDeeply) : JSON.stringify(a) === JSON.stringify(b);

Uncaught TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'Object'
    |     property 'items' -> object with constructor 'Array'
    |     index 0 -> object with constructor 'Object'
    --- property 'parent' closes the circle
    at JSON.stringify (<anonymous>)
    at Function.isEqual (ObjectHelper.js:85)
    at isEqual (Model.js:26)
    at Model.js:1008
    at Array.forEach (<anonymous>)
    at TestEx.inSet (Model.js:992)
    at TestEx.set (Model.js:941)
@matsbryntse matsbryntse added the bug Something isn't working label Feb 10, 2020
@isglass isglass self-assigned this Oct 19, 2023
@isglass isglass added ready for review Issue is fixed, the pull request is being reviewed resolved Fixed but not yet released (available in the nightly builds) and removed ready for review Issue is fixed, the pull request is being reviewed labels Oct 19, 2023
@isglass isglass added this to the 5.5.5 milestone Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working resolved Fixed but not yet released (available in the nightly builds)
Projects
None yet
Development

No branches or pull requests

2 participants