Commit 1c6cf8a
fix(compiler-cli): do not drop non-Angular decorators when downleveling (#39577)
There is a compiler transform that downlevels Angular class decorators
to static properties so that metadata is available for JIT compilation.
The transform was supposed to ignore non-Angular decorators but it was
actually completely dropping decorators that did not conform to a very
specific syntactic shape (i.e. the decorator was a simple identifier, or
a namespaced identifier).
This commit ensures that all non-Angular decorators are kepts as-is
even if they are built using a syntax that the Angular compiler does not
understand.
Fixes #39574
PR Close #395771 parent 7bd0133 commit 1c6cf8aCopy full SHA for 1c6cf8a
File tree
Expand file treeCollapse file tree
2 files changed
+27
-7
lines changedOpen diff view settings
Filter options
- packages/compiler-cli
- src/transformers
- test/transformers
Expand file treeCollapse file tree
2 files changed
+27
-7
lines changedOpen diff view settings
Collapse file
packages/compiler-cli/src/transformers/downlevel_decorators_transform.ts
Copy file name to clipboardExpand all lines: packages/compiler-cli/src/transformers/downlevel_decorators_transform.ts+12-7Lines changed: 12 additions & 7 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
538 | 538 | |
539 | 539 | |
540 | 540 | |
541 | | - |
| 541 | + |
| 542 | + |
| 543 | + |
| 544 | + |
| 545 | + |
| 546 | + |
| 547 | + |
542 | 548 | |
543 | 549 | |
544 | 550 | |
545 | | - |
546 | | - |
| 551 | + |
547 | 552 | |
548 | 553 | |
549 | 554 | |
| ||
557 | 562 | |
558 | 563 | |
559 | 564 | |
560 | | - |
561 | | - |
| 565 | + |
562 | 566 | |
563 | 567 | |
564 | 568 | |
| ||
581 | 585 | |
582 | 586 | |
583 | 587 | |
584 | | - |
585 | | - |
| 588 | + |
| 589 | + |
| 590 | + |
586 | 591 | |
587 | 592 | |
588 | 593 | |
|
Collapse file
packages/compiler-cli/test/transformers/downlevel_decorators_transform_spec.ts
Copy file name to clipboardExpand all lines: packages/compiler-cli/test/transformers/downlevel_decorators_transform_spec.ts+15Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
189 | 189 | |
190 | 190 | |
191 | 191 | |
| 192 | + |
| 193 | + |
| 194 | + |
| 195 | + |
| 196 | + |
| 197 | + |
| 198 | + |
| 199 | + |
| 200 | + |
| 201 | + |
| 202 | + |
| 203 | + |
| 204 | + |
| 205 | + |
| 206 | + |
192 | 207 | |
193 | 208 | |
194 | 209 | |
|
0 commit comments