fix(ivy): make ngtsc `ClassMember` `node` and `declaration` optional (#24897)
Not all code formats have associated nodes and declarations for class members. PR Close #24897
This commit is contained in:
parent
185b932138
commit
ee2c050521
|
@ -53,9 +53,9 @@ export enum ClassMemberKind {
|
|||
*/
|
||||
export interface ClassMember {
|
||||
/**
|
||||
* TypeScript reference to the class member itself.
|
||||
* TypeScript reference to the class member itself, or null if it is not applicable.
|
||||
*/
|
||||
node: ts.Node;
|
||||
node: ts.Node|null;
|
||||
|
||||
/**
|
||||
* Indication of which type of member this is (property, method, etc).
|
||||
|
|
|
@ -544,7 +544,7 @@ class StaticInterpreter {
|
|||
throw new Error(`attempting to call something that is not a function: ${lhs}`);
|
||||
} else if (!isFunctionOrMethodReference(lhs)) {
|
||||
throw new Error(
|
||||
`calling something that is not a function declaration? ${ts.SyntaxKind[lhs.node.kind]}`);
|
||||
`calling something that is not a function declaration? ${ts.SyntaxKind[lhs.node.kind]} (${node.getText()})`);
|
||||
}
|
||||
|
||||
const fn = lhs.node;
|
||||
|
|
Loading…
Reference in New Issue