@angular/core 15.0.2 → 15.0.3

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/fesm2015/core.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v15.0.2
2
+ * @license Angular v15.0.3
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1439,7 +1439,7 @@ const MOVED_VIEWS = 9;
1439
1439
  const CONTAINER_HEADER_OFFSET = 10;
1440
1440
  // Note: This hack is necessary so we don't erroneously get a circular dependency
1441
1441
  // failure based on types.
1442
- const unusedValueExportToPlacateAjd$8 = 1;
1442
+ const unusedValueExportToPlacateAjd$4 = 1;
1443
1443
 
1444
1444
  /**
1445
1445
  * @license
@@ -1484,7 +1484,7 @@ const EMBEDDED_VIEW_INJECTOR = 21;
1484
1484
  const HEADER_OFFSET = 22;
1485
1485
  // Note: This hack is necessary so we don't erroneously get a circular dependency
1486
1486
  // failure based on types.
1487
- const unusedValueExportToPlacateAjd$7 = 1;
1487
+ const unusedValueExportToPlacateAjd$3 = 1;
1488
1488
 
1489
1489
  /**
1490
1490
  * @license
@@ -1569,11 +1569,6 @@ function assertHasParent(tNode) {
1569
1569
  assertDefined(tNode, 'currentTNode should exist!');
1570
1570
  assertDefined(tNode.parent, 'currentTNode should have a parent');
1571
1571
  }
1572
- function assertDataNext(lView, index, arr) {
1573
- if (arr == null)
1574
- arr = lView;
1575
- assertEqual(arr.length, index, `index ${index} expected to be at the end of arr (length ${arr.length})`);
1576
- }
1577
1572
  function assertLContainer(value) {
1578
1573
  assertDefined(value, 'LContainer must be defined');
1579
1574
  assertEqual(isLContainer(value), true, 'Expecting LContainer');
@@ -1822,14 +1817,7 @@ const profiler = function (event, instance, hookOrListener) {
1822
1817
  * found in the LICENSE file at https://angular.io/license
1823
1818
  */
1824
1819
  const SVG_NAMESPACE = 'svg';
1825
- const SVG_NAMESPACE_URI = 'http://www.w3.org/2000/svg';
1826
1820
  const MATH_ML_NAMESPACE = 'math';
1827
- const MATH_ML_NAMESPACE_URI = 'http://www.w3.org/1998/MathML/';
1828
- function getNamespaceUri(namespace) {
1829
- const name = namespace.toLowerCase();
1830
- return name === SVG_NAMESPACE ? SVG_NAMESPACE_URI :
1831
- (name === MATH_ML_NAMESPACE ? MATH_ML_NAMESPACE_URI : null);
1832
- }
1833
1821
 
1834
1822
  /**
1835
1823
  * @license
@@ -1878,20 +1866,6 @@ function unwrapLView(value) {
1878
1866
  }
1879
1867
  return null;
1880
1868
  }
1881
- /**
1882
- * Returns `LContainer` or `null` if not found.
1883
- * @param value wrapped value of `RNode`, `LView`, `LContainer`
1884
- */
1885
- function unwrapLContainer(value) {
1886
- while (Array.isArray(value)) {
1887
- // This check is same as `isLContainer()` but we don't call at as we don't want to call
1888
- // `Array.isArray()` twice and give JITer more work for inlining.
1889
- if (value[TYPE] === true)
1890
- return value;
1891
- value = value[HOST];
1892
- }
1893
- return null;
1894
- }
1895
1869
  /**
1896
1870
  * Retrieves an element value from the provided `viewData`, by unwrapping
1897
1871
  * from any containers, component views, or style contexts.
@@ -2151,9 +2125,6 @@ function isCurrentTNodeParent() {
2151
2125
  function setCurrentTNodeAsNotParent() {
2152
2126
  instructionState.lFrame.isParent = false;
2153
2127
  }
2154
- function setCurrentTNodeAsParent() {
2155
- instructionState.lFrame.isParent = true;
2156
- }
2157
2128
  function getContextLView() {
2158
2129
  const contextLView = instructionState.lFrame.contextLView;
2159
2130
  ngDevMode && assertDefined(contextLView, 'contextLView must be defined.');
@@ -2876,7 +2847,7 @@ function isFactory(obj) {
2876
2847
  }
2877
2848
  // Note: This hack is necessary so we don't erroneously get a circular dependency
2878
2849
  // failure based on types.
2879
- const unusedValueExportToPlacateAjd$6 = 1;
2850
+ const unusedValueExportToPlacateAjd$2 = 1;
2880
2851
 
2881
2852
  /**
2882
2853
  * Converts `TNodeType` into human readable text.
@@ -2895,7 +2866,7 @@ function toTNodeTypeAsString(tNodeType) {
2895
2866
  }
2896
2867
  // Note: This hack is necessary so we don't erroneously get a circular dependency
2897
2868
  // failure based on types.
2898
- const unusedValueExportToPlacateAjd$5 = 1;
2869
+ const unusedValueExportToPlacateAjd$1 = 1;
2899
2870
  /**
2900
2871
  * Returns `true` if the `TNode` has a directive which has `@Input()` for `class` binding.
2901
2872
  *
@@ -4378,17 +4349,6 @@ function isType(v) {
4378
4349
  * Use of this source code is governed by an MIT-style license that can be
4379
4350
  * found in the LICENSE file at https://angular.io/license
4380
4351
  */
