Bug 142858

Summary: Web Inspector: Adopt ES6 Class Syntax for all Model Objects
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: burg, graouts, joepeck, jonowells, mattbaker, nvasilyev, rniwa, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed Fix - For Bots
none
[PATCH] Easier to Review - Ignores Whitespace
none
[PATCH] Proposed Fix timothy: review+

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