mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
When producing a listener, the template pipeline does the following in separate phases: 1. Generates all the variables available within its scope. 2. Adds `restoreView` and `resetView` calls if there are any referenced to local variables (e.g. `@let` or local refs). 3. Optimizes away the variables that aren't used. This means that we can end up in a situation where the references to the variables in the scope no longer exist, but we still enter and leave the view as if they're there which is unnecessary. These changes add a simple optimization pass that looks specifically for the pattern of a `restoreView` followed by a `return resetView(expr)`. Furthermore, by changing the order of some optimizations, we're able to drop the `getCurrentView` variable as well. Fixes #66286. |
||
|---|---|---|
| .. | ||
| design | ||
| src | ||
| test | ||
| BUILD.bazel | ||
| compiler.ts | ||
| index.ts | ||
| package.json | ||
| public_api.ts | ||