4381
- /**
4382
- * Equivalent to ES6 spread, add each item to an array.
4383
- *
4384
- * @param items The items to add
4385
- * @param arr The array to which you want to add the items
4386
- */
4387
- function addAllToArray(items, arr) {
4388
- for (let i = 0; i < items.length; i++) {
4389
- arr.push(items[i]);
4390
- }
4391
- }
4392
4352
  /**
4393
4353
  * Determines if the contents of two arrays is identical
4394
4354
  *
@@ -4416,25 +4376,8 @@ function arrayEquals(a, b, identityAccessor) {
4416
4376
  /**
4417
4377
  * Flattens an array.
4418
4378
  */
4419
- function flatten(list, dst) {
4420
- if (dst === undefined)
4421
- dst = list;
4422
- for (let i = 0; i < list.length; i++) {
4423
- let item = list[i];
4424
- if (Array.isArray(item)) {
4425
- // we need to inline it.
4426
- if (dst === list) {
4427
- // Our assumption that the list was already flat was wrong and
4428
- // we need to clone flat since we need to write to it.
4429
- dst = list.slice(0, i);
4430
- }
4431
- flatten(item, dst);
4432
- }
4433
- else if (dst !== list) {
4434
- dst.push(item);
4435
- }
4436
- }
4437
- return dst;
4379
+ function flatten(list) {
4380
+ return list.flat(Number.POSITIVE_INFINITY);
4438
4381
  }
4439
4382
  function deepForEach(input, fn) {
4440
4383
  input.forEach(value => Array.isArray(value) ? deepForEach(value, fn) : fn(value));
@@ -4544,46 +4487,6 @@ function arrayInsert2(array, index, value1, value2) {
4544
4487
  array[index + 1] = value2;
4545
4488
  }
4546
4489
  }
4547
- /**
4548
- * Insert a `value` into an `array` so that the array remains sorted.
4549
- *
4550
- * NOTE:
4551
- * - Duplicates are not allowed, and are ignored.
4552
- * - This uses binary search algorithm for fast inserts.
4553
- *
4554
- * @param array A sorted array to insert into.
4555
- * @param value The value to insert.
4556
- * @returns index of the inserted value.
4557
- */
4558
- function arrayInsertSorted(array, value) {
4559
- let index = arrayIndexOfSorted(array, value);
4560
- if (index < 0) {
4561
- // if we did not find it insert it.
4562
- index = ~index;
4563
- arrayInsert(array, index, value);
4564
- }
4565
- return index;
4566
- }
4567
- /**
4568
- * Remove `value` from a sorted `array`.
4569
- *
4570
- * NOTE:
4571
- * - This uses binary search algorithm for fast removals.
4572
- *
4573
- * @param array A sorted array to remove from.
4574
- * @param value The value to remove.
4575
- * @returns index of the removed value.
4576
- * - positive index if value found and removed.
4577
- * - negative index if value not found. (`~index` to get the value where it should have been
4578
- * inserted)
4579
- */
4580
- function arrayRemoveSorted(array, value) {
4581
- const index = arrayIndexOfSorted(array, value);
4582
- if (index >= 0) {
4583
- arraySplice(array, index, 1);
4584
- }
4585
- return index;
4586
- }
4587
4490
  /**
4588
4491
  * Get an index of an `value` in a sorted `array`.
4589
4492
  *
@@ -6036,28 +5939,6 @@ function ensureIcuContainerVisitorLoaded(loader) {
6036
5939
  }
6037
5940
  }
6038
5941
 
6039
- /**
6040
- * @license
6041
- * Copyright Google LLC All Rights Reserved.
6042
- *
6043
- * Use of this source code is governed by an MIT-style license that can be
6044
- * found in the LICENSE file at https://angular.io/license
6045
- */
6046
- // Note: This hack is necessary so we don't erroneously get a circular dependency
6047
- // failure based on types.
6048
- const unusedValueExportToPlacateAjd$4 = 1;
6049
-
6050
- /**
6051
- * @license
6052
- * Copyright Google LLC All Rights Reserved.
6053
- *
6054
- * Use of this source code is governed by an MIT-style license that can be
6055
- * found in the LICENSE file at https://angular.io/license
6056
- */
6057
- // Note: This hack is necessary so we don't erroneously get a circular dependency
6058
- // failure based on types.
6059
- const unusedValueExportToPlacateAjd$3 = 1;
6060
-
6061
5942
  /**
6062
5943
  * @license
6063
5944
  * Copyright Google LLC All Rights Reserved.
@@ -6129,7 +6010,6 @@ function getNearestLContainer(viewOrContainer) {
6129
6010
  * Use of this source code is governed by an MIT-style license that can be
6130
6011
  * found in the LICENSE file at https://angular.io/license
6131
6012
  */
6132
- const unusedValueToPlacateAjd$2 = unusedValueExportToPlacateAjd$8 + unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd$3 + unusedValueExportToPlacateAjd$7;
6133
6013
  /**
6134
6014
  * NOTE: for performance reasons, the possible actions are inlined within the function instead of
6135
6015
  * being passed as an argument.
@@ -9111,7 +8991,7 @@ class Version {
9111
8991
  /**
9112
8992
  * @publicApi
9113
8993
  */
9114
- const VERSION = new Version('15.0.2');
8994
+ const VERSION = new Version('15.0.3');
9115
8995
 
9116
8996
  /**
9117
8997
  * @license
@@ -9432,7 +9312,6 @@ function classIndexOf(className, classToSearch, startingIndex) {
9432
9312
  * Use of this source code is governed by an MIT-style license that can be
9433
9313
  * found in the LICENSE file at https://angular.io/license
9434
9314
  */
9435
- const unusedValueToPlacateAjd$1 = unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd$4;
9436
9315
  const NG_TEMPLATE_SELECTOR = 'ng-template';
9437
9316
  /**
9438
9317
  * Search the `TAttributes` to see if it contains `cssClassToMatch` (case insensitive)
@@ -11892,6 +11771,12 @@ function lastSelectedElementIdx(hostBindingOpCodes) {
11892
11771
  function instantiateAllDirectives(tView, lView, tNode, native) {
11893
11772
  const start = tNode.directiveStart;
11894
11773
  const end = tNode.directiveEnd;
11774
+ // The component view needs to be created before creating the node injector
11775
+ // since it is used to inject some special symbols like `ChangeDetectorRef`.
11776
+ if (isComponentHost(tNode)) {
11777
+ ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */);
11778
+ addComponentLogic(lView, tNode, tView.data[start + tNode.componentOffset]);
11779
+ }
11895
11780
  if (!tView.firstCreatePass) {
11896
11781
  getOrCreateNodeInjectorForNode(tNode, lView);
11897
11782
  }
