@angular/core 15.2.5 → 15.2.6

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.5
2
+ * @license Angular v15.2.6
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -2256,16 +2256,15 @@ function registerPreOrderHooks(directiveIndex, directiveDef, tView) {
2256
2256
  const { ngOnChanges, ngOnInit, ngDoCheck } = directiveDef.type.prototype;
2257
2257
  if (ngOnChanges) {
2258
2258
  const wrappedOnChanges = NgOnChangesFeatureImpl(directiveDef);
2259
- (tView.preOrderHooks || (tView.preOrderHooks = [])).push(directiveIndex, wrappedOnChanges);
2260
- (tView.preOrderCheckHooks || (tView.preOrderCheckHooks = []))
2261
- .push(directiveIndex, wrappedOnChanges);
2259
+ (tView.preOrderHooks ?? (tView.preOrderHooks = [])).push(directiveIndex, wrappedOnChanges);
2260
+ (tView.preOrderCheckHooks ?? (tView.preOrderCheckHooks = [])).push(directiveIndex, wrappedOnChanges);
2262
2261
  }
2263
2262
  if (ngOnInit) {
2264
- (tView.preOrderHooks || (tView.preOrderHooks = [])).push(0 - directiveIndex, ngOnInit);
2263
+ (tView.preOrderHooks ?? (tView.preOrderHooks = [])).push(0 - directiveIndex, ngOnInit);
2265
2264
  }
2266
2265
  if (ngDoCheck) {
2267
- (tView.preOrderHooks || (tView.preOrderHooks = [])).push(directiveIndex, ngDoCheck);
2268
- (tView.preOrderCheckHooks || (tView.preOrderCheckHooks = [])).push(directiveIndex, ngDoCheck);
2266
+ (tView.preOrderHooks ?? (tView.preOrderHooks = [])).push(directiveIndex, ngDoCheck);
2267
+ (tView.preOrderCheckHooks ?? (tView.preOrderCheckHooks = [])).push(directiveIndex, ngDoCheck);
2269
2268
  }
2270
2269
  }
2271
2270
  /**
@@ -2297,21 +2296,21 @@ function registerPostOrderHooks(tView, tNode) {
2297
2296
  const lifecycleHooks = directiveDef.type.prototype;
2298
2297
  const { ngAfterContentInit, ngAfterContentChecked, ngAfterViewInit, ngAfterViewChecked, ngOnDestroy } = lifecycleHooks;
2299
2298
  if (ngAfterContentInit) {
2300
- (tView.contentHooks || (tView.contentHooks = [])).push(-i, ngAfterContentInit);
2299
+ (tView.contentHooks ?? (tView.contentHooks = [])).push(-i, ngAfterContentInit);
2301
2300
  }
2302
2301
  if (ngAfterContentChecked) {
2303
- (tView.contentHooks || (tView.contentHooks = [])).push(i, ngAfterContentChecked);
2304
- (tView.contentCheckHooks || (tView.contentCheckHooks = [])).push(i, ngAfterContentChecked);
2302
+ (tView.contentHooks ?? (tView.contentHooks = [])).push(i, ngAfterContentChecked);
2303
+ (tView.contentCheckHooks ?? (tView.contentCheckHooks = [])).push(i, ngAfterContentChecked);
2305
2304
  }
2306
2305
  if (ngAfterViewInit) {
2307
- (tView.viewHooks || (tView.viewHooks = [])).push(-i, ngAfterViewInit);
2306
+ (tView.viewHooks ?? (tView.viewHooks = [])).push(-i, ngAfterViewInit);
2308
2307
  }
2309
2308
  if (ngAfterViewChecked) {
2310
- (tView.viewHooks || (tView.viewHooks = [])).push(i, ngAfterViewChecked);
2311
- (tView.viewCheckHooks || (tView.viewCheckHooks = [])).push(i, ngAfterViewChecked);
2309
+ (tView.viewHooks ?? (tView.viewHooks = [])).push(i, ngAfterViewChecked);
2310
+ (tView.viewCheckHooks ?? (tView.viewCheckHooks = [])).push(i, ngAfterViewChecked);
2312
2311
  }
2313
2312
  if (ngOnDestroy != null) {
2314
- (tView.destroyHooks || (tView.destroyHooks = [])).push(i, ngOnDestroy);
2313
+ (tView.destroyHooks ?? (tView.destroyHooks = [])).push(i, ngOnDestroy);
2315
2314
  }
2316
2315
  }
2317
2316
  }
@@ -6966,13 +6965,14 @@ function isDOMParserAvailable() {
6966
6965
  }
6967
6966
 
6968
6967
  /**
6969
- * A pattern that recognizes a commonly useful subset of URLs that are safe.
6968
+ * A pattern that recognizes URLs that are safe wrt. XSS in URL navigation
6969
+ * contexts.
6970
6970
  *
6971
6971
  * This regular expression matches a subset of URLs that will not cause script
6972
6972
  * execution if used in URL context within a HTML document. Specifically, this
6973
- * regular expression matches if (comment from here on and regex copied from
6974
- * Soy's EscapingConventions):
6975
- * (1) Either an allowed protocol (http, https, mailto or ftp).
6973
+ * regular expression matches if:
6974
+ * (1) Either a protocol that is not javascript:, and that has valid characters
6975
+ * (alphanumeric or [+-.]).
6976
6976
  * (2) or no protocol. A protocol must be followed by a colon. The below
6977
6977
  * allows that by allowing colons only after one of the characters [/?#].
6978
6978
  * A colon after a hash (#) must be in the fragment.
@@ -6991,7 +6991,7 @@ function isDOMParserAvailable() {
6991
6991
  *
6992
6992
  * This regular expression was taken from the Closure sanitization library.
6993
6993
  */
