angular/packages/compiler/src
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
..
aot refactor(compiler): remove cyclic dependencies (#43129) 2021-08-16 13:07:23 -07:00
compiler_util refactor(compiler): combine call ASTs (#42882) 2021-09-21 20:55:29 +00:00
expression_parser refactor(compiler): combine call ASTs (#42882) 2021-09-21 20:55:29 +00:00
i18n refactor(compiler): define interfaces for each lexer token (#43132) 2021-09-16 18:15:51 +00:00
jit refactor(compiler): remove cyclic dependencies (#43129) 2021-08-16 13:07:23 -07:00
ml_parser refactor(compiler): define interfaces for each lexer token (#43132) 2021-09-16 18:15:51 +00:00
output refactor(compiler): combine call ASTs (#42882) 2021-09-21 20:55:29 +00:00
render3 refactor(compiler): combine call ASTs (#42882) 2021-09-21 20:55:29 +00:00
schema refactor: add override keyword to members implementing abstract declarations (#42512) 2021-07-12 13:11:17 -07:00
template_parser refactor(compiler): remove cyclic dependencies (#43129) 2021-08-16 13:07:23 -07:00
view_compiler refactor(compiler): combine call ASTs (#42882) 2021-09-21 20:55:29 +00:00
assertions.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
ast_path.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
chars.ts refactor(compiler): share isQuote() via chars.ts (#43129) 2021-08-16 13:07:23 -07:00
compile_metadata.ts refactor(compiler): remove cyclic dependencies (#43129) 2021-08-16 13:07:23 -07:00
compile_reflector.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
compiler.ts refactor(compiler): combine call ASTs (#42882) 2021-09-21 20:55:29 +00:00
compiler_facade_interface.ts refactor(compiler): ensure compatibility with noImplicitOverride (#42512) 2021-07-12 13:11:14 -07:00
config.ts refactor(compiler): remove extra imports (#37246) 2020-06-11 19:00:33 -07:00
constant_pool.ts refactor(compiler): combine call ASTs (#42882) 2021-09-21 20:55:29 +00:00
core.ts refactor(core): remove the need for ɵɵinjectPipeChangeDetectorRef() (#41231) 2021-03-30 16:46:37 -07:00
directive_normalizer.ts refactor(compiler): remove cyclic dependencies (#43129) 2021-08-16 13:07:23 -07:00
directive_resolver.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
identifiers.ts refactor(compiler-cli): introduce declaration function to declare class metadata (#41200) 2021-04-12 10:41:17 -07:00
injectable_compiler.ts refactor(compiler): remove cyclic dependencies (#43129) 2021-08-16 13:07:23 -07:00
injectable_compiler_2.ts refactor(compiler): combine call ASTs (#42882) 2021-09-21 20:55:29 +00:00
jit_compiler_facade.ts refactor(compiler): implement ngDeclareInjectable() (#41316) 2021-04-07 13:57:13 -07:00
lifecycle_reflector.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
metadata_resolver.ts refactor(compiler): remove cyclic dependencies (#43129) 2021-08-16 13:07:23 -07:00
ng_module_compiler.ts refactor(compiler): remove cyclic dependencies (#43129) 2021-08-16 13:07:23 -07:00
ng_module_resolver.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
parse_util.ts refactor(compiler): remove cyclic dependencies (#43129) 2021-08-16 13:07:23 -07:00
pipe_resolver.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
provider_analyzer.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
resource_loader.ts refactor(compiler): ensure compatibility with noImplicitOverride (#42512) 2021-07-12 13:11:14 -07:00
selector.ts feat(compiler): support directive selectors with attributes containing $ (#41567) 2021-05-04 21:06:58 -07:00
shadow_css.ts refactor(compiler): improve regular expression for stripping comments (#43456) 2021-09-16 16:50:49 +00:00
style_compiler.ts refactor(compiler): remove cyclic dependencies (#43129) 2021-08-16 13:07:23 -07:00
style_url_resolver.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
summary_resolver.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
url_resolver.ts docs: remove unused "docregions" (#40479) 2021-01-20 16:12:15 -08:00
util.ts refactor(compiler): remove cyclic dependencies (#43129) 2021-08-16 13:07:23 -07:00
version.ts docs: fix package name in version.ts files in different packages (#41208) 2021-05-10 10:26:34 -04:00