* If the readDirectory result was already cached, it returns that * Otherwise gets result from host and caches it. * The host request is done under try catch block to avoid caching incorrect result
(rootDir, rootDirPath)
| 115260 | * The host request is done under try catch block to avoid caching incorrect result |
| 115261 | */ |
| 115262 | function tryReadDirectory(rootDir, rootDirPath) { |
| 115263 | rootDirPath = ts.ensureTrailingDirectorySeparator(rootDirPath); |
| 115264 | var cachedResult = getCachedFileSystemEntries(rootDirPath); |
| 115265 | if (cachedResult) { |
| 115266 | return cachedResult; |
| 115267 | } |
| 115268 | try { |
| 115269 | return createCachedFileSystemEntries(rootDir, rootDirPath); |
| 115270 | } |
| 115271 | catch (_e) { |
| 115272 | // If there is exception to read directories, dont cache the result and direct the calls to host |
| 115273 | ts.Debug.assert(!cachedReadDirectoryResult.has(ts.ensureTrailingDirectorySeparator(rootDirPath))); |
| 115274 | return undefined; |
| 115275 | } |
| 115276 | } |
| 115277 | function fileNameEqual(name1, name2) { |
| 115278 | return getCanonicalFileName(name1) === getCanonicalFileName(name2); |
| 115279 | } |
no test coverage detected
searching dependent graphs…