Remove incorrect assert that triggers crash on completions of globalThis (#40278)

Fixes #39338
This commit is contained in:
Ryan Cavanaugh
2020-12-02 11:47:32 -08:00
committed by GitHub
parent 3b4cacc321
commit 9a957e7b9c
2 changed files with 18 additions and 2 deletions

View File

@@ -71,8 +71,6 @@ namespace ts.SymbolDisplay {
if (rootSymbolFlags & (SymbolFlags.PropertyOrAccessor | SymbolFlags.Variable)) {
return ScriptElementKind.memberVariableElement;
}
// May be a Function if this was from `typeof N` with `namespace N { function f();. }`.
Debug.assert(!!(rootSymbolFlags & (SymbolFlags.Method | SymbolFlags.Function)));
});
if (!unionPropertyKind) {
// If this was union of all methods,

View File

@@ -0,0 +1,18 @@
/// <reference path="fourslash.ts" />
// @allowJs: true
// @target: esnext
// @Filename: test.js
//// (typeof foo !== "undefined"
//// ? foo
//// : {}
//// )./**/;
// @Filename: someLib.d.ts
//// declare var foo: typeof globalThis;
goTo.marker();
verify.completions({
marker: ""
});