fix(ivy): don't run decorator handlers against declaration files (#34557)

Currently the decorator handlers are run against all `SourceFile`s in the compilation, but we shouldn't be doing it against declaration files. This initially came up as a CI issue in #33264 where it was worked around only for the `DirectiveDecoratorHandler`. These changes move the logic into the `TraitCompiler` and `DecorationAnalyzer` so that it applies to all of the handlers.

PR Close #34557
This commit is contained in:
crisbeto
2019-12-27 08:18:21 +02:00
committed by atscott
parent 6d28a209e4
commit 6d534f10e6
8 changed files with 126 additions and 5 deletions

View File

@ -137,6 +137,7 @@ export class DecorationAnalyzer {
analyzeProgram(): DecorationAnalyses {
const decorationAnalyses = new DecorationAnalyses();
const analyzedFiles = this.program.getSourceFiles()
.filter(sourceFile => !sourceFile.isDeclarationFile)
.filter(sourceFile => isWithinPackage(this.packagePath, sourceFile))
.map(sourceFile => this.analyzeFile(sourceFile))
.filter(isDefined);