angular-cn/packages/compiler/test
Kristiyan Kostadinov cbc0907bfd fix(compiler): preserve this.$event and this.$any accesses in expressions (#39323)
Currently expressions `$event.foo()` and `this.$event.foo()`, as well as `$any(foo)` and
`this.$any(foo)`, are treated as the same expression by the compiler, because `this` is considered
the same implicit receiver as when the receiver is omitted. This introduces the following issues:

1. Any time something called `$any` is used, it'll be stripped away, leaving only the first parameter.
2. If something called `$event` is used anywhere in a template, it'll be preserved as `$event`,
rather than being rewritten to `ctx.$event`, causing the value to undefined at runtime. This
applies to listener, property and text bindings.

These changes resolve the first issue and part of the second one by preserving anything that
is accessed through `this`, even if it's one of the "special" ones like `$any` or `$event`.
Furthermore, these changes only expose the `$event` global variable inside event listeners,
whereas previously it was available everywhere.

Fixes #30278.

PR Close #39323
2020-10-30 10:49:15 -07:00
..
aot test(compiler-cli): improve test performance using shared source file cache (#38909) 2020-09-25 14:28:49 -04:00
css_parser build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
expression_parser fix(compiler): preserve this.$event and this.$any accesses in expressions (#39323) 2020-10-30 10:49:15 -07:00
i18n refactor(compiler): associate accurate source spans with ICU expressions (#39072) 2020-10-08 11:55:27 -07:00
ml_parser feat(compiler): Parse and recover on incomplete opening HTML tags (#38681) 2020-09-21 12:27:01 -07:00
output refactor(compiler): replace Comment nodes with leadingComments property (#38811) 2020-09-18 08:01:25 -07:00
render3 refactor(compiler): associate accurate source spans with ICU expressions (#39072) 2020-10-08 11:55:27 -07:00
schema build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
selector build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
template_parser refactor(compiler): `element.sourceSpan` should span the `outerHTML` (#38581) 2020-09-02 14:47:31 -07:00
BUILD.bazel test(compiler-cli): improve test performance using shared source file cache (#38909) 2020-09-25 14:28:49 -04:00
compiler_facade_interface_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
config_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
core_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
directive_lifecycle_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
directive_normalizer_spec.ts feat(core): remove ViewEncapsulation.Native (#38882) 2020-10-08 11:56:03 -07:00
directive_resolver_mock_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
directive_resolver_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
integration_spec.ts feat(core): update reference and doc to change `async` to `waitAsync`. (#37583) 2020-08-03 12:54:13 -07:00
metadata_resolver_fixture.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
metadata_resolver_spec.ts feat(core): update reference and doc to change `async` to `waitAsync`. (#37583) 2020-08-03 12:54:13 -07:00
ng_module_resolver_mock_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
ng_module_resolver_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
parse_util_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
pipe_resolver_mock_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
pipe_resolver_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
resource_loader_mock_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
runtime_compiler_spec.ts feat(core): update reference and doc to change `async` to `waitAsync`. (#37583) 2020-08-03 12:54:13 -07:00
shadow_css_spec.ts fix(compiler): incorrectly encapsulating @import containing colons and semicolons (#38716) 2020-10-09 08:33:04 -07:00
spies.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
style_url_resolver_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
test_bindings.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
url_resolver_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
util_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00