angular-cn/packages/language-service/ivy
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
..
test fix(compiler): do not throw away render3 AST on errors (#39413) 2020-10-27 13:37:19 -07:00
BUILD.bazel feat(language-service): Implement go to definition for style and template urls (#39202) 2020-10-16 12:31:54 -07:00
compiler_factory.ts feat(language-service): Implement go to definition for style and template urls (#39202) 2020-10-16 12:31:54 -07:00
definitions.ts feat(language-service): Implement go to definition for style and template urls (#39202) 2020-10-16 12:31:54 -07:00
hybrid_visitor.ts refactor(language-service): Return directive defs when input name is part of selector (#39243) 2020-10-15 14:17:24 -07:00
language_service.ts feat(language-service): Implement go to definition for style and template urls (#39202) 2020-10-16 12:31:54 -07:00
language_service_adapter.ts feat(language-service): Implement go to definition for style and template urls (#39202) 2020-10-16 12:31:54 -07:00
quick_info.ts fix(compiler): preserve this.$event and this.$any accesses in expressions (#39323) 2020-10-30 10:49:15 -07:00
ts_plugin.ts feat(language-service): Add getTypeDefinitionAtPosition (go to type definition) (#39145) 2020-10-09 10:57:37 -07:00
utils.ts fix(compiler): preserve this.$event and this.$any accesses in expressions (#39323) 2020-10-30 10:49:15 -07:00