@@ -65,11 +65,11 @@ namespace ts {
65
65
}
66
66
67
67
public getSourceFile ( ) : SourceFile {
68
- return getSourceFileOfNode ( this ) ;
68
+ return getSourceFileOfNode ( this as Node ) ;
69
69
}
70
70
71
71
public getStart ( sourceFile ?: SourceFileLike , includeJsDocComment ?: boolean ) : number {
72
- return getTokenPosOfNode ( this , sourceFile , includeJsDocComment ) ;
72
+ return getTokenPosOfNode ( this as Node , sourceFile , includeJsDocComment ) ;
73
73
}
74
74
75
75
public getFullStart ( ) : number {
@@ -109,7 +109,7 @@ namespace ts {
109
109
const token = scanner . scan ( ) ;
110
110
const textPos = scanner . getTextPos ( ) ;
111
111
if ( textPos <= end ) {
112
- nodes . push ( createNode ( token , pos , textPos , this ) ) ;
112
+ nodes . push ( createNode ( token , pos , textPos , this as Node ) as Node ) ;
113
113
}
114
114
pos = textPos ;
115
115
if ( token === SyntaxKind . EndOfFileToken ) {
@@ -120,7 +120,7 @@ namespace ts {
120
120
}
121
121
122
122
private createSyntaxList ( nodes : NodeArray < Node > ) : Node {
123
- const list = < NodeObject > createNode ( SyntaxKind . SyntaxList , nodes . pos , nodes . end , this ) ;
123
+ const list = < NodeObject > createNode ( SyntaxKind . SyntaxList , nodes . pos , nodes . end , this as Node ) ;
124
124
list . _children = [ ] ;
125
125
let pos = nodes . pos ;
126
126
@@ -134,7 +134,7 @@ namespace ts {
134
134
if ( pos < nodes . end ) {
135
135
this . addSyntheticNodes ( list . _children , pos , nodes . end ) ;
136
136
}
137
- return list ;
137
+ return list as Node ;
138
138
}
139
139
140
140
private createChildren ( sourceFile ?: SourceFileLike ) {
@@ -143,7 +143,7 @@ namespace ts {
143
143
return ;
144
144
}
145
145
146
- if ( isJSDocCommentContainingNode ( this ) ) {
146
+ if ( isJSDocCommentContainingNode ( this as Node ) ) {
147
147
/** Don't add trivia for "tokens" since this is in a comment. */
148
148
const children : Node [ ] = [ ] ;
149
149
this . forEachChild ( child => { children . push ( child ) ; } ) ;
@@ -176,7 +176,7 @@ namespace ts {
176
176
// For that to work, the jsdoc comments should still be the leading trivia of the first child.
177
177
// Restoring the scanner position ensures that.
178
178
pos = this . pos ;
179
- forEachChild ( this , processNode , processNodes ) ;
179
+ forEachChild ( this as Node , processNode , processNodes ) ;
180
180
if ( pos < this . end ) {
181
181
this . addSyntheticNodes ( children , pos , this . end ) ;
182
182
}
@@ -223,11 +223,11 @@ namespace ts {
223
223
}
224
224
225
225
public forEachChild < T > ( cbNode : ( node : Node ) => T , cbNodeArray ?: ( nodes : NodeArray < Node > ) => T ) : T {
226
- return forEachChild ( this , cbNode , cbNodeArray ) ;
226
+ return forEachChild ( this as Node , cbNode , cbNodeArray ) ;
227
227
}
228
228
}
229
229
230
- class TokenOrIdentifierObject implements Node {
230
+ class TokenOrIdentifierObject implements BaseNode {
231
231
public kind : SyntaxKind ;
232
232
public pos : number ;
233
233
public end : number ;
@@ -244,11 +244,11 @@ namespace ts {
244
244
}
245
245
246
246
public getSourceFile ( ) : SourceFile {
247
- return getSourceFileOfNode ( this ) ;
247
+ return getSourceFileOfNode ( this as Node ) ;
248
248
}
249
249
250
250
public getStart ( sourceFile ?: SourceFileLike , includeJsDocComment ?: boolean ) : number {
251
- return getTokenPosOfNode ( this , sourceFile , includeJsDocComment ) ;
251
+ return getTokenPosOfNode ( this as Node , sourceFile , includeJsDocComment ) ;
252
252
}
253
253
254
254
public getFullStart ( ) : number {
@@ -740,8 +740,8 @@ namespace ts {
740
740
741
741
function getServicesObjectAllocator ( ) : ObjectAllocator {
742
742
return {
743
- getNodeConstructor : ( ) => NodeObject ,
744
- getTokenConstructor : ( ) => TokenObject ,
743
+ getNodeConstructor : ( ) => NodeObject as new ( kind : SyntaxKind , pos ?: number , end ?: number ) => Node ,
744
+ getTokenConstructor : ( ) => TokenObject as new ( kind : SyntaxKind , pos ?: number , end ?: number ) => Node ,
745
745
746
746
getIdentifierConstructor : ( ) => IdentifierObject ,
747
747
getSourceFileConstructor : ( ) => SourceFileObject ,
@@ -1595,7 +1595,7 @@ namespace ts {
1595
1595
return ;
1596
1596
}
1597
1597
1598
- let nodeForStartPos = node ;
1598
+ let nodeForStartPos : Node = node ;
1599
1599
while ( true ) {
1600
1600
if ( isRightSideOfPropertyAccess ( nodeForStartPos ) || isRightSideOfQualifiedName ( nodeForStartPos ) ) {
1601
1601
// If on the span is in right side of the the property or qualified name, return the span from the qualified name pos to end of this node
0 commit comments