Bug 158817

Summary: Web Inspector: REGRESSION (r200064): syntax error in a breakpoint condition should not create an Anonymous Script in the Debugger Tab sidebar
Product: WebKit Reporter: BJ Burg <bburg>
Component: Web InspectorAssignee: Matt Baker <mattbaker>
Status: NEW ---    
Severity: Normal CC: buildbot, inspector-bugzilla-changes, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Bad anonymous scripts
none
[Patch] Proposed Fix
joepeck: review-, buildbot: commit-queue-
Archive of layout-test-results from ews117 for mac-yosemite
none
Archive of layout-test-results from ews103 for mac-yosemite
none
Archive of layout-test-results from ews104 for mac-yosemite-wk2
none
[Image] Proposed UI none

Description BJ Burg 2016-06-15 16:02:41 PDT
Created attachment 281400 [details]
Bad anonymous scripts

This seems to be a regression from Safari 9.x.

STEPS TO REPRODUCE:
1. set a breakpoint with invalid JS
2. make the breakpoint's line execute

EXPECTED:
No anonymous script is added to the debugger tab's sidebar.

ACTUAL:
An anonymous script is created per breakpoint, but reused across failed condition evaluations. See attached screenshot.

NOTES:
In both cases, and in shipped Safari, the syntax error appears in the console with a link to the breakpoint's file/line/column.
Comment 1 Radar WebKit Bug Importer 2016-06-15 16:04:36 PDT
<rdar://problem/26825020>
Comment 2 Matt Baker 2016-06-16 15:13:10 PDT
For comparison, Chrome and Edge show nothing when a condition contains an error. FireFox shows an error message beneath the breakpoint itself.
Comment 3 Matt Baker 2016-06-16 15:36:07 PDT
Regressed in https://trac.webkit.org/changeset/200064.
Comment 4 Matt Baker 2016-06-16 16:14:21 PDT
Created attachment 281500 [details]
[Patch] Proposed Fix
Comment 5 Build Bot 2016-06-16 16:56:24 PDT
Comment on attachment 281500 [details]
[Patch] Proposed Fix

Attachment 281500 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/1514980

New failing tests:
inspector/model/stack-trace.html
Comment 6 Build Bot 2016-06-16 16:56:26 PDT
Created attachment 281508 [details]
Archive of layout-test-results from ews117 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews117  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 7 Build Bot 2016-06-16 16:58:05 PDT
Comment on attachment 281500 [details]
[Patch] Proposed Fix

Attachment 281500 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/1515041

New failing tests:
inspector/model/stack-trace.html
Comment 8 Build Bot 2016-06-16 16:58:08 PDT
Created attachment 281509 [details]
Archive of layout-test-results from ews103 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews103  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 9 Build Bot 2016-06-16 17:19:13 PDT
Comment on attachment 281500 [details]
[Patch] Proposed Fix

Attachment 281500 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/1515097

New failing tests:
inspector/model/stack-trace.html
Comment 10 Build Bot 2016-06-16 17:19:16 PDT
Created attachment 281511 [details]
Archive of layout-test-results from ews104 for mac-yosemite-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews104  Port: mac-yosemite-wk2  Platform: Mac OS X 10.10.5
Comment 11 Joseph Pecoraro 2016-06-23 13:39:34 PDT
Comment on attachment 281500 [details]
[Patch] Proposed Fix

I think we wanted to take a different approach here. Show anonymous scripts sometimes.
Comment 12 Matt Baker 2017-02-10 21:04:04 PST
(In reply to comment #11)
> Comment on attachment 281500 [details]
> [Patch] Proposed Fix
> 
> I think we wanted to take a different approach here. Show anonymous scripts
> sometimes.

Instead of exposing breakpoint implementation details (the anonymous script item), we should associate the error with the breakpoint, and display an error message widget on the breakpoint's line.

Clicking an entry for a breakpoint script error in the Console should highlight the source code location of the breakpoint.
Comment 13 Matt Baker 2017-02-10 21:04:32 PST
Created attachment 301244 [details]
[Image] Proposed UI