Bug 217241

Summary: Web Inspector: Uncaught Exception: TypeError: undefined is not an object (evaluating 'breakpoint.disabled = true')
Product: WebKit Reporter: Devin Rousso <hi>
Component: Web InspectorAssignee: Devin Rousso <hi>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, hi, inspector-bugzilla-changes, katherine_cheney, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch none

Description Devin Rousso 2020-10-02 12:03:14 PDT
# STEPS TO REPRODUCE
1. inspect any page with JS event listeners
2. uncheck the "Enabled" checkbox for any event listener on any node

Uncaught Exceptions:
-----------------------
 - TypeError: undefined is not an object (evaluating 'breakpoint.disabled = true') (at DOMManager.js:705:19)
    removeBreakpointForEventListener @ DOMManager.js:705:19
    hasEventListenerBreakpoint @ EventListenerSectionGroup.js:167:59
    ? @ EventListenerSectionGroup.js:62:25
Comment 1 Devin Rousso 2020-10-02 12:21:42 PDT
Created attachment 410351 [details]
Patch
Comment 2 Kate Cheney 2020-10-05 09:02:02 PDT
Comment on attachment 410351 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=410351&action=review

> Source/WebInspectorUI/UserInterface/Controllers/DOMManager.js:-701
> -                target.DOMAgent.removeBreakpointForEventListener(eventListener.eventListenerId);

Why remove this call?
Comment 3 Devin Rousso 2020-10-05 10:56:46 PDT
Comment on attachment 410351 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=410351&action=review

>> Source/WebInspectorUI/UserInterface/Controllers/DOMManager.js:-701
>> -                target.DOMAgent.removeBreakpointForEventListener(eventListener.eventListenerId);
> 
> Why remove this call?

this is done later inside `_handleEventBreakpointDisabledStateChanged` (which is an event listener callback for `WI.Breakpoint.Event.DisabledStateDidChange`, which is dispatched by `WI.Breakpoint.prototype.set disabled`)
Comment 4 Kate Cheney 2020-10-05 11:05:17 PDT
(In reply to Devin Rousso from comment #3)
> Comment on attachment 410351 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=410351&action=review
> 
> >> Source/WebInspectorUI/UserInterface/Controllers/DOMManager.js:-701
> >> -                target.DOMAgent.removeBreakpointForEventListener(eventListener.eventListenerId);
> > 
> > Why remove this call?
> 
> this is done later inside `_handleEventBreakpointDisabledStateChanged`
> (which is an event listener callback for
> `WI.Breakpoint.Event.DisabledStateDidChange`, which is dispatched by
> `WI.Breakpoint.prototype.set disabled`)

Nice, thanks for explaining!
Comment 5 BJ Burg 2020-10-05 12:43:52 PDT
Comment on attachment 410351 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=410351&action=review

r=e

>>>> Source/WebInspectorUI/UserInterface/Controllers/DOMManager.js:-701
>>>> -                target.DOMAgent.removeBreakpointForEventListener(eventListener.eventListenerId);
>>> 
>>> Why remove this call?
>> 
>> this is done later inside `_handleEventBreakpointDisabledStateChanged` (which is an event listener callback for `WI.Breakpoint.Event.DisabledStateDidChange`, which is dispatched by `WI.Breakpoint.prototype.set disabled`)
> 
> Nice, thanks for explaining!

Would have been good to put this in the changelog :-)
Comment 6 BJ Burg 2020-10-05 12:44:02 PDT
r=me *
Comment 7 EWS 2020-10-05 13:03:10 PDT
Committed r267998: <https://trac.webkit.org/changeset/267998>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 410351 [details].
Comment 8 Radar WebKit Bug Importer 2020-10-05 13:04:19 PDT
<rdar://problem/69967550>