fix(ngcc): viaModule
should be null
for local imports (#36989)
In the CommonJS and UMD reflection hosts, the logic for computing the `viaModule` property of `Declaration` objects was not correct for some cases when getting the exports of modules. In these cases it was setting `viaModule` to the path of the local module rather than `null`. PR Close #36989
This commit is contained in:

committed by
Kara Erickson

parent
2486db7c2b
commit
d268d2ad85
@ -56,7 +56,7 @@ export interface RequireCall extends ts.CallExpression {
|
||||
* `ts.Identifier` corresponding to `<namespace>` will be returned). Otherwise return `null`.
|
||||
*/
|
||||
export function findNamespaceOfIdentifier(id: ts.Identifier): ts.Identifier|null {
|
||||
return id.parent && ts.isPropertyAccessExpression(id.parent) &&
|
||||
return id.parent && ts.isPropertyAccessExpression(id.parent) && id.parent.name === id &&
|
||||
ts.isIdentifier(id.parent.expression) ?
|
||||
id.parent.expression :
|
||||
null;
|
||||
|
Reference in New Issue
Block a user