Bug 142858 - Web Inspector: Adopt ES6 Class Syntax for all Model Objects
Summary: Web Inspector: Adopt ES6 Class Syntax for all Model Objects
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-03-18 19:44 PDT by Joseph Pecoraro
Modified: 2015-03-19 17:19 PDT (History)
9 users (show)

See Also:


Attachments
[PATCH] Proposed Fix - For Bots (501.73 KB, patch)
2015-03-19 11:44 PDT, Joseph Pecoraro
no flags Details | Formatted Diff | Diff
[PATCH] Easier to Review - Ignores Whitespace (416.82 KB, patch)
2015-03-19 11:44 PDT, Joseph Pecoraro
no flags Details | Formatted Diff | Diff
[PATCH] Proposed Fix (503.05 KB, patch)
2015-03-19 15:05 PDT, Joseph Pecoraro
timothy: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2015-03-18 19:44:27 PDT
* SUMMARY
Adopt ES6 Class Syntax for all Model Objects.

Why?
• Cleaner, briefer syntax across the board (methods, static methods, etc)
• Real inheritance makes following class hierarchies easier. The top line tells you exactly what your super class is.
• Much easier to call super class methods and constructors, in constructors it is runtime enforced!
• Dog food new JavaScriptCore features to get real world test coverage
Comment 1 Joseph Pecoraro 2015-03-19 11:44:17 PDT
Created attachment 249041 [details]
[PATCH] Proposed Fix - For Bots
Comment 2 Radar WebKit Bug Importer 2015-03-19 11:44:31 PDT
<rdar://problem/20227143>
Comment 3 Joseph Pecoraro 2015-03-19 11:44:56 PDT
Created attachment 249042 [details]
[PATCH] Easier to Review - Ignores Whitespace
Comment 4 Brian Burg 2015-03-19 11:50:00 PDT
Comment on attachment 249041 [details]
[PATCH] Proposed Fix - For Bots

View in context: https://bugs.webkit.org/attachment.cgi?id=249041&action=review

> LayoutTests/ChangeLog:7
> +

Can you note the bugs fixed along the way?

> Source/WebInspectorUI/ChangeLog:7
> +

It would also be good to enumerate the various temporary workarounds and FIXMEs.
Comment 5 Joseph Pecoraro 2015-03-19 15:05:53 PDT
Created attachment 249062 [details]
[PATCH] Proposed Fix

Sorry, the earlier patch was hastily put up to ensure the bots were as fine with it as I was locally.

This is one with ChangeLogs, and rebased.
Comment 6 Timothy Hatcher 2015-03-19 16:22:22 PDT
Comment on attachment 249062 [details]
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=249062&action=review

> Source/WebInspectorUI/UserInterface/Base/Object.js:161
> +    var list = ["addEventListener", "removeEventListener", "removeAllListeners", "hasEventListeners"];
> +    for (var property of list) {

Maybe this should be one line, it won't be much difference in line length.

> Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js:435
> -        newRecording.addTimeline(new WebInspector.Timeline(WebInspector.TimelineRecord.Type.Script, newRecording));
> +        newRecording.addTimeline(WebInspector.Timeline.create(WebInspector.TimelineRecord.Type.Network, newRecording));

Sad face.
Comment 7 Joseph Pecoraro 2015-03-19 17:19:33 PDT
http://trac.webkit.org/changeset/181769