Bug 299618

Summary: Web Inspector: Sources tab fails to display JavaScript code correctly
Product: WebKit Reporter: Jonas Walldén <jonasw>
Component: Web InspectorAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: inspector-bugzilla-changes, rcaliman
Priority: P2    
Version: Safari 26   
Hardware: Mac (Apple Silicon)   
OS: macOS 15   
Attachments:
Description Flags
HTML page with embedded JavaScript code
none
Screenshot of incorrect source code none

Jonas Walldén
Reported 2025-09-26 10:53:00 PDT
Created attachment 476866 [details] HTML page with embedded JavaScript code The attached test case will not be displayed correctly in the Sources tab. The `a?.x` expression in combination with string interpolation appears to be factors here. Execution of the code is not affected though. For me the source code highlighting works partly through line 8 (containing the "return" statement), and subsequent lines are displayed in red as if they were part of a string constant.
Attachments
HTML page with embedded JavaScript code (267 bytes, text/html)
2025-09-26 10:53 PDT, Jonas Walldén
no flags
Screenshot of incorrect source code (27.93 KB, image/jpeg)
2025-09-26 10:55 PDT, Jonas Walldén
no flags
Jonas Walldén
Comment 1 2025-09-26 10:55:11 PDT
Created attachment 476867 [details] Screenshot of incorrect source code
Razvan Caliman
Comment 2 2025-09-29 08:15:42 PDT
*** This bug has been marked as a duplicate of bug 283870 ***
Razvan Caliman
Comment 3 2025-09-29 08:16:47 PDT
Thank you for filing the issue! This has been fixed by the patch for https://bugs.webkit.org/show_bug.cgi?id=283870 which landed recently.
Note You need to log in before you can comment on or make changes to this bug.