Skip to content

Commit 95072aa

Browse files
committed
Responding to PR feedback
1 parent 86cde9e commit 95072aa

4 files changed

Lines changed: 15 additions & 7 deletions

File tree

src/compiler/commandLineParser.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ namespace ts {
672672

673673
// Skip over any minified JavaScript files (ending in ".min.js")
674674
// Skip over dotted files and folders as well
675-
const IgnoreFileNamePattern = /(\.min\.js$)|([\\/]\.[\w.])/;
675+
const ignoreFileNamePattern = /(\.min\.js$)|([\\/]\.[\w.])/;
676676
/**
677677
* Parse the contents of a config file (tsconfig.json).
678678
* @param json The contents of the config file to parse
@@ -969,7 +969,7 @@ namespace ts {
969969
continue;
970970
}
971971

972-
if (IgnoreFileNamePattern.test(file)) {
972+
if (ignoreFileNamePattern.test(file)) {
973973
continue;
974974
}
975975

@@ -1055,8 +1055,8 @@ namespace ts {
10551055
// Remove any subpaths under an existing recursively watched directory.
10561056
for (const key in wildcardDirectories) {
10571057
if (hasProperty(wildcardDirectories, key)) {
1058-
for (const recursiveKey in recursiveKeys) {
1059-
if (containsPath(recursiveKey, key, path, !useCaseSensitiveFileNames)) {
1058+
for (const recursiveKey of recursiveKeys) {
1059+
if (key !== recursiveKey && containsPath(recursiveKey, key, path, !useCaseSensitiveFileNames)) {
10601060
delete wildcardDirectories[key];
10611061
}
10621062
}

src/compiler/core.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1211,7 +1211,7 @@ namespace ts {
12111211
export function isJsxOrTsxExtension(ext: string): boolean {
12121212
return ext === ".jsx" || ext === ".tsx";
12131213
}
1214-
1214+
12151215
export function changeExtension<T extends string | Path>(path: T, newExtension: string): T {
12161216
return <T>(removeFileExtension(path) + newExtension);
12171217
}

src/compiler/sys.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,15 @@ namespace ts {
381381
continue;
382382
}
383383
const name = combinePaths(path, entry);
384-
const stat = _fs.statSync(name);
384+
385+
let stat: any;
386+
try {
387+
stat = _fs.statSync(name);
388+
}
389+
catch (e) {
390+
continue;
391+
}
392+
385393
if (stat.isFile()) {
386394
files.push(entry);
387395
}

tests/cases/unittests/cachingInServerLSHost.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ namespace ts {
8282
const projectService = new server.ProjectService(serverHost, logger);
8383
const rootScriptInfo = projectService.openFile(rootFile, /* openedByClient */true);
8484
const project = projectService.createInferredProject(rootScriptInfo);
85-
project.setProjectOptions( {files: [rootScriptInfo.fileName], compilerOptions: {module: ts.ModuleKind.AMD} } );
85+
project.setProjectOptions({ files: [rootScriptInfo.fileName], compilerOptions: { module: ts.ModuleKind.AMD } });
8686
return {
8787
project,
8888
rootScriptInfo

0 commit comments

Comments
 (0)