@angular/compiler 20.2.0-next.6 → 20.2.0-rc.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 v20.2.0-next.6
2
+ * @license Angular v20.2.0-rc.1
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -421,7 +421,6 @@ var ViewEncapsulation$1;
421
421
  // Historically the 1 value was for `Native` encapsulation which has been removed as of v11.
422
422
  ViewEncapsulation[ViewEncapsulation["None"] = 2] = "None";
423
423
  ViewEncapsulation[ViewEncapsulation["ShadowDom"] = 3] = "ShadowDom";
424
- ViewEncapsulation[ViewEncapsulation["IsolatedShadowDom"] = 4] = "IsolatedShadowDom";
425
424
  })(ViewEncapsulation$1 || (ViewEncapsulation$1 = {}));
426
425
  var ChangeDetectionStrategy;
427
426
  (function (ChangeDetectionStrategy) {
@@ -530,7 +529,6 @@ var ViewEncapsulation;
530
529
  // Historically the 1 value was for `Native` encapsulation which has been removed as of v11.
531
530
  ViewEncapsulation[ViewEncapsulation["None"] = 2] = "None";
532
531
  ViewEncapsulation[ViewEncapsulation["ShadowDom"] = 3] = "ShadowDom";
533
- ViewEncapsulation[ViewEncapsulation["IsolatedShadowDom"] = 4] = "IsolatedShadowDom";
534
532
  })(ViewEncapsulation || (ViewEncapsulation = {}));
535
533
 
