angular/packages/compiler-cli/test/compliance/test_cases
Kristiyan Kostadinov ce80136e7b fix(compiler): optimize away unnecessary restore/reset view calls
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.
2026-01-20 10:22:55 -08:00
..
model_inputs test(compiler): switch compliance tests to es2022 2026-01-02 08:29:12 +01:00
output_function test(compiler): switch compliance tests to es2022 2026-01-02 08:29:12 +01:00
r3_compiler_compliance build: initial test of TypeScript 6 2026-01-15 13:41:01 -08:00
r3_view_compiler feat(compiler): Add support for the instanceof binary operator 2026-01-13 08:33:12 -08:00
r3_view_compiler_arrow_functions fix(compiler): optimize away unnecessary restore/reset view calls 2026-01-20 10:22:55 -08:00
r3_view_compiler_bindings fix(forms): Ensure the control instruction comes after the other bindings 2026-01-12 13:49:19 -08:00
r3_view_compiler_control_flow fix(compiler): Support empty cases 2026-01-07 15:47:59 -08:00
r3_view_compiler_deferred test(compiler): switch compliance tests to es2022 2026-01-02 08:29:12 +01:00
r3_view_compiler_di/di test(compiler): switch compliance tests to es2022 2026-01-02 08:29:12 +01:00
r3_view_compiler_directives test(compiler): switch compliance tests to es2022 2026-01-02 08:29:12 +01:00
r3_view_compiler_i18n test(compiler): switch compliance tests to es2022 2026-01-02 08:29:12 +01:00
r3_view_compiler_input_outputs test(compiler): switch compliance tests to es2022 2026-01-02 08:29:12 +01:00
r3_view_compiler_let test(compiler): switch compliance tests to es2022 2026-01-02 08:29:12 +01:00
r3_view_compiler_listener fix(compiler): optimize away unnecessary restore/reset view calls 2026-01-20 10:22:55 -08:00
r3_view_compiler_providers test(compiler): switch compliance tests to es2022 2026-01-02 08:29:12 +01:00
r3_view_compiler_styling test(compiler): switch compliance tests to es2022 2026-01-02 08:29:12 +01:00
r3_view_compiler_template test(compiler): switch compliance tests to es2022 2026-01-02 08:29:12 +01:00
signal_inputs test(compiler): switch compliance tests to es2022 2026-01-02 08:29:12 +01:00
signal_queries test(compiler): switch compliance tests to es2022 2026-01-02 08:29:12 +01:00
source_mapping test(compiler): switch compliance tests to es2022 2026-01-02 08:29:12 +01:00
BUILD.bazel build: rename defaults2.bzl to defaults.bzl (#63383) 2025-08-25 15:45:01 -07:00
list_golden_update_rules.ts test(core): remove shelljs from core schematics tests (#64042) 2025-09-26 13:14:09 -04:00
test_case_schema.json feat(compiler-cli): add experimental support for fast type declaration emission (#61334) 2025-05-14 14:07:37 -07:00