Skip to content

Commit e4f7add

Browse files
committed
Merge pull request #7027 from Microsoft/fixTestsAndLinter
fix falling tests and linter issues
2 parents 2922bd5 + 7404b90 commit e4f7add

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

src/compiler/commandLineParser.ts

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

529529
let exclude: string[] = [];
530-
if(json["exclude"] instanceof Array){
530+
if (json["exclude"] instanceof Array) {
531531
exclude = json["exclude"];
532532
}
533533
else {
534534
// by default exclude node_modules, and any specificied output directory
535-
exclude = ["node_modules"]
536-
let outDir = json["compilerOptions"] && json["compilerOptions"]["outDir"];
537-
if(outDir) {
535+
exclude = ["node_modules"];
536+
const outDir = json["compilerOptions"] && json["compilerOptions"]["outDir"];
537+
if (outDir) {
538538
exclude.push(outDir);
539539
}
540540
}

src/compiler/program.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1288,7 +1288,6 @@ namespace ts {
12881288
const languageVersion = options.target || ScriptTarget.ES3;
12891289
const outFile = options.outFile || options.out;
12901290

1291-
const firstExternalModuleSourceFile = forEach(files, f => isExternalModule(f) ? f : undefined);
12921291
if (options.isolatedModules) {
12931292
const firstNonExternalModuleSourceFile = forEach(files, f => !isExternalModule(f) && !isDeclarationFile(f) ? f : undefined);
12941293
if (firstNonExternalModuleSourceFile) {

tests/cases/unittests/cachingInServerLSHost.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ module ts {
77
}
88

99
function createDefaultServerHost(fileMap: Map<File>): server.ServerHost {
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+
});
1020
return {
1121
args: <string[]>[],
1222
newLine: "\r\n",
@@ -26,7 +36,7 @@ module ts {
2636
return hasProperty(fileMap, path);
2737
},
2838
directoryExists: (path: string): boolean => {
29-
throw new Error("NYI");
39+
return hasProperty(existingDirectories, path);
3040
},
3141
createDirectory: (path: string) => {
3242
},

0 commit comments

Comments
 (0)