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

fix: handle circular refs in errors #82

Merged
merged 2 commits into from
Oct 7, 2024
Merged

fix: handle circular refs in errors #82

merged 2 commits into from
Oct 7, 2024

Conversation

43081j
Copy link
Contributor

@43081j 43081j commented Oct 7, 2024

Fixes chaijs/chai#1645

We already handle circular references in objects, but do not do the same for Error objects. This change adds the same seen logic to error inspection as we have in object inspection.

Also adds cause to the list of "built in" properties

Fixes chaijs/chai#1645

We already handle circular references in objects, but do not do the same
for `Error` objects. This change adds the same `seen` logic to error
inspection as we have in object inspection.
Copy link
Member

@koddsson koddsson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍🏻

src/error.ts Outdated Show resolved Hide resolved
@43081j 43081j merged commit 983691f into main Oct 7, 2024
6 checks passed
@43081j 43081j deleted the circular-errors branch October 7, 2024 09:45
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

Successfully merging this pull request may close these issues.

Maximum call stack size exceeded when assertion fails with cyclic references of Error.cause
2 participants