6994
- const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|data|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi;
6994
+ const SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;
6995
6995
  function _sanitizeUrl(url) {
6996
6996
  url = String(url);
6997
6997
  if (url.match(SAFE_URL_PATTERN))
@@ -8347,7 +8347,7 @@ class Version {
8347
8347
  /**
8348
8348
  * @publicApi
8349
8349
  */
8350
- const VERSION = new Version('15.2.5');
8350
+ const VERSION = new Version('15.2.6');
8351
8351
 
8352
8352
  // This default value is when checking the hierarchy for a token.
8353
8353
  //
@@ -10935,11 +10935,11 @@ function initializeDirectives(tView, lView, tNode, directives, exportsMap, hostD
10935
10935
  // We will push the actual hook function into this array later during dir instantiation.
10936
10936
  // We cannot do it now because we must ensure hooks are registered in the same
10937
10937
  // order that directives are created (i.e. injection order).
10938
- (tView.preOrderHooks || (tView.preOrderHooks = [])).push(tNode.index);
10938
+ (tView.preOrderHooks ?? (tView.preOrderHooks = [])).push(tNode.index);
10939
10939
  preOrderHooksFound = true;
10940
10940
  }
10941
10941
  if (!preOrderCheckHooksFound && (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngDoCheck)) {
10942
- (tView.preOrderCheckHooks || (tView.preOrderCheckHooks = [])).push(tNode.index);
10942
+ (tView.preOrderCheckHooks ?? (tView.preOrderCheckHooks = [])).push(tNode.index);
10943
10943
  preOrderCheckHooksFound = true;
10944
10944
  }
10945
10945
  directiveIdx++;
@@ -11125,7 +11125,7 @@ function markAsComponentHost(tView, hostTNode, componentOffset) {
11125
11125
  ngDevMode && assertFirstCreatePass(tView);
11126
11126
  ngDevMode && assertGreaterThan(componentOffset, -1, 'componentOffset must be great than -1');
11127
11127
  hostTNode.componentOffset = componentOffset;
11128
- (tView.components || (tView.components = [])).push(hostTNode.index);
11128
+ (tView.components ?? (tView.components = [])).push(hostTNode.index);
11129
11129
  }
11130
11130
  /** Caches local names and their matching directive indices for query and template lookups. */
11131
11131
  function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {
@@ -20715,7 +20715,7 @@ function ɵɵpipe(index, pipeName) {
20715
20715
  pipeDef = getPipeDef(pipeName, tView.pipeRegistry);
20716
20716
  tView.data[adjustedIndex] = pipeDef;
20717
20717
  if (pipeDef.onDestroy) {
20718
- (tView.destroyHooks || (tView.destroyHooks = [])).push(adjustedIndex, pipeDef.onDestroy);
20718
+ (tView.destroyHooks ?? (tView.destroyHooks = [])).push(adjustedIndex, pipeDef.onDestroy);
20719
20719
  }
20720
20720
  }
20721
20721
  else {
@@ -21170,7 +21170,7 @@ function createTemplateRef(hostTNode, hostLView) {
21170
21170
  * (created by instantiating a `TemplateRef` with the `createEmbeddedView()` method).
21171
21171
  *
21172
21172
  * A view container instance can contain other view containers,
21173
- * creating a [view hierarchy](guide/glossary#view-tree).
21173
+ * creating a [view hierarchy](guide/glossary#view-hierarchy).
21174
21174
  *
21175
21175
  * @see `ComponentRef`
21176
21176
  * @see `EmbeddedViewRef`
@@ -25599,7 +25599,7 @@ class ViewRef extends ChangeDetectorRef {
25599
25599
  }
25600
25600
  /**
25601
25601
  * Represents an Angular [view](guide/glossary#view) in a view container.
25602
- * An [embedded view](guide/glossary#view-tree) can be referenced from a component
25602
+ * An [embedded view](guide/glossary#view-hierarchy) can be referenced from a component
25603
25603
  * other than the hosting component whose template defines it, or it can be defined
25604
25604
  * independently by a `TemplateRef`.
25605
25605
  *