@@ -224,9 +224,9 @@ namespace ts {
224
224
* @param visitor The callback used to visit each child.
225
225
* @param context A lexical environment context for the visitor.
226
226
*/
227
- export function visitEachChild < T extends Node > ( node : T | undefined , visitor : Visitor , context : TransformationContext , nodesVisitor ?: typeof visitNodes ) : T | undefined ;
227
+ export function visitEachChild < T extends Node > ( node : T | undefined , visitor : Visitor , context : TransformationContext , nodesVisitor ?: typeof visitNodes , tokenVisitor ?: Visitor ) : T | undefined ;
228
228
229
- export function visitEachChild ( node : Node , visitor : Visitor , context : TransformationContext , nodesVisitor = visitNodes ) : Node {
229
+ export function visitEachChild ( node : Node , visitor : Visitor , context : TransformationContext , nodesVisitor = visitNodes , tokenVisitor ?: Visitor ) : Node {
230
230
if ( node === undefined ) {
231
231
return undefined ;
232
232
}
@@ -274,7 +274,7 @@ namespace ts {
274
274
visitParameterList ( ( < SignatureDeclaration & TypeElement > node ) . parameters , visitor , context , nodesVisitor ) ,
275
275
visitNode ( ( < SignatureDeclaration & TypeElement > node ) . type , visitor , isTypeNode ) ,
276
276
visitNode ( ( < SignatureDeclaration & TypeElement > node ) . name , visitor , isPropertyName ) ,
277
- visitNode ( ( < SignatureDeclaration & TypeElement > node ) . questionToken , visitor , isToken ) ) ;
277
+ visitNode ( ( < SignatureDeclaration & TypeElement > node ) . questionToken , tokenVisitor , isToken ) ) ;
278
278
279
279
case SyntaxKind . IndexSignature :
280
280
return updateIndexSignatureDeclaration ( < IndexSignatureDeclaration > node ,
@@ -287,9 +287,9 @@ namespace ts {
287
287
return updateParameter ( < ParameterDeclaration > node ,
288
288
nodesVisitor ( ( < ParameterDeclaration > node ) . decorators , visitor , isDecorator ) ,
289
289
nodesVisitor ( ( < ParameterDeclaration > node ) . modifiers , visitor , isModifier ) ,
290
- visitNode ( ( < ParameterDeclaration > node ) . dotDotDotToken , visitor ) ,
290
+ visitNode ( ( < ParameterDeclaration > node ) . dotDotDotToken , tokenVisitor , isToken ) ,
291
291
visitNode ( ( < ParameterDeclaration > node ) . name , visitor , isBindingName ) ,
292
- visitNode ( ( < ParameterDeclaration > node ) . questionToken , visitor , isToken ) ,
292
+ visitNode ( ( < ParameterDeclaration > node ) . questionToken , tokenVisitor , isToken ) ,
293
293
visitNode ( ( < ParameterDeclaration > node ) . type , visitor , isTypeNode ) ,
294
294
visitNode ( ( < ParameterDeclaration > node ) . initializer , visitor , isExpression ) ) ;
295
295
@@ -335,9 +335,9 @@ namespace ts {
335
335
visitNode ( ( < IndexedAccessTypeNode > node ) . indexType , visitor , isTypeNode ) ) ;
336
336
case SyntaxKind . MappedType :
337
337
return updateMappedTypeNode ( ( < MappedTypeNode > node ) ,
338
- visitNode ( ( < MappedTypeNode > node ) . readonlyToken , visitor , isToken ) ,
338
+ visitNode ( ( < MappedTypeNode > node ) . readonlyToken , tokenVisitor , isToken ) ,
339
339
visitNode ( ( < MappedTypeNode > node ) . typeParameter , visitor , isTypeParameter ) ,
340
- visitNode ( ( < MappedTypeNode > node ) . questionToken , visitor , isToken ) ,
340
+ visitNode ( ( < MappedTypeNode > node ) . questionToken , tokenVisitor , isToken ) ,
341
341
visitNode ( ( < MappedTypeNode > node ) . type , visitor , isTypeNode ) ) ;
342
342
343
343
case SyntaxKind . LiteralType :
@@ -357,7 +357,7 @@ namespace ts {
357
357
case SyntaxKind . PropertySignature :
358
358
return updatePropertySignature ( ( < PropertySignature > node ) ,
359
359
visitNode ( ( < PropertySignature > node ) . name , visitor , isPropertyName ) ,
360
- visitNode ( ( < PropertySignature > node ) . questionToken , visitor , isToken ) ,
360
+ visitNode ( ( < PropertySignature > node ) . questionToken , tokenVisitor , isToken ) ,
361
361
visitNode ( ( < PropertySignature > node ) . type , visitor , isTypeNode ) ,
362
362
visitNode ( ( < PropertySignature > node ) . initializer , visitor , isExpression ) ) ;
363
363
@@ -380,9 +380,9 @@ namespace ts {
380
380
return updateMethod ( < MethodDeclaration > node ,
381
381
nodesVisitor ( ( < MethodDeclaration > node ) . decorators , visitor , isDecorator ) ,
382
382
nodesVisitor ( ( < MethodDeclaration > node ) . modifiers , visitor , isModifier ) ,
383
- visitNode ( ( < MethodDeclaration > node ) . asteriskToken , visitor , isToken ) ,
383
+ visitNode ( ( < MethodDeclaration > node ) . asteriskToken , tokenVisitor , isToken ) ,
384
384
visitNode ( ( < MethodDeclaration > node ) . name , visitor , isPropertyName ) ,
385
- visitNode ( ( < MethodDeclaration > node ) . questionToken , visitor , isToken ) ,
385
+ visitNode ( ( < MethodDeclaration > node ) . questionToken , tokenVisitor , isToken ) ,
386
386
nodesVisitor ( ( < MethodDeclaration > node ) . typeParameters , visitor , isTypeParameter ) ,
387
387
visitParameterList ( ( < MethodDeclaration > node ) . parameters , visitor , context , nodesVisitor ) ,
388
388
visitNode ( ( < MethodDeclaration > node ) . type , visitor , isTypeNode ) ,
@@ -423,7 +423,7 @@ namespace ts {
423
423
424
424
case SyntaxKind . BindingElement :
425
425
return updateBindingElement ( < BindingElement > node ,
426
- ( < BindingElement > node ) . dotDotDotToken ,
426
+ visitNode ( ( < BindingElement > node ) . dotDotDotToken , tokenVisitor , isToken ) ,
427
427
visitNode ( ( < BindingElement > node ) . propertyName , visitor , isPropertyName ) ,
428
428
visitNode ( ( < BindingElement > node ) . name , visitor , isBindingName ) ,
429
429
visitNode ( ( < BindingElement > node ) . initializer , visitor , isExpression ) ) ;
@@ -476,7 +476,7 @@ namespace ts {
476
476
case SyntaxKind . FunctionExpression :
477
477
return updateFunctionExpression ( < FunctionExpression > node ,
478
478
nodesVisitor ( ( < FunctionExpression > node ) . modifiers , visitor , isModifier ) ,
479
- ( < FunctionExpression > node ) . asteriskToken ,
479
+ visitNode ( ( < FunctionExpression > node ) . asteriskToken , tokenVisitor , isToken ) ,
480
480
visitNode ( ( < FunctionExpression > node ) . name , visitor , isIdentifier ) ,
481
481
nodesVisitor ( ( < FunctionExpression > node ) . typeParameters , visitor , isTypeParameter ) ,
482
482
visitParameterList ( ( < FunctionExpression > node ) . parameters , visitor , context , nodesVisitor ) ,
@@ -533,7 +533,7 @@ namespace ts {
533
533
534
534
case SyntaxKind . YieldExpression :
535
535
return updateYield ( < YieldExpression > node ,
536
- ( < YieldExpression > node ) . asteriskToken ,
536
+ visitNode ( ( < YieldExpression > node ) . asteriskToken , tokenVisitor , isToken ) ,
537
537
visitNode ( ( < YieldExpression > node ) . expression , visitor , isExpression ) ) ;
538
538
539
539
case SyntaxKind . SpreadElement :
@@ -669,7 +669,7 @@ namespace ts {
669
669
return updateFunctionDeclaration ( < FunctionDeclaration > node ,
670
670
nodesVisitor ( ( < FunctionDeclaration > node ) . decorators , visitor , isDecorator ) ,
671
671
nodesVisitor ( ( < FunctionDeclaration > node ) . modifiers , visitor , isModifier ) ,
672
- ( < FunctionDeclaration > node ) . asteriskToken ,
672
+ visitNode ( ( < FunctionDeclaration > node ) . asteriskToken , tokenVisitor , isToken ) ,
673
673
visitNode ( ( < FunctionDeclaration > node ) . name , visitor , isIdentifier ) ,
674
674
nodesVisitor ( ( < FunctionDeclaration > node ) . typeParameters , visitor , isTypeParameter ) ,
675
675
visitParameterList ( ( < FunctionDeclaration > node ) . parameters , visitor , context , nodesVisitor ) ,
0 commit comments