forked from angular/angular
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ngcc): correctly match aliased classes between src and dts files
The naïve matching algorithm we previously used to match declarations in source files to declarations in typings files was based only on the name of the thing being declared. This did not handle cases where the declared item has been exported via an alias. This is a common scenariow when one of the two file sets (source or typings) has been flattened, while the other has not. The new algorithm tries to overcome this by creating two maps of export name to declaration (i.e. `Map<string, ts.Declaration>`). One for the source files and one for the typings files. It then joins these two together by matching export names, resulting in a new map that maps source declarations to typings declarations directly (i.e. `Map<ts.Declaration, ts.Declaration>`). This new map can handle the declaration names being different between the source and typings as long as they are ultimately both exported with the same alias name. Fixes angular#33593
- Loading branch information
1 parent
e4c9092
commit cbd4235
Showing
11 changed files
with
339 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.