[PR #511] [MERGED] fix(javascript): isolate lexical loop bindings #2035

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/511
Author: @rudycelekli
Created: 10/5/2026
Status: ✅ Merged
Merged: 10/5/2026
Merged by: @morluto

Base: main ← Head: fix/loop-lexical-bindings-20261004


📝 Commits (3)

  • 4890c9a fix(javascript): isolate lexical loop bindings
  • ada1ec0 test(javascript): isolate loop lexical names regression cases
  • 05ea744 Merge origin/main into fix/loop-lexical-bindings-20261004

📊 Changes

2 files changed (+66 additions, -0 deletions)

View changed files

📝 src/domain/javascriptSemanticAnalysis.structure.test.ts (+60 -0)
📝 src/domain/javascriptSemanticAnalysis.ts (+6 -0)

📄 Description

Change

Give for/for-of/for-in loops an existing block scope so lexical declarations and captured references do not contaminate the outer binding. Preserve var hoisting to the enclosing function and the outer identity after the loop. Actual native analyzer and nested closure capture controls; no new scope enum/schema.

Reproduction and verification

29 tests PASS; final before4FAIL5PASS

  • npm run check:pr: passed (Test Files 352 passed (352); Tests 1803 passed | 2 skipped (1805)).
  • npm run check:ci: passed.
  • npm run verify:package: passed installed-tarball CLI/MCP verification, including optional-dependency degradation.
  • npm pack --dry-run: passed.
  • Exact lockfile installation on Node 24.18.0 and npm 11.16.0.

These tests exercise the production seams described above. No real Hopper, Ghidra, desktop browser or Linux sandbox end-to-end verification is claimed.

Prepared with AI assistance; the reproductions and verification commands above were executed locally.


🔄 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/511 **Author:** [@rudycelekli](https://github.com/rudycelekli) **Created:** 10/5/2026 **Status:** ✅ Merged **Merged:** 10/5/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/loop-lexical-bindings-20261004` --- ### 📝 Commits (3) - [`4890c9a`](https://github.com/morluto/rea/commit/4890c9a601876a34e474d4354130214a77cf79ca) fix(javascript): isolate lexical loop bindings - [`ada1ec0`](https://github.com/morluto/rea/commit/ada1ec0b7fac320ae881aefefb5518fb2fe918a5) test(javascript): isolate loop lexical names regression cases - [`05ea744`](https://github.com/morluto/rea/commit/05ea744efd1e97611c690113577ccfcdec16a5a1) Merge origin/main into fix/loop-lexical-bindings-20261004 ### 📊 Changes **2 files changed** (+66 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/javascriptSemanticAnalysis.structure.test.ts` (+60 -0) 📝 `src/domain/javascriptSemanticAnalysis.ts` (+6 -0) </details> ### 📄 Description ## Change Give for/for-of/for-in loops an existing block scope so lexical declarations and captured references do not contaminate the outer binding. Preserve var hoisting to the enclosing function and the outer identity after the loop. Actual native analyzer and nested closure capture controls; no new scope enum/schema. ## Reproduction and verification 29 tests PASS; final before4FAIL5PASS - `npm run check:pr`: passed (Test Files 352 passed (352); Tests 1803 passed | 2 skipped (1805)). - `npm run check:ci`: passed. - `npm run verify:package`: passed installed-tarball CLI/MCP verification, including optional-dependency degradation. - `npm pack --dry-run`: passed. - Exact lockfile installation on Node 24.18.0 and npm 11.16.0. These tests exercise the production seams described above. No real Hopper, Ghidra, desktop browser or Linux sandbox end-to-end verification is claimed. Prepared with AI assistance; the reproductions and verification commands above were executed locally. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:13:35 +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#2035
No description provided.