angular/packages/compiler-cli/test
Dylan Hunn ec661a3f0b refactor(compiler): Fix ambiguous repeater context variables in template pipeline (#53662)
In #52931, Kristiyan fixed a TemplateDefinitionBuilder bug in which derived alias variables in for loops (`$even`, `$first`, etc) were referring to the wrong level of nested `@for` block. (These variables are unique because they become inlined expressions, and are not "real" context variables.) He fixed this by appending level information to the generated alias name.

Template Pipeline actually suffered from the same bug. We fix it in a very similar way -- in particular, whenever these derived context variables are used, we make them depend on versions of `$index` and `$count` that have been suffixed with the xref of the enclosing repeater.

I have added a few more pipeline goldens, because we are not quite as clever as TDB about only generating the duplicate suffixed index and count variables when inside nested loops. This is fine, since in the long run, we want to refactor it more fundamentally.

I have also added a TODO to fix this more rigorously. In particular, it would be nice if we had proper support for shadowed variables, as well as unlimited levels of variables depending on one another.

PR Close #53662
2024-01-03 11:24:20 -08:00
..
compliance refactor(compiler): Fix ambiguous repeater context variables in template pipeline (#53662) 2024-01-03 11:24:20 -08:00
ngtsc fix(compiler-cli): input transform in local compilation mode (#53645) 2024-01-03 10:29:34 -08:00
BUILD.bazel build: ensure bootstrap transitive runfiles are made available (#48521) 2022-12-19 19:50:41 +00:00
downlevel_decorators_transform_spec.ts feat(core): support TypeScript 5.2 (#51334) 2023-08-18 07:55:16 -07:00
extract_i18n_spec.ts build: switch devmode output to es2015 (#44505) 2022-01-05 23:20:20 +00:00
mocks.ts build: align with internal tsconfig options (#51728) 2023-09-12 11:39:42 -07:00
perform_compile_spec.ts build: align with internal tsconfig options (#51728) 2023-09-12 11:39:42 -07:00
perform_watch_spec.ts perf(compiler-cli): minimize filesystem calls when generating shims (#47682) 2022-10-07 09:10:34 -07:00
test_support.ts refactor: fix a number of typos throughout the codebase (#52249) 2023-10-25 16:51:24 -07:00
typescript_support_spec.ts fix(compiler-cli): handle pre-release versions when checking version (#44109) 2021-11-09 20:54:45 +00:00
version_helpers_spec.ts refactor(compiler-cli): move version number helpers out of diagnostics subfolder (#44269) 2021-12-01 10:36:30 -08:00