@@ -894,8 +894,8 @@ module ts {
894
894
getScriptVersion ( fileName : string ) : string ;
895
895
getScriptIsOpen ( fileName : string ) : boolean ;
896
896
getScriptSnapshot ( fileName : string ) : IScriptSnapshot ;
897
- getLocalizedDiagnosticMessages ( ) : any ;
898
- getCancellationToken ( ) : CancellationToken ;
897
+ getLocalizedDiagnosticMessages ? ( ) : any ;
898
+ getCancellationToken ? ( ) : CancellationToken ;
899
899
getCurrentDirectory ( ) : string ;
900
900
getDefaultLibFilename ( options : CompilerOptions ) : string ;
901
901
}
@@ -2398,12 +2398,12 @@ module ts {
2398
2398
var useCaseSensitivefilenames = false ;
2399
2399
var sourceFilesByName : Map < SourceFile > = { } ;
2400
2400
var documentRegistry = documentRegistry ;
2401
- var cancellationToken = new CancellationTokenObject ( host . getCancellationToken ( ) ) ;
2401
+ var cancellationToken = new CancellationTokenObject ( host . getCancellationToken && host . getCancellationToken ( ) ) ;
2402
2402
var activeCompletionSession : CompletionSession ; // The current active completion session, used to get the completion entry details
2403
2403
var writer : ( filename : string , data : string , writeByteOrderMark : boolean ) => void = undefined ;
2404
2404
2405
2405
// Check if the localized messages json is set, otherwise query the host for it
2406
- if ( ! localizedDiagnosticMessages ) {
2406
+ if ( ! localizedDiagnosticMessages && host . getLocalizedDiagnosticMessages ) {
2407
2407
localizedDiagnosticMessages = host . getLocalizedDiagnosticMessages ( ) ;
2408
2408
}
2409
2409
0 commit comments