Skip to content

Commit 7d2ce0f

Browse files
vladimabillti
authored andcommitted
fix falling tests and linter issues
(cherry picked from commit 7404b90)
1 parent dd5dc3a commit 7d2ce0f

2 files changed

Lines changed: 15 additions & 9 deletions

File tree

src/compiler/commandLineParser.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -554,14 +554,14 @@ namespace ts {
554554
const filesSeen: Map<boolean> = {};
555555

556556
let exclude: string[] = [];
557-
if(json["exclude"] instanceof Array){
557+
if (json["exclude"] instanceof Array) {
558558
exclude = json["exclude"];
559559
}
560560
else {
561561
// by default exclude node_modules, and any specificied output directory
562-
exclude = ["node_modules"]
563-
let outDir = json["compilerOptions"] && json["compilerOptions"]["outDir"];
564-
if(outDir) {
562+
exclude = ["node_modules"];
563+
const outDir = json["compilerOptions"] && json["compilerOptions"]["outDir"];
564+
if (outDir) {
565565
exclude.push(outDir);
566566
}
567567
}

tests/cases/unittests/cachingInServerLSHost.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,16 @@ module ts {
77
}
88

99
function createDefaultServerHost(fileMap: Map<File>): server.ServerHost {
10-
const directories: Map<string> = {};
11-
for (const f in fileMap) {
12-
directories[getDirectoryPath(f)] = f;
13-
}
10+
let existingDirectories: Map<boolean> = {};
11+
forEachValue(fileMap, v => {
12+
let dir = getDirectoryPath(v.name);
13+
let previous: string;
14+
do {
15+
existingDirectories[dir] = true;
16+
previous = dir;
17+
dir = getDirectoryPath(dir);
18+
} while (dir !== previous);
19+
});
1420
return {
1521
args: <string[]>[],
1622
newLine: "\r\n",
@@ -30,7 +36,7 @@ module ts {
3036
return hasProperty(fileMap, path);
3137
},
3238
directoryExists: (path: string): boolean => {
33-
return hasProperty(directories, path);
39+
return hasProperty(existingDirectories, path);
3440
},
3541
createDirectory: (path: string) => {
3642
},

0 commit comments

Comments
 (0)