mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-10 18:04:18 -05:00
Revert changes to matchFiles/readDirectory made since 4.3 (#46787)
* Revert "Fix RWC missing file detection (#46673)" This reverts commit4a065f524c. * Revert "Pass absolute path to directoryExists (#46086)" This reverts commit55b4928e82. * Revert "Reduce exceptions (#44710)" This reverts commitc0d5c29080. * Add back system watcher limit
This commit is contained in:
@@ -95,7 +95,7 @@ namespace fakes {
|
||||
}
|
||||
|
||||
public readDirectory(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[] {
|
||||
return ts.matchFiles(path, extensions, exclude, include, this.useCaseSensitiveFileNames, this.getCurrentDirectory(), depth, path => this.getAccessibleFileSystemEntries(path), path => this.realpath(path), path => this.directoryExists(path));
|
||||
return ts.matchFiles(path, extensions, exclude, include, this.useCaseSensitiveFileNames, this.getCurrentDirectory(), depth, path => this.getAccessibleFileSystemEntries(path), path => this.realpath(path));
|
||||
}
|
||||
|
||||
public getAccessibleFileSystemEntries(path: string): ts.FileSystemEntries {
|
||||
|
||||
@@ -1438,15 +1438,14 @@ namespace Harness {
|
||||
}
|
||||
|
||||
const referenceDir = referencePath(relativeFileBase, opts && opts.Baselinefolder, opts && opts.Subfolder);
|
||||
let existing = IO.readDirectory(referenceDir, referencedExtensions || [extension]); // always an _absolute_ path
|
||||
let existing = IO.readDirectory(referenceDir, referencedExtensions || [extension]);
|
||||
if (extension === ".ts" || referencedExtensions && referencedExtensions.indexOf(".ts") > -1 && referencedExtensions.indexOf(".d.ts") === -1) {
|
||||
// special-case and filter .d.ts out of .ts results
|
||||
existing = existing.filter(f => !ts.endsWith(f, ".d.ts"));
|
||||
}
|
||||
const missing: string[] = [];
|
||||
const absoluteTestDir = `${process.cwd()}/${referenceDir}`;
|
||||
for (const name of existing) {
|
||||
const localCopy = name.substring(absoluteTestDir.length - relativeFileBase.length);
|
||||
const localCopy = name.substring(referenceDir.length - relativeFileBase.length);
|
||||
if (!writtenFiles.has(localCopy)) {
|
||||
missing.push(localCopy);
|
||||
}
|
||||
|
||||
@@ -922,7 +922,7 @@ interface Array<T> { length: number; [n: number]: T; }`
|
||||
});
|
||||
}
|
||||
return { directories, files };
|
||||
}, path => this.realpath(path), path => this.directoryExists(path));
|
||||
}, path => this.realpath(path));
|
||||
}
|
||||
|
||||
createHash(s: string): string {
|
||||
|
||||
Reference in New Issue
Block a user