Title: [189096] trunk/Source/WebInspectorUI
Revision
189096
Author
commit-qu...@webkit.org
Date
2015-08-28 05:58:14 -0700 (Fri, 28 Aug 2015)

Log Message

Web Inspector: Type Profiler does not understand Functions within Default Argument Expressions
https://bugs.webkit.org/show_bug.cgi?id=148557

Patch by Joseph Pecoraro <pecor...@apple.com> on 2015-08-28
Reviewed by Timothy Hatcher.

* UserInterface/Models/ScriptSyntaxTree.js:
(WebInspector.ScriptSyntaxTree.prototype._recurse):
(WebInspector.ScriptSyntaxTree.prototype._createInternalSyntaxTree):
(WebInspector.ScriptSyntaxTree):
Add support for abstracting and recursing through the default parameter
expressions Esprima has on function expressions and declarations.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (189095 => 189096)


--- trunk/Source/WebInspectorUI/ChangeLog	2015-08-28 12:57:07 UTC (rev 189095)
+++ trunk/Source/WebInspectorUI/ChangeLog	2015-08-28 12:58:14 UTC (rev 189096)
@@ -1,5 +1,19 @@
 2015-08-28  Joseph Pecoraro  <pecor...@apple.com>
 
+        Web Inspector: Type Profiler does not understand Functions within Default Argument Expressions
+        https://bugs.webkit.org/show_bug.cgi?id=148557
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Models/ScriptSyntaxTree.js:
+        (WebInspector.ScriptSyntaxTree.prototype._recurse):
+        (WebInspector.ScriptSyntaxTree.prototype._createInternalSyntaxTree):
+        (WebInspector.ScriptSyntaxTree):
+        Add support for abstracting and recursing through the default parameter
+        expressions Esprima has on function expressions and declarations.
+
+2015-08-28  Joseph Pecoraro  <pecor...@apple.com>
+
         Web Inspector: Type Profiler does not understand Functions inside Template Strings (ScriptSyntaxTree warnings)
         https://bugs.webkit.org/show_bug.cgi?id=148556
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Models/ScriptSyntaxTree.js (189095 => 189096)


--- trunk/Source/WebInspectorUI/UserInterface/Models/ScriptSyntaxTree.js	2015-08-28 12:57:07 UTC (rev 189095)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ScriptSyntaxTree.js	2015-08-28 12:58:14 UTC (rev 189096)
@@ -372,12 +372,14 @@
             callback(node, state);
             this._recurse(node.id, callback, state);
             this._recurseArray(node.params, callback, state);
+            this._recurseArray(node.defaults, callback, state);
             this._recurse(node.body, callback, state);
             break;
         case WebInspector.ScriptSyntaxTree.NodeType.FunctionExpression:
             callback(node, state);
             this._recurse(node.id, callback, state);
             this._recurseArray(node.params, callback, state);
+            this._recurseArray(node.defaults, callback, state);
             this._recurse(node.body, callback, state);
             break;
         case WebInspector.ScriptSyntaxTree.NodeType.Identifier:
@@ -678,6 +680,7 @@
                 type: WebInspector.ScriptSyntaxTree.NodeType.FunctionDeclaration,
                 id: this._createInternalSyntaxTree(node.id),
                 params: node.params.map(this._createInternalSyntaxTree.bind(this)),
+                defaults: node.defaults.map(this._createInternalSyntaxTree.bind(this)),
                 body: this._createInternalSyntaxTree(node.body),
                 isGetterOrSetter: false // This is obvious, but is convenient none the less b/c Declarations and Expressions are often intertwined.
             };
@@ -687,6 +690,7 @@
                 type: WebInspector.ScriptSyntaxTree.NodeType.FunctionExpression,
                 id: this._createInternalSyntaxTree(node.id),
                 params: node.params.map(this._createInternalSyntaxTree.bind(this)),
+                defaults: node.defaults.map(this._createInternalSyntaxTree.bind(this)),
                 body: this._createInternalSyntaxTree(node.body),
                 isGetterOrSetter: false // If true, it is set in the Property AST node.
             };
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to