Skip to content

Commit 9a957e7

Browse files
Remove incorrect assert that triggers crash on completions of globalThis (#40278)
Fixes #39338
1 parent 3b4cacc commit 9a957e7

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

src/services/symbolDisplay.ts

-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ namespace ts.SymbolDisplay {
7171
if (rootSymbolFlags & (SymbolFlags.PropertyOrAccessor | SymbolFlags.Variable)) {
7272
return ScriptElementKind.memberVariableElement;
7373
}
74-
// May be a Function if this was from `typeof N` with `namespace N { function f();. }`.
75-
Debug.assert(!!(rootSymbolFlags & (SymbolFlags.Method | SymbolFlags.Function)));
7674
});
7775
if (!unionPropertyKind) {
7876
// If this was union of all methods,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
// @allowJs: true
4+
// @target: esnext
5+
6+
// @Filename: test.js
7+
//// (typeof foo !== "undefined"
8+
//// ? foo
9+
//// : {}
10+
//// )./**/;
11+
12+
// @Filename: someLib.d.ts
13+
//// declare var foo: typeof globalThis;
14+
15+
goTo.marker();
16+
verify.completions({
17+
marker: ""
18+
});

0 commit comments

Comments
 (0)