Skip to content

Fix diffJson's handling of non-callable toJSON properties - #700

Merged
ExplodingCabbage merged 4 commits into
masterfrom
fix-toJSON-handling
Aug 12, 2026
Merged

Fix diffJson's handling of non-callable toJSON properties#700
ExplodingCabbage merged 4 commits into
masterfrom
fix-toJSON-handling

Conversation

@ExplodingCabbage

Copy link
Copy Markdown
Collaborator

Fixes#699

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes diffJson to match JSON.stringify when an object has a non-callable toJSON property.

Changes:

  • Calls toJSON only when it is a function.
  • Adds regression tests for callable and non-callable properties.
  • Documents the fix for version 9.1.0.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

FileDescription
src/diff/json.tsGuards toJSON invocation by type.
test/diff/json.jsAdds regression coverage.
release-notes.mdRecords the corrected behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ExplodingCabbage
ExplodingCabbage merged commit 84726ca into masterAug 12, 2026
1 check passed
@ExplodingCabbage
ExplodingCabbage deleted the fix-toJSON-handling branch August 12, 2026 15:56
Sign up for freeto 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.

diffJson throws on truthy, non-callable toJSON

2 participants

@ExplodingCabbage