Commit 8f9e242
fix(@angular-devkit/build-optimizer): don't assume enum values
Enum values were assumed to start with 0 and be digits. But enum values can be anything really.
When a enum declaration was not identified as an enum in a side effect free package, it would be identified as a top level IIFE (in another transform) and assumed pure. This drops the enum.
This PR fixes the behaviour by allowing the enum to be initialized with anything that doesn't have whitespaces. This is still limited and might lead to other false negatives that break things.
We should find a better way of identifying enums.
/cc @clydin
Fix angular/angular#234001 parent 6289c25 commit 8f9e242
File tree
2 files changed
+25
-1
lines changed- packages/angular_devkit/build_optimizer/src/transforms
2 files changed
+25
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
61 | 85 | | |
62 | 86 | | |
63 | 87 | | |
| |||
0 commit comments