Repository navigation
fix(ts): preserve literal __proto__ fields and strip nulls in nested arrays - #542
Open
Tejas Lamba (TejasLamba2006) wants to merge 1 commit into
Open
Tejas Lamba (TejasLamba2006) wants to merge 1 commit into
Tejas Lamba (TejasLamba2006) wants to merge 1 commit into
Conversation
Tejas Lamba (TejasLamba2006)
force-pushed
the
consolidate-proto-and-stripnulls
branch
from
November 28, 2026 17:41
cbf79d6 to
03cb801
Compare
…s in stripNulls Emit a computed property name ["__proto__"] so an own data property is preserved. Test string, object, and null values against the JSON program interpreter. Recurse into the filtered array in stripNulls. Cover nested and flat arrays through the TypeScript JSON validator.
Tejas Lamba (TejasLamba2006)
force-pushed
the
consolidate-proto-and-stripnulls
branch
from
December 2, 2026 06:09
03cb801 to
bf1a147
Compare
Tejas Lamba (TejasLamba2006)
marked this pull request as ready for review
December 2, 2026 06:09
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.
Consolidates the two TypeScript fixes discussed in #497 against current
main.Changes
typescript/src/ts/program.ts: Emit a computed property name (["__proto__"]) increateModuleTextFromProgramso literal__proto__fields remain own data properties instead of invoking the prototype setter.typescript/src/typechat.ts: Updatevaluealongsideobj[k]when filteringnullentries instripNullsso recursion cleans nested arrays as well.typescript/test/program.test.ts: Execute the generated module (stripTypeScriptTypes+node:vm) for string, object, andnullvalues, verifying computed key emission, own__proto__preservation, JSON serialization, and parity withevaluateJsonProgram.typescript/test/failure.test.ts: ExercisestripNullsthroughcreateTypeScriptJsonValidator(attemptRepair = false, closed infinally) for[null, [null, 1]],[[null, 1], null, [null, null]], and flat arrays.References, Credit, and CLA Notes
createTypeScriptJsonValidatorcoverage in fix: normalize nested arrays after filtering null values #496 and executing the generated module in fix(program): preserve literal __proto__ fields in generated modules #497); Tejas Lamba (@TejasLamba2006) independently submitted Fix nested array null filtering with stripNulls #525 and Emit computed property name for __proto__ in generated object literals #526 and put together this consolidated branch.cbf79d6on this branch was written cleanly on top ofmainby Tejas Lamba (@TejasLamba2006) (no commits cherry-picked or copied from fix: normalize nested arrays after filtering null values #496/fix(program): preserve literal __proto__ fields in generated modules #497), re-implementing the test scenarios requested during review while crediting JOJO (@moneymaker26754-crypto) for the original test ideas and fixes.Verification
npm run build-allintypescript/passes.npm testintypescript/passes (428/428 tests across 70 suites).