fix(ivy): ngcc - properly handle aliases class expressions (#29119)
In ES2015, classes could have been emitted as a variable declaration initialized with a class expression. In certain situations, an intermediary variable suffixed with `_1` is present such that the variable declaration's initializer becomes a binary expression with its rhs being the class expression, and its lhs being the identifier of the intermediate variable. This structure was not recognized, resulting in such classes not being considered as a class in `Esm2015ReflectionHost`. As a consequence, the analysis of functions/methods that return a `ModuleWithProviders` object did not take the methods of such classes into account. Another edge-case with such intermediate variable was that static properties would not be considered as class members. A testcase was added to prevent regressions. Fixes #29078 PR Close #29119
This commit is contained in:
@ -44,7 +44,7 @@ export function findAll<T>(node: ts.Node, test: (node: ts.Node) => node is ts.No
|
||||
/**
|
||||
* Does the given declaration have a name which is an identifier?
|
||||
* @param declaration The declaration to test.
|
||||
* @returns true if the declaration has an identifer for a name.
|
||||
* @returns true if the declaration has an identifier for a name.
|
||||
*/
|
||||
export function hasNameIdentifier(declaration: ts.Declaration): declaration is ts.Declaration&
|
||||
{name: ts.Identifier} {
|
||||
|
Reference in New Issue
Block a user