@angular/core 15.0.0-rc.4 → 15.0.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.0.0-rc.4
2
+ * @license Angular v15.0.1
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -907,11 +907,15 @@ const NG_INJECTOR_DEF = getClosureSafeProperty({ ngInjectorDef: getClosureSafePr
907
907
  /**
908
908
  * Base URL for the error details page.
909
909
  *
910
- * Keep the files below in full sync:
910
+ * Keep this constant in sync across:
911
911
  * - packages/compiler-cli/src/ngtsc/diagnostics/src/error_details_base_url.ts
912
912
  * - packages/core/src/error_details_base_url.ts
913
913
  */
914
914
  const ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.io/errors';
915
+ /**
916
+ * URL for the XSS security documentation.
917
+ */
918
+ const XSS_SECURITY_URL = 'https://g.co/ng/security#xss';
915
919
 
916
920
  /**
917
921
  * @license
@@ -6812,26 +6816,17 @@ function processCleanups(tView, lView) {
6812
6816
  if (tCleanup !== null) {
6813
6817
  for (let i = 0; i < tCleanup.length - 1; i += 2) {
6814
6818
  if (typeof tCleanup[i] === 'string') {
6815
- // This is a native DOM listener
6816
- const idxOrTargetGetter = tCleanup[i + 1];
6817
- const target = typeof idxOrTargetGetter === 'function' ?
6818
- idxOrTargetGetter(lView) :
6819
- unwrapRNode(lView[idxOrTargetGetter]);
6820
- const listener = lCleanup[lastLCleanupIndex = tCleanup[i + 2]];
6821
- const useCaptureOrSubIdx = tCleanup[i + 3];
6822
- if (typeof useCaptureOrSubIdx === 'boolean') {
6823
- // native DOM listener registered with Renderer3
6824
- target.removeEventListener(tCleanup[i], listener, useCaptureOrSubIdx);
6819
+ // This is a native DOM listener. It will occupy 4 entries in the TCleanup array (hence i +=
6820
+ // 2 at the end of this block).
6821
+ const targetIdx = tCleanup[i + 3];
6822
+ ngDevMode && assertNumber(targetIdx, 'cleanup target must be a number');
6823
+ if (targetIdx >= 0) {
6824
+ // unregister
6825
+ lCleanup[lastLCleanupIndex = targetIdx]();
6825
6826
  }
6826
6827
  else {
6827
- if (useCaptureOrSubIdx >= 0) {
6828
- // unregister
6829
- lCleanup[lastLCleanupIndex = useCaptureOrSubIdx]();
6830
- }
6831
- else {
6832
- // Subscription
6833
- lCleanup[lastLCleanupIndex = -useCaptureOrSubIdx].unsubscribe();
6834
- }
6828
+ // Subscription
6829
+ lCleanup[lastLCleanupIndex = -targetIdx].unsubscribe();
6835
6830
  }
6836
6831
  i += 2;
6837
6832
  }
@@ -7693,7 +7688,7 @@ class SafeValueImpl {
7693
7688
  }
7694
7689
  toString() {
7695
7690
  return `SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity}` +
7696
- ` (see https://g.co/ng/security#xss)`;
7691
+ ` (see ${XSS_SECURITY_URL})`;
7697
7692
  }
7698
7693
  }
7699
7694
  class SafeHtmlImpl extends SafeValueImpl {
@@ -7731,7 +7726,7 @@ function allowSanitizationBypassAndThrow(value, type) {
7731
7726
  // Allow ResourceURLs in URL contexts, they are strictly more trusted.
7732
7727
  if (actualType === "ResourceURL" /* BypassType.ResourceUrl */ && type === "URL" /* BypassType.Url */)
7733
7728
  return true;
7734
- throw new Error(`Required a safe ${type}, got a ${actualType} (see https://g.co/ng/security#xss)`);
7729
+ throw new Error(`Required a safe ${type}, got a ${actualType} (see ${XSS_SECURITY_URL})`);
7735
7730
  }
7736
7731
  return actualType === type;
7737
7732
  }
@@ -7971,7 +7966,7 @@ function _sanitizeUrl(url) {
7971
7966
  if (url.match(SAFE_URL_PATTERN))
7972
7967
  return url;
7973
7968
  if (typeof ngDevMode === 'undefined' || ngDevMode) {
7974
- console.warn(`WARNING: sanitizing unsafe URL value ${url} (see https://g.co/ng/security#xss)`);
7969
+ console.warn(`WARNING: sanitizing unsafe URL value ${url} (see ${XSS_SECURITY_URL})`);
7975
7970
  }
7976
7971
  return 'unsafe:' + url;
7977
7972
  }
