refactor(ivy): `TypeScriptReflectionHost.isClass` cannot be a type discriminator (#24897)

The `ReflectionHost` interface that is being implemented only expects a
return value of `boolean`.

Moreover, if you want to extend this class to support non-TS code formats,
e.g. ES5, the result of this call returning true does not mean that the `node`
is a `ClassDeclaration`. It could be a `VariableDeclaration`.

PR Close #24897
This commit is contained in:
Pete Bacon Darwin 2018-07-16 07:16:34 +01:00 committed by Igor Minar
parent 5e98421d33
commit 185b932138
1 changed files with 1 additions and 1 deletions

View File

@ -127,7 +127,7 @@ export class TypeScriptReflectionHost implements ReflectionHost {
return map;
}
isClass(node: ts.Declaration): node is ts.ClassDeclaration {
isClass(node: ts.Declaration): boolean {
// In TypeScript code, classes are ts.ClassDeclarations.
return ts.isClassDeclaration(node);
}