cbc0907bfd
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 |
||
---|---|---|
.. | ||
mock_compile | ||
prelink | ||
BUILD.bazel | ||
README.md | ||
mock_compiler_spec.ts | ||
r3_compiler_compliance_spec.ts | ||
r3_view_compiler_binding_spec.ts | ||
r3_view_compiler_di_spec.ts | ||
r3_view_compiler_directives_spec.ts | ||
r3_view_compiler_i18n_spec.ts | ||
r3_view_compiler_input_outputs_spec.ts | ||
r3_view_compiler_listener_spec.ts | ||
r3_view_compiler_providers_spec.ts | ||
r3_view_compiler_spec.ts | ||
r3_view_compiler_styling_spec.ts | ||
r3_view_compiler_template_spec.ts |
README.md
Tests in this directory should be run with:
yarn bazel test --config=ivy packages/compiler-cli/test/compliance:compliance