@angular-devkit/build-angular 12.2.7 → 12.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@angular-devkit/build-angular",
3
- "version": "12.2.7",
3
+ "version": "12.2.8",
4
4
  "description": "Angular Webpack Build Facade",
5
5
  "main": "src/index.js",
6
6
  "typings": "src/index.d.ts",
7
7
  "builders": "builders.json",
8
8
  "dependencies": {
9
9
  "@ampproject/remapping": "1.0.1",
10
- "@angular-devkit/architect": "0.1202.7",
11
- "@angular-devkit/build-optimizer": "0.1202.7",
12
- "@angular-devkit/build-webpack": "0.1202.7",
13
- "@angular-devkit/core": "12.2.7",
10
+ "@angular-devkit/architect": "0.1202.8",
11
+ "@angular-devkit/build-optimizer": "0.1202.8",
12
+ "@angular-devkit/build-webpack": "0.1202.8",
13
+ "@angular-devkit/core": "12.2.8",
14
14
  "@babel/core": "7.14.8",
15
15
  "@babel/generator": "7.14.8",
16
16
  "@babel/helper-annotate-as-pure": "7.14.5",
@@ -22,7 +22,7 @@
22
22
  "@babel/template": "7.14.5",
23
23
  "@discoveryjs/json-ext": "0.5.3",
24
24
  "@jsdevtools/coverage-istanbul-loader": "3.0.5",
25
- "@ngtools/webpack": "12.2.7",
25
+ "@ngtools/webpack": "12.2.8",
26
26
  "ansi-colors": "4.1.1",
27
27
  "babel-loader": "8.2.2",
28
28
  "browserslist": "^4.9.1",
@@ -68,9 +68,15 @@ function default_1() {
68
68
  if (!enumCallee.isFunctionExpression() || enumCallee.node.params.length !== 1) {
69
69
  return;
70
70
  }
71
+ const enumCalleeParam = enumCallee.node.params[0];
72
+ const isEnumCalleeMatching = core_1.types.isIdentifier(enumCalleeParam) && enumCalleeParam.name === declarationId.name;
71
73
  // Loose mode rewrites the enum to a shorter but less TypeScript-like form
74
+ // Note: We only can apply the `loose` mode transformation if the callee parameter matches
75
+ // with the declaration identifier name. This is necessary in case the the declaration id has
76
+ // been renamed to avoid collisions, as the loose transform would then break the enum assignments
77
+ // which rely on the differently-named callee identifier name.
72
78
  let enumAssignments;
73
- if (loose) {
79
+ if (loose && isEnumCalleeMatching) {
74
80
  enumAssignments = [];
75
81
  }
76
82
  // Check if all enum member values are pure.