[PR #3146] [CLOSED] fix(javascript): keep uncertain paths and skipped initializers #5642

Closed
opened 2026-10-31 01:08:12 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3146
Author: @chessing234
Created: 10/14/2026
Status: ❌ Closed

Base: main ← Head: fix/javascript-uncertain-paths


📝 Commits (3)

  • caf2b9b fix(javascript): decode literal file URLs passed to fileURLToPath
  • e517e83 fix(javascript): keep skipped initializers uncertain
  • 9230a82 fix(javascript): treat skipped expression writes and windows file URLs as uncertain

📊 Changes

5 files changed (+188 additions, -20 deletions)

View changed files

➕ src/domain/javascript/javascriptSemanticAnalysis.conditional_initializer.test.ts (+50 -0)
📝 src/domain/javascript/javascriptSemanticAnalysis.ts (+44 -12)
📝 src/domain/javascript/javascriptSemanticValues.ts (+5 -0)
📝 src/domain/javascript/javascriptStaticAnalysisHelpers.ts (+52 -8)
📝 src/domain/javascript/javascriptStaticPathResolution.test.ts (+37 -0)

📄 Description

Summary

  • A literal fileURLToPath("file:///...") is decoded with Node's file URL rules, so an Electron preload is the filesystem path rather than the URL string. Fixes #2561.
  • A var initializer or assignment that can be skipped by a branch, loop, switch, or try is no longer a definite literal, and a function that returns it does not claim that literal either. Fixes #2562.

Test plan

  • vitest run src/domain/javascript/javascriptStaticPathResolution.test.ts src/domain/javascript/javascriptSemanticAnalysis.conditional_initializer.test.ts src/domain/javascript/javascriptSemanticAnalysis.logical_assignment.test.ts

Made with Cursor


🔄 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/3146 **Author:** [@chessing234](https://github.com/chessing234) **Created:** 10/14/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/javascript-uncertain-paths` --- ### 📝 Commits (3) - [`caf2b9b`](https://github.com/morluto/rea/commit/caf2b9b2f1b4467b0944487c0b9fb414fd1577a8) fix(javascript): decode literal file URLs passed to fileURLToPath - [`e517e83`](https://github.com/morluto/rea/commit/e517e83856afe52884db87cce9a98361a0473d06) fix(javascript): keep skipped initializers uncertain - [`9230a82`](https://github.com/morluto/rea/commit/9230a823b07faa7e4886a0e5693f02b3f22ca2a8) fix(javascript): treat skipped expression writes and windows file URLs as uncertain ### 📊 Changes **5 files changed** (+188 additions, -20 deletions) <details> <summary>View changed files</summary> ➕ `src/domain/javascript/javascriptSemanticAnalysis.conditional_initializer.test.ts` (+50 -0) 📝 `src/domain/javascript/javascriptSemanticAnalysis.ts` (+44 -12) 📝 `src/domain/javascript/javascriptSemanticValues.ts` (+5 -0) 📝 `src/domain/javascript/javascriptStaticAnalysisHelpers.ts` (+52 -8) 📝 `src/domain/javascript/javascriptStaticPathResolution.test.ts` (+37 -0) </details> ### 📄 Description ## Summary - A literal `fileURLToPath("file:///...")` is decoded with Node's file URL rules, so an Electron preload is the filesystem path rather than the URL string. Fixes #2561. - A `var` initializer or assignment that can be skipped by a branch, loop, switch, or try is no longer a definite literal, and a function that returns it does not claim that literal either. Fixes #2562. ## Test plan - [x] `vitest run src/domain/javascript/javascriptStaticPathResolution.test.ts src/domain/javascript/javascriptSemanticAnalysis.conditional_initializer.test.ts src/domain/javascript/javascriptSemanticAnalysis.logical_assignment.test.ts` Made with [Cursor](https://cursor.com) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:08:12 +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#5642
No description provided.