@@ -7,8 +7,7 @@ import ts = require("typescript");
7
7
export function translateProgram ( program : ts . Program ) : string {
8
8
var result : string = "" ;
9
9
program . getSourceFiles ( )
10
- . filter ( ( sourceFile : ts . SourceFile ) =>
11
- sourceFile . fileName . indexOf ( ".d.ts" ) < 0 )
10
+ . filter ( ( sourceFile : ts . SourceFile ) => sourceFile . fileName . indexOf ( ".d.ts" ) < 0 )
12
11
. forEach ( emitDart ) ;
13
12
return result ;
14
13
@@ -55,8 +54,7 @@ export function translateProgram(program: ts.Program): string {
55
54
56
55
function visit ( node : ts . Node ) {
57
56
// console.log(`Node kind: ${node.kind} ${node.getText()}`);
58
- var comments = ts . getLeadingCommentRanges ( node . getSourceFile ( ) . text ,
59
- node . getFullStart ( ) ) ;
57
+ var comments = ts . getLeadingCommentRanges ( node . getSourceFile ( ) . text , node . getFullStart ( ) ) ;
60
58
if ( comments ) {
61
59
comments . forEach ( ( c ) => {
62
60
if ( c . pos <= lastCommentIdx ) return ;
@@ -354,8 +352,7 @@ export function translateProgram(program: ts.Program): string {
354
352
355
353
case ts . SyntaxKind . Parameter :
356
354
var paramDecl = < ts . ParameterDeclaration > node ;
357
- if ( paramDecl . dotDotDotToken )
358
- reportError ( node , 'rest parameters are unsupported' ) ;
355
+ if ( paramDecl . dotDotDotToken ) reportError ( node , 'rest parameters are unsupported' ) ;
359
356
if ( paramDecl . initializer ) emit ( '[' ) ;
360
357
if ( paramDecl . type ) visit ( paramDecl . type ) ;
361
358
visit ( paramDecl . name ) ;
@@ -379,8 +376,7 @@ export function translateProgram(program: ts.Program): string {
379
376
break ;
380
377
381
378
default :
382
- reportError (
383
- node , "Unsupported node type " + ( < any > ts ) . SyntaxKind [ node . kind ] ) ;
379
+ reportError ( node , "Unsupported node type " + ( < any > ts ) . SyntaxKind [ node . kind ] ) ;
384
380
break ;
385
381
}
386
382
}
0 commit comments