@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
  */
@@ -8695,7 +8695,7 @@ class Version {
8695
8695
  /**
8696
8696
  * @publicApi
8697
8697
  */
8698
- const VERSION = new Version('15.2.3');
8698
+ const VERSION = new Version('15.2.4');
8699
8699
 
8700
8700
  // This default value is when checking the hierarchy for a token.
8701
8701
  //
@@ -8929,12 +8929,19 @@ function isCssClassMatching(attrs, cssClassToMatch, isProjectionMode) {
8929
8929
  ngDevMode &&
8930
8930
  assertEqual(cssClassToMatch, cssClassToMatch.toLowerCase(), 'Class name expected to be lowercase.');
8931
8931
  let i = 0;
8932
+ // Indicates whether we are processing value from the implicit
8933
+ // attribute section (i.e. before the first marker in the array).
8934
+ let isImplicitAttrsSection = true;
8932
8935
  while (i < attrs.length) {
8933
8936
  let item = attrs[i++];
8934
- if (isProjectionMode && item === 'class') {
8935
- item = attrs[i];
8936
- if (classIndexOf(item.toLowerCase(), cssClassToMatch, 0) !== -1) {
8937
- return true;
8937
+ if (typeof item === 'string' && isImplicitAttrsSection) {
8938
+ const value = attrs[i++];
8939
+ if (isProjectionMode && item === 'class') {
8940
+ // We found a `class` attribute in the implicit attribute section,
8941
+ // check if it matches the value of the `cssClassToMatch` argument.
8942
+ if (classIndexOf(value.toLowerCase(), cssClassToMatch, 0) !== -1) {
8943
+ return true;
8944
+ }
8938
8945
  }
8939
8946
  }
8940
8947
  else if (item === 1 /* AttributeMarker.Classes */) {
@@ -8946,6 +8953,11 @@ function isCssClassMatching(attrs, cssClassToMatch, isProjectionMode) {
8946
8953
  }
8947
8954
  return false;
8948
8955
  }
8956
+ else if (typeof item === 'number') {
8957
+ // We've came across a first marker, which indicates
8958
+ // that the implicit attribute section is over.
8959
+ isImplicitAttrsSection = false;
8960
+ }
8949
8961
  }
8950
8962
  return false;
8951
8963
  }
@@ -23570,10 +23582,11 @@ class TestBedCompiler {
23570
23582
  }
23571
23583
  }
23572
23584
  queueTypesFromModulesArray(arr) {
23573
- // Because we may encounter the same NgModule while processing the imports and exports of an
23574
- // NgModule tree, we cache them in this set so we can skip ones that have already been seen
23575
- // encountered. In some test setups, this caching resulted in 10X runtime improvement.
23576
- const processedNgModuleDefs = new Set();
23585
+ // Because we may encounter the same NgModule or a standalone Component while processing
23586
+ // the dependencies of an NgModule or a standalone Component, we cache them in this set so we
23587
+ // can skip ones that have already been seen encountered. In some test setups, this caching
23588
+ // resulted in 10X runtime improvement.
23589
+ const processedDefs = new Set();
23577
23590
  const queueTypesFromModulesArrayRecur = (arr) => {
23578
23591
  var _a;
23579
23592
  for (const value of arr) {
@@ -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((_a = def.dependencies) !== null && _a !== void 0 ? _a : []);
23602
23619
  dependencies.forEach((dependency) => {
23603
23620
  // Note: in AOT, the `dependencies` might also contain regular