@angular/core 15.2.3 → 15.2.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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v15.2.3
2
+ * @license Angular v15.2.4
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -8705,7 +8705,7 @@ class Version {
8705
8705
  /**
8706
8706
  * @publicApi
8707
8707
  */
8708
- const VERSION = new Version('15.2.3');
8708
+ const VERSION = new Version('15.2.4');
8709
8709
 
8710
8710
  // This default value is when checking the hierarchy for a token.
8711
8711
  //
@@ -8939,12 +8939,19 @@ function isCssClassMatching(attrs, cssClassToMatch, isProjectionMode) {
8939
8939
  ngDevMode &&
8940
8940
  assertEqual(cssClassToMatch, cssClassToMatch.toLowerCase(), 'Class name expected to be lowercase.');
8941
8941
  let i = 0;
8942
+ // Indicates whether we are processing value from the implicit
8943
+ // attribute section (i.e. before the first marker in the array).
8944
+ let isImplicitAttrsSection = true;
8942
8945
  while (i < attrs.length) {
8943
8946
  let item = attrs[i++];
8944
- if (isProjectionMode && item === 'class') {
8945
- item = attrs[i];
8946
- if (classIndexOf(item.toLowerCase(), cssClassToMatch, 0) !== -1) {
8947
- return true;
8947
+ if (typeof item === 'string' && isImplicitAttrsSection) {
8948
+ const value = attrs[i++];
8949
+ if (isProjectionMode && item === 'class') {
8950
+ // We found a `class` attribute in the implicit attribute section,
8951
+ // check if it matches the value of the `cssClassToMatch` argument.
8952
+ if (classIndexOf(value.toLowerCase(), cssClassToMatch, 0) !== -1) {
8953
+ return true;
8954
+ }
8948
8955
  }
8949
8956
  }
8950
8957
  else if (item === 1 /* AttributeMarker.Classes */) {
@@ -8956,6 +8963,11 @@ function isCssClassMatching(attrs, cssClassToMatch, isProjectionMode) {
8956
8963
  }
8957
8964
  return false;
8958
8965
  }
8966
+ else if (typeof item === 'number') {
8967
+ // We've came across a first marker, which indicates
8968
+ // that the implicit attribute section is over.
8969
+ isImplicitAttrsSection = false;
8970
+ }
8959
8971
  }
8960
8972
  return false;
8961
8973
  }
@@ -23571,10 +23583,11 @@ class TestBedCompiler {
23571
23583
  }
23572
23584
  }
23573
23585
  queueTypesFromModulesArray(arr) {
23574
- // Because we may encounter the same NgModule while processing the imports and exports of an
23575
- // NgModule tree, we cache them in this set so we can skip ones that have already been seen
23576
- // encountered. In some test setups, this caching resulted in 10X runtime improvement.
23577
- const processedNgModuleDefs = new Set();
23586
+ // Because we may encounter the same NgModule or a standalone Component while processing
23587
+ // the dependencies of an NgModule or a standalone Component, we cache them in this set so we
23588
+ // can skip ones that have already been seen encountered. In some test setups, this caching
23589
+ // resulted in 10X runtime improvement.
23590
+ const processedDefs = new Set();
23578
23591
  const queueTypesFromModulesArrayRecur = (arr) => {
23579
23592
  for (const value of arr) {
23580
23593
  if (Array.isArray(value)) {
@@ -23582,10 +23595,10 @@ class TestBedCompiler {
23582
23595
  }
23583
23596
  else if (hasNgModuleDef(value)) {
23584
23597
  const def = value.ɵmod;
23585
- if (processedNgModuleDefs.has(def)) {
23598
+ if (processedDefs.has(def)) {
23586
23599
  continue;
23587
23600
  }
23588
- processedNgModuleDefs.add(def);
23601
+ processedDefs.add(def);
23589
23602
  // Look through declarations, imports, and exports, and queue
23590
23603
  // everything found there.
23591
23604
  this.queueTypeArray(maybeUnwrapFn(def.declarations), value);
@@ -23598,6 +23611,10 @@ class TestBedCompiler {
23598
23611
  else if (isStandaloneComponent(value)) {
23599
23612
  this.queueType(value, null);
23600
23613
  const def = getComponentDef(value);
23614
+ if (processedDefs.has(def)) {
23615
+ continue;
23616
+ }
23617
+ processedDefs.add(def);
23601
23618
  const dependencies = maybeUnwrapFn(def.dependencies ?? []);
23602
23619
  dependencies.forEach((dependency) => {
23603
23620
  // Note: in AOT, the `dependencies` might also contain regular