@angular/core 15.0.2 → 15.0.4

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.
Files changed (46) hide show
  1. package/esm2020/src/application_init.mjs +2 -1
  2. package/esm2020/src/application_ref.mjs +9 -2
  3. package/esm2020/src/di/create_injector.mjs +1 -1
  4. package/esm2020/src/di/r3_injector.mjs +2 -2
  5. package/esm2020/src/errors.mjs +1 -1
  6. package/esm2020/src/render3/assert.mjs +1 -6
  7. package/esm2020/src/render3/instructions/shared.mjs +9 -8
  8. package/esm2020/src/render3/namespaces.mjs +1 -8
  9. package/esm2020/src/render3/node_manipulation.mjs +3 -7
  10. package/esm2020/src/render3/node_selector_matcher.mjs +1 -4
  11. package/esm2020/src/render3/query.mjs +1 -6
  12. package/esm2020/src/render3/state.mjs +1 -4
  13. package/esm2020/src/render3/util/view_utils.mjs +1 -15
  14. package/esm2020/src/util/array_utils.mjs +3 -71
  15. package/esm2020/src/version.mjs +1 -1
  16. package/esm2020/testing/src/logger.mjs +3 -3
  17. package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
  18. package/esm2020/testing/src/test_bed.mjs +1 -1
  19. package/fesm2015/core.mjs +27 -162
  20. package/fesm2015/core.mjs.map +1 -1
  21. package/fesm2015/testing.mjs +18 -161
  22. package/fesm2015/testing.mjs.map +1 -1
  23. package/fesm2020/core.mjs +27 -162
  24. package/fesm2020/core.mjs.map +1 -1
  25. package/fesm2020/testing.mjs +18 -161
  26. package/fesm2020/testing.mjs.map +1 -1
  27. package/index.d.ts +2 -2
  28. package/package.json +1 -1
  29. package/schematics/migrations.json +3 -18
  30. package/testing/index.d.ts +4 -1
  31. package/schematics/migrations/entry-components/index.d.ts +0 -11
  32. package/schematics/migrations/entry-components/index.js +0 -71
  33. package/schematics/migrations/entry-components/util.d.ts +0 -16
  34. package/schematics/migrations/entry-components/util.js +0 -57
  35. package/schematics/migrations/path-match-type/index.d.ts +0 -11
  36. package/schematics/migrations/path-match-type/index.js +0 -95
  37. package/schematics/migrations/path-match-type/transform.d.ts +0 -19
  38. package/schematics/migrations/path-match-type/transform.js +0 -48
  39. package/schematics/migrations/path-match-type/update_recorder.d.ts +0 -18
  40. package/schematics/migrations/path-match-type/update_recorder.js +0 -20
  41. package/schematics/migrations/path-match-type/util.d.ts +0 -11
  42. package/schematics/migrations/path-match-type/util.js +0 -106
  43. package/schematics/migrations/typed-forms/index.d.ts +0 -10
  44. package/schematics/migrations/typed-forms/index.js +0 -68
  45. package/schematics/migrations/typed-forms/util.d.ts +0 -19
  46. package/schematics/migrations/typed-forms/util.js +0 -134
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v15.0.2
2
+ * @license Angular v15.0.4
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1094,17 +1094,6 @@ function assertOneOf(value, ...validValues) {
1094
1094
  * Use of this source code is governed by an MIT-style license that can be
1095
1095
  * found in the LICENSE file at https://angular.io/license
1096
1096
  */
1097
- /**
1098
- * Equivalent to ES6 spread, add each item to an array.
1099
- *
1100
- * @param items The items to add
1101
- * @param arr The array to which you want to add the items
1102
- */
1103
- function addAllToArray(items, arr) {
1104
- for (let i = 0; i < items.length; i++) {
1105
- arr.push(items[i]);
1106
- }
1107
- }
1108
1097
  /**
1109
1098
  * Determines if the contents of two arrays is identical
1110
1099
  *
@@ -1132,25 +1121,8 @@ function arrayEquals(a, b, identityAccessor) {
1132
1121
  /**
1133
1122
  * Flattens an array.
1134
1123
  */
1135
- function flatten$1(list, dst) {
1136
- if (dst === undefined)
1137
- dst = list;
1138
- for (let i = 0; i < list.length; i++) {
1139
- let item = list[i];
1140
- if (Array.isArray(item)) {
1141
- // we need to inline it.
1142
- if (dst === list) {
1143
- // Our assumption that the list was already flat was wrong and
1144
- // we need to clone flat since we need to write to it.
1145
- dst = list.slice(0, i);
1146
- }
1147
- flatten$1(item, dst);
1148
- }
1149
- else if (dst !== list) {
1150
- dst.push(item);
1151
- }
1152
- }
1153
- return dst;
1124
+ function flatten$1(list) {
1125
+ return list.flat(Number.POSITIVE_INFINITY);
1154
1126
  }
1155
1127
  function deepForEach(input, fn) {
1156
1128
  input.forEach(value => Array.isArray(value) ? deepForEach(value, fn) : fn(value));
@@ -1260,46 +1232,6 @@ function arrayInsert2(array, index, value1, value2) {
1260
1232
  array[index + 1] = value2;
1261
1233
  }
1262
1234
  }
1263
- /**
1264
- * Insert a `value` into an `array` so that the array remains sorted.
1265
- *
1266
- * NOTE:
1267
- * - Duplicates are not allowed, and are ignored.
1268
- * - This uses binary search algorithm for fast inserts.
1269
- *
1270
- * @param array A sorted array to insert into.
1271
- * @param value The value to insert.
1272
- * @returns index of the inserted value.
1273
- */
1274
- function arrayInsertSorted(array, value) {
1275
- let index = arrayIndexOfSorted(array, value);
1276
- if (index < 0) {
1277
- // if we did not find it insert it.
1278
- index = ~index;
1279
- arrayInsert(array, index, value);
1280
- }
1281
- return index;
1282
- }
1283
- /**
1284
- * Remove `value` from a sorted `array`.
1285
- *
1286
- * NOTE:
1287
- * - This uses binary search algorithm for fast removals.
1288
- *
1289
- * @param array A sorted array to remove from.
1290
- * @param value The value to remove.
1291
- * @returns index of the removed value.
1292
- * - positive index if value found and removed.
1293
- * - negative index if value not found. (`~index` to get the value where it should have been
1294
- * inserted)
1295
- */
1296
- function arrayRemoveSorted(array, value) {
1297
- const index = arrayIndexOfSorted(array, value);
1298
- if (index >= 0) {
1299
- arraySplice(array, index, 1);
1300
- }
1301
- return index;
1302
- }
1303
1235
  /**
1304
1236
  * Get an index of an `value` in a sorted `array`.
1305
1237
  *
@@ -2857,7 +2789,7 @@ const EMBEDDED_VIEW_INJECTOR = 21;
2857
2789
  const HEADER_OFFSET = 22;
2858
2790
  // Note: This hack is necessary so we don't erroneously get a circular dependency
2859
2791
  // failure based on types.
2860
- const unusedValueExportToPlacateAjd$8 = 1;
2792
+ const unusedValueExportToPlacateAjd$4 = 1;
2861
2793
 
2862
2794
  /**
2863
2795
  * @license
@@ -2902,7 +2834,7 @@ const MOVED_VIEWS = 9;
2902
2834
  const CONTAINER_HEADER_OFFSET = 10;
2903
2835
  // Note: This hack is necessary so we don't erroneously get a circular dependency
2904
2836
  // failure based on types.
2905
- const unusedValueExportToPlacateAjd$7 = 1;
2837
+ const unusedValueExportToPlacateAjd$3 = 1;
2906
2838
 
2907
2839
  /**
2908
2840
  * @license
@@ -2987,11 +2919,6 @@ function assertHasParent(tNode) {
2987
2919
  assertDefined(tNode, 'currentTNode should exist!');
2988
2920
  assertDefined(tNode.parent, 'currentTNode should have a parent');
2989
2921
  }
2990
- function assertDataNext(lView, index, arr) {
2991
- if (arr == null)
2992
- arr = lView;
2993
- assertEqual(arr.length, index, `index ${index} expected to be at the end of arr (length ${arr.length})`);
2994
- }
2995
2922
  function assertLContainer(value) {
2996
2923
  assertDefined(value, 'LContainer must be defined');
2997
2924
  assertEqual(isLContainer(value), true, 'Expecting LContainer');
@@ -3240,14 +3167,7 @@ const profiler = function (event, instance, hookOrListener) {
3240
3167
  * found in the LICENSE file at https://angular.io/license
3241
3168
  */
3242
3169
  const SVG_NAMESPACE = 'svg';
3243
- const SVG_NAMESPACE_URI = 'http://www.w3.org/2000/svg';
3244
3170
  const MATH_ML_NAMESPACE = 'math';
3245
- const MATH_ML_NAMESPACE_URI = 'http://www.w3.org/1998/MathML/';
3246
- function getNamespaceUri(namespace) {
3247
- const name = namespace.toLowerCase();
3248
- return name === SVG_NAMESPACE ? SVG_NAMESPACE_URI :
3249
- (name === MATH_ML_NAMESPACE ? MATH_ML_NAMESPACE_URI : null);
3250
- }
3251
3171
 
3252
3172
  /**
3253
3173
  * @license
@@ -3296,20 +3216,6 @@ function unwrapLView(value) {
3296
3216
  }
3297
3217
  return null;
3298
3218
  }
3299
- /**
3300
- * Returns `LContainer` or `null` if not found.
3301
- * @param value wrapped value of `RNode`, `LView`, `LContainer`
3302
- */
3303
- function unwrapLContainer(value) {
3304
- while (Array.isArray(value)) {
3305
- // This check is same as `isLContainer()` but we don't call at as we don't want to call
3306
- // `Array.isArray()` twice and give JITer more work for inlining.
3307
- if (value[TYPE] === true)
3308
- return value;
3309
- value = value[HOST];
3310
- }
3311
- return null;
3312
- }
3313
3219
  /**
3314
3220
  * Retrieves an element value from the provided `viewData`, by unwrapping
3315
3221
  * from any containers, component views, or style contexts.
@@ -3569,9 +3475,6 @@ function isCurrentTNodeParent() {
3569
3475
  function setCurrentTNodeAsNotParent() {
3570
3476
  instructionState.lFrame.isParent = false;
3571
3477
  }
3572
- function setCurrentTNodeAsParent() {
3573
- instructionState.lFrame.isParent = true;
3574
- }
3575
3478
  function getContextLView() {
3576
3479
  const contextLView = instructionState.lFrame.contextLView;
3577
3480
  ngDevMode && assertDefined(contextLView, 'contextLView must be defined.');
@@ -4294,7 +4197,7 @@ function isFactory(obj) {
4294
4197
  }
4295
4198
  // Note: This hack is necessary so we don't erroneously get a circular dependency
4296
4199
  // failure based on types.
4297
- const unusedValueExportToPlacateAjd$6 = 1;
4200
+ const unusedValueExportToPlacateAjd$2 = 1;
4298
4201
 
4299
4202
  /**
4300
4203
  * Converts `TNodeType` into human readable text.
@@ -4313,7 +4216,7 @@ function toTNodeTypeAsString(tNodeType) {
4313
4216
  }
4314
4217
  // Note: This hack is necessary so we don't erroneously get a circular dependency
4315
4218
  // failure based on types.
4316
- const unusedValueExportToPlacateAjd$5 = 1;
4219
+ const unusedValueExportToPlacateAjd$1 = 1;
4317
4220
  /**
4318
4221
  * Returns `true` if the `TNode` has a directive which has `@Input()` for `class` binding.
4319
4222
  *
@@ -6353,28 +6256,6 @@ function ensureIcuContainerVisitorLoaded(loader) {
6353
6256
  }
6354
6257
  }
6355
6258
 
6356
- /**
6357
- * @license
6358
- * Copyright Google LLC All Rights Reserved.
6359
- *
6360
- * Use of this source code is governed by an MIT-style license that can be
6361
- * found in the LICENSE file at https://angular.io/license
6362
- */
6363
- // Note: This hack is necessary so we don't erroneously get a circular dependency
6364
- // failure based on types.
6365
- const unusedValueExportToPlacateAjd$4 = 1;
6366
-
6367
- /**
6368
- * @license
6369
- * Copyright Google LLC All Rights Reserved.
6370
- *
6371
- * Use of this source code is governed by an MIT-style license that can be
6372
- * found in the LICENSE file at https://angular.io/license
6373
- */
6374
- // Note: This hack is necessary so we don't erroneously get a circular dependency
6375
- // failure based on types.
6376
- const unusedValueExportToPlacateAjd$3 = 1;
6377
-
6378
6259
  /**
6379
6260
  * @license
6380
6261
  * Copyright Google LLC All Rights Reserved.
@@ -6446,7 +6327,6 @@ function getNearestLContainer(viewOrContainer) {
6446
6327
  * Use of this source code is governed by an MIT-style license that can be
6447
6328
  * found in the LICENSE file at https://angular.io/license
6448
6329
  */
6449
- const unusedValueToPlacateAjd$2 = unusedValueExportToPlacateAjd$7 + unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd$3 + unusedValueExportToPlacateAjd$8;
6450
6330
  /**
6451
6331
  * NOTE: for performance reasons, the possible actions are inlined within the function instead of
6452
6332
  * being passed as an argument.
@@ -9081,7 +8961,7 @@ class R3Injector extends EnvironmentInjector {
9081
8961
  try {
9082
8962
  const initializers = this.get(ENVIRONMENT_INITIALIZER.multi, EMPTY_ARRAY, InjectFlags.Self);
9083
8963
  if (ngDevMode && !Array.isArray(initializers)) {
9084
- throw new RuntimeError(209 /* RuntimeErrorCode.INVALID_MULTI_PROVIDER */, 'Unexpected type of the `ENVIRONMENT_INITIALIZER` token value ' +
8964
+ throw new RuntimeError(-209 /* RuntimeErrorCode.INVALID_MULTI_PROVIDER */, 'Unexpected type of the `ENVIRONMENT_INITIALIZER` token value ' +
9085
8965
  `(expected an array, but got ${typeof initializers}). ` +
9086
8966
  'Please check that the `ENVIRONMENT_INITIALIZER` token is configured as a ' +
9087
8967
  '`multi: true` provider.');
@@ -9511,7 +9391,7 @@ class Version {
9511
9391
  /**
9512
9392
  * @publicApi
9513
9393
  */
9514
- const VERSION = new Version('15.0.2');
9394
+ const VERSION = new Version('15.0.4');
9515
9395
 
9516
9396
  /**
9517
9397
  * @license
@@ -9777,7 +9657,6 @@ function classIndexOf(className, classToSearch, startingIndex) {
9777
9657
  * Use of this source code is governed by an MIT-style license that can be
9778
9658
  * found in the LICENSE file at https://angular.io/license
9779
9659
  */
9780
- const unusedValueToPlacateAjd$1 = unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd$4;
9781
9660
  const NG_TEMPLATE_SELECTOR = 'ng-template';
9782
9661
  /**
9783
9662
  * Search the `TAttributes` to see if it contains `cssClassToMatch` (case insensitive)
@@ -12236,6 +12115,12 @@ function lastSelectedElementIdx(hostBindingOpCodes) {
12236
12115
  function instantiateAllDirectives(tView, lView, tNode, native) {
12237
12116
  const start = tNode.directiveStart;
12238
12117
  const end = tNode.directiveEnd;
12118
+ // The component view needs to be created before creating the node injector
12119
+ // since it is used to inject some special symbols like `ChangeDetectorRef`.
12120
+ if (isComponentHost(tNode)) {
12121
+ ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */);
12122
+ addComponentLogic(lView, tNode, tView.data[start + tNode.componentOffset]);
12123
+ }
12239
12124
  if (!tView.firstCreatePass) {
12240
12125
  getOrCreateNodeInjectorForNode(tNode, lView);
12241
12126
  }
@@ -12243,19 +12128,14 @@ function instantiateAllDirectives(tView, lView, tNode, native) {
12243
12128
  const initialInputs = tNode.initialInputs;
12244
12129
  for (let i = start; i < end; i++) {
12245
12130
  const def = tView.data[i];
12246
- const isComponent = isComponentDef(def);
12247
- if (isComponent) {
12248
- ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */);
12249
- addComponentLogic(lView, tNode, def);
12250
- }
12251
12131
  const directive = getNodeInjectable(lView, tView, i, tNode);
12252
12132
  attachPatchData(directive, lView);
12253
12133
  if (initialInputs !== null) {
12254
12134
  setInputsFromAttrs(lView, i - start, directive, def, tNode, initialInputs);
12255
12135
  }
12256
- if (isComponent) {
12136
+ if (isComponentDef(def)) {
12257
12137
  const componentView = getComponentLViewByIndex(tNode.index, lView);
12258
- componentView[CONTEXT] = directive;
12138
+ componentView[CONTEXT] = getNodeInjectable(lView, tView, i, tNode);
12259
12139
  }
12260
12140
  }
12261
12141
  }
@@ -19158,7 +19038,7 @@ var I18nCreateOpCode;
19158
19038
  })(I18nCreateOpCode || (I18nCreateOpCode = {}));
