fix(compiler): do not emit line/char in ngsummary files. (#22840)

Having ngsummaries emit line/char numbers causes white space change to
retrigger upstream recompilations.

PR Close #22840
This commit is contained in:
Rado Kirov 2018-03-16 22:11:06 -07:00 committed by Miško Hevery
parent fc50c77bd3
commit 5c387a7f3c
1 changed files with 18 additions and 0 deletions

View File

@ -221,6 +221,24 @@ class ToJsonSerializer extends ValueTransformer {
}
}
/**
* Strip line and character numbers from ngsummaries.
* Emitting them causes white spaces changes to retrigger upstream
* recompilations in bazel.
* TODO: find out a way to have line and character numbers in errors without
* excessive recompilation in bazel.
*/
visitStringMap(map: {[key: string]: any}, context: any): any {
if (map['__symbolic'] === 'resolved') {
return visitValue(map.symbol, this, context);
}
if (map['__symbolic'] === 'error') {
delete map['line'];
delete map['character'];
}
return super.visitStringMap(map, context);
}
/**
* Returns null if the options.resolveValue is true, and the summary for the symbol
* resolved to a type or could not be resolved.