536
534
  /**
@@ -12060,6 +12058,7 @@ function generateConditionalExpressions(job) {
12060
12058
  }
12061
12059
  // Switch expressions assign their main test to a temporary, to avoid re-executing it.
12062
12060
  let tmp = op.test == null ? null : new AssignTemporaryExpr(op.test, job.allocateXrefId());
12061
+ let caseExpressionTemporaryXref = null;
12063
12062
  // For each remaining condition, test whether the temporary satifies the check. (If no temp is
12064
12063
  // present, just check each expression directly.)
12065
12064
  for (let i = op.conditions.length - 1; i >= 0; i--) {
@@ -12072,7 +12071,9 @@ function generateConditionalExpressions(job) {
12072
12071
  conditionalCase.expr = new BinaryOperatorExpr(BinaryOperator.Identical, useTmp, conditionalCase.expr);
12073
12072
  }
12074
12073
  else if (conditionalCase.alias !== null) {
12075
- const caseExpressionTemporaryXref = job.allocateXrefId();
12074
+ // Since we can only pass one variable into the conditional instruction,
12075
+ // reuse the same variable to store the result of the expressions.
12076
+ caseExpressionTemporaryXref ??= job.allocateXrefId();
12076
12077
  conditionalCase.expr = new AssignTemporaryExpr(conditionalCase.expr, caseExpressionTemporaryXref);
12077
12078
  op.contextValue = new ReadTemporaryExpr(caseExpressionTemporaryXref);
12078
12079
  }
@@ -28767,8 +28768,8 @@ function parseConditionalBlockParameters(block, errors, bindingParser) {
28767
28768
  if (aliasMatch === null) {
28768
28769
  errors.push(new ParseError(param.sourceSpan, `Unrecognized conditional parameter "${param.expression}"`));
28769
28770
  }
28770
- else if (block.name !== 'if') {
28771
- errors.push(new ParseError(param.sourceSpan, '"as" expression is only allowed on the primary @if block'));
28771
+ else if (block.name !== 'if' && !ELSE_IF_PATTERN.test(block.name)) {
28772
+ errors.push(new ParseError(param.sourceSpan, '"as" expression is only allowed on `@if` and `@else if` blocks'));
28772
28773
  }
28773
28774
  else if (expressionAlias !== null) {
28774
28775
  errors.push(new ParseError(param.sourceSpan, 'Conditional can only have one "as" expression'));
@@ -29753,8 +29754,8 @@ class HtmlAstToIvyAst {
29753
29754
  const value = attribute.value;
29754
29755
  const srcSpan = attribute.sourceSpan;
29755
29756
  const absoluteOffset = attribute.valueSpan
29756
- ? attribute.valueSpan.start.offset
29757
- : srcSpan.start.offset;
29757
+ ? attribute.valueSpan.fullStart.offset
29758
+ : srcSpan.fullStart.offset;
29758
29759
  function createKeySpan(srcSpan, prefix, identifier) {
29759
29760
  // We need to adjust the start location for the keySpan to account for the removed 'data-'
29760
29761
  // prefix from `normalizeAttributeName`.
@@ -34273,7 +34274,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
34273
34274
  function compileDeclareClassMetadata(metadata) {
34274
34275
  const definitionMap = new DefinitionMap();
34275
34276
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
34276
- definitionMap.set('version', literal('20.2.0-next.6'));
34277
+ definitionMap.set('version', literal('20.2.0-rc.1'));
34277
34278
  definitionMap.set('ngImport', importExpr(Identifiers.core));
34278
34279
  definitionMap.set('type', metadata.type);
34279
34280
  definitionMap.set('decorators', metadata.decorators);
@@ -34291,7 +34292,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
34291
34292
  callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? literal(null));
34292
34293
  callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? literal(null));
34293
34294
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
34294
- definitionMap.set('version', literal('20.2.0-next.6'));
34295
+ definitionMap.set('version', literal('20.2.0-rc.1'));
34295
34296
  definitionMap.set('ngImport', importExpr(Identifiers.core));
34296
34297
  definitionMap.set('type', metadata.type);
34297
34298
  definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
@@ -34386,7 +34387,7 @@ function createDirectiveDefinitionMap(meta) {
34386
34387
  const definitionMap = new DefinitionMap();
34387
34388
  const minVersion = getMinimumVersionForPartialOutput(meta);
34388
34389
  definitionMap.set('minVersion', literal(minVersion));
34389
- definitionMap.set('version', literal('20.2.0-next.6'));
34390
+ definitionMap.set('version', literal('20.2.0-rc.1'));
34390
34391
  // e.g. `type: MyDirective`
34391
34392
  definitionMap.set('type', meta.type.value);
34392
34393
  if (meta.isStandalone !== undefined) {
@@ -34802,7 +34803,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
34802
34803
  function compileDeclareFactoryFunction(meta) {
34803
34804
  const definitionMap = new DefinitionMap();
34804
34805
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
34805
- definitionMap.set('version', literal('20.2.0-next.6'));
34806
+ definitionMap.set('version', literal('20.2.0-rc.1'));
34806
34807
  definitionMap.set('ngImport', importExpr(Identifiers.core));
34807
34808
  definitionMap.set('type', meta.type.value);
34808
34809
  definitionMap.set('deps', compileDependencies(meta.deps));
@@ -34837,7 +34838,7 @@ function compileDeclareInjectableFromMetadata(meta) {
34837
34838
  function createInjectableDefinitionMap(meta) {
34838
34839
  const definitionMap = new DefinitionMap();
34839
34840
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
34840
- definitionMap.set('version', literal('20.2.0-next.6'));
34841
+ definitionMap.set('version', literal('20.2.0-rc.1'));
34841
34842
  definitionMap.set('ngImport', importExpr(Identifiers.core));
34842
34843
  definitionMap.set('type', meta.type.value);
34843
34844
  // Only generate providedIn property if it has a non-null value
@@ -34888,7 +34889,7 @@ function compileDeclareInjectorFromMetadata(meta) {
34888
34889
  function createInjectorDefinitionMap(meta) {
34889
34890
  const definitionMap = new DefinitionMap();
34890
34891
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
34891
- definitionMap.set('version', literal('20.2.0-next.6'));
34892
+ definitionMap.set('version', literal('20.2.0-rc.1'));
34892
34893
  definitionMap.set('ngImport', importExpr(Identifiers.core));
34893
34894
  definitionMap.set('type', meta.type.value);
34894
34895
  definitionMap.set('providers', meta.providers);
@@ -34921,7 +34922,7 @@ function createNgModuleDefinitionMap(meta) {
34921
34922
  throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
34922
34923
  }
34923
34924
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
34924
- definitionMap.set('version', literal('20.2.0-next.6'));
34925
+ definitionMap.set('version', literal('20.2.0-rc.1'));
34925
34926
  definitionMap.set('ngImport', importExpr(Identifiers.core));
34926
34927
  definitionMap.set('type', meta.type.value);
34927
34928
  // We only generate the keys in the metadata if the arrays contain values.
@@ -34972,7 +34973,7 @@ function compileDeclarePipeFromMetadata(meta) {
34972
34973
  function createPipeDefinitionMap(meta) {
34973
34974
  const definitionMap = new DefinitionMap();
34974
34975
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
34975
- definitionMap.set('version', literal('20.2.0-next.6'));
34976
+ definitionMap.set('version', literal('20.2.0-rc.1'));
34976
34977
  definitionMap.set('ngImport', importExpr(Identifiers.core));
34977
34978
  // e.g. `type: MyPipe`
34978
34979
  definitionMap.set('type', meta.type.value);
@@ -35128,7 +35129,7 @@ function compileHmrUpdateCallback(definitions, constantStatements, meta) {
35128
35129
  * @description
35129
35130
  * Entry point for all public APIs of the compiler package.
35130
35131
  */
35131
- const VERSION = new Version('20.2.0-next.6');
35132
+ const VERSION = new Version('20.2.0-rc.1');
35132
35133
 
35133
35134
  //////////////////////////////////////
35134
35135
  // THIS FILE HAS GLOBAL SIDE EFFECT //