19159
19039
  // Note: This hack is necessary so we don't erroneously get a circular dependency
19160
19040
  // failure based on types.
19161
- const unusedValueExportToPlacateAjd$2 = 1;
19041
+ const unusedValueExportToPlacateAjd = 1;
19162
19042
 
19163
19043
  /**
19164
19044
  * @license
@@ -23155,29 +23035,6 @@ function createContainerRef(hostTNode, hostLView) {
23155
23035
  * Use of this source code is governed by an MIT-style license that can be
23156
23036
  * found in the LICENSE file at https://angular.io/license
23157
23037
  */
23158
- // Note: This hack is necessary so we don't erroneously get a circular dependency
23159
- // failure based on types.
23160
- const unusedValueExportToPlacateAjd$1 = 1;
23161
-
23162
- /**
23163
- * @license
23164
- * Copyright Google LLC All Rights Reserved.
23165
- *
23166
- * Use of this source code is governed by an MIT-style license that can be
23167
- * found in the LICENSE file at https://angular.io/license
23168
- */
23169
- // Note: This hack is necessary so we don't erroneously get a circular dependency
23170
- // failure based on types.
23171
- const unusedValueExportToPlacateAjd = 1;
23172
-
23173
- /**
23174
- * @license
23175
- * Copyright Google LLC All Rights Reserved.
23176
- *
23177
- * Use of this source code is governed by an MIT-style license that can be
23178
- * found in the LICENSE file at https://angular.io/license
23179
- */
23180
- const unusedValueToPlacateAjd = unusedValueExportToPlacateAjd$1 + unusedValueExportToPlacateAjd$6 + unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd;
23181
23038
  class LQuery_ {
23182
23039
  constructor(queryList) {
23183
23040
  this.queryList = queryList;