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:
Pete Bacon Darwin 2018-07-16 08:42:03 +01:00 committed by Igor Minar
parent 185b932138
commit ee2c050521
2 changed files with 3 additions and 3 deletions

View File

@ -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).

View File

@ -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;