@@ -864,6 +864,7 @@ export abstract class Node {
864864 body : Statement | null ,
865865 decorators : DecoratorNode [ ] | null ,
866866 flags : CommonFlags ,
867+ arrowKind : ArrowKind ,
867868 range : Range
868869 ) : FunctionDeclaration {
869870 var stmt = new FunctionDeclaration ( ) ;
@@ -874,6 +875,7 @@ export abstract class Node {
874875 stmt . signature = signature ;
875876 stmt . body = body ;
876877 stmt . decorators = decorators ;
878+ stmt . arrowKind = arrowKind ;
877879 return stmt ;
878880 }
879881
@@ -1773,6 +1775,16 @@ export class ForStatement extends Statement {
17731775 statement : Statement ;
17741776}
17751777
1778+ /** Indicates the kind of an array function. */
1779+ export const enum ArrowKind {
1780+ /** Not an arrow function. */
1781+ NONE ,
1782+ /** Parenthesized parameter list. */
1783+ ARROW_PARENTHESIZED ,
1784+ /** Single parameter without parenthesis. */
1785+ ARROW_SINGLE
1786+ }
1787+
17761788/** Represents a `function` declaration. */
17771789export class FunctionDeclaration extends DeclarationStatement {
17781790 kind = NodeKind . FUNCTIONDECLARATION ;
@@ -1783,6 +1795,8 @@ export class FunctionDeclaration extends DeclarationStatement {
17831795 signature : SignatureNode ;
17841796 /** Body statement. Usually a block. */
17851797 body : Statement | null ;
1798+ /** Arrow function kind, if applicable. */
1799+ arrowKind : ArrowKind ;
17861800
17871801 get isGeneric ( ) : bool {
17881802 var typeParameters = this . typeParameters ;
@@ -1792,7 +1806,14 @@ export class FunctionDeclaration extends DeclarationStatement {
17921806 /** Clones this function declaration. */
17931807 clone ( ) : FunctionDeclaration {
17941808 return Node . createFunctionDeclaration (
1795- this . name , this . typeParameters , this . signature , this . body , this . decorators , this . flags , this . range
1809+ this . name ,
1810+ this . typeParameters ,
1811+ this . signature ,
1812+ this . body ,
1813+ this . decorators ,
1814+ this . flags ,
1815+ this . arrowKind ,
1816+ this . range
17961817 ) ;
17971818 }
17981819}
@@ -1960,3 +1981,12 @@ export function mangleInternalPath(path: string): string {
19601981 if ( path . endsWith ( ".ts" ) ) path = path . substring ( 0 , path . length - 3 ) ;
19611982 return path ;
19621983}
1984+
1985+ /** Tests if the specified type node represents an omitted type. */
1986+ export function isTypeOmitted ( type : CommonTypeNode ) : bool {
1987+ if ( type . kind == NodeKind . TYPE ) {
1988+ let name = ( < TypeNode > type ) . name ;
1989+ return ! ( name . next || name . identifier . text . length ) ;
1990+ }
1991+ return false ;
1992+ }
0 commit comments