(diagnostic)
| 18027 | return undefined; |
| 18028 | } |
| 18029 | function add(diagnostic) { |
| 18030 | var diagnostics; |
| 18031 | if (diagnostic.file) { |
| 18032 | diagnostics = fileDiagnostics.get(diagnostic.file.fileName); |
| 18033 | if (!diagnostics) { |
| 18034 | diagnostics = []; // See GH#19873 |
| 18035 | fileDiagnostics.set(diagnostic.file.fileName, diagnostics); |
| 18036 | ts.insertSorted(filesWithDiagnostics, diagnostic.file.fileName, ts.compareStringsCaseSensitive); |
| 18037 | } |
| 18038 | } |
| 18039 | else { |
| 18040 | // If we've already read the non-file diagnostics, do not modify the existing array. |
| 18041 | if (hasReadNonFileDiagnostics) { |
| 18042 | hasReadNonFileDiagnostics = false; |
| 18043 | nonFileDiagnostics = nonFileDiagnostics.slice(); |
| 18044 | } |
| 18045 | diagnostics = nonFileDiagnostics; |
| 18046 | } |
| 18047 | ts.insertSorted(diagnostics, diagnostic, compareDiagnostics); |
| 18048 | } |
| 18049 | function getGlobalDiagnostics() { |
| 18050 | hasReadNonFileDiagnostics = true; |
| 18051 | return nonFileDiagnostics; |
no test coverage detected