@angular/core 13.3.0-rc.0 → 13.3.2

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 v13.3.0-rc.0
2
+ * @license Angular v13.3.2
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
package/fesm2020/core.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v13.3.0-rc.0
2
+ * @license Angular v13.3.2
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -10067,7 +10067,7 @@ function elementPropertyInternal(tView, tNode, lView, propName, value, renderer,
10067
10067
  else if (tNode.type & 12 /* AnyContainer */) {
10068
10068
  // If the node is a container and the property didn't
10069
10069
  // match any of the inputs or schemas we should throw.
10070
- if (ngDevMode && !matchingSchemas(tView, tNode.value)) {
10070
+ if (ngDevMode && !matchingSchemas(tView.schemas, tNode.value)) {
10071
10071
  logUnknownPropertyError(propName, tNode);
10072
10072
  }
10073
10073
  }
@@ -10129,15 +10129,20 @@ function validateProperty(tView, element, propName, tNode) {
10129
10129
  return true;
10130
10130
  // The property is considered valid if the element matches the schema, it exists on the element
10131
10131
  // or it is synthetic, and we are in a browser context (web worker nodes should be skipped).
10132
- if (matchingSchemas(tView, tNode.value) || propName in element || isAnimationProp(propName)) {
10132
+ if (matchingSchemas(tView.schemas, tNode.value) || propName in element ||
10133
+ isAnimationProp(propName)) {
10133
10134
  return true;
10134
10135
  }
10135
10136
  // Note: `typeof Node` returns 'function' in most browsers, but on IE it is 'object' so we
10136
10137
  // need to account for both here, while being careful for `typeof null` also returning 'object'.
10137
10138
  return typeof Node === 'undefined' || Node === null || !(element instanceof Node);
10138
10139
  }
10139
- function matchingSchemas(tView, tagName) {
10140
- const schemas = tView.schemas;
10140
+ /**
10141
+ * Returns true if the tag name is allowed by specified schemas.
10142
+ * @param schemas Array of schemas
10143
+ * @param tagName Name of the tag
10144
+ */
10145
+ function matchingSchemas(schemas, tagName) {
10141
10146
  if (schemas !== null) {
10142
10147
  for (let i = 0; i < schemas.length; i++) {
10143
10148
  const schema = schemas[i];
@@ -14487,7 +14492,7 @@ function elementStartFirstCreatePass(index, tView, lView, native, name, attrsInd
14487
14492
  const attrs = getConstant(tViewConsts, attrsIndex);
14488
14493
  const tNode = getOrCreateTNode(tView, index, 2 /* Element */, name, attrs);
14489
14494
  const hasDirectives = resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex));
14490
- ngDevMode && logUnknownElementError(tView, native, tNode, hasDirectives);
14495
+ ngDevMode && validateElementIsKnown(native, tNode.value, tView.schemas, hasDirectives);
14491
14496
  if (tNode.attrs !== null) {
14492
14497
  computeStaticStyling(tNode, tNode.attrs, false);
14493
14498
  }
@@ -14611,18 +14616,33 @@ function ɵɵelement(index, name, attrsIndex, localRefsIndex) {
14611
14616
  ɵɵelementEnd();
14612
14617
  return ɵɵelement;
14613
14618
  }
14614
- function logUnknownElementError(tView, element, tNode, hasDirectives) {
14615
- const schemas = tView.schemas;
14619
+ /**
14620
+ * Validates that the element is known at runtime and produces
14621
+ * an error if it's not the case.
14622
+ * This check is relevant for JIT-compiled components (for AOT-compiled
14623
+ * ones this check happens at build time).
14624
+ *
14625
+ * The element is considered known if either:
14626
+ * - it's a known HTML element
14627
+ * - it's a known custom element
14628
+ * - the element matches any directive
14629
+ * - the element is allowed by one of the schemas
14630
+ *
14631
+ * @param element Element to validate
14632
+ * @param tagName Name of the tag to check
14633
+ * @param schemas Array of schemas
14634
+ * @param hasDirectives Boolean indicating that the element matches any directive
14635
+ */
14636
+ function validateElementIsKnown(element, tagName, schemas, hasDirectives) {
14616
14637
  // If `schemas` is set to `null`, that's an indication that this Component was compiled in AOT
14617
14638
  // mode where this check happens at compile time. In JIT mode, `schemas` is always present and
14618
14639
  // defined as an array (as an empty array in case `schemas` field is not defined) and we should
14619
14640
  // execute the check below.
14620
14641
  if (schemas === null)
14621
14642
  return;
14622
- const tagName = tNode.value;
14623
14643
  // If the element matches any directive, it's considered as valid.
14624
14644
  if (!hasDirectives && tagName !== null) {
14625
- // The element is unknown if it's an instance of HTMLUnknownElement or it isn't registered
14645
+ // The element is unknown if it's an instance of HTMLUnknownElement, or it isn't registered
14626
14646
  // as a custom element. Note that unknown elements with a dash in their name won't be instances
14627
14647
  // of HTMLUnknownElement in browsers that support web components.
14628
14648
  const isUnknown =
@@ -14632,7 +14652,7 @@ function logUnknownElementError(tView, element, tNode, hasDirectives) {
14632
14652
  element instanceof HTMLUnknownElement) ||
14633
14653
  (typeof customElements !== 'undefined' && tagName.indexOf('-') > -1 &&
14634
14654
  !customElements.get(tagName));
14635
- if (isUnknown && !matchingSchemas(tView, tagName)) {
14655
+ if (isUnknown && !matchingSchemas(schemas, tagName)) {
14636
14656
  let message = `'${tagName}' is not a known element:\n`;
14637
14657
  message += `1. If '${tagName}' is an Angular component, then verify that it is part of this module.\n`;
14638
14658
  if (tagName && tagName.indexOf('-') > -1) {
@@ -21102,7 +21122,7 @@ class Version {
21102
21122
  /**
21103
21123
  * @publicApi
21104
21124
  */
21105
- const VERSION = new Version('13.3.0-rc.0');
21125
+ const VERSION = new Version('13.3.2');
21106
21126
 
21107
21127
  /**
21108
21128
  * @license
@@ -24940,16 +24960,16 @@ Console.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: Console, factory: C
24940
24960
  /**
24941
24961
  * Work out the locale from the potential global properties.
24942
24962
  *
24943
- * * Closure Compiler: use `goog.getLocale()`.
24963
+ * * Closure Compiler: use `goog.LOCALE`.
24944
24964
  * * Ivy enabled: use `$localize.locale`
24945
24965
  */
24946
24966
  function getGlobalLocale() {
24947
24967
  if (typeof ngI18nClosureMode !== 'undefined' && ngI18nClosureMode &&
24948
- typeof goog !== 'undefined' && goog.getLocale() !== 'en') {
24949
- // * The default `goog.getLocale()` value is `en`, while Angular used `en-US`.
24968
+ typeof goog !== 'undefined' && goog.LOCALE !== 'en') {
24969
+ // * The default `goog.LOCALE` value is `en`, while Angular used `en-US`.
24950
24970
  // * In order to preserve backwards compatibility, we use Angular default value over
24951
24971
  // Closure Compiler's one.
24952
- return goog.getLocale();
24972
+ return goog.LOCALE;
24953
24973
  }
24954
24974
  else {
24955
24975
  // KEEP `typeof $localize !== 'undefined' && $localize.locale` IN SYNC WITH THE LOCALIZE