Skip to content

fix: count duplicate keys independently of prototype names - #318

Open
fhgffy wants to merge 1 commit into
npm:mainfrom
fhgffy:fix-prototype-duplicate-keys-20261011
Open

fhgffy wants to merge 1 commit into
npm:mainfrom
fhgffy:fix-prototype-duplicate-keys-20261011

Conversation

@fhgffy

@fhgffy fhgffy commented Oct 10, 2026

Copy link
Copy Markdown

With bracketedArray: false, repeated keys such as constructor and toString currently lose all but their last value. The duplicate counter inherits those names from Object.prototype, so its first increment starts from a function instead of zero.

Use a null-prototype counter, matching the parser's output objects. Tests cover three repeated values and scalar/default-mode controls for four prototype member names. This is separate from #299, which changes duplicate tracking across sections.

Validation: the new tests fail on the unchanged base; npm test passes all five test files with 100% coverage, ESLint, and template checks on Node 24.15.0.

@fhgffy
fhgffy requested a review from a team as a code owner October 10, 2026 20:22
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.

1 participant