From 7d6c0f0893d76f11c6d68bd92f500355eaf89f83 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 26 Feb 2015 16:16:20 -0800 Subject: [PATCH] Add ArrowFunction and sort cases. --- src/compiler/utilities.ts | 41 ++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 489e985fb42..a6923e1eb94 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -681,32 +681,33 @@ module ts { export function isDeclaration(node: Node): boolean { switch (node.kind) { - case SyntaxKind.TypeParameter: - case SyntaxKind.Parameter: - case SyntaxKind.VariableDeclaration: + case SyntaxKind.ArrowFunction: case SyntaxKind.BindingElement: - case SyntaxKind.PropertyDeclaration: - case SyntaxKind.PropertySignature: - case SyntaxKind.PropertyAssignment: - case SyntaxKind.ShorthandPropertyAssignment: + case SyntaxKind.ClassDeclaration: + case SyntaxKind.Constructor: + case SyntaxKind.EnumDeclaration: case SyntaxKind.EnumMember: + case SyntaxKind.ExportSpecifier: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.FunctionExpression: + case SyntaxKind.GetAccessor: + case SyntaxKind.ImportClause: + case SyntaxKind.ImportEqualsDeclaration: + case SyntaxKind.ImportSpecifier: + case SyntaxKind.InterfaceDeclaration: case SyntaxKind.MethodDeclaration: case SyntaxKind.MethodSignature: - case SyntaxKind.FunctionDeclaration: - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - case SyntaxKind.Constructor: - case SyntaxKind.ClassDeclaration: - case SyntaxKind.InterfaceDeclaration: - case SyntaxKind.TypeAliasDeclaration: - case SyntaxKind.EnumDeclaration: case SyntaxKind.ModuleDeclaration: - case SyntaxKind.ImportEqualsDeclaration: - case SyntaxKind.ImportClause: - case SyntaxKind.ImportSpecifier: case SyntaxKind.NamespaceImport: - case SyntaxKind.ExportSpecifier: - case SyntaxKind.FunctionExpression: + case SyntaxKind.Parameter: + case SyntaxKind.PropertyAssignment: + case SyntaxKind.PropertyDeclaration: + case SyntaxKind.PropertySignature: + case SyntaxKind.SetAccessor: + case SyntaxKind.ShorthandPropertyAssignment: + case SyntaxKind.TypeAliasDeclaration: + case SyntaxKind.TypeParameter: + case SyntaxKind.VariableDeclaration: return true; } return false;