@angular/core 15.2.6 → 15.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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v15.2.6
2
+ * @license Angular v15.2.8
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -771,30 +771,15 @@ function getOwnDefinition(type, field) {
771
771
  function getInheritedInjectableDef(type) {
772
772
  const def = type && (type[NG_PROV_DEF] || type[NG_INJECTABLE_DEF]);
773
773
  if (def) {
774
- const typeName = getTypeName(type);
775
774
  ngDevMode &&
776
- console.warn(`DEPRECATED: DI is instantiating a token "${typeName}" that inherits its @Injectable decorator but does not provide one itself.\n` +
777
- `This will become an error in a future version of Angular. Please add @Injectable() to the "${typeName}" class.`);
775
+ console.warn(`DEPRECATED: DI is instantiating a token "${type.name}" that inherits its @Injectable decorator but does not provide one itself.\n` +
776
+ `This will become an error in a future version of Angular. Please add @Injectable() to the "${type.name}" class.`);
778
777
  return def;
779
778
  }
780
779
  else {
781
780
  return null;
782
781
  }
783
782
  }
784
- /** Gets the name of a type, accounting for some cross-browser differences. */
785
- function getTypeName(type) {
786
- // `Function.prototype.name` behaves differently between IE and other browsers. In most browsers
787
- // it'll always return the name of the function itself, no matter how many other functions it
788
- // inherits from. On IE the function doesn't have its own `name` property, but it takes it from
789
- // the lowest level in the prototype chain. E.g. if we have `class Foo extends Parent` most
790
- // browsers will evaluate `Foo.name` to `Foo` while IE will return `Parent`. We work around
791
- // the issue by converting the function to a string and parsing its name out that way via a regex.
792
- if (type.hasOwnProperty('name')) {
793
- return type.name;
794
- }
795
- const match = ('' + type).match(/^function\s*([^\s(]+)/);
796
- return match === null ? '' : match[1];
797
- }
798
783
  /**
799
784
  * Read the injector def type in a way which is immune to accidentally reading inherited value.
800
785
  *
@@ -5154,8 +5139,8 @@ function validateElementIsKnown(element, lView, tagName, schemas, hasDirectives)
5154
5139
  // as a custom element. Note that unknown elements with a dash in their name won't be instances
5155
5140
  // of HTMLUnknownElement in browsers that support web components.
5156
5141
  const isUnknown =
5157
- // Note that we can't check for `typeof HTMLUnknownElement === 'function'`,
5158
- // because while most browsers return 'function', IE returns 'object'.
5142
+ // Note that we can't check for `typeof HTMLUnknownElement === 'function'` because
5143
+ // Domino doesn't expose HTMLUnknownElement globally.
5159
5144
  (typeof HTMLUnknownElement !== 'undefined' && HTMLUnknownElement &&
5160
5145
  element instanceof HTMLUnknownElement) ||
5161
5146
  (typeof customElements !== 'undefined' && tagName.indexOf('-') > -1 &&
@@ -5212,8 +5197,7 @@ function isPropertyValid(element, propName, tagName, schemas) {
5212
5197
  if (matchingSchemas(schemas, tagName) || propName in element || isAnimationProp(propName)) {
5213
5198
  return true;
5214
5199
  }
5215
- // Note: `typeof Node` returns 'function' in most browsers, but on IE it is 'object' so we
5216
- // need to account for both here, while being careful with `typeof null` also returning 'object'.
5200
+ // Note: `typeof Node` returns 'function' in most browsers, but is undefined with domino.
5217
5201
  return typeof Node === 'undefined' || Node === null || !(element instanceof Node);
5218
5202
  }
5219
5203
  /**
@@ -8705,7 +8689,7 @@ class Version {
8705
8689
  /**
8706
8690
  * @publicApi
8707
8691
  */
8708
- const VERSION = new Version('15.2.6');
8692
+ const VERSION = new Version('15.2.8');
8709
8693
 
8710
8694
  // This default value is when checking the hierarchy for a token.
8711
8695
  //
@@ -12533,7 +12517,8 @@ class ComponentRef extends ComponentRef$1 {
12533
12517
  if (inputData !== null && (dataValue = inputData[name])) {
12534
12518
  const lView = this._rootLView;
12535
12519
  setInputsForProperty(lView[TVIEW], lView, dataValue, name, value);
12536
- markDirtyIfOnPush(lView, this._tNode.index);
12520
+ const childComponentLView = getComponentLViewByIndex(this._tNode.index, lView);
12521
+ markViewDirty(childComponentLView);
12537
12522
  }
12538
12523
  else {
12539
12524
  if (ngDevMode) {
@@ -15736,7 +15721,7 @@ function styleStringParser(keyValueArray, text) {
15736
15721
  * @codeGenApi
15737
15722
  */
15738
15723
  function ɵɵclassMap(classes) {
15739
- checkStylingMap(keyValueArraySet, classStringParser, classes, true);
15724
+ checkStylingMap(classKeyValueArraySet, classStringParser, classes, true);
15740
15725
  }
15741
15726
  /**
15742
15727
  * Parse text as class and add values to KeyValueArray.
@@ -16178,6 +16163,26 @@ function toStylingKeyValueArray(keyValueArraySet, stringParser, value) {
16178
16163
  function styleKeyValueArraySet(keyValueArray, key, value) {
16179
16164
  keyValueArraySet(keyValueArray, key, unwrapSafeValue(value));
16180
16165
  }
16166
+ /**
16167
+ * Class-binding-specific function for setting the `value` for a `key`.
16168
+ *
16169
+ * See: `keyValueArraySet` for details
16170
+ *
16171
+ * @param keyValueArray KeyValueArray to add to.
16172
+ * @param key Style key to add.
16173
+ * @param value The value to set.
16174
+ */
16175
+ function classKeyValueArraySet(keyValueArray, key, value) {
16176
+ // We use `classList.add` to eventually add the CSS classes to the DOM node. Any value passed into
16177
+ // `add` is stringified and added to the `class` attribute, e.g. even null, undefined or numbers
16178
+ // will be added. Stringify the key here so that our internal data structure matches the value in
16179
+ // the DOM. The only exceptions are empty strings and strings that contain spaces for which
16180
+ // the browser throws an error. We ignore such values, because the error is somewhat cryptic.
16181
+ const stringKey = String(key);
16182
+ if (stringKey !== '' && !stringKey.includes(' ')) {
16183
+ keyValueArraySet(keyValueArray, stringKey, value);
16184
+ }
16185
+ }
16181
16186
  /**
16182
16187
  * Update map based styling.
16183
16188
  *