Changeset 276146 in webkit
- Timestamp:
- Apr 16, 2021, 11:07:23 AM (4 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r276144 r276146 1 2021-04-16 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Uncaught Exception: null is not an object (evaluating 'this._listeners.get') 4 https://bugs.webkit.org/show_bug.cgi?id=224651 5 6 Reviewed by BJ Burg. 7 8 * UserInterface/Base/Object.js: 9 (WI.Object.removeEventListener): 10 Add early-return checks just in case `_listeners` or `listenersForEventType` is falsy. While 11 ideally it would be the case that these would never be falsy, the logic of Web Inspector is 12 complex and far reaching, so better safe than sorry. 13 14 * UserInterface/Views/TreeElement.js: 15 (WI.TreeElement.prototype._detach): 16 * UserInterface/Views/AuditTreeElement.js: 17 (WI.AuditTreeElement.prototype.ondetach): 18 * UserInterface/Views/BootstrapScriptTreeElement.js: 19 (WI.BootstrapScriptTreeElement.prototype.ondetach): 20 * UserInterface/Views/BreakpointTreeElement.js: 21 (WI.BreakpointTreeElement.prototype.ondetach): 22 * UserInterface/Views/DOMTreeElement.js: 23 (WI.DOMTreeElement.prototype.ondetach): 24 * UserInterface/Views/FrameTreeElement.js: 25 (WI.FrameTreeElement.prototype.ondetach): 26 * UserInterface/Views/JavaScriptBreakpointTreeElement.js: 27 (WI.JavaScriptBreakpointTreeElement.prototype.ondetach): 28 * UserInterface/Views/LocalResourceOverrideTreeElement.js: 29 (WI.LocalResourceOverrideTreeElement.prototype.ondetach): 30 * UserInterface/Views/ShaderProgramTreeElement.js: 31 (WI.ShaderProgramTreeElement.prototype.ondetach): 32 * UserInterface/Views/WebSocketResourceTreeElement.js: 33 (WI.WebSocketResourceTreeElement.prototype.ondetach): 34 Add FIXME comments warning of this issue so that future changes can take it into account. 35 <https://webkit.org/b/224652> (Web Inspector: Tree Outlines: `ondetach` can be called without `onattach` ever being called) 36 1 37 2021-04-16 Devin Rousso <drousso@apple.com> 2 38 -
trunk/Source/WebInspectorUI/UserInterface/Base/Object.js
r274303 r276146 79 79 console.assert(typeof thisObject === "object" || window.InspectorTest || window.ProtocolTest, this, eventType, listener, thisObject); 80 80 81 if (!this._listeners) 82 return; 83 81 84 thisObject ??= this; 82 85 83 86 let listenersForEventType = this._listeners.get(eventType); 84 87 console.assert(listenersForEventType, this, eventType, listener, thisObject); 88 if (!listenersForEventType) 89 return; 85 90 86 91 let didDelete = false; -
trunk/Source/WebInspectorUI/UserInterface/Views/AuditTreeElement.js
r269359 r276146 98 98 ondetach() 99 99 { 100 // FIXME: <https://webkit.org/b/224652> (Web Inspector: Tree Outlines: `ondetach` can be called without `onattach` ever being called) 101 100 102 if (this.representedObject instanceof WI.AuditTestBase) { 101 103 this.representedObject.removeEventListener(WI.AuditTestBase.Event.DisabledChanged, this._handleTestDisabledChanged, this); -
trunk/Source/WebInspectorUI/UserInterface/Views/BootstrapScriptTreeElement.js
r253402 r276146 53 53 ondetach() 54 54 { 55 // FIXME: <https://webkit.org/b/224652> (Web Inspector: Tree Outlines: `ondetach` can be called without `onattach` ever being called) 56 55 57 WI.NetworkManager.removeEventListener(WI.NetworkManager.Event.BootstrapScriptEnabledChanged, this._handleNetworkManagerBootstrapScriptEnabledChanged, this); 56 58 -
trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.js
r269359 r276146 112 112 ondetach() 113 113 { 114 // FIXME: <https://webkit.org/b/224652> (Web Inspector: Tree Outlines: `ondetach` can be called without `onattach` ever being called) 115 114 116 super.ondetach(); 115 117 -
trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js
r274592 r276146 456 456 ondetach() 457 457 { 458 // FIXME: <https://webkit.org/b/224652> (Web Inspector: Tree Outlines: `ondetach` can be called without `onattach` ever being called) 459 458 460 if (this.representedObject.layoutContextType === WI.DOMNode.LayoutContextType.Grid) { 459 461 WI.overlayManager.removeEventListener(WI.OverlayManager.Event.GridOverlayShown, this._updateGridBadgeStatus, this); -
trunk/Source/WebInspectorUI/UserInterface/Views/FrameTreeElement.js
r265714 r276146 122 122 ondetach() 123 123 { 124 // FIXME: <https://webkit.org/b/224652> (Web Inspector: Tree Outlines: `ondetach` can be called without `onattach` ever being called) 125 124 126 if (this.listItemElement) { 125 127 WI.cssManager.removeEventListener(WI.CSSManager.Event.StyleSheetAdded, this._styleSheetAdded, this); -
trunk/Source/WebInspectorUI/UserInterface/Views/JavaScriptBreakpointTreeElement.js
r269359 r276146 60 60 ondetach() 61 61 { 62 // FIXME: <https://webkit.org/b/224652> (Web Inspector: Tree Outlines: `ondetach` can be called without `onattach` ever being called) 63 62 64 if (!this.breakpoint.special) 63 65 this.breakpoint.removeEventListener(WI.JavaScriptBreakpoint.Event.LocationDidChange, this._breakpointLocationDidChange, this); -
trunk/Source/WebInspectorUI/UserInterface/Views/LocalResourceOverrideTreeElement.js
r270604 r276146 57 57 ondetach() 58 58 { 59 // FIXME: <https://webkit.org/b/224652> (Web Inspector: Tree Outlines: `ondetach` can be called without `onattach` ever being called) 60 59 61 this._localResourceOverride.removeEventListener(WI.LocalResourceOverride.Event.DisabledChanged, this._handleLocalResourceOverrideDisabledChanged, this); 60 62 -
trunk/Source/WebInspectorUI/UserInterface/Views/ShaderProgramTreeElement.js
r250258 r276146 61 61 ondetach() 62 62 { 63 // FIXME: <https://webkit.org/b/224652> (Web Inspector: Tree Outlines: `ondetach` can be called without `onattach` ever being called) 64 63 65 // FIXME: add support for disabling/highlighting WebGPU shader pipelines. 64 66 let contextType = this.representedObject.canvas.contextType; -
trunk/Source/WebInspectorUI/UserInterface/Views/TreeElement.js
r272371 r276146 291 291 _detach() 292 292 { 293 // FIXME: <https://webkit.org/b/224652> (Web Inspector: Tree Outlines: `ondetach` can be called without `onattach` ever being called) 293 294 if (this.ondetach) 294 295 this.ondetach(this); -
trunk/Source/WebInspectorUI/UserInterface/Views/WebSocketResourceTreeElement.js
r220119 r276146 39 39 ondetach() 40 40 { 41 // FIXME: <https://webkit.org/b/224652> (Web Inspector: Tree Outlines: `ondetach` can be called without `onattach` ever being called) 42 41 43 super.ondetach(); 42 44
Note:
See TracChangeset
for help on using the changeset viewer.