mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
05672ab136
Previously the value passed to `AstFactory.attachComments()` could be `undefined` which is counterintuitive, since why attach something that doesn't exist? Now it expects there to be a defined array. Further it no longer returns a statement. Both these aspects of the interface were designed to make the usage simpler but has the result of complicating the implemenation. The `ExpressionTranslatorVisitor` now has a helper function (`attachComments()`) to handle `leadingComments` being undefined and also returning the statement. This keeps the usage in the translator simple, while ensuring that the `AstFactory` API is not influenced by how it is used. PR Close #39076