Skip to content

Commit 4c6e93b

Browse files
authored
Merge pull request #23878 from Microsoft/vfsBaselines
New vfs baselines follow-up
2 parents 0d7d75e + f67afa0 commit 4c6e93b

File tree

1,414 files changed

+4786
-4897
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,414 files changed

+4786
-4897
lines changed

src/harness/fakes.ts

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -289,27 +289,7 @@ namespace fakes {
289289
}
290290

291291
public getDefaultLibFileName(options: ts.CompilerOptions): string {
292-
// return vpath.resolve(this.getDefaultLibLocation(), ts.getDefaultLibFileName(options));
293-
294-
// TODO(rbuckton): This patches the baseline to replace lib.es5.d.ts with lib.d.ts.
295-
// This is only to make the PR for this change easier to read. A follow-up PR will
296-
// revert this change and accept the new baselines.
297-
// See https://github.com/Microsoft/TypeScript/pull/20763#issuecomment-352553264
298-
return vpath.resolve(this.getDefaultLibLocation(), getDefaultLibFileName(options));
299-
function getDefaultLibFileName(options: ts.CompilerOptions) {
300-
switch (options.target) {
301-
case ts.ScriptTarget.ESNext:
302-
case ts.ScriptTarget.ES2017:
303-
return "lib.es2017.d.ts";
304-
case ts.ScriptTarget.ES2016:
305-
return "lib.es2016.d.ts";
306-
case ts.ScriptTarget.ES2015:
307-
return "lib.es2015.d.ts";
308-
309-
default:
310-
return "lib.d.ts";
311-
}
312-
}
292+
return vpath.resolve(this.getDefaultLibLocation(), ts.getDefaultLibFileName(options));
313293
}
314294

315295
public getSourceFile(fileName: string, languageVersion: number): ts.SourceFile | undefined {

src/harness/projectsRunner.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -219,13 +219,7 @@ namespace project {
219219
.map(output => utils.removeTestPathPrefixes(vpath.isAbsolute(output) ? vpath.relative(cwd, output, ignoreCase) : output));
220220

221221
const content = JSON.stringify(resolutionInfo, undefined, " ");
222-
223-
// TODO(rbuckton): This patches the baseline to replace lib.es5.d.ts with lib.d.ts.
224-
// This is only to make the PR for this change easier to read. A follow-up PR will
225-
// revert this change and accept the new baselines.
226-
// See https://github.com/Microsoft/TypeScript/pull/20763#issuecomment-352553264
227-
const patchedContent = content.replace(/lib\.es5\.d\.ts/g, "lib.d.ts");
228-
Harness.Baseline.runBaseline(this.getBaselineFolder(this.compilerResult.moduleKind) + this.testCaseJustName + ".json", () => patchedContent);
222+
Harness.Baseline.runBaseline(this.getBaselineFolder(this.compilerResult.moduleKind) + this.testCaseJustName + ".json", () => content);
229223
}
230224

231225
public verifyDiagnostics() {

src/harness/vfs.ts

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,25 +1253,6 @@ namespace vfs {
12531253
node: Inode | undefined;
12541254
}
12551255

1256-
// TODO(rbuckton): This patches the baseline to replace lib.d.ts with lib.es5.d.ts.
1257-
// This is only to make the PR for this change easier to read. A follow-up PR will
1258-
// revert this change and accept the new baselines.
1259-
// See https://github.com/Microsoft/TypeScript/pull/20763#issuecomment-352553264
1260-
function patchResolver(host: FileSystemResolverHost, resolver: FileSystemResolver): FileSystemResolver {
1261-
const libFile = vpath.combine(host.getWorkspaceRoot(), "built/local/lib.d.ts");
1262-
const es5File = vpath.combine(host.getWorkspaceRoot(), "built/local/lib.es5.d.ts");
1263-
const stringComparer = host.useCaseSensitiveFileNames() ? vpath.compareCaseSensitive : vpath.compareCaseInsensitive;
1264-
return {
1265-
readdirSync: path => resolver.readdirSync(path),
1266-
statSync: path => resolver.statSync(fixPath(path)),
1267-
readFileSync: (path) => resolver.readFileSync(fixPath(path))
1268-
};
1269-
1270-
function fixPath(path: string) {
1271-
return stringComparer(path, libFile) === 0 ? es5File : path;
1272-
}
1273-
}
1274-
12751256
let builtLocalHost: FileSystemResolverHost | undefined;
12761257
let builtLocalCI: FileSystem | undefined;
12771258
let builtLocalCS: FileSystem | undefined;
@@ -1286,7 +1267,7 @@ namespace vfs {
12861267
const resolver = createResolver(host);
12871268
builtLocalCI = new FileSystem(/*ignoreCase*/ true, {
12881269
files: {
1289-
[builtFolder]: new Mount(vpath.resolve(host.getWorkspaceRoot(), "built/local"), patchResolver(host, resolver)),
1270+
[builtFolder]: new Mount(vpath.resolve(host.getWorkspaceRoot(), "built/local"), resolver),
12901271
[testLibFolder]: new Mount(vpath.resolve(host.getWorkspaceRoot(), "tests/lib"), resolver),
12911272
[srcFolder]: {}
12921273
},

tests/baselines/reference/ES5For-of1.errors.txt

Lines changed: 0 additions & 9 deletions
This file was deleted.

tests/baselines/reference/ES5For-of1.symbols

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@ for (var v of ['a', 'b', 'c']) {
33
>v : Symbol(v, Decl(ES5For-of1.ts, 0, 8))
44

55
console.log(v);
6+
>console.log : Symbol(Console.log, Decl(lib.d.ts, --, --))
7+
>console : Symbol(console, Decl(lib.d.ts, --, --))
8+
>log : Symbol(Console.log, Decl(lib.d.ts, --, --))
69
>v : Symbol(v, Decl(ES5For-of1.ts, 0, 8))
710
}

tests/baselines/reference/ES5For-of1.types

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ for (var v of ['a', 'b', 'c']) {
77
>'c' : "c"
88

99
console.log(v);
10-
>console.log(v) : any
11-
>console.log : any
12-
>console : any
13-
>log : any
10+
>console.log(v) : void
11+
>console.log : (message?: any, ...optionalParams: any[]) => void
12+
>console : Console
13+
>log : (message?: any, ...optionalParams: any[]) => void
1414
>v : string
1515
}

tests/baselines/reference/ES5For-of22.errors.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.

tests/baselines/reference/ES5For-of22.symbols

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@ for (var x of [1, 2, 3]) {
66
>_a : Symbol(_a, Decl(ES5For-of22.ts, 1, 7))
77

88
console.log(x);
9+
>console.log : Symbol(Console.log, Decl(lib.d.ts, --, --))
10+
>console : Symbol(console, Decl(lib.d.ts, --, --))
11+
>log : Symbol(Console.log, Decl(lib.d.ts, --, --))
912
>x : Symbol(x, Decl(ES5For-of22.ts, 0, 8))
1013
}

tests/baselines/reference/ES5For-of22.types

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ for (var x of [1, 2, 3]) {
1111
>0 : 0
1212

1313
console.log(x);
14-
>console.log(x) : any
15-
>console.log : any
16-
>console : any
17-
>log : any
14+
>console.log(x) : void
15+
>console.log : (message?: any, ...optionalParams: any[]) => void
16+
>console : Console
17+
>log : (message?: any, ...optionalParams: any[]) => void
1818
>x : number
1919
}

tests/baselines/reference/ES5For-of23.errors.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)