angular-cn/packages
JoostK 5de5b52beb fix(ivy): repeat template guards to narrow types in event handlers (#35193)
In Ivy's template type checker, event bindings are checked in a closure
to allow for accurate type inference of the `$event` parameter. Because
of the closure, any narrowing effects of template guards will no longer
be in effect when checking the event binding, as TypeScript assumes that
the guard outside of the closure may no longer be true once the closure
is invoked. For more information on TypeScript's Control Flow Analysis,
please refer to https://github.com/microsoft/TypeScript/issues/9998.

In Angular templates, it is known that an event binding can only be
executed when the view it occurs in is currently rendered, hence the
corresponding template guard is known to hold during the invocation of
an event handler closure. As such, it is desirable that any narrowing
effects from template guards are still in effect within the event
handler closure.

This commit tweaks the generated Type-Check Block (TCB) to repeat all
template guards within an event handler closure. This achieves the
narrowing effect of the guards even within the closure.

Fixes #35073

PR Close #35193
2020-02-07 13:06:00 -08:00
..
animations test: setup circular dependency tests for all entry points (#34774) 2020-01-23 11:36:40 -08:00
bazel fix(bazel): spawn prod server using port 4200 (#35160) 2020-02-06 15:35:11 -08:00
benchpress build: derive ts_library dep from jasmine_node_test boostrap label if it ends in `_es5` (#34736) 2020-01-15 14:58:07 -05:00
common test(common): unit test for http/testing expectOne with several requests (#27005) 2020-01-31 13:13:38 -08:00
compiler docs: changes AoT to AOT for consistency (#35112) 2020-02-04 10:43:33 -08:00
compiler-cli fix(ivy): repeat template guards to narrow types in event handlers (#35193) 2020-02-07 13:06:00 -08:00
core docs: improve description of providedIn any (#35192) 2020-02-07 09:59:09 -08:00
docs refactor(core): remove deprecated Renderer (#33019) 2019-10-08 09:23:00 -07:00
elements test: setup circular dependency tests for all entry points (#34774) 2020-01-23 11:36:40 -08:00
examples docs: changes AoT to AOT for consistency (#35112) 2020-02-04 10:43:33 -08:00
forms docs: value changes emits on additional events documented (#34497) 2020-01-23 13:57:46 -08:00
http refactor(http): fix a strictBindCallApply issue. (#34817) 2020-01-21 16:44:40 -05:00
language-service refactor(language-service): dedupe diagnostics using ts utility function (#35086) 2020-02-03 08:57:58 -08:00
localize build(localize): sync up babel dependencies (#35008) 2020-01-29 09:24:08 -08:00
platform-browser fix(ivy): ensure `DebugNode`/`DebugElement` are tree-shakeable in Ivy (#35003) 2020-01-28 15:57:57 -08:00
platform-browser-dynamic refactor(core): order private exports alphabetically (#35003) 2020-01-28 15:57:57 -08:00
platform-server refactor(ivy): change styling to use programmatic API on updates (#34804) 2020-01-24 12:23:19 -08:00
platform-webworker build: derive ts_library dep from jasmine_node_test boostrap label if it ends in `_es5` (#34736) 2020-01-15 14:58:07 -05:00
platform-webworker-dynamic build: set up all packages to publish via wombot proxy (#33747) 2019-11-13 11:34:33 -08:00
private/testing build: migrate determining if Ivy is enabled in typescript genrule files to use angular_ivy_enabled (#33983) 2019-11-26 16:38:40 -05:00
router test: setup circular dependency tests for all entry points (#34774) 2020-01-23 11:36:40 -08:00
service-worker test: setup circular dependency tests for all entry points (#34774) 2020-01-23 11:36:40 -08:00
upgrade docs: changes AoT to AOT for consistency (#35112) 2020-02-04 10:43:33 -08:00
zone.js feat: add basic jest support (#35080) 2020-02-07 11:43:21 -08:00
BUILD.bazel build: reference zone.js from source directly instead of npm. (#33046) 2019-11-06 00:48:34 +00:00
README.md docs: add doc reference to npm package readme (#33911) 2019-11-20 14:46:23 -08:00
empty.ts
goog.d.ts fix(ivy): use goog.LOCALE for Closure Compiler to define default LOCALE_ID (#31519) 2019-07-16 13:02:10 -04:00
license-banner.txt build: bump year (#34651) 2020-01-13 07:21:43 -08:00
system.d.ts
tsconfig-build-no-strict.json refactor(core): ensure compatibility with typescript strict flag (#30993) 2019-07-18 14:21:25 -07:00
tsconfig-build.json refactor(core): ensure compatibility with typescript strict flag (#30993) 2019-07-18 14:21:25 -07:00
tsconfig-test.json refactor: fix typescript strict flag failures in all tests (#30993) 2019-07-18 14:21:26 -07:00
tsconfig.json build: consolidate @angular-devkit/build-angular to the root package.json (#34002) 2019-12-02 10:49:12 -08:00
types.d.ts build: reference zone.js from source directly instead of npm. (#33046) 2019-11-06 00:48:34 +00:00

README.md

Angular

The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.

Usage information and reference details can be found in Angular documentation.

License: MIT