Addressing CR feedback:

New SyntaxKind.BindingElement
Introduced new VariableLikeDeclaration and BindingElement types
Cleaned up VariableDeclaration, ParameterDeclaration, PropertyDeclaration types
Node kind of binding element is always SyntaxKind.BindingElement
Changed CheckVariableDeclaration to CheckVariableLikeDeclaration
Reorganized CheckVariableLikeDeclaration
This commit is contained in:
Anders Hejlsberg
2014-12-06 13:53:06 -08:00
parent 4118ffc703
commit 05c9966180
7 changed files with 231 additions and 156 deletions
+3
View File
@@ -224,6 +224,9 @@ module ts.NavigationBar {
function createChildItem(node: Node): ts.NavigationBarItem {
switch (node.kind) {
case SyntaxKind.Parameter:
if (isBindingPattern((<VariableDeclaration>node).name)) {
break;
}
if ((node.flags & NodeFlags.Modifier) === 0) {
return undefined;
}
+2
View File
@@ -819,6 +819,7 @@ module ts {
}
// fall through
case SyntaxKind.VariableDeclaration:
case SyntaxKind.BindingElement:
if (isBindingPattern((<VariableDeclaration>node).name)) {
forEachChild((<VariableDeclaration>node).name, visit);
break;
@@ -4712,6 +4713,7 @@ module ts {
switch (node.kind) {
case SyntaxKind.Parameter:
case SyntaxKind.VariableDeclaration:
case SyntaxKind.BindingElement:
case SyntaxKind.Property:
case SyntaxKind.PropertyAssignment:
case SyntaxKind.ShorthandPropertyAssignment: