[PR #1388] [CLOSED] fix(javascript): avoid regex overflow for large source maps #2846

Closed
opened 2026-10-17 21:10:58 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1388
Author: @kuishou68
Created: 10/10/2026
Status: ❌ Closed

Base: main ← Head: fix/1380-source-map-regexp-overflow


📝 Commits (1)

  • b9e8f31 fix(javascript): avoid regex overflow for large source maps

📊 Changes

2 files changed (+25 additions, -6 deletions)

View changed files

📝 src/domain/javascript/javascriptStaticAnalysisCalls.ts (+13 -6)
📝 src/domain/javascript/javascriptStaticAnalysisSourceMaps.test.ts (+12 -0)

📄 Description

Summary

  • replace the unbounded source-map URL capture regexp with a fixed prefix match and linear URL scan
  • preserve source-map directive extraction and location ranges for line and block comments
  • add a regression test for an 8.5M-character URL in a two-byte JavaScript source

Fixes #1380

Validation

  • on the changed files
  • on the changed files

🔄 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/1388 **Author:** [@kuishou68](https://github.com/kuishou68) **Created:** 10/10/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/1380-source-map-regexp-overflow` --- ### 📝 Commits (1) - [`b9e8f31`](https://github.com/morluto/rea/commit/b9e8f31d6dfb1d9c873cca04902fda5e84f04b94) fix(javascript): avoid regex overflow for large source maps ### 📊 Changes **2 files changed** (+25 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/javascript/javascriptStaticAnalysisCalls.ts` (+13 -6) 📝 `src/domain/javascript/javascriptStaticAnalysisSourceMaps.test.ts` (+12 -0) </details> ### 📄 Description ## Summary - replace the unbounded source-map URL capture regexp with a fixed prefix match and linear URL scan - preserve source-map directive extraction and location ranges for line and block comments - add a regression test for an 8.5M-character URL in a two-byte JavaScript source Fixes #1380 ## Validation - - - on the changed files - on the changed files - --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:10:58 +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#2846
No description provided.