mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-19 10:41:56 -05:00
Remove incorrect assert that triggers crash on completions of globalThis (#40278)
Fixes #39338
This commit is contained in:
@@ -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,
|
||||
|
||||
18
tests/cases/fourslash/globalThisCompletion.ts
Normal file
18
tests/cases/fourslash/globalThisCompletion.ts
Normal 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: ""
|
||||
});
|
||||
Reference in New Issue
Block a user