@angular/core 15.2.0 → 15.2.1

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.0
2
+ * @license Angular v15.2.1
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -8742,7 +8742,7 @@ class Version {
8742
8742
  /**
8743
8743
  * @publicApi
8744
8744
  */
8745
- const VERSION = new Version('15.2.0');
8745
+ const VERSION = new Version('15.2.1');
8746
8746
 
8747
8747
  // This default value is when checking the hierarchy for a token.
8748
8748
  //
@@ -10555,6 +10555,7 @@ function createTNodeAtIndex(tView, index, type, name, attrs) {
10555
10555
  // In the case of i18n the `currentTNode` may already be linked, in which case we don't want
10556
10556
  // to break the links which i18n created.
10557
10557
  currentTNode.next = tNode;
10558
+ tNode.prev = currentTNode;
10558
10559
  }
10559
10560
  }
10560
10561
  }
@@ -10995,6 +10996,7 @@ function createTNode(tView, tParent, type, index, value, attrs) {
10995
10996
  outputs: null,
10996
10997
  tViews: null,
10997
10998
  next: null,
10999
+ prev: null,
10998
11000
  projectionNext: null,
10999
11001
  child: null,
11000
11002
  parent: tParent,
@@ -11204,7 +11206,6 @@ function resolveDirectives(tView, lView, tNode, localRefs) {
11204
11206
  // Please make sure to have explicit type for `exportsMap`. Inferred type triggers bug in
11205
11207
  // tsickle.
11206
11208
  ngDevMode && assertFirstCreatePass(tView);
11207
- let hasDirectives = false;
11208
11209
  if (getBindingsEnabled()) {
11209
11210
  const exportsMap = localRefs === null ? null : { '': -1 };
11210
11211
  const matchResult = findDirectiveDefMatches(tView, tNode);
@@ -11217,7 +11218,6 @@ function resolveDirectives(tView, lView, tNode, localRefs) {
11217
11218
  [directiveDefs, hostDirectiveDefs] = matchResult;
11218
11219
  }
11219
11220
  if (directiveDefs !== null) {
11220
- hasDirectives = true;
11221
11221
  initializeDirectives(tView, lView, tNode, directiveDefs, exportsMap, hostDirectiveDefs);
11222
11222
  }
11223
11223
  if (exportsMap)
@@ -11225,7 +11225,6 @@ function resolveDirectives(tView, lView, tNode, localRefs) {
11225
11225
  }
11226
11226
  // Merge the template attrs last so that they have the highest priority.
11227
11227
  tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, tNode.attrs);
11228
- return hasDirectives;
11229
11228
  }
11230
11229
  /** Initializes the data structures necessary for a list of directives to be instantiated. */
11231
11230
  function initializeDirectives(tView, lView, tNode, directives, exportsMap, hostDirectiveDefs) {
@@ -13091,41 +13090,19 @@ function validateMappings(bindingType, def, hostDirectiveBindings) {
13091
13090
  }
13092
13091
  }
13093
13092
 
13094
- let _symbolIterator = null;
13095
- function getSymbolIterator() {
13096
- if (!_symbolIterator) {
13097
- const Symbol = _global$1['Symbol'];
13098
- if (Symbol && Symbol.iterator) {
13099
- _symbolIterator = Symbol.iterator;
13100
- }
13101
- else {
13102
- // es6-shim specific logic
13103
- const keys = Object.getOwnPropertyNames(Map.prototype);
13104
- for (let i = 0; i < keys.length; ++i) {
13105
- const key = keys[i];
13106
- if (key !== 'entries' && key !== 'size' &&
13107
- Map.prototype[key] === Map.prototype['entries']) {
13108
- _symbolIterator = key;
13109
- }
13110
- }
13111
- }
13112
- }
13113
- return _symbolIterator;
13114
- }
13115
-
13116
13093
  function isIterable(obj) {
13117
- return obj !== null && typeof obj === 'object' && obj[getSymbolIterator()] !== undefined;
13094
+ return obj !== null && typeof obj === 'object' && obj[Symbol.iterator] !== undefined;
13118
13095
  }
13119
13096
  function isListLikeIterable(obj) {
13120
13097
  if (!isJsObject(obj))
13121
13098
  return false;
13122
13099
  return Array.isArray(obj) ||
13123
13100
  (!(obj instanceof Map) && // JS Map are iterables but return entries as [k, v]
13124
- getSymbolIterator() in obj); // JS Iterable have a Symbol.iterator prop
13101
+ Symbol.iterator in obj); // JS Iterable have a Symbol.iterator prop
13125
13102
  }
