Skip to content

Commit 645d1cd

Browse files
authoredSep 22, 2022
Fix assert in addIndirectUser in FAR (#50905)
1 parent bbec17d commit 645d1cd

File tree

3 files changed

+314
-1
lines changed

3 files changed

+314
-1
lines changed
 

‎src/services/importTracker.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ namespace ts.FindAllReferences {
137137

138138
case SyntaxKind.ImportType:
139139
// Only check for typeof import('xyz')
140-
if (direct.isTypeOf && !direct.qualifier && isExported(direct)) {
140+
if (!isAvailableThroughGlobal && direct.isTypeOf && !direct.qualifier && isExported(direct)) {
141141
addIndirectUser(direct.getSourceFile(), /** addTransitiveDependencies */ true);
142142
}
143143
directImports.push(direct);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,293 @@
1+
// === /packages/playwright-core/bundles/utils/node_modules/@types/debug/index.d.ts ===
2+
// declare var [|debug|]: [|debug|].Debug & { debug: [|debug|].Debug; default: [|debug|].Debug };
3+
// [|export|] = [|debug|];
4+
// export as namespace debug;
5+
// declare namespace [|debug|] {
6+
// interface Debug {
7+
// coerce: (val: any) => any;
8+
// }
9+
// }
10+
11+
// === /packages/playwright-core/src/index.ts ===
12+
// export const debug: typeof import('[|../bundles/utils/node_modules//*FIND ALL REFS*/@types/debug|]') = require('./utilsBundleImpl').debug;
13+
14+
[
15+
{
16+
"definition": {
17+
"containerKind": "",
18+
"containerName": "",
19+
"fileName": "/packages/playwright-core/bundles/utils/node_modules/@types/debug/index.d.ts",
20+
"kind": "module",
21+
"name": "module \"/packages/playwright-core/bundles/utils/node_modules/@types/debug/index\"",
22+
"textSpan": {
23+
"start": 0,
24+
"length": 211
25+
},
26+
"displayParts": [
27+
{
28+
"text": "module",
29+
"kind": "keyword"
30+
},
31+
{
32+
"text": " ",
33+
"kind": "space"
34+
},
35+
{
36+
"text": "\"/packages/playwright-core/bundles/utils/node_modules/@types/debug/index\"",
37+
"kind": "stringLiteral"
38+
}
39+
]
40+
},
41+
"references": [
42+
{
43+
"textSpan": {
44+
"start": 79,
45+
"length": 6
46+
},
47+
"fileName": "/packages/playwright-core/bundles/utils/node_modules/@types/debug/index.d.ts",
48+
"contextSpan": {
49+
"start": 79,
50+
"length": 15
51+
},
52+
"isWriteAccess": false
53+
}
54+
]
55+
},
56+
{
57+
"definition": {
58+
"containerKind": "",
59+
"containerName": "",
60+
"fileName": "/packages/playwright-core/bundles/utils/node_modules/@types/debug/index.d.ts",
61+
"kind": "var",
62+
"name": "namespace debug\nvar debug: debug.Debug & {\n debug: debug.Debug;\n default: debug.Debug;\n}",
63+
"textSpan": {
64+
"start": 12,
65+
"length": 5
66+
},
67+
"displayParts": [
68+
{
69+
"text": "namespace",
70+
"kind": "keyword"
71+
},
72+
{
73+
"text": " ",
74+
"kind": "space"
75+
},
76+
{
77+
"text": "debug",
78+
"kind": "localName"
79+
},
80+
{
81+
"text": "\n",
82+
"kind": "lineBreak"
83+
},
84+
{
85+
"text": "var",
86+
"kind": "keyword"
87+
},
88+
{
89+
"text": " ",
90+
"kind": "space"
91+
},
92+
{
93+
"text": "debug",
94+
"kind": "localName"
95+
},
96+
{
97+
"text": ":",
98+
"kind": "punctuation"
99+
},
100+
{
101+
"text": " ",
102+
"kind": "space"
103+
},
104+
{
105+
"text": "debug",
106+
"kind": "localName"
107+
},
108+
{
109+
"text": ".",
110+
"kind": "punctuation"
111+
},
112+
{
113+
"text": "Debug",
114+
"kind": "interfaceName"
115+
},
116+
{
117+
"text": " ",
118+
"kind": "space"
119+
},
120+
{
121+
"text": "&",
122+
"kind": "punctuation"
123+
},
124+
{
125+
"text": " ",
126+
"kind": "space"
127+
},
128+
{
129+
"text": "{",
130+
"kind": "punctuation"
131+
},
132+
{
133+
"text": "\n",
134+
"kind": "lineBreak"
135+
},
136+
{
137+
"text": " ",
138+
"kind": "space"
139+
},
140+
{
141+
"text": "debug",
142+
"kind": "propertyName"
143+
},
144+
{
145+
"text": ":",
146+
"kind": "punctuation"
147+
},
148+
{
149+
"text": " ",
150+
"kind": "space"
151+
},
152+
{
153+
"text": "debug",
154+
"kind": "localName"
155+
},
156+
{
157+
"text": ".",
158+
"kind": "punctuation"
159+
},
160+
{
161+
"text": "Debug",
162+
"kind": "text"
163+
},
164+
{
165+
"text": ";",
166+
"kind": "punctuation"
167+
},
168+
{
169+
"text": "\n",
170+
"kind": "lineBreak"
171+
},
172+
{
173+
"text": " ",
174+
"kind": "space"
175+
},
176+
{
177+
"text": "default",
178+
"kind": "propertyName"
179+
},
180+
{
181+
"text": ":",
182+
"kind": "punctuation"
183+
},
184+
{
185+
"text": " ",
186+
"kind": "space"
187+
},
188+
{
189+
"text": "debug",
190+
"kind": "localName"
191+
},
192+
{
193+
"text": ".",
194+
"kind": "punctuation"
195+
},
196+
{
197+
"text": "Debug",
198+
"kind": "text"
199+
},
200+
{
201+
"text": ";",
202+
"kind": "punctuation"
203+
},
204+
{
205+
"text": "\n",
206+
"kind": "lineBreak"
207+
},
208+
{
209+
"text": "}",
210+
"kind": "punctuation"
211+
}
212+
],
213+
"contextSpan": {
214+
"start": 0,
215+
"length": 78
216+
}
217+
},
218+
"references": [
219+
{
220+
"textSpan": {
221+
"start": 12,
222+
"length": 5
223+
},
224+
"fileName": "/packages/playwright-core/bundles/utils/node_modules/@types/debug/index.d.ts",
225+
"contextSpan": {
226+
"start": 0,
227+
"length": 78
228+
},
229+
"isWriteAccess": true
230+
},
231+
{
232+
"textSpan": {
233+
"start": 19,
234+
"length": 5
235+
},
236+
"fileName": "/packages/playwright-core/bundles/utils/node_modules/@types/debug/index.d.ts",
237+
"isWriteAccess": false
238+
},
239+
{
240+
"textSpan": {
241+
"start": 42,
242+
"length": 5
243+
},
244+
"fileName": "/packages/playwright-core/bundles/utils/node_modules/@types/debug/index.d.ts",
245+
"isWriteAccess": false
246+
},
247+
{
248+
"textSpan": {
249+
"start": 64,
250+
"length": 5
251+
},
252+
"fileName": "/packages/playwright-core/bundles/utils/node_modules/@types/debug/index.d.ts",
253+
"isWriteAccess": false
254+
},
255+
{
256+
"textSpan": {
257+
"start": 88,
258+
"length": 5
259+
},
260+
"fileName": "/packages/playwright-core/bundles/utils/node_modules/@types/debug/index.d.ts",
261+
"contextSpan": {
262+
"start": 79,
263+
"length": 15
264+
},
265+
"isWriteAccess": false
266+
},
267+
{
268+
"textSpan": {
269+
"start": 35,
270+
"length": 42
271+
},
272+
"fileName": "/packages/playwright-core/src/index.ts",
273+
"contextSpan": {
274+
"start": 0,
275+
"length": 117
276+
},
277+
"isWriteAccess": false
278+
},
279+
{
280+
"textSpan": {
281+
"start": 140,
282+
"length": 5
283+
},
284+
"fileName": "/packages/playwright-core/bundles/utils/node_modules/@types/debug/index.d.ts",
285+
"contextSpan": {
286+
"start": 122,
287+
"length": 89
288+
},
289+
"isWriteAccess": true
290+
}
291+
]
292+
}
293+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
// @Filename: /packages/playwright-core/bundles/utils/node_modules/@types/debug/index.d.ts
4+
//// declare var debug: debug.Debug & { debug: debug.Debug; default: debug.Debug };
5+
//// export = debug;
6+
//// export as namespace debug;
7+
//// declare namespace debug {
8+
//// interface Debug {
9+
//// coerce: (val: any) => any;
10+
//// }
11+
//// }
12+
13+
// @Filename: /packages/playwright-core/bundles/utils/node_modules/@types/debug/package.json
14+
//// { "types": "index.d.ts" }
15+
16+
// @Filename: /packages/playwright-core/src/index.ts
17+
//// export const debug: typeof import('../bundles/utils/node_modules//*1*/@types/debug') = require('./utilsBundleImpl').debug;
18+
19+
20+
verify.baselineFindAllReferences('1');

0 commit comments

Comments
 (0)
Please sign in to comment.