@angular/core 15.2.4 → 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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v15.2.4
2
+ * @license Angular v15.2.6
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -260,7 +260,7 @@ function resetFakeAsyncZone() {
260
260
  *
261
261
  * Can be used to wrap `inject()` calls.
262
262
  *
263
- * @param fn The function that you want to wrap in the `fakeAysnc` zone.
263
+ * @param fn The function that you want to wrap in the `fakeAsync` zone.
264
264
  *
265
265
  * @usageNotes
266
266
  * ### Example
@@ -3515,16 +3515,15 @@ function registerPreOrderHooks(directiveIndex, directiveDef, tView) {
3515
3515
  const { ngOnChanges, ngOnInit, ngDoCheck } = directiveDef.type.prototype;
3516
3516
  if (ngOnChanges) {
3517
3517
  const wrappedOnChanges = NgOnChangesFeatureImpl(directiveDef);
3518
- (tView.preOrderHooks || (tView.preOrderHooks = [])).push(directiveIndex, wrappedOnChanges);
3519
- (tView.preOrderCheckHooks || (tView.preOrderCheckHooks = []))
3520
- .push(directiveIndex, wrappedOnChanges);
3518
+ (tView.preOrderHooks ?? (tView.preOrderHooks = [])).push(directiveIndex, wrappedOnChanges);
3519
+ (tView.preOrderCheckHooks ?? (tView.preOrderCheckHooks = [])).push(directiveIndex, wrappedOnChanges);
3521
3520
  }
3522
3521
  if (ngOnInit) {
3523
- (tView.preOrderHooks || (tView.preOrderHooks = [])).push(0 - directiveIndex, ngOnInit);
3522
+ (tView.preOrderHooks ?? (tView.preOrderHooks = [])).push(0 - directiveIndex, ngOnInit);
3524
3523
  }
3525
3524
  if (ngDoCheck) {
3526
- (tView.preOrderHooks || (tView.preOrderHooks = [])).push(directiveIndex, ngDoCheck);
3527
- (tView.preOrderCheckHooks || (tView.preOrderCheckHooks = [])).push(directiveIndex, ngDoCheck);
3525
+ (tView.preOrderHooks ?? (tView.preOrderHooks = [])).push(directiveIndex, ngDoCheck);
3526
+ (tView.preOrderCheckHooks ?? (tView.preOrderCheckHooks = [])).push(directiveIndex, ngDoCheck);
3528
3527
  }
3529
3528
  }
3530
3529
  /**
@@ -3556,21 +3555,21 @@ function registerPostOrderHooks(tView, tNode) {
3556
3555
  const lifecycleHooks = directiveDef.type.prototype;
3557
3556
  const { ngAfterContentInit, ngAfterContentChecked, ngAfterViewInit, ngAfterViewChecked, ngOnDestroy } = lifecycleHooks;
3558
3557
  if (ngAfterContentInit) {
3559
- (tView.contentHooks || (tView.contentHooks = [])).push(-i, ngAfterContentInit);
3558
+ (tView.contentHooks ?? (tView.contentHooks = [])).push(-i, ngAfterContentInit);
3560
3559
  }
3561
3560
  if (ngAfterContentChecked) {
3562
- (tView.contentHooks || (tView.contentHooks = [])).push(i, ngAfterContentChecked);
3563
- (tView.contentCheckHooks || (tView.contentCheckHooks = [])).push(i, ngAfterContentChecked);
3561
+ (tView.contentHooks ?? (tView.contentHooks = [])).push(i, ngAfterContentChecked);
3562
+ (tView.contentCheckHooks ?? (tView.contentCheckHooks = [])).push(i, ngAfterContentChecked);
3564
3563
  }
3565
3564
  if (ngAfterViewInit) {
3566
- (tView.viewHooks || (tView.viewHooks = [])).push(-i, ngAfterViewInit);
3565
+ (tView.viewHooks ?? (tView.viewHooks = [])).push(-i, ngAfterViewInit);
3567
3566
  }
3568
3567
  if (ngAfterViewChecked) {
3569
- (tView.viewHooks || (tView.viewHooks = [])).push(i, ngAfterViewChecked);
3570
- (tView.viewCheckHooks || (tView.viewCheckHooks = [])).push(i, ngAfterViewChecked);
3568
+ (tView.viewHooks ?? (tView.viewHooks = [])).push(i, ngAfterViewChecked);
3569
+ (tView.viewCheckHooks ?? (tView.viewCheckHooks = [])).push(i, ngAfterViewChecked);
3571
3570
  }
3572
3571
  if (ngOnDestroy != null) {
3573
- (tView.destroyHooks || (tView.destroyHooks = [])).push(i, ngOnDestroy);
3572
+ (tView.destroyHooks ?? (tView.destroyHooks = [])).push(i, ngOnDestroy);
3574
3573
  }
3575
3574
  }
3576
3575
  }
@@ -7242,13 +7241,14 @@ function isDOMParserAvailable() {
7242
7241
  }
7243
7242
 
7244
7243
  /**
7245
- * A pattern that recognizes a commonly useful subset of URLs that are safe.
7244
+ * A pattern that recognizes URLs that are safe wrt. XSS in URL navigation
7245
+ * contexts.
7246
7246
  *
7247
7247
  * This regular expression matches a subset of URLs that will not cause script
7248
7248
  * execution if used in URL context within a HTML document. Specifically, this
7249
- * regular expression matches if (comment from here on and regex copied from
7250
- * Soy's EscapingConventions):
7251
- * (1) Either an allowed protocol (http, https, mailto or ftp).
7249
+ * regular expression matches if:
7250
+ * (1) Either a protocol that is not javascript:, and that has valid characters
7251
+ * (alphanumeric or [+-.]).
7252
7252
  * (2) or no protocol. A protocol must be followed by a colon. The below
7253
7253
  * allows that by allowing colons only after one of the characters [/?#].
7254
7254
  * A colon after a hash (#) must be in the fragment.
@@ -7267,7 +7267,7 @@ function isDOMParserAvailable() {
7267
7267
  *
7268
7268
  * This regular expression was taken from the Closure sanitization library.
7269
7269
  */
7270
- const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|data|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi;
7270
+ const SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;
7271
7271
  function _sanitizeUrl(url) {
7272
7272
  url = String(url);
7273
7273
  if (url.match(SAFE_URL_PATTERN))
@@ -8705,7 +8705,7 @@ class Version {
8705
8705
  /**
8706
8706
  * @publicApi
8707
8707
  */
8708
- const VERSION = new Version('15.2.4');
8708
+ const VERSION = new Version('15.2.6');
8709
8709
 
8710
8710
  // This default value is when checking the hierarchy for a token.
8711
8711
  //
@@ -11245,11 +11245,11 @@ function initializeDirectives(tView, lView, tNode, directives, exportsMap, hostD
11245
11245
  // We will push the actual hook function into this array later during dir instantiation.
11246
11246
  // We cannot do it now because we must ensure hooks are registered in the same
11247
11247
  // order that directives are created (i.e. injection order).
11248
- (tView.preOrderHooks || (tView.preOrderHooks = [])).push(tNode.index);
11248
+ (tView.preOrderHooks ?? (tView.preOrderHooks = [])).push(tNode.index);
11249
11249
  preOrderHooksFound = true;
11250
11250
  }
11251
11251
  if (!preOrderCheckHooksFound && (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngDoCheck)) {
11252
- (tView.preOrderCheckHooks || (tView.preOrderCheckHooks = [])).push(tNode.index);
11252
+ (tView.preOrderCheckHooks ?? (tView.preOrderCheckHooks = [])).push(tNode.index);
11253
11253
  preOrderCheckHooksFound = true;
11254
11254
  }
11255
11255
  directiveIdx++;
@@ -11435,7 +11435,7 @@ function markAsComponentHost(tView, hostTNode, componentOffset) {
11435
11435
  ngDevMode && assertFirstCreatePass(tView);
11436
11436
  ngDevMode && assertGreaterThan(componentOffset, -1, 'componentOffset must be great than -1');
11437
11437
  hostTNode.componentOffset = componentOffset;
11438
- (tView.components || (tView.components = [])).push(hostTNode.index);
11438
+ (tView.components ?? (tView.components = [])).push(hostTNode.index);
11439
11439
  }
11440
11440
  /** Caches local names and their matching directive indices for query and template lookups. */
11441
11441
  function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {
@@ -16384,8 +16384,11 @@ function isStylingValuePresent(value) {
16384
16384
  * @param suffix
16385
16385
  */
16386
16386
  function normalizeSuffix(value, suffix) {
16387
- if (value == null /** || value === undefined */) {
16387
+ if (value == null || value === '') {
16388
16388
  // do nothing
16389
+ // Do not add the suffix if the value is going to be empty.
16390
+ // As it produce invalid CSS, which the browsers will automatically omit but Domino will not.
16391
+ // Example: `"left": "px;"` instead of `"left": ""`.
16389
16392
  }
16390
16393
  else if (typeof suffix === 'string') {
16391
16394
  value = value + suffix;
@@ -21022,7 +21025,7 @@ function ɵɵpipe(index, pipeName) {
21022
21025
  pipeDef = getPipeDef(pipeName, tView.pipeRegistry);
21023
21026
  tView.data[adjustedIndex] = pipeDef;
21024
21027
  if (pipeDef.onDestroy) {
21025
- (tView.destroyHooks || (tView.destroyHooks = [])).push(adjustedIndex, pipeDef.onDestroy);
21028
+ (tView.destroyHooks ?? (tView.destroyHooks = [])).push(adjustedIndex, pipeDef.onDestroy);
21026
21029
  }
21027
21030
  }
21028
21031
  else {
@@ -21477,7 +21480,7 @@ function createTemplateRef(hostTNode, hostLView) {
21477
21480
  * (created by instantiating a `TemplateRef` with the `createEmbeddedView()` method).
21478
21481
  *
21479
21482
  * A view container instance can contain other view containers,
21480
- * creating a [view hierarchy](guide/glossary#view-tree).
21483
+ * creating a [view hierarchy](guide/glossary#view-hierarchy).
21481
21484
  *
21482
21485
  * @see `ComponentRef`
21483
21486
  * @see `EmbeddedViewRef`