Repository navigation
fix(compiler): preserve prototype-named keys during camelCase conversion - #89
Merged
setu4993 merged 1 commit intoOct 9, 2026
Conversation
setu4993
approved these changes
Oct 9, 2026
setu4993
left a comment
Member
There was a problem hiding this comment.
This is great. Thank you, Kenneth!
setu4993
enabled auto-merge (squash)
October 9, 2026 16:34
setu4993
disabled auto-merge
October 9, 2026 16:35
BichengWang
deleted the
BichengWang/contribution-prototype-record-20261008
branch
October 9, 2026 17:29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Preserve arbitrary record keys named
constructor,toString,hasOwnProperty, or__proto__during schema-guided camelCase conversion. Keep declared-field conversion and source ranges intact, with ordinary output-object prototypes and data properties.Why
The schema-shape dictionary inherited
Object.prototype, so an object-valued record entry such asconfiguration.constructor = { customer_name: 'Ada' }was mistaken for a declared Zod schema and crashed. An own__proto__key is also misclassified, causing a crash or incorrect renaming. Preserving that key additionally requires defining an own data property so the output object's legacy prototype setter is not invoked.Fixes #88.
How
Use a prototype-free dictionary for accumulated schema fields and define output entries as enumerable, writable, configurable data properties. Add 21 real-Zod regression cases using the generated
byoClientConfigschema and declared object/record schemas, covering values, prototypes, input preservation, and exact range remapping. No generated schemas or dependencies changed.Test Plan
The final regression tests produce 18 failures on the original converter and pass all 21 cases with the fix. These are local results; upstream CI results are not claimed here.
pnpm test), including 912 compiler and 309 Agentforce tests; existing skips remainpnpm lint && pnpm typecheck); lint reports 12 warnings in unchanged UI files, and changed-file ESLint has nonepnpm format:check)Checklist