@angular/compiler 19.0.0-next.2 → 19.0.0-next.4

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 v19.0.0-next.2
2
+ * @license Angular v19.0.0-next.4
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -26300,7 +26300,7 @@ function createForLoop(ast, connectedBlocks, visitor, bindingParser) {
26300
26300
  if (params.trackBy === null) {
26301
26301
  // TODO: We should not fail here, and instead try to produce some AST for the language
26302
26302
  // service.
26303
- errors.push(new ParseError(ast.sourceSpan, '@for loop must have a "track" expression'));
26303
+ errors.push(new ParseError(ast.startSourceSpan, '@for loop must have a "track" expression'));
26304
26304
  }
26305
26305
  else {
26306
26306
  // The `for` block has a main span that includes the `empty` branch. For only the span of the
@@ -26351,7 +26351,7 @@ function createSwitchBlock(ast, visitor, bindingParser) {
26351
26351
  /** Parses the parameters of a `for` loop block. */
26352
26352
  function parseForLoopParameters(block, errors, bindingParser) {
26353
26353
  if (block.parameters.length === 0) {
26354
- errors.push(new ParseError(block.sourceSpan, '@for loop does not have an expression'));
26354
+ errors.push(new ParseError(block.startSourceSpan, '@for loop does not have an expression'));
26355
26355
  return null;
26356
26356
  }
26357
26357
  const [expressionParam, ...secondaryParams] = block.parameters;
@@ -26395,7 +26395,7 @@ function parseForLoopParameters(block, errors, bindingParser) {
26395
26395
  else {
26396
26396
  const expression = parseBlockParameterToBinding(param, bindingParser, trackMatch[1]);
26397
26397
  if (expression.ast instanceof EmptyExpr$1) {
26398
- errors.push(new ParseError(param.sourceSpan, '@for loop must have a "track" expression'));
26398
+ errors.push(new ParseError(block.startSourceSpan, '@for loop must have a "track" expression'));
26399
26399
  }
26400
26400
  const keywordSpan = new ParseSourceSpan(param.sourceSpan.start, param.sourceSpan.start.moveBy('track'.length));
26401
26401
  result.trackBy = { expression, keywordSpan };
@@ -26460,18 +26460,18 @@ function validateIfConnectedBlocks(connectedBlocks) {
26460
26460
  const block = connectedBlocks[i];
26461
26461
  if (block.name === 'else') {
26462
26462
  if (hasElse) {
26463
- errors.push(new ParseError(block.sourceSpan, 'Conditional can only have one @else block'));
26463
+ errors.push(new ParseError(block.startSourceSpan, 'Conditional can only have one @else block'));
26464
26464
  }
26465
26465
  else if (connectedBlocks.length > 1 && i < connectedBlocks.length - 1) {
26466
- errors.push(new ParseError(block.sourceSpan, '@else block must be last inside the conditional'));
26466
+ errors.push(new ParseError(block.startSourceSpan, '@else block must be last inside the conditional'));
26467
26467
  }
26468
26468
  else if (block.parameters.length > 0) {
26469
- errors.push(new ParseError(block.sourceSpan, '@else block cannot have parameters'));
26469
+ errors.push(new ParseError(block.startSourceSpan, '@else block cannot have parameters'));
26470
26470
  }
26471
26471
  hasElse = true;
26472
26472
  }
26473
26473
  else if (!ELSE_IF_PATTERN.test(block.name)) {
26474
- errors.push(new ParseError(block.sourceSpan, `Unrecognized conditional block @${block.name}`));
26474
+ errors.push(new ParseError(block.startSourceSpan, `Unrecognized conditional block @${block.name}`));
26475
26475
  }
26476
26476
  }
26477
26477
  return errors;
@@ -26481,7 +26481,7 @@ function validateSwitchBlock(ast) {
26481
26481
  const errors = [];
26482
26482
  let hasDefault = false;
26483
26483
  if (ast.parameters.length !== 1) {
26484
- errors.push(new ParseError(ast.sourceSpan, '@switch block must have exactly one parameter'));
26484
+ errors.push(new ParseError(ast.startSourceSpan, '@switch block must have exactly one parameter'));
26485
26485
  return errors;
26486
26486
  }
26487
26487
  for (const node of ast.children) {
@@ -26497,15 +26497,15 @@ function validateSwitchBlock(ast) {
26497
26497
  }
26498
26498
  if (node.name === 'default') {
26499
26499
  if (hasDefault) {
26500
- errors.push(new ParseError(node.sourceSpan, '@switch block can only have one @default block'));
26500
+ errors.push(new ParseError(node.startSourceSpan, '@switch block can only have one @default block'));
26501
26501
  }
26502
26502
  else if (node.parameters.length > 0) {
26503
- errors.push(new ParseError(node.sourceSpan, '@default block cannot have parameters'));
26503
+ errors.push(new ParseError(node.startSourceSpan, '@default block cannot have parameters'));
26504
26504
  }
26505
26505
  hasDefault = true;
26506
26506
  }
26507
26507
  else if (node.name === 'case' && node.parameters.length !== 1) {
26508
- errors.push(new ParseError(node.sourceSpan, '@case block must have exactly one parameter'));
26508
+ errors.push(new ParseError(node.startSourceSpan, '@case block must have exactly one parameter'));
26509
26509
  }
26510
26510
  }
26511
26511
  return errors;
@@ -26537,7 +26537,7 @@ function parseBlockParameterToBinding(ast, bindingParser, part) {
26537
26537
  /** Parses the parameter of a conditional block (`if` or `else if`). */
26538
26538
  function parseConditionalBlockParameters(block, errors, bindingParser) {
26539
26539
  if (block.parameters.length === 0) {
26540
- errors.push(new ParseError(block.sourceSpan, 'Conditional block does not have an expression'));
26540
+ errors.push(new ParseError(block.startSourceSpan, 'Conditional block does not have an expression'));
26541
26541
  return null;
26542
26542
  }
26543
26543
  const expression = parseBlockParameterToBinding(block.parameters[0], bindingParser);
@@ -29805,7 +29805,7 @@ function publishFacade(global) {
29805
29805
  * @description
29806
29806
  * Entry point for all public APIs of the compiler package.
29807
29807
  */
29808
- const VERSION = new Version('19.0.0-next.2');
29808
+ const VERSION = new Version('19.0.0-next.4');
29809
29809
 
29810
29810
  class CompilerConfig {
29811
29811
  constructor({ defaultEncapsulation = ViewEncapsulation.Emulated, preserveWhitespaces, strictInjectionParameters, } = {}) {
@@ -31456,7 +31456,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
31456
31456
  function compileDeclareClassMetadata(metadata) {
31457
31457
  const definitionMap = new DefinitionMap();
31458
31458
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
31459
- definitionMap.set('version', literal('19.0.0-next.2'));
31459
+ definitionMap.set('version', literal('19.0.0-next.4'));
31460
31460
  definitionMap.set('ngImport', importExpr(Identifiers.core));
31461
31461
  definitionMap.set('type', metadata.type);
31462
31462
  definitionMap.set('decorators', metadata.decorators);
@@ -31474,7 +31474,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
31474
31474
  callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? literal(null));
31475
31475
  callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? literal(null));
31476
31476
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
31477
- definitionMap.set('version', literal('19.0.0-next.2'));
31477
+ definitionMap.set('version', literal('19.0.0-next.4'));
31478
31478
  definitionMap.set('ngImport', importExpr(Identifiers.core));
31479
31479
  definitionMap.set('type', metadata.type);
31480
31480
  definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
@@ -31569,7 +31569,7 @@ function createDirectiveDefinitionMap(meta) {
31569
31569
  const definitionMap = new DefinitionMap();
31570
31570
  const minVersion = getMinimumVersionForPartialOutput(meta);
31571
31571
  definitionMap.set('minVersion', literal(minVersion));
31572
- definitionMap.set('version', literal('19.0.0-next.2'));
31572
+ definitionMap.set('version', literal('19.0.0-next.4'));
31573
31573
  // e.g. `type: MyDirective`
31574
31574
  definitionMap.set('type', meta.type.value);
31575
31575
  if (meta.isStandalone) {
@@ -31991,7 +31991,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
31991
31991
  function compileDeclareFactoryFunction(meta) {
31992
31992
  const definitionMap = new DefinitionMap();
31993
31993
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
31994
- definitionMap.set('version', literal('19.0.0-next.2'));
31994
+ definitionMap.set('version', literal('19.0.0-next.4'));
31995
31995
  definitionMap.set('ngImport', importExpr(Identifiers.core));
31996
31996
  definitionMap.set('type', meta.type.value);
31997
31997
  definitionMap.set('deps', compileDependencies(meta.deps));
@@ -32026,7 +32026,7 @@ function compileDeclareInjectableFromMetadata(meta) {
32026
32026
  function createInjectableDefinitionMap(meta) {
32027
32027
  const definitionMap = new DefinitionMap();
32028
32028
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
32029
- definitionMap.set('version', literal('19.0.0-next.2'));
32029
+ definitionMap.set('version', literal('19.0.0-next.4'));
32030
32030
  definitionMap.set('ngImport', importExpr(Identifiers.core));
32031
32031
  definitionMap.set('type', meta.type.value);
32032
32032
  // Only generate providedIn property if it has a non-null value
@@ -32077,7 +32077,7 @@ function compileDeclareInjectorFromMetadata(meta) {
32077
32077
  function createInjectorDefinitionMap(meta) {
32078
32078
  const definitionMap = new DefinitionMap();
32079
32079
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
32080
- definitionMap.set('version', literal('19.0.0-next.2'));
32080
+ definitionMap.set('version', literal('19.0.0-next.4'));
32081
32081
  definitionMap.set('ngImport', importExpr(Identifiers.core));
32082
32082
  definitionMap.set('type', meta.type.value);
32083
32083
  definitionMap.set('providers', meta.providers);
@@ -32110,7 +32110,7 @@ function createNgModuleDefinitionMap(meta) {
32110
32110
  throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
32111
32111
  }
32112
32112
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
32113
- definitionMap.set('version', literal('19.0.0-next.2'));
32113
+ definitionMap.set('version', literal('19.0.0-next.4'));
32114
32114
  definitionMap.set('ngImport', importExpr(Identifiers.core));
32115
32115
  definitionMap.set('type', meta.type.value);
32116
32116
  // We only generate the keys in the metadata if the arrays contain values.
@@ -32161,7 +32161,7 @@ function compileDeclarePipeFromMetadata(meta) {
32161
32161
  function createPipeDefinitionMap(meta) {
32162
32162
  const definitionMap = new DefinitionMap();
32163
32163
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
32164
- definitionMap.set('version', literal('19.0.0-next.2'));
32164
+ definitionMap.set('version', literal('19.0.0-next.4'));
32165
32165
  definitionMap.set('ngImport', importExpr(Identifiers.core));
32166
32166
  // e.g. `type: MyPipe`
32167
32167
  definitionMap.set('type', meta.type.value);