angular-cn/packages/language-service
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
..
bundles build(language-service): remove typescript from ivy bundle (#38088) 2020-07-16 11:04:57 -07:00
common feat(language-service): Implement go to definition for style and template urls (#39202) 2020-10-16 12:31:54 -07:00
ivy fix(compiler): preserve this.$event and this.$any accesses in expressions (#39323) 2020-10-30 10:49:15 -07:00
src fix(compiler): preserve this.$event and this.$any accesses in expressions (#39323) 2020-10-30 10:49:15 -07:00
test feat(language-service): Implement go to definition for style and template urls (#39202) 2020-10-16 12:31:54 -07:00
BUILD.bazel refactor(language-service): Extract common methods from VE and Ivy to new package (#39098) 2020-10-05 16:14:54 -07:00
build.sh build(language-service): add script to build package locally (#38103) 2020-07-16 16:39:54 -07:00
index.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
language-service.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
package.json build(language-service): Remove ls_rollup_bundle (#38086) 2020-07-16 11:04:28 -07:00