* SUMMARY Adopt ES6 Class Syntax for all Controller Objects. * NOTES The const keyword isn't allowed in strict mode, and ES6 class method scope uses strict mode implicitly. Instances of const will need to be replaced with var.
<rdar://problem/20233853>
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.