Skip to content

fix(javascript): respect object property overwrite order - #671

Closed
rudycelekli wants to merge 2 commits into
morluto:mainfrom
rudycelekli:fix/rea-object-values-20261006
Closed

rudycelekli wants to merge 2 commits into
morluto:mainfrom
rudycelekli:fix/rea-object-values-20261006

Conversation

@rudycelekli

@rudycelekli rudycelekli commented Oct 6, 2026 •

Copy link
Copy Markdown

What changed

Object-literal value recovery now follows declaration order: the last named key wins; an unknown spread or computed key invalidates earlier exact values; a later named assignment can restore an exact value. Methods/accessors replace a prior primitive with an unknown value. Literal computed keys remain usable. A non-shorthand __proto__ setter is excluded from own-property evidence, while { __proto__ } shorthand remains an own property.

Consumer evidence

On an owned application file, the complete built public analyzeJavaScriptApplication workflow previously emitted "old" for { key: "old", key: "new" }.key; native Node emits "new". After the repair, the serialized graph reports the final value and a later post-spread override. Unknown-spread and dynamic-key values are retained as unknown instead of falsely exact; the native shorthand __proto__ control also agrees.

Verification

  • Three new object-boundary regression cases failed before the patch.
  • Focused dataflow, semantic graph, and public export-shape comparison tests — 45 passed after the CI repair. The guaranteed post-spread discriminator control retains its /depth unknown assertion; a separate trailing-spread case verifies two unpaired unknown variants and no definite changes.
  • npm run check, npm run check:fast, npm run build:cached — passed.
  • Complete built application/native Node comparison — exact final/override/shorthand controls agree; uncertain overwrite values have no exact literal.
  • Native Node overwrite counterexample confirms trailing spread replaces type, while a post-spread type remains guaranteed.
  • git diff --check — passed.

The initial hosted shard 3 failure was an existing comparison fixture assuming the pre-spread discriminator stayed exact. Its corrected fixtures and added consumer regression passed locally; all 18 hosted checks on updated head 0622582e169fe3d4c226eac457b27f354fb03a07 passed, including all four shards and aggregate coverage.

No new tool, schema, or execution authority. This is conservative static analysis, not an object evaluator. Hopper/Ghidra verification was not run because no binary provider behavior changes. AI assistance was used for investigation, implementation and verification.

@morluto morluto left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Approve: object literals are last-wins with deterministic compareCodePoints order; spreads/unknown-computed/proto-setter invalidate earlier exacts while later exacts restore. Correctly handles literal computed keys, methods/accessors, and proto shorthand. Dataflow tests + export-shape trailing-spread lock covered. Checks green.

@morluto

morluto commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Superseded by #705, which cherry-picks this change (plus 13 sibling fixes) onto current main with conflict resolution and regenerated catalogs. Closing to keep one reviewable merge unit.

@morluto morluto closed this Oct 6, 2026
@morluto

morluto commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Thanks, @rudycelekli, for your work on “fix(javascript): respect object property overwrite order.” I appreciate your contribution to REA.

@morluto morluto added bug Something isn't working area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants