Skip to content

Commit 3806ee7

Browse files
committed
Assert CompilerHost.readDiretory for projectReferences with include
Fixes: #26785
1 parent 4510149 commit 3806ee7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/compiler/program.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2811,7 +2811,10 @@ namespace ts {
28112811
export function parseConfigHostFromCompilerHost(host: CompilerHost): ParseConfigFileHost {
28122812
return {
28132813
fileExists: f => host.fileExists(f),
2814-
readDirectory: (root, extensions, includes, depth?) => host.readDirectory ? host.readDirectory(root, extensions, includes, depth) : [],
2814+
readDirectory(root, extensions, excludes, includes, depth) {
2815+
Debug.assertDefined(host.readDirectory, "'CompilerHost.readDirectory' must be implemented to correctly process 'projectReferences'");
2816+
return host.readDirectory!(root, extensions, excludes, includes, depth);
2817+
},
28152818
readFile: f => host.readFile(f),
28162819
useCaseSensitiveFileNames: host.useCaseSensitiveFileNames(),
28172820
getCurrentDirectory: () => host.getCurrentDirectory(),

0 commit comments

Comments
 (0)