File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -301,8 +301,11 @@ module ts {
301
301
302
302
Debug . assert ( start >= 0 , "start must be non-negative, is " + start ) ;
303
303
Debug . assert ( length >= 0 , "length must be non-negative, is " + length ) ;
304
- Debug . assert ( start <= file . text . length , `start must be within the bounds of the file. ${ start } > ${ file . text . length } ` ) ;
305
- Debug . assert ( end <= file . text . length , `end must be the bounds of the file. ${ end } > ${ file . text . length } ` ) ;
304
+
305
+ if ( file ) {
306
+ Debug . assert ( start <= file . text . length , `start must be within the bounds of the file. ${ start } > ${ file . text . length } ` ) ;
307
+ Debug . assert ( end <= file . text . length , `end must be the bounds of the file. ${ end } > ${ file . text . length } ` ) ;
308
+ }
306
309
307
310
let text = getLocaleSpecificMessage ( message . key ) ;
308
311
Original file line number Diff line number Diff line change @@ -165,6 +165,10 @@ module ts {
165
165
return "" ;
166
166
}
167
167
168
+ if ( ! sourceFile && node . kind === SyntaxKind . Identifier ) {
169
+ return ( < Identifier > node ) . text ;
170
+ }
171
+
168
172
let text = sourceFile . text ;
169
173
return text . substring ( skipTrivia ( text , node . pos ) , node . end ) ;
170
174
}
You can’t perform that action at this time.
0 commit comments