Skip to content

Commit 87aa917

Browse files
authored
Always set up host in node builder (#62726)
1 parent e872a6e commit 87aa917

File tree

794 files changed

+6645
-6647
lines changed

Some content is hidden

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

794 files changed

+6645
-6647
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6633,9 +6633,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
66336633
cb: (context: NodeBuilderContext) => T,
66346634
out?: WriterContextOut,
66356635
): T | undefined {
6636-
const moduleResolverHost = tracker?.trackSymbol ? tracker.moduleResolverHost :
6637-
(internalFlags || InternalNodeBuilderFlags.None) & InternalNodeBuilderFlags.DoNotIncludeSymbolChain ? createBasicNodeBuilderModuleSpecifierResolutionHost(host) :
6638-
undefined;
6636+
const moduleResolverHost = tracker?.moduleResolverHost ?? createBasicNodeBuilderModuleSpecifierResolutionHost(host);
66396637
flags = flags || NodeBuilderFlags.None;
66406638
const maxTruncationLength = maximumLength ||
66416639
(flags & NodeBuilderFlags.NoTruncation ? noTruncationMaximumTruncationLength : defaultMaximumTruncationLength);

tests/baselines/reference/allowSyntheticDefaultImportsCanPaintCrossModuleDeclaration.types

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ export declare function styled(): Color;
2121

2222
=== file2.ts ===
2323
import { styled } from "./file1";
24-
>styled : () => import("color").default
25-
> : ^^^^^^ ^^^^^^^ ^^^^^^^
24+
>styled : () => import("./color").default
25+
> : ^^^^^^ ^^^^^^^^^ ^^^^^^^
2626

2727
export const A = styled();
28-
>A : import("color").default
29-
> : ^^^^^^^^^^^^^^^^^^^^^^^
30-
>styled() : import("color").default
31-
> : ^^^^^^^^^^^^^^^^^^^^^^^
32-
>styled : () => import("color").default
33-
> : ^^^^^^ ^^^^^^^ ^^^^^^^
28+
>A : import("./color").default
29+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^
30+
>styled() : import("./color").default
31+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^
32+
>styled : () => import("./color").default
33+
> : ^^^^^^ ^^^^^^^^^ ^^^^^^^
3434

tests/baselines/reference/allowsImportingTsExtension.symbols

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type __A = import("./a.ts").A; // ok
2323

2424
const aPromise = import("./a.ts"); // error
2525
>aPromise : Symbol(aPromise, Decl(b.ts, 4, 5))
26-
>"./a.ts" : Symbol("a", Decl(a.ts, 0, 0))
26+
>"./a.ts" : Symbol("./a.ts", Decl(a.ts, 0, 0))
2727

2828
=== c.ts ===
2929
import type { A } from "./a.d.ts"; // ok
@@ -40,5 +40,5 @@ type __A = import("./a.d.ts").A; // ok
4040

4141
const aPromise = import("./a.d.ts"); // error
4242
>aPromise : Symbol(aPromise, Decl(c.ts, 4, 5))
43-
>"./a.d.ts" : Symbol("a", Decl(a.ts, 0, 0))
43+
>"./a.d.ts" : Symbol("./a.d.ts", Decl(a.ts, 0, 0))
4444

tests/baselines/reference/allowsImportingTsExtension.types

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ type __A = import("./a.ts").A; // ok
2727
> : ^
2828

2929
const aPromise = import("./a.ts"); // error
30-
>aPromise : Promise<typeof import("a")>
31-
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^
32-
>import("./a.ts") : Promise<typeof import("a")>
33-
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^
30+
>aPromise : Promise<typeof import("./a.ts")>
31+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
32+
>import("./a.ts") : Promise<typeof import("./a.ts")>
33+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3434
>"./a.ts" : "./a.ts"
3535
> : ^^^^^^^^
3636

@@ -51,10 +51,10 @@ type __A = import("./a.d.ts").A; // ok
5151
> : ^
5252

5353
const aPromise = import("./a.d.ts"); // error
54-
>aPromise : Promise<typeof import("a")>
55-
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^
56-
>import("./a.d.ts") : Promise<typeof import("a")>
57-
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^
54+
>aPromise : Promise<typeof import("./a.d.ts")>
55+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
56+
>import("./a.d.ts") : Promise<typeof import("./a.d.ts")>
57+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5858
>"./a.d.ts" : "./a.d.ts"
5959
> : ^^^^^^^^^^
6060

tests/baselines/reference/ambientExportDefaultErrors.types

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ export default 2 + 2;
1818
> : ^
1919

2020
export as namespace Foo;
21-
>Foo : typeof import("foo")
22-
> : ^^^^^^^^^^^^^^^^^^^^
21+
>Foo : typeof import("./foo")
22+
> : ^^^^^^^^^^^^^^^^^^^^^^
2323

2424
=== foo2.d.ts ===
2525
export = 2 + 2;

tests/baselines/reference/amdDeclarationEmitNoExtraDeclare.types

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
=== Class.ts ===
44
import { Configurable } from "./Configurable"
55
>Configurable : <T extends import("Configurable").Constructor<{}>>(base: T) => T
6-
> : ^ ^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^ ^^ ^^ ^^^^^
6+
> : ^ ^^^^^^^^^ ^^^^^^^^^^^^^^ ^^^^^^^^^^^ ^^ ^^ ^^^^^
77

88
export class HiddenClass {}
99
>HiddenClass : HiddenClass
@@ -15,7 +15,7 @@ export class ActualClass extends Configurable(HiddenClass) {}
1515
>Configurable(HiddenClass) : HiddenClass
1616
> : ^^^^^^^^^^^
1717
>Configurable : <T extends import("Configurable").Constructor<{}>>(base: T) => T
18-
> : ^ ^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^ ^^ ^^ ^^^^^
18+
> : ^ ^^^^^^^^^ ^^^^^^^^^^^^^^ ^^^^^^^^^^^ ^^ ^^ ^^^^^
1919
>HiddenClass : typeof HiddenClass
2020
> : ^^^^^^^^^^^^^^^^^^
2121

tests/baselines/reference/anonClassDeclarationEmitIsAnon.types

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ export function Timestamped<TBase extends Constructor>(Base: TBase) {
5959
import { wrapClass, Timestamped } from "./wrapClass";
6060
>wrapClass : (param: any) => typeof Wrapped
6161
> : ^ ^^ ^^^^^^^^^^^^^^^^^^^
62-
>Timestamped : <TBase extends import("wrapClass").Constructor>(Base: TBase) => { new (...args: any[]): (Anonymous class); prototype: Timestamped<any>.(Anonymous class); } & TBase
63-
> : ^ ^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
62+
>Timestamped : <TBase extends import("./wrapClass").Constructor>(Base: TBase) => { new (...args: any[]): (Anonymous class); prototype: Timestamped<any>.(Anonymous class); } & TBase
63+
> : ^ ^^^^^^^^^ ^^^^^^^^^^^^^ ^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6464

6565
export default wrapClass(0);
6666
>wrapClass(0) : typeof Wrapped
@@ -88,8 +88,8 @@ export class TimestampedUser extends Timestamped(User) {
8888
> : ^^^^^^^^^^^^^^^
8989
>Timestamped(User) : Timestamped<typeof User>.(Anonymous class) & User
9090
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
91-
>Timestamped : <TBase extends import("wrapClass").Constructor>(Base: TBase) => { new (...args: any[]): (Anonymous class); prototype: Timestamped<any>.(Anonymous class); } & TBase
92-
> : ^ ^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
91+
>Timestamped : <TBase extends import("./wrapClass").Constructor>(Base: TBase) => { new (...args: any[]): (Anonymous class); prototype: Timestamped<any>.(Anonymous class); } & TBase
92+
> : ^ ^^^^^^^^^ ^^^^^^^^^^^^^ ^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9393
>User : typeof User
9494
> : ^^^^^^^^^^^
9595

tests/baselines/reference/arbitraryModuleNamespaceIdentifiers_syntax.types

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ export { foo as "valid 3" } from "./values-valid";
2828
> : ^^^
2929

3030
export * as "valid 4" from "./values-valid";
31-
>"valid 4" : typeof import("values-valid")
32-
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
31+
>"valid 4" : typeof import("./values-valid")
32+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3333

3434
=== values-bad-import.ts ===
3535
import { foo as "invalid 2" } from "./values-valid";
@@ -82,8 +82,8 @@ export type { foo as "valid 3" } from "./type-decls-valid";
8282
> : ^^^
8383

8484
export type * as "valid 4" from "./type-decls-valid";
85-
>"valid 4" : typeof import("type-decls-valid")
86-
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
85+
>"valid 4" : typeof import("./type-decls-valid")
86+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8787

8888
=== type-decls-bad-import.ts ===
8989
import type { foo as "invalid 2" } from "./type-decls-valid";

tests/baselines/reference/assignmentToVoidZero1.symbols

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
// #38552
55
exports.y = exports.x = void 0;
66
>exports.y : Symbol(y, Decl(assignmentToVoidZero1.js, 2, 14))
7-
>exports : Symbol("assignmentToVoidZero1", Decl(assignmentToVoidZero1.js, 0, 0))
7+
>exports : Symbol("./assignmentToVoidZero1", Decl(assignmentToVoidZero1.js, 0, 0))
88
>y : Symbol(y, Decl(assignmentToVoidZero1.js, 2, 14))
99
>exports.x : Symbol(x, Decl(assignmentToVoidZero1.js, 1, 31))
10-
>exports : Symbol("assignmentToVoidZero1", Decl(assignmentToVoidZero1.js, 0, 0))
10+
>exports : Symbol("./assignmentToVoidZero1", Decl(assignmentToVoidZero1.js, 0, 0))
1111
>x : Symbol(x, Decl(assignmentToVoidZero1.js, 1, 31))
1212

1313
exports.x = 1;

tests/baselines/reference/assignmentToVoidZero1.types

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ exports.y = exports.x = void 0;
77
> : ^^^^^^^^^
88
>exports.y : 2
99
> : ^
10-
>exports : typeof import("assignmentToVoidZero1")
11-
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10+
>exports : typeof import("./assignmentToVoidZero1")
11+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1212
>y : 2
1313
> : ^
1414
>exports.x = void 0 : undefined
1515
> : ^^^^^^^^^
1616
>exports.x : 1
1717
> : ^
18-
>exports : typeof import("assignmentToVoidZero1")
19-
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18+
>exports : typeof import("./assignmentToVoidZero1")
19+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2020
>x : 1
2121
> : ^
2222
>void 0 : undefined
@@ -29,8 +29,8 @@ exports.x = 1;
2929
> : ^
3030
>exports.x : 1
3131
> : ^
32-
>exports : typeof import("assignmentToVoidZero1")
33-
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
32+
>exports : typeof import("./assignmentToVoidZero1")
33+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3434
>x : 1
3535
> : ^
3636
>1 : 1
@@ -41,8 +41,8 @@ exports.y = 2;
4141
> : ^
4242
>exports.y : 2
4343
> : ^
44-
>exports : typeof import("assignmentToVoidZero1")
45-
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44+
>exports : typeof import("./assignmentToVoidZero1")
45+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4646
>y : 2
4747
> : ^
4848
>2 : 2

0 commit comments

Comments
 (0)