2
2
/// <reference path="factory.ts" />
3
3
/// <reference path="utilities.ts" />
4
4
5
- namespace ts {
6
-
7
-
5
+ namespace ts {
8
6
export const nullTransformationContext : TransformationContext = {
9
7
enableEmitNotification : noop ,
10
8
enableSubstitution : noop ,
@@ -265,25 +263,25 @@ namespace ts {
265
263
case SyntaxKind . ConstructorType :
266
264
case SyntaxKind . CallSignature :
267
265
case SyntaxKind . ConstructSignature :
268
- return updateSignatureDeclaration ( < SignatureDeclaration > node
269
- , nodesVisitor ( ( < SignatureDeclaration > node ) . typeParameters , visitor , isTypeParameter )
270
- , visitParameterList ( ( < SignatureDeclaration > node ) . parameters , visitor , context , nodesVisitor )
271
- , visitNode ( ( < SignatureDeclaration > node ) . type , visitor , isTypeNode ) ) ;
266
+ return updateSignatureDeclaration ( < SignatureDeclaration > node ,
267
+ nodesVisitor ( ( < SignatureDeclaration > node ) . typeParameters , visitor , isTypeParameter ) ,
268
+ visitParameterList ( ( < SignatureDeclaration > node ) . parameters , visitor , context , nodesVisitor ) ,
269
+ visitNode ( ( < SignatureDeclaration > node ) . type , visitor , isTypeNode ) ) ;
272
270
273
271
case SyntaxKind . MethodSignature :
274
- return updateSignatureDeclaration ( < SignatureDeclaration & TypeElement > node
275
- , nodesVisitor ( ( < SignatureDeclaration & TypeElement > node ) . typeParameters , visitor , isTypeParameter )
276
- , visitParameterList ( ( < SignatureDeclaration & TypeElement > node ) . parameters , visitor , context , nodesVisitor )
277
- , visitNode ( ( < SignatureDeclaration & TypeElement > node ) . type , visitor , isTypeNode )
278
- , visitNode ( ( < SignatureDeclaration & TypeElement > node ) . name , visitor , isPropertyName )
279
- , visitNode ( ( < SignatureDeclaration & TypeElement > node ) . questionToken , visitor , isToken ) ) ;
272
+ return updateSignatureDeclaration ( < SignatureDeclaration & TypeElement > node ,
273
+ nodesVisitor ( ( < SignatureDeclaration & TypeElement > node ) . typeParameters , visitor , isTypeParameter ) ,
274
+ visitParameterList ( ( < SignatureDeclaration & TypeElement > node ) . parameters , visitor , context , nodesVisitor ) ,
275
+ visitNode ( ( < SignatureDeclaration & TypeElement > node ) . type , visitor , isTypeNode ) ,
276
+ visitNode ( ( < SignatureDeclaration & TypeElement > node ) . name , visitor , isPropertyName ) ,
277
+ visitNode ( ( < SignatureDeclaration & TypeElement > node ) . questionToken , visitor , isToken ) ) ;
280
278
281
279
case SyntaxKind . IndexSignature :
282
- return updateIndexSignatureDeclaration ( < IndexSignatureDeclaration > node
283
- , visitParameterList ( ( < IndexSignatureDeclaration > node ) . parameters , visitor , context , nodesVisitor )
284
- , visitNode ( ( < IndexSignatureDeclaration > node ) . type , visitor , isTypeNode )
285
- , nodesVisitor ( ( < IndexSignatureDeclaration > node ) . decorators , visitor , isDecorator )
286
- , nodesVisitor ( ( < IndexSignatureDeclaration > node ) . modifiers , visitor , isModifier ) ) ;
280
+ return updateIndexSignatureDeclaration ( < IndexSignatureDeclaration > node ,
281
+ visitParameterList ( ( < IndexSignatureDeclaration > node ) . parameters , visitor , context , nodesVisitor ) ,
282
+ visitNode ( ( < IndexSignatureDeclaration > node ) . type , visitor , isTypeNode ) ,
283
+ nodesVisitor ( ( < IndexSignatureDeclaration > node ) . decorators , visitor , isDecorator ) ,
284
+ nodesVisitor ( ( < IndexSignatureDeclaration > node ) . modifiers , visitor , isModifier ) ) ;
287
285
288
286
case SyntaxKind . Parameter :
289
287
return updateParameter ( < ParameterDeclaration > node ,
@@ -304,9 +302,9 @@ namespace ts {
304
302
case SyntaxKind . TypePredicate :
305
303
throw new Error ( "reached unsupported type in visitor." ) ;
306
304
case SyntaxKind . TypeReference :
307
- return updateTypeReferenceNode ( < TypeReferenceNode > node
308
- , visitNode ( ( < TypeReferenceNode > node ) . typeName , visitor , isEntityName )
309
- , nodesVisitor ( ( < TypeReferenceNode > node ) . typeArguments , visitor , isTypeNode ) ) ;
305
+ return updateTypeReferenceNode ( < TypeReferenceNode > node ,
306
+ visitNode ( ( < TypeReferenceNode > node ) . typeName , visitor , isEntityName ) ,
307
+ nodesVisitor ( ( < TypeReferenceNode > node ) . typeArguments , visitor , isTypeNode ) ) ;
310
308
311
309
case SyntaxKind . TypeQuery :
312
310
return updateTypeQueryNode ( ( < TypeQueryNode > node ) , visitNode ( ( < TypeQueryNode > node ) . exprName , visitor , isEntityName ) ) ;
@@ -322,8 +320,8 @@ namespace ts {
322
320
323
321
case SyntaxKind . UnionType :
324
322
case SyntaxKind . IntersectionType :
325
- return updateUnionOrIntersectionTypeNode ( < UnionOrIntersectionTypeNode > node
326
- , nodesVisitor ( ( < UnionOrIntersectionTypeNode > node ) . types , visitor , isTypeNode ) ) ;
323
+ return updateUnionOrIntersectionTypeNode ( < UnionOrIntersectionTypeNode > node ,
324
+ nodesVisitor ( ( < UnionOrIntersectionTypeNode > node ) . types , visitor , isTypeNode ) ) ;
327
325
328
326
case SyntaxKind . ParenthesizedType :
329
327
throw new Error ( "reached unsupported type in visitor." ) ;
@@ -332,43 +330,43 @@ namespace ts {
332
330
case SyntaxKind . TypeOperator :
333
331
return updateTypeOperatorNode ( < TypeOperatorNode > node , visitNode ( ( < TypeOperatorNode > node ) . type , visitor , isTypeNode ) ) ;
334
332
case SyntaxKind . IndexedAccessType :
335
- return updateIndexedAccessTypeNode ( ( < IndexedAccessTypeNode > node )
336
- , visitNode ( ( < IndexedAccessTypeNode > node ) . objectType , visitor , isTypeNode )
337
- , visitNode ( ( < IndexedAccessTypeNode > node ) . indexType , visitor , isTypeNode ) ) ;
333
+ return updateIndexedAccessTypeNode ( ( < IndexedAccessTypeNode > node ) ,
334
+ visitNode ( ( < IndexedAccessTypeNode > node ) . objectType , visitor , isTypeNode ) ,
335
+ visitNode ( ( < IndexedAccessTypeNode > node ) . indexType , visitor , isTypeNode ) ) ;
338
336
case SyntaxKind . MappedType :
339
- return updateMappedTypeNode ( ( < MappedTypeNode > node )
340
- , visitNode ( ( < MappedTypeNode > node ) . readonlyToken , visitor , isToken )
341
- , visitNode ( ( < MappedTypeNode > node ) . typeParameter , visitor , isTypeParameter )
342
- , visitNode ( ( < MappedTypeNode > node ) . questionToken , visitor , isToken )
343
- , visitNode ( ( < MappedTypeNode > node ) . type , visitor , isTypeNode ) ) ;
337
+ return updateMappedTypeNode ( ( < MappedTypeNode > node ) ,
338
+ visitNode ( ( < MappedTypeNode > node ) . readonlyToken , visitor , isToken ) ,
339
+ visitNode ( ( < MappedTypeNode > node ) . typeParameter , visitor , isTypeParameter ) ,
340
+ visitNode ( ( < MappedTypeNode > node ) . questionToken , visitor , isToken ) ,
341
+ visitNode ( ( < MappedTypeNode > node ) . type , visitor , isTypeNode ) ) ;
344
342
345
343
case SyntaxKind . LiteralType :
346
- return updateLiteralTypeNode ( < LiteralTypeNode > node
347
- , visitNode ( ( < LiteralTypeNode > node ) . literal , visitor , isExpression ) ) ;
344
+ return updateLiteralTypeNode ( < LiteralTypeNode > node ,
345
+ visitNode ( ( < LiteralTypeNode > node ) . literal , visitor , isExpression ) ) ;
348
346
349
347
// Type Declarations
350
348
351
349
case SyntaxKind . TypeParameter :
352
- return updateTypeParameterDeclaration ( < TypeParameterDeclaration > node
353
- , visitNode ( ( < TypeParameterDeclaration > node ) . name , visitor , isIdentifier )
354
- , visitNode ( ( < TypeParameterDeclaration > node ) . constraint , visitor , isTypeNode )
355
- , visitNode ( ( < TypeParameterDeclaration > node ) . default , visitor , isTypeNode ) ) ;
350
+ return updateTypeParameterDeclaration ( < TypeParameterDeclaration > node ,
351
+ visitNode ( ( < TypeParameterDeclaration > node ) . name , visitor , isIdentifier ) ,
352
+ visitNode ( ( < TypeParameterDeclaration > node ) . constraint , visitor , isTypeNode ) ,
353
+ visitNode ( ( < TypeParameterDeclaration > node ) . default , visitor , isTypeNode ) ) ;
356
354
357
355
// Type members
358
356
359
357
case SyntaxKind . PropertySignature :
360
- return updatePropertySignature ( ( < PropertySignature > node )
361
- , visitNode ( ( < PropertySignature > node ) . name , visitor , isPropertyName )
362
- , visitNode ( ( < PropertySignature > node ) . questionToken , visitor , isToken )
363
- , visitNode ( ( < PropertySignature > node ) . type , visitor , isTypeNode )
364
- , visitNode ( ( < PropertySignature > node ) . initializer , visitor , isExpression ) ) ;
358
+ return updatePropertySignature ( ( < PropertySignature > node ) ,
359
+ visitNode ( ( < PropertySignature > node ) . name , visitor , isPropertyName ) ,
360
+ visitNode ( ( < PropertySignature > node ) . questionToken , visitor , isToken ) ,
361
+ visitNode ( ( < PropertySignature > node ) . type , visitor , isTypeNode ) ,
362
+ visitNode ( ( < PropertySignature > node ) . initializer , visitor , isExpression ) ) ;
365
363
366
364
case SyntaxKind . IndexSignature :
367
- return updateIndexSignatureDeclaration ( < IndexSignatureDeclaration > node
368
- , visitParameterList ( ( < IndexSignatureDeclaration > node ) . parameters , visitor , context , nodesVisitor )
369
- , visitNode ( ( < IndexSignatureDeclaration > node ) . type , visitor , isTypeNode )
370
- , nodesVisitor ( ( < IndexSignatureDeclaration > node ) . decorators , visitor , isDecorator )
371
- , nodesVisitor ( ( < IndexSignatureDeclaration > node ) . modifiers , visitor , isModifier ) ) ;
365
+ return updateIndexSignatureDeclaration ( < IndexSignatureDeclaration > node ,
366
+ visitParameterList ( ( < IndexSignatureDeclaration > node ) . parameters , visitor , context , nodesVisitor ) ,
367
+ visitNode ( ( < IndexSignatureDeclaration > node ) . type , visitor , isTypeNode ) ,
368
+ nodesVisitor ( ( < IndexSignatureDeclaration > node ) . decorators , visitor , isDecorator ) ,
369
+ nodesVisitor ( ( < IndexSignatureDeclaration > node ) . modifiers , visitor , isModifier ) ) ;
372
370
373
371
case SyntaxKind . PropertyDeclaration :
374
372
return updateProperty ( < PropertyDeclaration > node ,
0 commit comments