[PR #678] [CLOSED] fix(javascript): invalidate values on nontrivial binding writes #2161

Closed
opened 2026-10-16 21:15:04 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/678
Author: @rudycelekli
Created: 10/6/2026
Status: ❌ Closed

Base: main ← Head: fix/rea-binding-writes-20261006


📝 Commits (1)

  • 4b852b7 fix(javascript): invalidate values on nontrivial binding writes

📊 Changes

2 files changed (+72 additions, -3 deletions)

View changed files

📝 src/domain/javascriptSemanticAnalysis.dataflow.test.ts (+36 -0)
📝 src/domain/javascriptSemanticAnalysis.ts (+36 -3)

📄 Description

What changed

Record identifier binding writes from updates, destructuring assignments, and predeclared for-in/of targets. Static value recovery now marks those bindings ambiguous instead of retaining their original initializer as an exact value. Assignment-pattern traversal visits target values/default-left/rest positions, not object keys or member owners. Existing direct assignment handling is preserved.

Real application reproduction

On an owned main.mjs, the complete built public analyzeJavaScriptApplication workflow previously emitted 1 for a binding read after counter++ (native Node produces 2), and "old" after [assigned] = ["new"] (native produces "new"). After, neither modified binding has a falsely exact semantic-graph literal; an unrelated "stable" binding remains exact. This is conservative write invalidation, not flow-sensitive evaluation of the final state.

Verification

  • Six added write-form cases fail before; the key/member-owner control passes.
  • Focused dataflow, lexical-structure and graph tests: 52 passed.
  • npm run check, npm run check:fast, npm run build:cached passed.
  • Built public application/native Node comparison and git diff --check passed.

No schema or tool changes. Member-object mutation, source execution and precise loop outcomes remain outside this fix. Hopper/Ghidra were not exercised because no binary provider changes. AI assistance was used for investigation, implementation and verification.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/678 **Author:** [@rudycelekli](https://github.com/rudycelekli) **Created:** 10/6/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/rea-binding-writes-20261006` --- ### 📝 Commits (1) - [`4b852b7`](https://github.com/morluto/rea/commit/4b852b71f6bde305a2e9736f1cc85b0072d46605) fix(javascript): invalidate values on nontrivial binding writes ### 📊 Changes **2 files changed** (+72 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/javascriptSemanticAnalysis.dataflow.test.ts` (+36 -0) 📝 `src/domain/javascriptSemanticAnalysis.ts` (+36 -3) </details> ### 📄 Description ## What changed Record identifier binding writes from updates, destructuring assignments, and predeclared for-in/of targets. Static value recovery now marks those bindings ambiguous instead of retaining their original initializer as an exact value. Assignment-pattern traversal visits target values/default-left/rest positions, not object keys or member owners. Existing direct assignment handling is preserved. ## Real application reproduction On an owned `main.mjs`, the complete built public `analyzeJavaScriptApplication` workflow previously emitted 1 for a binding read after `counter++` (native Node produces 2), and `"old"` after `[assigned] = ["new"]` (native produces `"new"`). After, neither modified binding has a falsely exact semantic-graph literal; an unrelated `"stable"` binding remains exact. This is conservative write invalidation, not flow-sensitive evaluation of the final state. ## Verification - Six added write-form cases fail before; the key/member-owner control passes. - Focused dataflow, lexical-structure and graph tests: 52 passed. - `npm run check`, `npm run check:fast`, `npm run build:cached` passed. - Built public application/native Node comparison and `git diff --check` passed. No schema or tool changes. Member-object mutation, source execution and precise loop outcomes remain outside this fix. Hopper/Ghidra were not exercised because no binary provider changes. AI assistance was used for investigation, implementation and verification. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:15:04 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#2161
No description provided.