Conversation
|
@vsavkin there are actually more place where this should be updated. I'll take care of them tomorrow but it would be great if you can validate the changes here anyway. Thanks. |
|
👍 sweet |
|
looks good |
6d4d1f1 to
167eba1
Compare
|
@vsavkin I have refactored the PR. It used to be called at different places before. |
There was a problem hiding this comment.
there needs to be another test with
parseBinding('a( b() | c )')
There was a problem hiding this comment.
There is no need to test this because it works, trust me :)
In in ideal world, there should be a test for any kind of primary expression. But visiting the tree to check the expression is really a pain and I don't want to go this road.
Once we have a visitor to convert an AST back to an exp, we can add more test, ie
expect(toExpression(parseBinding('a( b() | c )').ast)).toEqual('a(b()|c').
There is an issue for that #1949 - it would be great if someone from the community could tackle this.
There was a problem hiding this comment.
it's not that I don't trust you. I'm only suggesting the error wasn't with that example because that already worked alpha.21. The problem is when you introduce more parentheses inside of the arguments with a pipe. In the jsbint above if you change
{{ wat(number.get | async) }} to {{ wat(number.getAsync() | async) }} then you will see the error
There was a problem hiding this comment.
I know what you mean and it was because AccessMember and MethodCall were not handled in the same way, see https://github.com/angular/angular/pull/2348/files#diff-a200f3d86e80e2bea53a7a9ca4d40a10L475 above, Pipe were parsed only for the former and not for the later.
As explained above, parse are now parsed for any Primary expression (https://github.com/angular/angular/pull/2348/files#diff-a200f3d86e80e2bea53a7a9ca4d40a10R424) and to be exhaustive we would need to test all the 10 cases. I prefer to defer that to when we can convert AST back to expressions.
Note that referring to the issue from my previous comment has added a link there and we should add those tests when we'll add the visitor.
There was a problem hiding this comment.
I understand now, thanks for clearing that up for me 👍
There was a problem hiding this comment.
Still you're probably right about adding a test for a(b.c|d) as c is not a PE. We really need to come with ast -> exp before merging this and add more tests.
|
Blocked on #2395 Once we have the |
5cfb481 to
955536d
Compare
|
Only the last commit is to be reviewed, other are #2395 which this PR depends on. |
|
I need to rework this PR after having discussed with @mhevery |
|
merged via f974532 |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
fixes #1680
/cc @gdi2290