fix(language-service): guard access to `Symbol.members` (#15529)
Fixes #15528 What is the current behavior? The language service access TypeScript's Symbol.members without checking for null or undefined. What is the new behavior? The access is guarded.
This commit is contained in:
parent
a9ae4daab2
commit
920bf373fe
|
@ -668,7 +668,7 @@ class TypeScriptSymbolQuery implements SymbolQuery {
|
|||
getSpanAt(line: number, column: number): Span { return spanAt(this.source, line, column); }
|
||||
|
||||
private getTemplateRefContextType(type: ts.Symbol): ts.Symbol {
|
||||
const constructor = type.members['__constructor'];
|
||||
const constructor = type.members && type.members['__constructor'];
|
||||
if (constructor) {
|
||||
const constructorDeclaration = constructor.declarations[0] as ts.ConstructorTypeNode;
|
||||
for (const parameter of constructorDeclaration.parameters) {
|
||||
|
|
Loading…
Reference in New Issue