New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 623150 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Oct 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug-Regression



Sign in to add a comment

Breakpoints cease to work after reloading script using sourceURL

Reported by sharonro...@gmail.com, Jun 24 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36

Steps to reproduce the problem:
1. open the dev tools console
2. input: eval('const x = 1;\nconsole.log(x);\n//# sourceURL=somescript.js')
3. input: eval('const x = 2;\nconsole.log(x);\n//# sourceURL=somescript.js')
4. Open the somescript.js source and try to set a breakpoint 

What is the expected behavior?
Breakpoint should be set and work correctly

What went wrong?
Breakpoints not being added when clicking line number. It is possible to right click the line number and add a breakpoint. It doesn't show but reloading the script makes execution stop there. The breakpoint then appears, is dimmed (inactive) and I can't remove it. Deleting it from the breakpoints tab seems to work but reloading the script once more makes execution stop on the same (presumably removed) breakpoint.

Did this work before? N/A 

Chrome version: 51.0.2704.103  Channel: n/a
OS Version: 10.0
Flash Version: Shockwave Flash 22.0 r0

This technique is used in SystemJS for example, for reloading scripts.
 
Owner: kozyatinskiy@chromium.org
Status: Assigned (was: Unconfirmed)
Cc: tkonch...@chromium.org
 Issue 640814  has been merged into this issue.
Project Member

Comment 3 by bugdroid1@chromium.org, Oct 4 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c0d25adc44ebd36c2dc2565942a1884479c40004

commit c0d25adc44ebd36c2dc2565942a1884479c40004
Author: kozyatinskiy <kozyatinskiy@chromium.org>
Date: Tue Oct 04 00:22:56 2016

[DevTools] Fixed breakpoints in hotreloaded scripts

We need to use last arrived script for ResourceScriptFile.
Otherwise _isDiverged check will always return true in case of:
eval("source1 //# sourceURL=foo.js")
eval("source2 //# sourceURL=foo.js")

BUG= 617450 , 623150 
R=lushnikov@chromium.org

Review-Url: https://codereview.chromium.org/2384953002
Cr-Commit-Position: refs/heads/master@{#422622}

[add] https://crrev.com/c0d25adc44ebd36c2dc2565942a1884479c40004/third_party/WebKit/LayoutTests/inspector/sources/dont-diverge-script-evaluated-twice-expected.txt
[add] https://crrev.com/c0d25adc44ebd36c2dc2565942a1884479c40004/third_party/WebKit/LayoutTests/inspector/sources/dont-diverge-script-evaluated-twice.html
[modify] https://crrev.com/c0d25adc44ebd36c2dc2565942a1884479c40004/third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js

Labels: Merge-Request-54
Status: Fixed (was: Assigned)
Labels: -Type-Bug Type-Bug-Regression

Comment 7 by dimu@chromium.org, Oct 4 2016

Labels: -Merge-Request-54 Merge-Review-54 Hotlist-Merge-Review
[Automated comment] Less than 2 weeks to go before stable on M54, manual review required.
Labels: -Merge-Review-54 Merge-Approved-54
This looks pretty safe and it would be good to get this in for stable.  Approved for merging into M54.
Project Member

Comment 9 by bugdroid1@chromium.org, Oct 6 2016

Labels: -merge-approved-54 merge-merged-2840
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/31c32c71acf292764248bb6716772ee9453c0fe5

commit 31c32c71acf292764248bb6716772ee9453c0fe5
Author: Alexey Kozyatinskiy <kozyatinskiy@chromium.org>
Date: Thu Oct 06 00:41:55 2016

[DevTools] Fixed breakpoints in hotreloaded scripts

We need to use last arrived script for ResourceScriptFile.
Otherwise _isDiverged check will always return true in case of:
eval("source1 //# sourceURL=foo.js")
eval("source2 //# sourceURL=foo.js")

BUG= 617450 , 623150 
R=lushnikov@chromium.org

Review-Url: https://codereview.chromium.org/2384953002
Cr-Commit-Position: refs/heads/master@{#422622}
(cherry picked from commit c0d25adc44ebd36c2dc2565942a1884479c40004)

Review URL: https://codereview.chromium.org/2397063002 .

Cr-Commit-Position: refs/branch-heads/2840@{#659}
Cr-Branched-From: 1ae106dbab4bddd85132d5b75c670794311f4c57-refs/heads/master@{#414607}

[add] https://crrev.com/31c32c71acf292764248bb6716772ee9453c0fe5/third_party/WebKit/LayoutTests/inspector/sources/dont-diverge-script-evaluated-twice-expected.txt
[add] https://crrev.com/31c32c71acf292764248bb6716772ee9453c0fe5/third_party/WebKit/LayoutTests/inspector/sources/dont-diverge-script-evaluated-twice.html
[modify] https://crrev.com/31c32c71acf292764248bb6716772ee9453c0fe5/third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js

Labels: TE-Verified-54.0.2840.59 TE-Verified-M54
Verified the issue on Windows-10 using chrome latest Beta M54-54.0.2840.59 by following steps mentioned in the original comment. Observed the break points are being added correctly by clicking line number. Hence adding TE-Verified label.


623150.mp4
1.6 MB View Download
Project Member

Comment 11 by bugdroid1@chromium.org, Oct 27 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/31c32c71acf292764248bb6716772ee9453c0fe5

commit 31c32c71acf292764248bb6716772ee9453c0fe5
Author: Alexey Kozyatinskiy <kozyatinskiy@chromium.org>
Date: Thu Oct 06 00:41:55 2016

[DevTools] Fixed breakpoints in hotreloaded scripts

We need to use last arrived script for ResourceScriptFile.
Otherwise _isDiverged check will always return true in case of:
eval("source1 //# sourceURL=foo.js")
eval("source2 //# sourceURL=foo.js")

BUG= 617450 , 623150 
R=lushnikov@chromium.org

Review-Url: https://codereview.chromium.org/2384953002
Cr-Commit-Position: refs/heads/master@{#422622}
(cherry picked from commit c0d25adc44ebd36c2dc2565942a1884479c40004)

Review URL: https://codereview.chromium.org/2397063002 .

Cr-Commit-Position: refs/branch-heads/2840@{#659}
Cr-Branched-From: 1ae106dbab4bddd85132d5b75c670794311f4c57-refs/heads/master@{#414607}

[add] https://crrev.com/31c32c71acf292764248bb6716772ee9453c0fe5/third_party/WebKit/LayoutTests/inspector/sources/dont-diverge-script-evaluated-twice-expected.txt
[add] https://crrev.com/31c32c71acf292764248bb6716772ee9453c0fe5/third_party/WebKit/LayoutTests/inspector/sources/dont-diverge-script-evaluated-twice.html
[modify] https://crrev.com/31c32c71acf292764248bb6716772ee9453c0fe5/third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js

Sign in to add a comment