@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
  */
@@ -772,30 +772,15 @@ function getOwnDefinition(type, field) {
772
772
  function getInheritedInjectableDef(type) {
773
773
  const def = type && (type[NG_PROV_DEF] || type[NG_INJECTABLE_DEF]);
774
774
  if (def) {
775
- const typeName = getTypeName(type);
776
775
  ngDevMode &&
777
- console.warn(`DEPRECATED: DI is instantiating a token "${typeName}" that inherits its @Injectable decorator but does not provide one itself.\n` +
778
- `This will become an error in a future version of Angular. Please add @Injectable() to the "${typeName}" class.`);
776
+ console.warn(`DEPRECATED: DI is instantiating a token "${type.name}" 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 "${type.name}" class.`);
779
778
  return def;
780
779
  }
781
780
  else {
782
781
  return null;
783
782
  }
784
783
  }
785
- /** Gets the name of a type, accounting for some cross-browser differences. */
786
- function getTypeName(type) {
787
- // `Function.prototype.name` behaves differently between IE and other browsers. In most browsers
788
- // it'll always return the name of the function itself, no matter how many other functions it
789
- // inherits from. On IE the function doesn't have its own `name` property, but it takes it from
790
- // the lowest level in the prototype chain. E.g. if we have `class Foo extends Parent` most
791
- // browsers will evaluate `Foo.name` to `Foo` while IE will return `Parent`. We work around
792
- // the issue by converting the function to a string and parsing its name out that way via a regex.
793
- if (type.hasOwnProperty('name')) {
794
- return type.name;
795
- }
796
- const match = ('' + type).match(/^function\s*([^\s(]+)/);
797
- return match === null ? '' : match[1];
798
- }
799
784
  /**
800
785
  * Read the injector def type in a way which is immune to accidentally reading inherited value.
801
786
  *
@@ -5139,8 +5124,8 @@ function validateElementIsKnown(element, lView, tagName, schemas, hasDirectives)
5139
5124
  // as a custom element. Note that unknown elements with a dash in their name won't be instances
5140
5125
  // of HTMLUnknownElement in browsers that support web components.
5141
5126
  const isUnknown =
5142
- // Note that we can't check for `typeof HTMLUnknownElement === 'function'`,
5143
- // because while most browsers return 'function', IE returns 'object'.
5127
+ // Note that we can't check for `typeof HTMLUnknownElement === 'function'` because
5128
+ // Domino doesn't expose HTMLUnknownElement globally.
5144
5129
  (typeof HTMLUnknownElement !== 'undefined' && HTMLUnknownElement &&
5145
5130
  element instanceof HTMLUnknownElement) ||
5146
5131
  (typeof customElements !== 'undefined' && tagName.indexOf('-') > -1 &&
@@ -5197,8 +5182,7 @@ function isPropertyValid(element, propName, tagName, schemas) {
5197
5182
  if (matchingSchemas(schemas, tagName) || propName in element || isAnimationProp(propName)) {
5198
5183
  return true;
5199
5184
  }
5200
- // Note: `typeof Node` returns 'function' in most browsers, but on IE it is 'object' so we
5201
- // need to account for both here, while being careful with `typeof null` also returning 'object'.
5185
+ // Note: `typeof Node` returns 'function' in most browsers, but is undefined with domino.
5202
5186
  return typeof Node === 'undefined' || Node === null || !(element instanceof Node);
5203
5187
  }
5204
5188
  /**
@@ -8697,7 +8681,7 @@ class Version {
8697
8681
  /**
8698
8682
  * @publicApi
8699
8683
  */
8700
- const VERSION = new Version('15.2.6');
8684
+ const VERSION = new Version('15.2.8');
8701
8685
 
8702
8686
  // This default value is when checking the hierarchy for a token.
8703
8687
  //
@@ -12529,7 +12513,8 @@ class ComponentRef extends ComponentRef$1 {
12529
12513
  if (inputData !== null && (dataValue = inputData[name])) {
12530
12514
  const lView = this._rootLView;
12531
12515
  setInputsForProperty(lView[TVIEW], lView, dataValue, name, value);
12532
- markDirtyIfOnPush(lView, this._tNode.index);
12516
+ const childComponentLView = getComponentLViewByIndex(this._tNode.index, lView);
12517
+ markViewDirty(childComponentLView);
12533
12518
  }
12534
12519
  else {
12535
12520
  if (ngDevMode) {
@@ -15732,7 +15717,7 @@ function styleStringParser(keyValueArray, text) {
15732
15717
  * @codeGenApi
15733
15718
  */
15734
15719
  function ɵɵclassMap(classes) {
15735
- checkStylingMap(keyValueArraySet, classStringParser, classes, true);
15720
+ checkStylingMap(classKeyValueArraySet, classStringParser, classes, true);
15736
15721
  }
15737
15722
  /**
15738
15723
  * Parse text as class and add values to KeyValueArray.
@@ -16174,6 +16159,26 @@ function toStylingKeyValueArray(keyValueArraySet, stringParser, value) {
16174
16159
  function styleKeyValueArraySet(keyValueArray, key, value) {
16175
16160
  keyValueArraySet(keyValueArray, key, unwrapSafeValue(value));
16176
16161
  }
16162
+ /**
16163
+ * Class-binding-specific function for setting the `value` for a `key`.
16164
+ *
16165
+ * See: `keyValueArraySet` for details
16166
+ *
16167
+ * @param keyValueArray KeyValueArray to add to.
16168
+ * @param key Style key to add.
16169
+ * @param value The value to set.
16170
+ */
16171
+ function classKeyValueArraySet(keyValueArray, key, value) {
16172
+ // We use `classList.add` to eventually add the CSS classes to the DOM node. Any value passed into
16173
+ // `add` is stringified and added to the `class` attribute, e.g. even null, undefined or numbers
16174
+ // will be added. Stringify the key here so that our internal data structure matches the value in
16175
+ // the DOM. The only exceptions are empty strings and strings that contain spaces for which
16176
+ // the browser throws an error. We ignore such values, because the error is somewhat cryptic.
16177
+ const stringKey = String(key);
16178
+ if (stringKey !== '' && !stringKey.includes(' ')) {
16179
+ keyValueArraySet(keyValueArray, stringKey, value);
16180
+ }
16181
+ }
16177
16182
  /**
16178
16183
  * Update map based styling.
16179
16184
  *