@@ -204,16 +204,14 @@ export class MessageRouter {
204
204
// NOTE: Since compiler errors pertain to issues specific to the .d.ts files,
205
205
// we do not apply source mappings for them.
206
206
const sourceFile : ts . SourceFile = diagnostic . file ;
207
- const sourceLocation : ISourceLocation | undefined = this . _sourceMapper . getSourceLocationFromFileAndPos (
207
+ const sourceLocation : ISourceLocation = this . _sourceMapper . getSourceLocationFromFileAndPos (
208
208
sourceFile ,
209
209
diagnostic . start || 0 ,
210
210
true /* useDtsLocation */
211
211
) ;
212
- if ( sourceLocation ) {
213
- options . sourceFilePath = sourceLocation . sourceFilePath ;
214
- options . sourceFileLine = sourceLocation . sourceFileLine ;
215
- options . sourceFileColumn = sourceLocation . sourceFileColumn ;
216
- }
212
+ options . sourceFilePath = sourceLocation . sourceFilePath ;
213
+ options . sourceFileLine = sourceLocation . sourceFileLine ;
214
+ options . sourceFileColumn = sourceLocation . sourceFileColumn ;
217
215
}
218
216
219
217
this . _messages . push ( new ExtractorMessage ( options ) ) ;
@@ -262,15 +260,13 @@ export class MessageRouter {
262
260
text : message . unformattedText
263
261
} ;
264
262
265
- const sourceLocation : ISourceLocation | undefined = this . _sourceMapper . getSourceLocationFromFileAndPos (
263
+ const sourceLocation : ISourceLocation = this . _sourceMapper . getSourceLocationFromFileAndPos (
266
264
sourceFile ,
267
265
message . textRange . pos
268
266
) ;
269
- if ( sourceLocation ) {
270
- options . sourceFilePath = sourceLocation . sourceFilePath ;
271
- options . sourceFileLine = sourceLocation . sourceFileLine ;
272
- options . sourceFileColumn = sourceLocation . sourceFileColumn ;
273
- }
267
+ options . sourceFilePath = sourceLocation . sourceFilePath ;
268
+ options . sourceFileLine = sourceLocation . sourceFileLine ;
269
+ options . sourceFileColumn = sourceLocation . sourceFileColumn ;
274
270
275
271
const extractorMessage : ExtractorMessage = new ExtractorMessage ( options ) ;
276
272
@@ -382,15 +378,13 @@ export class MessageRouter {
382
378
properties
383
379
} ;
384
380
385
- const sourceLocation : ISourceLocation | undefined = this . _sourceMapper . getSourceLocationFromFileAndPos (
381
+ const sourceLocation : ISourceLocation = this . _sourceMapper . getSourceLocationFromFileAndPos (
386
382
sourceFile ,
387
383
pos
388
384
) ;
389
- if ( sourceLocation ) {
390
- options . sourceFilePath = sourceLocation . sourceFilePath ;
391
- options . sourceFileLine = sourceLocation . sourceFileLine ;
392
- options . sourceFileColumn = sourceLocation . sourceFileColumn ;
393
- }
385
+ options . sourceFilePath = sourceLocation . sourceFilePath ;
386
+ options . sourceFileLine = sourceLocation . sourceFileLine ;
387
+ options . sourceFileColumn = sourceLocation . sourceFileColumn ;
394
388
395
389
const extractorMessage : ExtractorMessage = new ExtractorMessage ( options ) ;
396
390
0 commit comments