| Summary: | Web Inspector: Adopt ES6 Class Syntax for all Controller Objects | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Matt Baker <mattbaker> | ||||||||
| Component: | Web Inspector | Assignee: | Matt Baker <mattbaker> | ||||||||
| Status: | RESOLVED FIXED | ||||||||||
| Severity: | Normal | CC: | commit-queue, graouts, joepeck, jonowells, mattbaker, nvasilyev, rniwa, timothy, webkit-bug-importer | ||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||
| Version: | 528+ (Nightly build) | ||||||||||
| Hardware: | All | ||||||||||
| OS: | All | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Matt Baker
2015-03-19 18:31:43 PDT
Created attachment 249152 [details]
[PATCH] Proposed Fix
Comment on attachment 249152 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=249152&action=review > Source/WebInspectorUI/UserInterface/Controllers/BasicBlockAnnotator.js:31 > + super(this, sourceCodeTextEditor); This will throw a ReferenceError since it'll access "this" before calling super() Comment on attachment 249152 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=249152&action=review > Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorGradientEditingController.js:30 > + super(this, codeMirror, marker); Ditto. > Source/WebInspectorUI/UserInterface/Controllers/TypeTokenAnnotator.js:30 > + super(this, sourceCodeTextEditor); Ditto. Comment on attachment 249152 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=249152&action=review Must fix those super calls. >> Source/WebInspectorUI/UserInterface/Controllers/BasicBlockAnnotator.js:31 >> + super(this, sourceCodeTextEditor); > > This will throw a ReferenceError since it'll access "this" before calling super() Yes, this is replacing: WebInspector.Annotator.call(this, sourceCodeTextEditor); So the "this" is not needed. This should just be: super(sourceCodeTextEditor); You can test this at runtime by using the Type Profiler. > Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorColorEditingController.js:30 > + super(this, codeMirror, marker); Same. > Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorDragToAdjustNumberController.js:26 > -WebInspector.CodeMirrorDragToAdjustNumberController = function(codeMirror) > +WebInspector.CodeMirrorDragToAdjustNumberController = class CodeMirrorDragToAdjustNumberController Weird that some of our WebInspector.CodeMirrorFoo classes extend WebInspector.Object and others don't. Maybe they all should. > Source/WebInspectorUI/UserInterface/Controllers/FormatterSourceMap.js:35 > + } Trailing whitespace! > Source/WebInspectorUI/UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:28 > - get: function() > + get() Very interesting. I wonder if we should avoid this change. For now, I'd prefer this to be "get: function()" as thinking about it at a high level, this is a get property that is a function, not a method. I think it makes more sense to use the old syntax here. Created attachment 249155 [details]
[PATCH] Proposed Fix
Created attachment 249211 [details]
[PATCH] Proposed Fix
To appease the bots.
Comment on attachment 249211 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=249211&action=review > Source/WebInspectorUI/ChangeLog:6 > + Reviewed by Joseph Pecoraro. Since this is already reviewed, you can just set the cq+ flag to get it landed. Comment on attachment 249211 [details] [PATCH] Proposed Fix Clearing flags on attachment: 249211 Committed r181844: <http://trac.webkit.org/changeset/181844> All reviewed patches have been landed. Closing bug. |