@@ -11899,19 +11784,14 @@ function instantiateAllDirectives(tView, lView, tNode, native) {
11899
11784
  const initialInputs = tNode.initialInputs;
11900
11785
  for (let i = start; i < end; i++) {
11901
11786
  const def = tView.data[i];
11902
- const isComponent = isComponentDef(def);
11903
- if (isComponent) {
11904
- ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */);
11905
- addComponentLogic(lView, tNode, def);
11906
- }
11907
11787
  const directive = getNodeInjectable(lView, tView, i, tNode);
11908
11788
  attachPatchData(directive, lView);
11909
11789
  if (initialInputs !== null) {
11910
11790
  setInputsFromAttrs(lView, i - start, directive, def, tNode, initialInputs);
11911
11791
  }
11912
- if (isComponent) {
11792
+ if (isComponentDef(def)) {
11913
11793
  const componentView = getComponentLViewByIndex(tNode.index, lView);
11914
- componentView[CONTEXT] = directive;
11794
+ componentView[CONTEXT] = getNodeInjectable(lView, tView, i, tNode);
11915
11795
  }
11916
11796
  }
11917
11797
  }
@@ -18815,7 +18695,7 @@ var I18nCreateOpCode;
18815
18695
  })(I18nCreateOpCode || (I18nCreateOpCode = {}));
18816
18696
  // Note: This hack is necessary so we don't erroneously get a circular dependency
18817
18697
  // failure based on types.
18818
- const unusedValueExportToPlacateAjd$2 = 1;
18698
+ const unusedValueExportToPlacateAjd = 1;
18819
18699
 
18820
18700
  /**
18821
18701
  * @license
@@ -22813,29 +22693,6 @@ function createContainerRef(hostTNode, hostLView) {
22813
22693
  * Use of this source code is governed by an MIT-style license that can be
22814
22694
  * found in the LICENSE file at https://angular.io/license
22815
22695
  */
22816
- // Note: This hack is necessary so we don't erroneously get a circular dependency
22817
- // failure based on types.
22818
- const unusedValueExportToPlacateAjd$1 = 1;
22819
-
22820
- /**
22821
- * @license
22822
- * Copyright Google LLC All Rights Reserved.
22823
- *
22824
- * Use of this source code is governed by an MIT-style license that can be
22825
- * found in the LICENSE file at https://angular.io/license
22826
- */
22827
- // Note: This hack is necessary so we don't erroneously get a circular dependency
22828
- // failure based on types.
22829
- const unusedValueExportToPlacateAjd = 1;
22830
-
22831
- /**
22832
- * @license
22833
- * Copyright Google LLC All Rights Reserved.
22834
- *
22835
- * Use of this source code is governed by an MIT-style license that can be
22836
- * found in the LICENSE file at https://angular.io/license
22837
- */
22838
- const unusedValueToPlacateAjd = unusedValueExportToPlacateAjd$1 + unusedValueExportToPlacateAjd$6 + unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd;
22839
22696
  class LQuery_ {
22840
22697
  constructor(queryList) {
22841
22698
  this.queryList = queryList;