Modified: trunk/Source/WebInspectorUI/ChangeLog (189117 => 189118)
--- trunk/Source/WebInspectorUI/ChangeLog 2015-08-28 19:12:20 UTC (rev 189117)
+++ trunk/Source/WebInspectorUI/ChangeLog 2015-08-28 19:31:36 UTC (rev 189118)
@@ -1,5 +1,19 @@
2015-08-28 Joseph Pecoraro <pecor...@apple.com>
+ Web Inspector: Improve ScriptSyntaxTree a bit
+ https://bugs.webkit.org/show_bug.cgi?id=148563
+
+ Reviewed by Timothy Hatcher.
+
+ * UserInterface/Models/ScriptSyntaxTree.js:
+ (WebInspector.ScriptSyntaxTree.prototype._recurse):
+ (WebInspector.ScriptSyntaxTree.prototype._createInternalSyntaxTree):
+ Share and fix ClassDeclaration and ClassExpression recursion to visit
+ the identifier (node.id). Include the kind with a VariableDeclaration
+ ("var", "let", "const").
+
+2015-08-28 Joseph Pecoraro <pecor...@apple.com>
+
Web Inspector: Separate creating a style sheet from adding a new rule in the protocol
https://bugs.webkit.org/show_bug.cgi?id=148502
Modified: trunk/Source/WebInspectorUI/UserInterface/Models/ScriptSyntaxTree.js (189117 => 189118)
--- trunk/Source/WebInspectorUI/UserInterface/Models/ScriptSyntaxTree.js 2015-08-28 19:12:20 UTC (rev 189117)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ScriptSyntaxTree.js 2015-08-28 19:31:36 UTC (rev 189118)
@@ -326,12 +326,9 @@
this._recurseArray(node.body, callback, state);
break;
case WebInspector.ScriptSyntaxTree.NodeType.ClassDeclaration:
- callback(node, state);
- this._recurse(node.superClass, callback, state);
- this._recurse(node.body, callback, state);
- break;
case WebInspector.ScriptSyntaxTree.NodeType.ClassExpression:
callback(node, state);
+ this._recurse(node.id, callback, state);
this._recurse(node.superClass, callback, state);
this._recurse(node.body, callback, state);
break;
@@ -369,12 +366,6 @@
this._recurse(node.body, callback, state);
break;
case WebInspector.ScriptSyntaxTree.NodeType.FunctionDeclaration:
- 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);
@@ -886,7 +877,8 @@
case "VariableDeclaration":
result = {
type: WebInspector.ScriptSyntaxTree.NodeType.VariableDeclaration,
- declarations: node.declarations.map(this._createInternalSyntaxTree.bind(this))
+ declarations: node.declarations.map(this._createInternalSyntaxTree.bind(this)),
+ kind: node.kind
};
break;
case "VariableDeclarator":