.
Created attachment 364136 [details] Patch
Comment on attachment 364136 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=364136&action=review r=me > Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js:782 > + this.breakpointGutterEnabled = this._domTreeOutline.children.some((child) => child.hasBreakpoint); Nice! I think keeping the early return makes it read better, and with your changes it's cleaner still: if (!breakpoints.length) { treeElement.breakpointStatus = WI.DOMTreeElement.BreakpointStatus.None; return; } if (breakpoints.some((item) => item.disabled)) treeElement.breakpointStatus = WI.DOMTreeElement.BreakpointStatus.DisabledBreakpoint; else treeElement.breakpointStatus = WI.DOMTreeElement.BreakpointStatus.Breakpoint; this.breakpointGutterEnabled = this._domTreeOutline.children.some((child) => child.hasBreakpoint);
Comment on attachment 364136 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=364136&action=review >> Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js:782 >> + this.breakpointGutterEnabled = this._domTreeOutline.children.some((child) => child.hasBreakpoint); > > Nice! I think keeping the early return makes it read better, and with your changes it's cleaner still: > > if (!breakpoints.length) { > treeElement.breakpointStatus = WI.DOMTreeElement.BreakpointStatus.None; > return; > } > > if (breakpoints.some((item) => item.disabled)) > treeElement.breakpointStatus = WI.DOMTreeElement.BreakpointStatus.DisabledBreakpoint; > else > treeElement.breakpointStatus = WI.DOMTreeElement.BreakpointStatus.Breakpoint; > > this.breakpointGutterEnabled = this._domTreeOutline.children.some((child) => child.hasBreakpoint); Oh right, the early return. ;)
Comment on attachment 364136 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=364136&action=review >>> Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js:782 >>> + this.breakpointGutterEnabled = this._domTreeOutline.children.some((child) => child.hasBreakpoint); >> >> Nice! I think keeping the early return makes it read better, and with your changes it's cleaner still: >> >> if (!breakpoints.length) { >> treeElement.breakpointStatus = WI.DOMTreeElement.BreakpointStatus.None; >> return; >> } >> >> if (breakpoints.some((item) => item.disabled)) >> treeElement.breakpointStatus = WI.DOMTreeElement.BreakpointStatus.DisabledBreakpoint; >> else >> treeElement.breakpointStatus = WI.DOMTreeElement.BreakpointStatus.Breakpoint; >> >> this.breakpointGutterEnabled = this._domTreeOutline.children.some((child) => child.hasBreakpoint); > > Oh right, the early return. ;) I guess `this.breakpointGutterEnabled = ...` could be moved above an early return, and it would still work, but I think it's fine as is.
Comment on attachment 364136 [details] Patch Clearing flags on attachment: 364136 Committed r242811: <https://trac.webkit.org/changeset/242811>
All reviewed patches have been landed. Closing bug.
<rdar://problem/48817670>