@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.
package/fesm2020/core.mjs CHANGED
@@ -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
  */
@@ -402,30 +402,15 @@ function getOwnDefinition(type, field) {
402
402
  function getInheritedInjectableDef(type) {
403
403
  const def = type && (type[NG_PROV_DEF] || type[NG_INJECTABLE_DEF]);
404
404
  if (def) {
405
- const typeName = getTypeName(type);
406
405
  ngDevMode &&
407
- console.warn(`DEPRECATED: DI is instantiating a token "${typeName}" that inherits its @Injectable decorator but does not provide one itself.\n` +
408
- `This will become an error in a future version of Angular. Please add @Injectable() to the "${typeName}" class.`);
406
+ console.warn(`DEPRECATED: DI is instantiating a token "${type.name}" that inherits its @Injectable decorator but does not provide one itself.\n` +
407
+ `This will become an error in a future version of Angular. Please add @Injectable() to the "${type.name}" class.`);
409
408
  return def;
410
409
  }
411
410
  else {
412
411
  return null;
413
412
  }
414
413
  }
415
- /** Gets the name of a type, accounting for some cross-browser differences. */
416
- function getTypeName(type) {
417
- // `Function.prototype.name` behaves differently between IE and other browsers. In most browsers
418
- // it'll always return the name of the function itself, no matter how many other functions it
419
- // inherits from. On IE the function doesn't have its own `name` property, but it takes it from
420
- // the lowest level in the prototype chain. E.g. if we have `class Foo extends Parent` most
421
- // browsers will evaluate `Foo.name` to `Foo` while IE will return `Parent`. We work around
422
- // the issue by converting the function to a string and parsing its name out that way via a regex.
423
- if (type.hasOwnProperty('name')) {
424
- return type.name;
425
- }
426
- const match = ('' + type).match(/^function\s*([^\s(]+)/);
427
- return match === null ? '' : match[1];
428
- }
429
414
  /**
430
415
  * Read the injector def type in a way which is immune to accidentally reading inherited value.
431
416
  *
@@ -4878,8 +4863,8 @@ function validateElementIsKnown(element, lView, tagName, schemas, hasDirectives)
4878
4863
  // as a custom element. Note that unknown elements with a dash in their name won't be instances
4879
4864
  // of HTMLUnknownElement in browsers that support web components.
4880
4865
  const isUnknown =
4881
- // Note that we can't check for `typeof HTMLUnknownElement === 'function'`,
4882
- // because while most browsers return 'function', IE returns 'object'.
4866
+ // Note that we can't check for `typeof HTMLUnknownElement === 'function'` because
4867
+ // Domino doesn't expose HTMLUnknownElement globally.
4883
4868
  (typeof HTMLUnknownElement !== 'undefined' && HTMLUnknownElement &&
4884
4869
  element instanceof HTMLUnknownElement) ||
4885
4870
  (typeof customElements !== 'undefined' && tagName.indexOf('-') > -1 &&
@@ -4936,8 +4921,7 @@ function isPropertyValid(element, propName, tagName, schemas) {
4936
4921
  if (matchingSchemas(schemas, tagName) || propName in element || isAnimationProp(propName)) {
4937
4922
  return true;
4938
4923
  }
4939
- // Note: `typeof Node` returns 'function' in most browsers, but on IE it is 'object' so we
4940
- // need to account for both here, while being careful with `typeof null` also returning 'object'.
4924
+ // Note: `typeof Node` returns 'function' in most browsers, but is undefined with domino.
4941
4925
  return typeof Node === 'undefined' || Node === null || !(element instanceof Node);
4942
4926
  }
4943
4927
  /**
@@ -8347,7 +8331,7 @@ class Version {
8347
8331
  /**
8348
8332
  * @publicApi
8349
8333
  */
8350
- const VERSION = new Version('15.2.6');
8334
+ const VERSION = new Version('15.2.8');
8351
8335
 
8352
8336
  // This default value is when checking the hierarchy for a token.
8353
8337
  //
@@ -12223,7 +12207,8 @@ class ComponentRef extends ComponentRef$1 {
12223
12207
  if (inputData !== null && (dataValue = inputData[name])) {
12224
12208
  const lView = this._rootLView;
12225
12209
  setInputsForProperty(lView[TVIEW], lView, dataValue, name, value);
12226
- markDirtyIfOnPush(lView, this._tNode.index);
12210
+ const childComponentLView = getComponentLViewByIndex(this._tNode.index, lView);
12211
+ markViewDirty(childComponentLView);
12227
12212
  }
12228
12213
  else {
12229
12214
  if (ngDevMode) {
@@ -15426,7 +15411,7 @@ function styleStringParser(keyValueArray, text) {
15426
15411
  * @codeGenApi
15427
15412
  */
15428
15413
  function ɵɵclassMap(classes) {
15429
- checkStylingMap(keyValueArraySet, classStringParser, classes, true);
15414
+ checkStylingMap(classKeyValueArraySet, classStringParser, classes, true);
15430
15415
  }
15431
15416
  /**
15432
15417
  * Parse text as class and add values to KeyValueArray.
@@ -15868,6 +15853,26 @@ function toStylingKeyValueArray(keyValueArraySet, stringParser, value) {
15868
15853
  function styleKeyValueArraySet(keyValueArray, key, value) {
15869
15854
  keyValueArraySet(keyValueArray, key, unwrapSafeValue(value));
15870
15855
  }
15856
+ /**
15857
+ * Class-binding-specific function for setting the `value` for a `key`.
15858
+ *
15859
+ * See: `keyValueArraySet` for details
15860
+ *
15861
+ * @param keyValueArray KeyValueArray to add to.
15862
+ * @param key Style key to add.
15863
+ * @param value The value to set.
15864
+ */
15865
+ function classKeyValueArraySet(keyValueArray, key, value) {
15866
+ // We use `classList.add` to eventually add the CSS classes to the DOM node. Any value passed into
15867
+ // `add` is stringified and added to the `class` attribute, e.g. even null, undefined or numbers
15868
+ // will be added. Stringify the key here so that our internal data structure matches the value in
15869
+ // the DOM. The only exceptions are empty strings and strings that contain spaces for which
15870
+ // the browser throws an error. We ignore such values, because the error is somewhat cryptic.
15871
+ const stringKey = String(key);
15872
+ if (stringKey !== '' && !stringKey.includes(' ')) {
15873
+ keyValueArraySet(keyValueArray, stringKey, value);
15874
+ }
15875
+ }
15871
15876
  /**
15872
15877
  * Update map based styling.
15873
15878
  *
@@ -25832,16 +25837,11 @@ class DebugElement extends DebugNode {
25832
25837
  i += 2;
25833
25838
  }
25834
25839
  }
25835
- const eAttrs = element.attributes;
25836
- for (let i = 0; i < eAttrs.length; i++) {
25837
- const attr = eAttrs[i];
25838
- const lowercaseName = attr.name.toLowerCase();
25840
+ for (const attr of element.attributes) {
25839
25841
  // Make sure that we don't assign the same attribute both in its
25840
25842
  // case-sensitive form and the lower-cased one from the browser.
25841
- if (lowercaseTNodeAttrs.indexOf(lowercaseName) === -1) {
25842
- // Save the lowercase name to align the behavior between browsers.
25843
- // IE preserves the case, while all other browser convert it to lower case.
25844
- attributes[lowercaseName] = attr.value;
25843
+ if (!lowercaseTNodeAttrs.includes(attr.name)) {
25844
+ attributes[attr.name] = attr.value;
25845
25845
  }
25846
25846
  }
25847
25847
  return attributes;