Skip to content

Commit a8dfdf2

Browse files
ajafffmhegazy
authored andcommitted
Add and fix some AST Node parent types (#18200)
1 parent 7b12b79 commit a8dfdf2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/compiler/types.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,7 @@ namespace ts {
636636

637637
export interface Decorator extends Node {
638638
kind: SyntaxKind.Decorator;
639+
parent?: NamedDeclaration;
639640
expression: LeftHandSideExpression;
640641
}
641642

@@ -765,6 +766,7 @@ namespace ts {
765766
export interface SpreadAssignment extends ObjectLiteralElement {
766767
parent: ObjectLiteralExpression;
767768
kind: SyntaxKind.SpreadAssignment;
769+
parent?: ObjectLiteralExpression;
768770
expression: Expression;
769771
}
770772

@@ -781,7 +783,7 @@ namespace ts {
781783
export interface VariableLikeDeclaration extends NamedDeclaration {
782784
propertyName?: PropertyName;
783785
dotDotDotToken?: DotDotDotToken;
784-
name?: DeclarationName; // May be missing for ParameterDeclaration, see comment there
786+
name: DeclarationName;
785787
questionToken?: QuestionToken;
786788
type?: TypeNode;
787789
initializer?: Expression;
@@ -945,6 +947,7 @@ namespace ts {
945947

946948
export interface TypePredicateNode extends TypeNode {
947949
kind: SyntaxKind.TypePredicate;
950+
parent?: SignatureDeclaration;
948951
parameterName: Identifier | ThisTypeNode;
949952
type: TypeNode;
950953
}
@@ -1001,7 +1004,6 @@ namespace ts {
10011004

10021005
export interface MappedTypeNode extends TypeNode, Declaration {
10031006
kind: SyntaxKind.MappedType;
1004-
parent?: TypeAliasDeclaration;
10051007
readonlyToken?: ReadonlyToken;
10061008
typeParameter: TypeParameterDeclaration;
10071009
questionToken?: QuestionToken;
@@ -1453,6 +1455,7 @@ namespace ts {
14531455

14541456
export interface SpreadElement extends Expression {
14551457
kind: SyntaxKind.SpreadElement;
1458+
parent?: ArrayLiteralExpression | CallExpression | NewExpression;
14561459
expression: Expression;
14571460
}
14581461

0 commit comments

Comments
 (0)