Bug 143169

Summary: Web Inspector: TypeProfiler doesn't work on files with ES6 Class Syntax
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, graouts, joepeck, jonowells, mattbaker, nvasilyev, saam, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed Fix
none
[PATCH] Proposed Fix
none
[IMAGE] What it looks like none

Description Joseph Pecoraro 2015-03-27 18:05:00 PDT
* SUMMARY
TypeProfiler doesn't work on files with ES6 Class Syntax.

* STEPS
1. Inspect test page with Classes, instantiate instances and run methods
2. Type profile said page
  => Models/ScriptSyntaxTree.js:789:26: CONSOLE ERROR Unsupported Syntax Tree Node: ClassExpression

Probably need ClassExpression/ClassDeclaration at the least.
Comment 1 Radar WebKit Bug Importer 2015-03-27 18:05:15 PDT
<rdar://problem/20335450>
Comment 2 Joseph Pecoraro 2015-03-27 18:42:41 PDT
Created attachment 249631 [details]
[PATCH] Proposed Fix
Comment 3 Saam Barati 2015-03-27 19:11:19 PDT
Comment on attachment 249631 [details]
[PATCH] Proposed Fix

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

Looks correct to me besides adding the one bit regarding setter/getter methods.

> Source/WebInspectorUI/UserInterface/Models/ScriptSyntaxTree.js:715
> +            };

Like what's done with "Property" below, we should do:
if (result.kind === "get" || result.kind === "set") {
    result.value.isGetterOrSetter = true;
    result.value.getterOrSetterRange = result.key.range;
}
Comment 4 Joseph Pecoraro 2015-03-27 19:31:43 PDT
Created attachment 249637 [details]
[PATCH] Proposed Fix

Good comment, that greatly fixed up my test case.
Comment 5 Joseph Pecoraro 2015-03-27 19:32:02 PDT
Created attachment 249638 [details]
[IMAGE] What it looks like
Comment 6 WebKit Commit Bot 2015-03-27 22:05:08 PDT
Comment on attachment 249637 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 249637

Committed r182106: <http://trac.webkit.org/changeset/182106>
Comment 7 WebKit Commit Bot 2015-03-27 22:05:14 PDT
All reviewed patches have been landed.  Closing bug.