@@ -8199,7 +8194,7 @@ function _sanitizeHtml(defaultDoc, unsafeHtmlInput) {
8199
8194
  const sanitizer = new SanitizingHtmlSerializer();
8200
8195
  const safeHtml = sanitizer.sanitizeChildren(getTemplateContent(inertBodyElement) || inertBodyElement);
8201
8196
  if ((typeof ngDevMode === 'undefined' || ngDevMode) && sanitizer.sanitizedSomething) {
8202
- console.warn('WARNING: sanitizing HTML stripped some content, see https://g.co/ng/security#xss');
8197
+ console.warn(`WARNING: sanitizing HTML stripped some content, see ${XSS_SECURITY_URL}`);
8203
8198
  }
8204
8199
  return trustedHTMLFromString(safeHtml);
8205
8200
  }
@@ -8346,8 +8341,7 @@ function ɵɵsanitizeResourceUrl(unsafeResourceUrl) {
8346
8341
  if (allowSanitizationBypassAndThrow(unsafeResourceUrl, "ResourceURL" /* BypassType.ResourceUrl */)) {
8347
8342
  return trustedScriptURLFromStringBypass(unwrapSafeValue(unsafeResourceUrl));
8348
8343
  }
8349
- throw new RuntimeError(904 /* RuntimeErrorCode.UNSAFE_VALUE_IN_RESOURCE_URL */, ngDevMode &&
8350
- 'unsafe value used in a resource URL context (see https://g.co/ng/security#xss)');
8344
+ throw new RuntimeError(904 /* RuntimeErrorCode.UNSAFE_VALUE_IN_RESOURCE_URL */, ngDevMode && `unsafe value used in a resource URL context (see ${XSS_SECURITY_URL})`);
8351
8345
  }
8352
8346
  /**
8353
8347
  * A `script` sanitizer which only lets trusted javascript through.
@@ -9532,7 +9526,7 @@ class Version {
9532
9526
  /**
9533
9527
  * @publicApi
9534
9528
  */
9535
- const VERSION = new Version('15.0.0-rc.4');
9529
+ const VERSION = new Version('15.0.1');
9536
9530
 
9537
9531
  /**
9538
9532
  * @license
@@ -16139,7 +16133,8 @@ const isObservable = isSubscribable;
16139
16133
  *
16140
16134
  * @param eventName Name of the event
16141
16135
  * @param listenerFn The function to be called when event emits
16142
- * @param useCapture Whether or not to use capture in event listener
16136
+ * @param useCapture Whether or not to use capture in event listener - this argument is a reminder
16137
+ * from the Renderer3 infrastructure and should be removed from the instruction arguments
16143
16138
  * @param eventTargetResolver Function that returns global target information in case this listener
16144
16139
  * should be attached to a global object like window, document or body
16145
16140
  *
@@ -16149,7 +16144,7 @@ function ɵɵlistener(eventName, listenerFn, useCapture, eventTargetResolver) {
16149
16144
  const lView = getLView();
16150
16145
  const tView = getTView();
16151
16146
  const tNode = getCurrentTNode();
16152
- listenerInternal(tView, lView, lView[RENDERER], tNode, eventName, listenerFn, !!useCapture, eventTargetResolver);
16147
+ listenerInternal(tView, lView, lView[RENDERER], tNode, eventName, listenerFn, eventTargetResolver);
16153
16148
  return ɵɵlistener;
16154
16149
  }
16155
16150
  /**
@@ -16179,7 +16174,7 @@ function ɵɵsyntheticHostListener(eventName, listenerFn) {
16179
16174
  const tView = getTView();
16180
16175
  const currentDef = getCurrentDirectiveDef(tView.data);
16181
16176
  const renderer = loadComponentRenderer(currentDef, tNode, lView);
16182
- listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn, false);
16177
+ listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn);
16183
16178
  return ɵɵsyntheticHostListener;
16184
16179
  }
16185
16180
  /**
@@ -16212,7 +16207,7 @@ function findExistingListener(tView, lView, eventName, tNodeIdx) {
16212
16207
  }
16213
16208
  return null;
16214
16209
  }
16215
- function listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn, useCapture, eventTargetResolver) {
16210
+ function listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn, eventTargetResolver) {
16216
16211
  const isTNodeDirectiveHost = isDirectiveHost(tNode);
16217
16212
  const firstCreatePass = tView.firstCreatePass;
16218
16213
  const tCleanup = firstCreatePass && getOrCreateTViewCleanup(tView);
@@ -21539,7 +21534,7 @@ function walkIcuTree(tView, tIcu, lView, sharedUpdateOpCodes, create, remove, up
21539
21534
  ngDevMode &&
21540
21535
  console.warn(`WARNING: ignoring unsafe attribute value ` +
21541
21536
  `${lowerAttrName} on element ${tagName} ` +
21542
- `(see https://g.co/ng/security#xss)`);
21537
+ `(see ${XSS_SECURITY_URL})`);
21543
21538
  }
21544
21539
  }
21545
21540
  else {