RESOLVED FIXED 147534
Web Inspector: Convert remaining ContentViews to use ES6 classes
https://bugs.webkit.org/show_bug.cgi?id=147534
Summary Web Inspector: Convert remaining ContentViews to use ES6 classes
Brian Burg
Reported 2015-08-01 22:06:36 PDT
,
Attachments
WIP (95.95 KB, patch)
2015-08-02 10:31 PDT, Brian Burg
no flags
Proposed Fix (224.03 KB, patch)
2015-08-04 16:23 PDT, Blaze Burg
joepeck: review+
Brian Burg
Comment 1 2015-08-02 10:31:24 PDT
Blaze Burg
Comment 2 2015-08-04 16:23:33 PDT
Created attachment 258227 [details] Proposed Fix
Joseph Pecoraro
Comment 3 2015-08-04 22:13:59 PDT
Comment on attachment 258227 [details] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=258227&action=review r=me > Source/WebInspectorUI/UserInterface/Views/ContentBrowserTabContentView.js:40 > + this._contentBrowser = contentBrowser; // Must call the super constructor before using `this`. I'm not sure the comment is needed. It should be obvious, in the future if someone does this wrong as it will result in a runtime TDZ error. You've done the hard work here, and reordered the code appropriately. > Source/WebInspectorUI/UserInterface/Views/ContentFlowDOMTreeContentView.js:35 > + console.assert(contentFlow); We should assert that this is instanceof something. > Source/WebInspectorUI/UserInterface/Views/ContentView.js:43 > + // Public We've been going with a "// Static" section before a "// Public" section. > Source/WebInspectorUI/UserInterface/Views/CookieStorageContentView.js:35 > + }; I do not believe this semicolon is allowed. I'd have expected a parse error, but maybe it is allowed! Either way, drop it. > Source/WebInspectorUI/UserInterface/Views/CookieStorageContentView.js:40 > + static cookieMatchesResourceURL(cookie, resourceURL) Style: "// Static" header before "// Public". We can consider just dropping the "// Static" comments... I'm not sure they are valuable. > Source/WebInspectorUI/UserInterface/Views/FrameDOMTreeContentView.js:30 > + console.assert(domTree); Nit: instanceof > Source/WebInspectorUI/UserInterface/Views/ResourceContentView.js:30 > + console.assert(resource); Nit: instanceof > Source/WebInspectorUI/UserInterface/Views/ResourceContentView.js:31 > + console.assert(styleClassName); Nit: typeof === "string" > Source/WebInspectorUI/UserInterface/Views/ScriptContentView.js:30 > + super(script); Nit: Could assert instanceof WebInspector.Script. > Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js:576 > + this._timelineViewMap.set(timeline, WebInspector.ContentView.createFromRepresentedObject(timeline, {timelineSidebarPanel: this._timelineSidebarPanel})); I'm surprised there aren't more places where we called "new WebInspector.ContentView"!
Blaze Burg
Comment 4 2015-08-05 11:12:48 PDT
Note You need to log in before you can comment on or make changes to this bug.