WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
142890
Web Inspector: Adopt ES6 Class Syntax for all Controller Objects
https://bugs.webkit.org/show_bug.cgi?id=142890
Summary
Web Inspector: Adopt ES6 Class Syntax for all Controller Objects
Matt Baker
Reported
2015-03-19 18:31:43 PDT
* 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.
Attachments
[PATCH] Proposed Fix
(244.02 KB, patch)
2015-03-20 17:19 PDT
,
Matt Baker
no flags
Details
Formatted Diff
Diff
[PATCH] Proposed Fix
(243.82 KB, patch)
2015-03-20 18:53 PDT
,
Matt Baker
no flags
Details
Formatted Diff
Diff
[PATCH] Proposed Fix
(243.67 KB, patch)
2015-03-22 18:26 PDT
,
Matt Baker
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2015-03-19 18:32:13 PDT
<
rdar://problem/20233853
>
Matt Baker
Comment 2
2015-03-20 17:19:26 PDT
Created
attachment 249152
[details]
[PATCH] Proposed Fix
Ryosuke Niwa
Comment 3
2015-03-20 17:21:49 PDT
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()
Ryosuke Niwa
Comment 4
2015-03-20 17:26:22 PDT
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.
Joseph Pecoraro
Comment 5
2015-03-20 17:54:54 PDT
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.
Matt Baker
Comment 6
2015-03-20 18:53:01 PDT
Created
attachment 249155
[details]
[PATCH] Proposed Fix
Matt Baker
Comment 7
2015-03-22 18:26:15 PDT
Created
attachment 249211
[details]
[PATCH] Proposed Fix To appease the bots.
Joseph Pecoraro
Comment 8
2015-03-22 21:16:58 PDT
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.
WebKit Commit Bot
Comment 9
2015-03-22 22:03:10 PDT
Comment on
attachment 249211
[details]
[PATCH] Proposed Fix Clearing flags on attachment: 249211 Committed
r181844
: <
http://trac.webkit.org/changeset/181844
>
WebKit Commit Bot
Comment 10
2015-03-22 22:03:15 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug