Bug 272916

Summary: Web Inspector: JavaScript breakpoint on a line with just a semicolon doesn't get triggered
Product: WebKit Reporter: Qianlang Chen <qianlangchen>
Component: Web InspectorAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Minor CC: inspector-bugzilla-changes, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: All   
OS: All   
Attachments:
Description Flags
Test case: The test case I used in the video demo; host this
none
Video demo: The first breakpoint I created does not trigger none

Qianlang Chen
Reported 2024-04-18 13:09:42 PDT
Let's say you have the following simple JavaScript file: let s = "hello"; ; console.log(s); In Web Inspector's sources tab, if you create a breakpoint on line 2 (the line with just a semicolon), that breakpoint never gets triggered. However, if that line had some other no-ops like `42;`, `() => {};`, or even if it's just an empty line, the breakpoint does get triggered. - My guess is that the line `;` gets optimized out or something so it's ignored, but the empty line instead registers the breakpoint on the next useful line (the line with `console.log`). See attached for a video demo.
Attachments
Test case: The test case I used in the video demo; host this (724 bytes, application/zip)
2024-04-18 13:11 PDT, Qianlang Chen
no flags
Video demo: The first breakpoint I created does not trigger (968.24 KB, video/mp4)
2024-04-18 13:15 PDT, Qianlang Chen
no flags
Radar WebKit Bug Importer
Comment 1 2024-04-18 13:10:06 PDT
Qianlang Chen
Comment 2 2024-04-18 13:11:54 PDT
Created attachment 470991 [details] Test case: The test case I used in the video demo; host this
Qianlang Chen
Comment 3 2024-04-18 13:15:32 PDT
Created attachment 470992 [details] Video demo: The first breakpoint I created does not trigger
Note You need to log in before you can comment on or make changes to this bug.