angular/packages/compiler/test/expression_parser
Kristiyan Kostadinov 2028c3933f refactor(compiler): combine call ASTs (#42882)
Currently the compiler has three different classes to represent a "call to something":
1. `MethodCall` - `foo.bar()`
2. `SafeMethodCall` - `foo?.bar()`.
3. `FunctionCall` - Any calls that don't fit into the first two classes. E.g. `foo.bar()()`.

There are a few problems with this approach:
1. It is inconistent with the TypeScript AST which only has one node: `CallExpression`.
2. It means that we have to maintain more code, because the various parts of the compiler need to know about three node types.
3. It doesn't allow us to easily implement some new JS features like safe calls (e.g. `foo.bar?.())`).

These changes rework the compiler so that it produces only one node: `Call`. The new node behaves  similarly to the TypeScript `CallExpression` whose `receiver` can be any expression.

There was a similar situation in the output AST where we had an `InvokeMethodExpression` and `InvokeFunctionExpression`. I've combined both of them into `InvokeFunctionExpression`.

PR Close #42882
2021-09-21 20:55:29 +00:00
..
utils refactor(compiler): combine call ASTs (#42882) 2021-09-21 20:55:29 +00:00
ast_spec.ts refactor(compiler): combine call ASTs (#42882) 2021-09-21 20:55:29 +00:00
BUILD.bazel build: derive ts_library dep from jasmine_node_test boostrap label if it ends in _es5 (#34736) 2020-01-15 14:58:07 -05:00
lexer_spec.ts feat(compiler): support number separators in templates (#42672) 2021-06-30 10:36:15 -07:00
parser_spec.ts refactor(compiler): combine call ASTs (#42882) 2021-09-21 20:55:29 +00:00