13126
13103
  function areIterablesEqual(a, b, comparator) {
13127
- const iterator1 = a[getSymbolIterator()]();
13128
- const iterator2 = b[getSymbolIterator()]();
13104
+ const iterator1 = a[Symbol.iterator]();
13105
+ const iterator2 = b[Symbol.iterator]();
13129
13106
  while (true) {
13130
13107
  const item1 = iterator1.next();
13131
13108
  const item2 = iterator2.next();
@@ -13144,7 +13121,7 @@ function iterateListLike(obj, fn) {
13144
13121
  }
13145
13122
  }
13146
13123
  else {
13147
- const iterator = obj[getSymbolIterator()]();
13124
+ const iterator = obj[Symbol.iterator]();
13148
13125
  let item;
13149
13126
  while (!((item = iterator.next()).done)) {
13150
13127
  fn(item.value);
@@ -13907,16 +13884,13 @@ function setDirectiveInputsWhichShadowsStyling(tView, tNode, lView, value, isCla
13907
13884
  setInputsForProperty(tView, lView, inputs[property], property, value);
13908
13885
  }
13909
13886
 
13910
- function elementStartFirstCreatePass(index, tView, lView, native, name, attrsIndex, localRefsIndex) {
13887
+ function elementStartFirstCreatePass(index, tView, lView, name, attrsIndex, localRefsIndex) {
13911
13888
  ngDevMode && assertFirstCreatePass(tView);
13912
13889
  ngDevMode && ngDevMode.firstCreatePass++;
13913
13890
  const tViewConsts = tView.consts;
13914
13891
  const attrs = getConstant(tViewConsts, attrsIndex);
13915
13892
  const tNode = getOrCreateTNode(tView, index, 2 /* TNodeType.Element */, name, attrs);
13916
- const hasDirectives = resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex));
13917
- if (ngDevMode) {
13918
- validateElementIsKnown(native, lView, tNode.value, tView.schemas, hasDirectives);
13919
- }
13893
+ resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex));
13920
13894
  if (tNode.attrs !== null) {
13921
13895
  computeStaticStyling(tNode, tNode.attrs, false);
13922
13896
  }
@@ -13951,10 +13925,14 @@ function ɵɵelementStart(index, name, attrsIndex, localRefsIndex) {
13951
13925
  assertEqual(getBindingIndex(), tView.bindingStartIndex, 'elements should be created before any bindings');
13952
13926
  ngDevMode && assertIndexInRange(lView, adjustedIndex);
13953
13927
  const renderer = lView[RENDERER];
13954
- const native = lView[adjustedIndex] = createElementNode(renderer, name, getNamespace$1());
13955
13928
  const tNode = tView.firstCreatePass ?
13956
- elementStartFirstCreatePass(adjustedIndex, tView, lView, native, name, attrsIndex, localRefsIndex) :
13929
+ elementStartFirstCreatePass(adjustedIndex, tView, lView, name, attrsIndex, localRefsIndex) :
13957
13930
  tView.data[adjustedIndex];
13931
+ const native = lView[adjustedIndex] = createElementNode(renderer, name, getNamespace$1());
13932
+ const hasDirectives = isDirectiveHost(tNode);
13933
+ if (ngDevMode && tView.firstCreatePass) {
13934
+ validateElementIsKnown(native, lView, tNode.value, tView.schemas, hasDirectives);
13935
+ }
13958
13936
  setCurrentTNode(tNode, true);
13959
13937
  setupStaticAttributes(renderer, native, tNode);
13960
13938
  if ((tNode.flags & 32 /* TNodeFlags.isDetached */) !== 32 /* TNodeFlags.isDetached */) {
@@ -13969,7 +13947,7 @@ function ɵɵelementStart(index, name, attrsIndex, localRefsIndex) {
13969
13947
  attachPatchData(native, lView);
13970
13948
  }
13971
13949
  increaseElementDepthCount();
13972
- if (isDirectiveHost(tNode)) {
13950
+ if (hasDirectives) {
13973
13951
  createDirectivesInstances(tView, lView, tNode);
13974
13952
  executeContentQueries(tView, tNode, lView);
13975
13953
  }
@@ -21284,7 +21262,8 @@ function _wrapInTimeout(fn) {
21284
21262
  const EventEmitter = EventEmitter_;
21285
21263
 
21286
21264
  function symbolIterator() {
21287
- return this._results[getSymbolIterator()]();
21265
+ // @ts-expect-error accessing a private member
21266
+ return this._results[Symbol.iterator]();
21288
21267
  }
21289
21268
  /**
21290
21269
  * An unmodifiable list of items that Angular keeps up to date when the state
@@ -21336,11 +21315,10 @@ class QueryList {
21336
21315
  // This function should be declared on the prototype, but doing so there will cause the class
21337
21316
  // declaration to have side-effects and become not tree-shakable. For this reason we do it in
21338
21317
  // the constructor.
21339
- // [getSymbolIterator()](): Iterator<T> { ... }
21340
- const symbol = getSymbolIterator();
21318
+ // [Symbol.iterator](): Iterator<T> { ... }
21341
21319
  const proto = QueryList.prototype;
21342
- if (!proto[symbol])
21343
- proto[symbol] = symbolIterator;
21320
+ if (!proto[Symbol.iterator])
21321
+ proto[Symbol.iterator] = symbolIterator;
21344
21322
  }
21345
21323
  /**
21346
21324
  * Returns the QueryList entry at `index`.