Skip to content

fix: keep special JSON keys as own properties - #6281

Open
yanglbme wants to merge 1 commit into
mainfrom
cursor/fix-json-own-keys-15ab
Open

yanglbme wants to merge 1 commit into
mainfrom
cursor/fix-json-own-keys-15ab

Conversation

@yanglbme

@yanglbme yanglbme commented Nov 4, 2026

Copy link
Copy Markdown
Member

Summary

JSON helpers dropped or crashed on keys such as __proto__, toString, and hasOwnProperty, because bracket assignment and in follow the prototype. Own-property reads and writes keep those keys in the filter, diff, merge, compact, invert, parse, group-by, and two-array object builders.

Type

  • New solution
  • Update solution
  • Docs
  • Other

Checklist

For new or updated solutions:

  • README.md / README_EN.md follow solution/template.md
  • If a Thinking block is added, it sits after the method heading, is non-empty, and matches the code in the repo (naive idea vs constraints, bottleneck, key observation, why this method). Thinking is optional.
  • All languages implement the same algorithm; unrelated Solution.* files and code tabs are unchanged
  • Code is formatted as described in AGENTS.md
Open in Web Open in Cursor 

Bracket assignment and the in operator treat __proto__, toString, and
hasOwnProperty as inherited members. Read and write those keys with
own-property operations so filtering, merging, grouping, and parsing
keep them.
Copilot AI balanced review requested due to automatic review settings November 4, 2026 15:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@idoocs idoocs added core team Issues or pull requests from core team js Issues or Pull requests relate to .js code md Issues or Pull requests relate to .md files ts Issues or Pull requests relate to .ts code labels Nov 4, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core team Issues or pull requests from core team js Issues or Pull requests relate to .js code md Issues or Pull requests relate to .md files ts Issues or Pull requests relate to .ts code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants