@angular/compiler-cli 17.3.0-rc.0 → 17.3.0

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.
Files changed (33) hide show
  1. package/bundles/{chunk-WYZJV3LZ.js → chunk-3ESFLGKJ.js} +8 -5
  2. package/bundles/chunk-3ESFLGKJ.js.map +6 -0
  3. package/bundles/chunk-E5DF5SRS.js +1 -1
  4. package/bundles/{chunk-MNT5B5MH.js → chunk-GQ63H5AL.js} +2 -2
  5. package/bundles/{chunk-Q4UHSSKO.js → chunk-OXIOYWLB.js} +2 -2
  6. package/bundles/{chunk-FH3I22MY.js → chunk-X6GFRI46.js} +186 -131
  7. package/bundles/chunk-X6GFRI46.js.map +6 -0
  8. package/bundles/{chunk-Q5Y7HH3O.js → chunk-YUMIYLNL.js} +1 -1
  9. package/bundles/{chunk-Q5Y7HH3O.js.map → chunk-YUMIYLNL.js.map} +1 -1
  10. package/bundles/index.js +5 -5
  11. package/bundles/private/migrations.js +2 -2
  12. package/bundles/private/tooling.js +2 -2
  13. package/bundles/src/bin/ng_xi18n.js +4 -4
  14. package/bundles/src/bin/ngc.js +4 -4
  15. package/bundles_metadata.json +1 -1
  16. package/linker/src/file_linker/partial_linkers/util.d.ts +1 -1
  17. package/package.json +2 -2
  18. package/src/ngtsc/annotations/component/src/handler.d.ts +2 -0
  19. package/src/ngtsc/annotations/directive/src/initializer_functions.d.ts +1 -1
  20. package/src/ngtsc/core/src/compiler.d.ts +1 -7
  21. package/src/ngtsc/transform/src/api.d.ts +2 -0
  22. package/src/ngtsc/transform/src/compilation.d.ts +1 -2
  23. package/src/ngtsc/typecheck/api/checker.d.ts +6 -1
  24. package/src/ngtsc/typecheck/src/checker.d.ts +2 -1
  25. package/src/ngtsc/typecheck/src/oob.d.ts +1 -3
  26. package/src/ngtsc/typecheck/src/symbol_util.d.ts +10 -0
  27. package/src/ngtsc/typecheck/template_semantics/api/api.d.ts +18 -0
  28. package/src/ngtsc/typecheck/template_semantics/src/template_semantics_checker.d.ts +15 -0
  29. package/bundles/chunk-FH3I22MY.js.map +0 -6
  30. package/bundles/chunk-WYZJV3LZ.js.map +0 -6
  31. package/src/ngtsc/typecheck/src/template_semantics.d.ts +0 -21
  32. /package/bundles/{chunk-MNT5B5MH.js.map → chunk-GQ63H5AL.js.map} +0 -0
  33. /package/bundles/{chunk-Q4UHSSKO.js.map → chunk-OXIOYWLB.js.map} +0 -0
@@ -8,7 +8,7 @@ import {
8
8
  PotentialImportKind,
9
9
  PotentialImportMode,
10
10
  SymbolKind
11
- } from "./chunk-Q5Y7HH3O.js";
11
+ } from "./chunk-YUMIYLNL.js";
12
12
  import {
13
13
  CompilationMode,
14
14
  ComponentDecoratorHandler,
@@ -39,7 +39,7 @@ import {
39
39
  declarationTransformFactory,
40
40
  isHostDirectiveMetaForGlobalMode,
41
41
  ivyTransformFactory
42
- } from "./chunk-WYZJV3LZ.js";
42
+ } from "./chunk-3ESFLGKJ.js";
43
43
  import {
44
44
  AbsoluteModuleStrategy,
45
45
  AliasStrategy,
@@ -181,7 +181,7 @@ var MemberTags;
181
181
 
182
182
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/program.mjs
183
183
  import { HtmlParser, MessageBundle } from "@angular/compiler";
184
- import ts39 from "typescript";
184
+ import ts40 from "typescript";
185
185
 
186
186
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/transformers/i18n.mjs
187
187
  import { Xliff, Xliff2, Xmb } from "@angular/compiler";
@@ -286,7 +286,7 @@ function verifySupportedTypeScriptVersion() {
286
286
  }
287
287
 
288
288
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/compiler.mjs
289
- import ts37 from "typescript";
289
+ import ts38 from "typescript";
290
290
 
291
291
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/cycles/src/analyzer.mjs
292
292
  var CycleAnalyzer = class {
@@ -3411,8 +3411,8 @@ function constructTypeCtorParameter(env, meta, rawType) {
3411
3411
  const plainKeys = [];
3412
3412
  const coercedKeys = [];
3413
3413
  const signalInputKeys = [];
3414
- for (const { classPropertyName, transform, isSignal: isSignal2 } of meta.fields.inputs) {
3415
- if (isSignal2) {
3414
+ for (const { classPropertyName, transform, isSignal } of meta.fields.inputs) {
3415
+ if (isSignal) {
3416
3416
  signalInputKeys.push(ts23.factory.createLiteralTypeNode(ts23.factory.createStringLiteral(classPropertyName)));
3417
3417
  } else if (!meta.coercedInputFields.has(classPropertyName)) {
3418
3418
  plainKeys.push(ts23.factory.createLiteralTypeNode(ts23.factory.createStringLiteral(classPropertyName)));
@@ -3603,21 +3603,6 @@ var OutOfBandDiagnosticRecorderImpl = class {
3603
3603
  }
3604
3604
  this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan, ts25.DiagnosticCategory.Error, ngErrorCode(ErrorCode.DEFERRED_DIRECTIVE_USED_EAGERLY), errorMsg));
3605
3605
  }
3606
- illegalAssignmentToTemplateVar(templateId, assignment, target) {
3607
- var _a, _b;
3608
- const mapping = this.resolver.getSourceMapping(templateId);
3609
- const errorMsg = `Cannot use variable '${assignment.name}' as the left-hand side of an assignment expression. Template variables are read-only.`;
3610
- const sourceSpan = this.resolver.toParseSourceSpan(templateId, assignment.sourceSpan);
3611
- if (sourceSpan === null) {
3612
- throw new Error(`Assertion failure: no SourceLocation found for property binding.`);
3613
- }
3614
- this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan, ts25.DiagnosticCategory.Error, ngErrorCode(ErrorCode.WRITE_TO_READ_ONLY_VARIABLE), errorMsg, [{
3615
- text: `The variable ${assignment.name} is declared here.`,
3616
- start: ((_a = target.valueSpan) == null ? void 0 : _a.start.offset) || target.sourceSpan.start.offset,
3617
- end: ((_b = target.valueSpan) == null ? void 0 : _b.end.offset) || target.sourceSpan.end.offset,
3618
- sourceFile: mapping.node.getSourceFile()
3619
- }]));
3620
- }
3621
3606
  duplicateTemplateVar(templateId, variable, firstDecl) {
3622
3607
  const mapping = this.resolver.getSourceMapping(templateId);
3623
3608
  const errorMsg = `Cannot redeclare variable '${variable.name}' as it was previously declared elsewhere for the same template.`;
@@ -3769,7 +3754,7 @@ var TypeCheckShimGenerator = class {
3769
3754
  };
3770
3755
 
3771
3756
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_check_block.mjs
3772
- import { BindingPipe, Call as Call2, createCssSelectorFromNode, CssSelector, DYNAMIC_TYPE, ImplicitReceiver as ImplicitReceiver4, PropertyRead as PropertyRead4, PropertyWrite as PropertyWrite3, R3Identifiers as R3Identifiers3, SafeCall, SafePropertyRead as SafePropertyRead3, SelectorMatcher, ThisReceiver, TmplAstBoundAttribute, TmplAstBoundText, TmplAstDeferredBlock, TmplAstElement as TmplAstElement3, TmplAstForLoopBlock as TmplAstForLoopBlock2, TmplAstIcu, TmplAstIfBlock, TmplAstIfBlockBranch, TmplAstReference as TmplAstReference3, TmplAstSwitchBlock, TmplAstTemplate as TmplAstTemplate2, TmplAstText, TmplAstTextAttribute as TmplAstTextAttribute2, TmplAstVariable as TmplAstVariable2, TransplantedType } from "@angular/compiler";
3757
+ import { BindingPipe, Call as Call2, createCssSelectorFromNode, CssSelector, DYNAMIC_TYPE, ImplicitReceiver as ImplicitReceiver3, PropertyRead as PropertyRead4, PropertyWrite as PropertyWrite3, R3Identifiers as R3Identifiers3, SafeCall, SafePropertyRead as SafePropertyRead3, SelectorMatcher, ThisReceiver, TmplAstBoundAttribute, TmplAstBoundText, TmplAstDeferredBlock, TmplAstElement as TmplAstElement3, TmplAstForLoopBlock as TmplAstForLoopBlock2, TmplAstIcu, TmplAstIfBlock, TmplAstIfBlockBranch, TmplAstReference as TmplAstReference3, TmplAstSwitchBlock, TmplAstTemplate as TmplAstTemplate2, TmplAstText, TmplAstTextAttribute as TmplAstTextAttribute2, TmplAstVariable, TransplantedType } from "@angular/compiler";
3773
3758
  import ts29 from "typescript";
3774
3759
 
3775
3760
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/diagnostics.mjs
@@ -4151,30 +4136,6 @@ var VeSafeLhsInferenceBugDetector = _VeSafeLhsInferenceBugDetector;
4151
4136
  _VeSafeLhsInferenceBugDetector.SINGLETON = new _VeSafeLhsInferenceBugDetector();
4152
4137
  })();
4153
4138
 
4154
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/template_semantics.mjs
4155
- import { ImplicitReceiver as ImplicitReceiver3, RecursiveAstVisitor as RecursiveAstVisitor2, TmplAstVariable } from "@angular/compiler";
4156
- var ExpressionSemanticVisitor = class extends RecursiveAstVisitor2 {
4157
- constructor(templateId, boundTarget, oob) {
4158
- super();
4159
- this.templateId = templateId;
4160
- this.boundTarget = boundTarget;
4161
- this.oob = oob;
4162
- }
4163
- visitPropertyWrite(ast, context) {
4164
- super.visitPropertyWrite(ast, context);
4165
- if (!(ast.receiver instanceof ImplicitReceiver3)) {
4166
- return;
4167
- }
4168
- const target = this.boundTarget.getExpressionTarget(ast);
4169
- if (target instanceof TmplAstVariable) {
4170
- this.oob.illegalAssignmentToTemplateVar(this.templateId, ast, target);
4171
- }
4172
- }
4173
- static visit(ast, id, boundTarget, oob) {
4174
- ast.visit(new ExpressionSemanticVisitor(id, boundTarget, oob));
4175
- }
4176
- };
4177
-
4178
4139
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_check_block.mjs
4179
4140
  var TcbGenericContextBehavior;
4180
4141
  (function(TcbGenericContextBehavior2) {
@@ -4530,7 +4491,7 @@ var TcbDirectiveInputsOp = class extends TcbOp {
4530
4491
  for (const attr of boundAttrs) {
4531
4492
  const expr = widenBinding(translateInput(attr.attribute, this.tcb, this.scope), this.tcb);
4532
4493
  let assignment = wrapForDiagnostics(expr);
4533
- for (const { fieldName, required, transformType, isSignal: isSignal2, isTwoWayBinding } of attr.inputs) {
4494
+ for (const { fieldName, required, transformType, isSignal, isTwoWayBinding } of attr.inputs) {
4534
4495
  let target;
4535
4496
  if (required) {
4536
4497
  seenRequiredInputs.add(fieldName);
@@ -4570,7 +4531,7 @@ var TcbDirectiveInputsOp = class extends TcbOp {
4570
4531
  }
4571
4532
  target = this.dir.stringLiteralInputFields.has(fieldName) ? ts29.factory.createElementAccessExpression(dirId, ts29.factory.createStringLiteral(fieldName)) : ts29.factory.createPropertyAccessExpression(dirId, ts29.factory.createIdentifier(fieldName));
4572
4533
  }
4573
- if (isSignal2) {
4534
+ if (isSignal) {
4574
4535
  const inputSignalBrandWriteSymbol = this.tcb.env.referenceExternalSymbol(R3Identifiers3.InputSignalBrandWriteType.moduleName, R3Identifiers3.InputSignalBrandWriteType.name);
4575
4536
  if (!ts29.isIdentifier(inputSignalBrandWriteSymbol) && !ts29.isPropertyAccessExpression(inputSignalBrandWriteSymbol)) {
4576
4537
  throw new Error(`Expected identifier or property access for reference to ${R3Identifiers3.InputSignalBrandWriteType.name}`);
@@ -4814,7 +4775,6 @@ var TcbDirectiveOutputsOp = class extends TcbOp {
4814
4775
  const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 1);
4815
4776
  this.scope.addStatement(ts29.factory.createExpressionStatement(handler));
4816
4777
  }
4817
- ExpressionSemanticVisitor.visit(output.handler, this.tcb.id, this.tcb.boundTarget, this.tcb.oobRecorder);
4818
4778
  }
4819
4779
  return null;
4820
4780
  }
@@ -4864,7 +4824,6 @@ var TcbUnclaimedOutputsOp = class extends TcbOp {
4864
4824
  const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 1);
4865
4825
  this.scope.addStatement(ts29.factory.createExpressionStatement(handler));
4866
4826
  }
4867
- ExpressionSemanticVisitor.visit(output.handler, this.tcb.id, this.tcb.boundTarget, this.tcb.oobRecorder);
4868
4827
  }
4869
4828
  return null;
4870
4829
  }
@@ -5191,7 +5150,7 @@ var _Scope = class {
5191
5150
  resolveLocal(ref, directive) {
5192
5151
  if (ref instanceof TmplAstReference3 && this.referenceOpMap.has(ref)) {
5193
5152
  return this.resolveOp(this.referenceOpMap.get(ref));
5194
- } else if (ref instanceof TmplAstVariable2 && this.varMap.has(ref)) {
5153
+ } else if (ref instanceof TmplAstVariable && this.varMap.has(ref)) {
5195
5154
  const opIndexOrNode = this.varMap.get(ref);
5196
5155
  return typeof opIndexOrNode === "number" ? this.resolveOp(opIndexOrNode) : opIndexOrNode;
5197
5156
  } else if (ref instanceof TmplAstTemplate2 && directive === void 0 && this.templateCtxOpMap.has(ref)) {
@@ -5464,9 +5423,9 @@ var TcbExpressionTranslator = class {
5464
5423
  return astToTypescript(ast, (ast2) => this.resolve(ast2), this.tcb.env.config);
5465
5424
  }
5466
5425
  resolve(ast) {
5467
- if (ast instanceof PropertyRead4 && ast.receiver instanceof ImplicitReceiver4) {
5426
+ if (ast instanceof PropertyRead4 && ast.receiver instanceof ImplicitReceiver3) {
5468
5427
  return this.resolveTarget(ast);
5469
- } else if (ast instanceof PropertyWrite3 && ast.receiver instanceof ImplicitReceiver4) {
5428
+ } else if (ast instanceof PropertyWrite3 && ast.receiver instanceof ImplicitReceiver3) {
5470
5429
  const target = this.resolveTarget(ast);
5471
5430
  if (target === null) {
5472
5431
  return null;
@@ -5475,7 +5434,7 @@ var TcbExpressionTranslator = class {
5475
5434
  const result = ts29.factory.createParenthesizedExpression(ts29.factory.createBinaryExpression(target, ts29.SyntaxKind.EqualsToken, expr));
5476
5435
  addParseSpanInfo(result, ast.sourceSpan);
5477
5436
  return result;
5478
- } else if (ast instanceof ImplicitReceiver4) {
5437
+ } else if (ast instanceof ImplicitReceiver3) {
5479
5438
  return ts29.factory.createThis();
5480
5439
  } else if (ast instanceof BindingPipe) {
5481
5440
  const expr = this.translate(ast.exp);
@@ -5504,7 +5463,7 @@ var TcbExpressionTranslator = class {
5504
5463
  addParseSpanInfo(result, ast.sourceSpan);
5505
5464
  return result;
5506
5465
  } else if ((ast instanceof Call2 || ast instanceof SafeCall) && (ast.receiver instanceof PropertyRead4 || ast.receiver instanceof SafePropertyRead3)) {
5507
- if (ast.receiver.receiver instanceof ImplicitReceiver4 && !(ast.receiver.receiver instanceof ThisReceiver) && ast.receiver.name === "$any" && ast.args.length === 1) {
5466
+ if (ast.receiver.receiver instanceof ImplicitReceiver3 && !(ast.receiver.receiver instanceof ThisReceiver) && ast.receiver.name === "$any" && ast.args.length === 1) {
5508
5467
  const expr = this.translate(ast.args[0]);
5509
5468
  const exprAsAny = ts29.factory.createAsExpression(expr, ts29.factory.createKeywordTypeNode(ts29.SyntaxKind.AnyKeyword));
5510
5469
  const result = ts29.factory.createParenthesizedExpression(exprAsAny);
@@ -5669,7 +5628,7 @@ function isSplitTwoWayBinding(inputName, output, inputs, tcb) {
5669
5628
  }
5670
5629
  var TcbEventHandlerTranslator = class extends TcbExpressionTranslator {
5671
5630
  resolve(ast) {
5672
- if (ast instanceof PropertyRead4 && ast.receiver instanceof ImplicitReceiver4 && !(ast.receiver instanceof ThisReceiver) && ast.name === EVENT_PARAMETER) {
5631
+ if (ast instanceof PropertyRead4 && ast.receiver instanceof ImplicitReceiver3 && !(ast.receiver instanceof ThisReceiver) && ast.name === EVENT_PARAMETER) {
5673
5632
  const event = ts29.factory.createIdentifier(EVENT_PARAMETER);
5674
5633
  addParseSpanInfo(event, ast.nameSpan);
5675
5634
  return event;
@@ -5683,7 +5642,7 @@ var TcbForLoopTrackTranslator = class extends TcbExpressionTranslator {
5683
5642
  this.block = block;
5684
5643
  }
5685
5644
  resolve(ast) {
5686
- if (ast instanceof PropertyRead4 && ast.receiver instanceof ImplicitReceiver4) {
5645
+ if (ast instanceof PropertyRead4 && ast.receiver instanceof ImplicitReceiver3) {
5687
5646
  const target = this.tcb.boundTarget.getExpressionTarget(ast);
5688
5647
  if (target !== null && target !== this.block.item && target !== this.block.contextVariables.$index) {
5689
5648
  this.tcb.oobRecorder.illegalForLoopTrackAccess(this.tcb.id, this.block, ast);
@@ -6066,7 +6025,7 @@ var TemplateSourceManager = class {
6066
6025
  };
6067
6026
 
6068
6027
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/template_symbol_builder.mjs
6069
- import { AST, ASTWithSource as ASTWithSource3, BindingPipe as BindingPipe2, PropertyRead as PropertyRead5, PropertyWrite as PropertyWrite4, R3Identifiers as R3Identifiers4, SafePropertyRead as SafePropertyRead4, TmplAstBoundAttribute as TmplAstBoundAttribute2, TmplAstBoundEvent, TmplAstElement as TmplAstElement4, TmplAstReference as TmplAstReference4, TmplAstTemplate as TmplAstTemplate3, TmplAstTextAttribute as TmplAstTextAttribute3, TmplAstVariable as TmplAstVariable3 } from "@angular/compiler";
6028
+ import { AST, ASTWithSource as ASTWithSource3, BindingPipe as BindingPipe2, PropertyRead as PropertyRead5, PropertyWrite as PropertyWrite4, R3Identifiers as R3Identifiers4, SafePropertyRead as SafePropertyRead4, TmplAstBoundAttribute as TmplAstBoundAttribute2, TmplAstBoundEvent, TmplAstElement as TmplAstElement4, TmplAstReference as TmplAstReference4, TmplAstTemplate as TmplAstTemplate3, TmplAstTextAttribute as TmplAstTextAttribute3, TmplAstVariable as TmplAstVariable2 } from "@angular/compiler";
6070
6029
  import ts32 from "typescript";
6071
6030
  var SymbolBuilder = class {
6072
6031
  constructor(tcbPath, tcbIsShim, typeCheckBlock, templateData, componentScopeReader, getTypeChecker) {
@@ -6091,7 +6050,7 @@ var SymbolBuilder = class {
6091
6050
  symbol = this.getSymbolOfElement(node);
6092
6051
  } else if (node instanceof TmplAstTemplate3) {
6093
6052
  symbol = this.getSymbolOfAstTemplate(node);
6094
- } else if (node instanceof TmplAstVariable3) {
6053
+ } else if (node instanceof TmplAstVariable2) {
6095
6054
  symbol = this.getSymbolOfVariable(node);
6096
6055
  } else if (node instanceof TmplAstReference4) {
6097
6056
  symbol = this.getSymbolOfReference(node);
@@ -6794,6 +6753,10 @@ var TemplateTypeCheckerImpl = class {
6794
6753
  fileData.isComplete = false;
6795
6754
  this.isComplete = false;
6796
6755
  }
6756
+ getExpressionTarget(expression, clazz) {
6757
+ var _a;
6758
+ return ((_a = this.getLatestComponentState(clazz).data) == null ? void 0 : _a.boundTarget.getExpressionTarget(expression)) || null;
6759
+ }
6797
6760
  makeTemplateDiagnostic(clazz, sourceSpan, category, errorCode, message, relatedInformation) {
6798
6761
  const sfPath = absoluteFromSourceFile(clazz.getSourceFile());
6799
6762
  const fileRecord = this.state.get(sfPath);
@@ -7282,17 +7245,36 @@ var SingleShimTypeCheckingHost = class extends SingleFileTypeCheckingHost {
7282
7245
 
7283
7246
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/interpolated_signal_not_invoked/index.mjs
7284
7247
  import { Interpolation, PropertyRead as PropertyRead6 } from "@angular/compiler";
7248
+
7249
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/symbol_util.mjs
7285
7250
  import ts33 from "typescript";
7251
+ var SIGNAL_FNS = /* @__PURE__ */ new Set([
7252
+ "WritableSignal",
7253
+ "Signal",
7254
+ "InputSignal",
7255
+ "InputSignalWithTransform",
7256
+ "ModelSignal"
7257
+ ]);
7258
+ function isSignalReference(symbol) {
7259
+ return (symbol.kind === SymbolKind.Expression || symbol.kind === SymbolKind.Variable) && (symbol.tsType.symbol !== void 0 && isSignalSymbol(symbol.tsType.symbol) || symbol.tsType.aliasSymbol !== void 0 && isSignalSymbol(symbol.tsType.aliasSymbol));
7260
+ }
7261
+ function isSignalSymbol(symbol) {
7262
+ const declarations = symbol.getDeclarations();
7263
+ return declarations !== void 0 && declarations.some((decl) => {
7264
+ const fileName = decl.getSourceFile().fileName;
7265
+ return (ts33.isInterfaceDeclaration(decl) || ts33.isTypeAliasDeclaration(decl)) && SIGNAL_FNS.has(decl.name.text) && (fileName.includes("@angular/core") || fileName.includes("angular2/rc/packages/core"));
7266
+ });
7267
+ }
7286
7268
 
7287
7269
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/api/api.mjs
7288
- import { ASTWithSource as ASTWithSource4, RecursiveAstVisitor as RecursiveAstVisitor3, TmplAstBoundDeferredTrigger as TmplAstBoundDeferredTrigger2 } from "@angular/compiler";
7270
+ import { ASTWithSource as ASTWithSource4, RecursiveAstVisitor as RecursiveAstVisitor2, TmplAstBoundDeferredTrigger as TmplAstBoundDeferredTrigger2 } from "@angular/compiler";
7289
7271
  var TemplateCheckWithVisitor = class {
7290
7272
  run(ctx, component, template) {
7291
7273
  const visitor = new TemplateVisitor2(ctx, component, this);
7292
7274
  return visitor.getDiagnostics(template);
7293
7275
  }
7294
7276
  };
7295
- var TemplateVisitor2 = class extends RecursiveAstVisitor3 {
7277
+ var TemplateVisitor2 = class extends RecursiveAstVisitor2 {
7296
7278
  constructor(ctx, component, check) {
7297
7279
  super();
7298
7280
  this.ctx = ctx;
@@ -7409,13 +7391,6 @@ var TemplateVisitor2 = class extends RecursiveAstVisitor3 {
7409
7391
  };
7410
7392
 
7411
7393
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/interpolated_signal_not_invoked/index.mjs
7412
- var SIGNAL_FNS = /* @__PURE__ */ new Set([
7413
- "WritableSignal",
7414
- "Signal",
7415
- "InputSignal",
7416
- "InputSignalWithTransform",
7417
- "ModelSignal"
7418
- ]);
7419
7394
  var SIGNAL_INSTANCE_PROPERTIES = /* @__PURE__ */ new Set(["set", "update", "asReadonly"]);
7420
7395
  var FUNCTION_INSTANCE_PROPERTIES = /* @__PURE__ */ new Set(["name", "length", "prototype"]);
7421
7396
  var InterpolatedSignalCheck = class extends TemplateCheckWithVisitor {
@@ -7430,13 +7405,6 @@ var InterpolatedSignalCheck = class extends TemplateCheckWithVisitor {
7430
7405
  return [];
7431
7406
  }
7432
7407
  };
7433
- function isSignal(symbol) {
7434
- const declarations = symbol == null ? void 0 : symbol.getDeclarations();
7435
- return declarations !== void 0 && declarations.some((decl) => {
7436
- const fileName = decl.getSourceFile().fileName;
7437
- return (ts33.isInterfaceDeclaration(decl) || ts33.isTypeAliasDeclaration(decl)) && SIGNAL_FNS.has(decl.name.text) && (fileName.includes("@angular/core") || fileName.includes("angular2/rc/packages/core"));
7438
- });
7439
- }
7440
7408
  function isFunctionInstanceProperty(name) {
7441
7409
  return FUNCTION_INSTANCE_PROPERTIES.has(name);
7442
7410
  }
@@ -7445,14 +7413,14 @@ function isSignalInstanceProperty(name) {
7445
7413
  }
7446
7414
  function buildDiagnosticForSignal(ctx, node, component) {
7447
7415
  const symbol = ctx.templateTypeChecker.getSymbolOfNode(node, component);
7448
- if ((symbol == null ? void 0 : symbol.kind) === SymbolKind.Expression && (isSignal(symbol.tsType.symbol) || isSignal(symbol.tsType.aliasSymbol))) {
7416
+ if (symbol !== null && symbol.kind === SymbolKind.Expression && isSignalReference(symbol)) {
7449
7417
  const templateMapping = ctx.templateTypeChecker.getTemplateMappingAtTcbLocation(symbol.tcbLocation);
7450
7418
  const errorString = `${node.name} is a function and should be invoked: ${node.name}()`;
7451
7419
  const diagnostic = ctx.makeTemplateDiagnostic(templateMapping.span, errorString);
7452
7420
  return [diagnostic];
7453
7421
  }
7454
7422
  const symbolOfReceiver = ctx.templateTypeChecker.getSymbolOfNode(node.receiver, component);
7455
- if ((isFunctionInstanceProperty(node.name) || isSignalInstanceProperty(node.name)) && (symbolOfReceiver == null ? void 0 : symbolOfReceiver.kind) === SymbolKind.Expression && (isSignal(symbolOfReceiver.tsType.symbol) || isSignal(symbolOfReceiver.tsType.aliasSymbol))) {
7423
+ if ((isFunctionInstanceProperty(node.name) || isSignalInstanceProperty(node.name)) && symbolOfReceiver !== null && symbolOfReceiver.kind === SymbolKind.Expression && isSignalReference(symbolOfReceiver)) {
7456
7424
  const templateMapping = ctx.templateTypeChecker.getTemplateMappingAtTcbLocation(symbolOfReceiver.tcbLocation);
7457
7425
  const errorString = `${node.receiver.name} is a function and should be invoked: ${node.receiver.name}()`;
7458
7426
  const diagnostic = ctx.makeTemplateDiagnostic(templateMapping.span, errorString);
@@ -7804,6 +7772,88 @@ var SUPPORTED_DIAGNOSTIC_NAMES = /* @__PURE__ */ new Set([
7804
7772
  ...ALL_DIAGNOSTIC_FACTORIES.map((factory9) => factory9.name)
7805
7773
  ]);
7806
7774
 
7775
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/template_semantics/src/template_semantics_checker.mjs
7776
+ import { ASTWithSource as ASTWithSource5, ImplicitReceiver as ImplicitReceiver4, RecursiveAstVisitor as RecursiveAstVisitor3, TmplAstBoundEvent as TmplAstBoundEvent3, TmplAstRecursiveVisitor as TmplAstRecursiveVisitor2, TmplAstVariable as TmplAstVariable3 } from "@angular/compiler";
7777
+ import ts37 from "typescript";
7778
+ var TemplateSemanticsCheckerImpl = class {
7779
+ constructor(templateTypeChecker) {
7780
+ this.templateTypeChecker = templateTypeChecker;
7781
+ }
7782
+ getDiagnosticsForComponent(component) {
7783
+ const template = this.templateTypeChecker.getTemplate(component);
7784
+ return template !== null ? TemplateSemanticsVisitor.visit(template, component, this.templateTypeChecker) : [];
7785
+ }
7786
+ };
7787
+ var TemplateSemanticsVisitor = class extends TmplAstRecursiveVisitor2 {
7788
+ constructor(expressionVisitor) {
7789
+ super();
7790
+ this.expressionVisitor = expressionVisitor;
7791
+ }
7792
+ static visit(nodes, component, templateTypeChecker) {
7793
+ const diagnostics = [];
7794
+ const expressionVisitor = new ExpressionsSemanticsVisitor(templateTypeChecker, component, diagnostics);
7795
+ const templateVisitor = new TemplateSemanticsVisitor(expressionVisitor);
7796
+ nodes.forEach((node) => node.visit(templateVisitor));
7797
+ return diagnostics;
7798
+ }
7799
+ visitBoundEvent(event) {
7800
+ super.visitBoundEvent(event);
7801
+ event.handler.visit(this.expressionVisitor, event);
7802
+ }
7803
+ };
7804
+ var ExpressionsSemanticsVisitor = class extends RecursiveAstVisitor3 {
7805
+ constructor(templateTypeChecker, component, diagnostics) {
7806
+ super();
7807
+ this.templateTypeChecker = templateTypeChecker;
7808
+ this.component = component;
7809
+ this.diagnostics = diagnostics;
7810
+ }
7811
+ visitPropertyWrite(ast, context) {
7812
+ super.visitPropertyWrite(ast, context);
7813
+ this.checkForIllegalWriteInEventBinding(ast, context);
7814
+ }
7815
+ visitPropertyRead(ast, context) {
7816
+ super.visitPropertyRead(ast, context);
7817
+ this.checkForIllegalWriteInTwoWayBinding(ast, context);
7818
+ }
7819
+ checkForIllegalWriteInEventBinding(ast, context) {
7820
+ if (!(context instanceof TmplAstBoundEvent3) || !(ast.receiver instanceof ImplicitReceiver4)) {
7821
+ return;
7822
+ }
7823
+ const target = this.templateTypeChecker.getExpressionTarget(ast, this.component);
7824
+ if (target instanceof TmplAstVariable3) {
7825
+ const errorMessage = `Cannot use variable '${target.name}' as the left-hand side of an assignment expression. Template variables are read-only.`;
7826
+ this.diagnostics.push(this.makeIllegalTemplateVarDiagnostic(target, context, errorMessage));
7827
+ }
7828
+ }
7829
+ checkForIllegalWriteInTwoWayBinding(ast, context) {
7830
+ if (!(context instanceof TmplAstBoundEvent3) || context.type !== 2 || !(ast.receiver instanceof ImplicitReceiver4) || ast !== unwrapAstWithSource(context.handler)) {
7831
+ return;
7832
+ }
7833
+ const target = this.templateTypeChecker.getExpressionTarget(ast, this.component);
7834
+ if (!(target instanceof TmplAstVariable3)) {
7835
+ return;
7836
+ }
7837
+ const symbol = this.templateTypeChecker.getSymbolOfNode(target, this.component);
7838
+ if (symbol !== null && !isSignalReference(symbol)) {
7839
+ const errorMessage = `Cannot use a non-signal variable '${target.name}' in a two-way binding expression. Template variables are read-only.`;
7840
+ this.diagnostics.push(this.makeIllegalTemplateVarDiagnostic(target, context, errorMessage));
7841
+ }
7842
+ }
7843
+ makeIllegalTemplateVarDiagnostic(target, expressionNode, errorMessage) {
7844
+ var _a, _b;
7845
+ return this.templateTypeChecker.makeTemplateDiagnostic(this.component, expressionNode.handlerSpan, ts37.DiagnosticCategory.Error, ngErrorCode(ErrorCode.WRITE_TO_READ_ONLY_VARIABLE), errorMessage, [{
7846
+ text: `The variable ${target.name} is declared here.`,
7847
+ start: ((_a = target.valueSpan) == null ? void 0 : _a.start.offset) || target.sourceSpan.start.offset,
7848
+ end: ((_b = target.valueSpan) == null ? void 0 : _b.end.offset) || target.sourceSpan.end.offset,
7849
+ sourceFile: this.component.getSourceFile()
7850
+ }]);
7851
+ }
7852
+ };
7853
+ function unwrapAstWithSource(ast) {
7854
+ return ast instanceof ASTWithSource5 ? ast.ast : ast;
7855
+ }
7856
+
7807
7857
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/feature_detection.mjs
7808
7858
  import semver from "semver";
7809
7859
  function coreVersionSupportsFeature(coreVersion, minVersion) {
@@ -7906,7 +7956,7 @@ var NgCompiler = class {
7906
7956
  this.currentProgram = inputProgram;
7907
7957
  this.closureCompilerEnabled = !!this.options.annotateForClosureCompiler;
7908
7958
  this.entryPoint = adapter.entryPoint !== null ? getSourceFileOrNull(inputProgram, adapter.entryPoint) : null;
7909
- const moduleResolutionCache = ts37.createModuleResolutionCache(
7959
+ const moduleResolutionCache = ts38.createModuleResolutionCache(
7910
7960
  this.adapter.getCurrentDirectory(),
7911
7961
  this.adapter.getCanonicalFileName.bind(this.adapter)
7912
7962
  );
@@ -7950,7 +8000,7 @@ var NgCompiler = class {
7950
8000
  }
7951
8001
  for (const clazz of classesToUpdate) {
7952
8002
  this.compilation.traitCompiler.updateResources(clazz);
7953
- if (!ts37.isClassDeclaration(clazz)) {
8003
+ if (!ts38.isClassDeclaration(clazz)) {
7954
8004
  continue;
7955
8005
  }
7956
8006
  this.compilation.templateTypeChecker.invalidateClass(clazz);
@@ -7966,10 +8016,7 @@ var NgCompiler = class {
7966
8016
  ...this.getNonTemplateDiagnostics()
7967
8017
  ];
7968
8018
  try {
7969
- diagnostics.push(...this.getTemplateDiagnostics());
7970
- if (this.options.strictTemplates) {
7971
- diagnostics.push(...this.getExtendedTemplateDiagnostics());
7972
- }
8019
+ diagnostics.push(...this.getTemplateDiagnostics(), ...this.runAdditionalChecks());
7973
8020
  } catch (err) {
7974
8021
  if (!isFatalDiagnosticError(err)) {
7975
8022
  throw err;
@@ -7981,10 +8028,7 @@ var NgCompiler = class {
7981
8028
  getDiagnosticsForFile(file, optimizeFor) {
7982
8029
  const diagnostics = [...this.getNonTemplateDiagnostics().filter((diag) => diag.file === file)];
7983
8030
  try {
7984
- diagnostics.push(...this.getTemplateDiagnosticsForFile(file, optimizeFor));
7985
- if (this.options.strictTemplates) {
7986
- diagnostics.push(...this.getExtendedTemplateDiagnostics(file));
7987
- }
8031
+ diagnostics.push(...this.getTemplateDiagnosticsForFile(file, optimizeFor), ...this.runAdditionalChecks(file));
7988
8032
  } catch (err) {
7989
8033
  if (!isFatalDiagnosticError(err)) {
7990
8034
  throw err;
@@ -7999,8 +8043,11 @@ var NgCompiler = class {
7999
8043
  const diagnostics = [];
8000
8044
  try {
8001
8045
  diagnostics.push(...ttc.getDiagnosticsForComponent(component));
8002
- const extendedTemplateChecker = compilation.extendedTemplateChecker;
8003
- if (this.options.strictTemplates && extendedTemplateChecker) {
8046
+ const { extendedTemplateChecker, templateSemanticsChecker } = compilation;
8047
+ if (templateSemanticsChecker !== null) {
8048
+ diagnostics.push(...templateSemanticsChecker.getDiagnosticsForComponent(component));
8049
+ }
8050
+ if (this.options.strictTemplates && extendedTemplateChecker !== null) {
8004
8051
  diagnostics.push(...extendedTemplateChecker.getDiagnosticsForComponent(component));
8005
8052
  }
8006
8053
  } catch (err) {
@@ -8295,18 +8342,24 @@ var NgCompiler = class {
8295
8342
  }
8296
8343
  return this.nonTemplateDiagnostics;
8297
8344
  }
8298
- getExtendedTemplateDiagnostics(sf) {
8345
+ runAdditionalChecks(sf) {
8299
8346
  const diagnostics = [];
8300
8347
  const compilation = this.ensureAnalyzed();
8301
- const extendedTemplateChecker = compilation.extendedTemplateChecker;
8302
- if (!extendedTemplateChecker) {
8303
- return [];
8304
- }
8305
- if (sf !== void 0) {
8306
- return compilation.traitCompiler.extendedTemplateCheck(sf, extendedTemplateChecker);
8307
- }
8308
- for (const sf2 of this.inputProgram.getSourceFiles()) {
8309
- diagnostics.push(...compilation.traitCompiler.extendedTemplateCheck(sf2, extendedTemplateChecker));
8348
+ const { extendedTemplateChecker, templateSemanticsChecker } = compilation;
8349
+ const files = sf ? [sf] : this.inputProgram.getSourceFiles();
8350
+ for (const sf2 of files) {
8351
+ if (templateSemanticsChecker !== null) {
8352
+ diagnostics.push(...compilation.traitCompiler.runAdditionalChecks(sf2, (clazz, handler) => {
8353
+ var _a;
8354
+ return ((_a = handler.templateSemanticsCheck) == null ? void 0 : _a.call(handler, clazz, templateSemanticsChecker)) || null;
8355
+ }));
8356
+ }
8357
+ if (this.options.strictTemplates && extendedTemplateChecker !== null) {
8358
+ diagnostics.push(...compilation.traitCompiler.runAdditionalChecks(sf2, (clazz, handler) => {
8359
+ var _a;
8360
+ return ((_a = handler.extendedTemplateCheck) == null ? void 0 : _a.call(handler, clazz, extendedTemplateChecker)) || null;
8361
+ }));
8362
+ }
8310
8363
  }
8311
8364
  return diagnostics;
8312
8365
  }
@@ -8415,6 +8468,7 @@ var NgCompiler = class {
8415
8468
  });
8416
8469
  const templateTypeChecker = new TemplateTypeCheckerImpl(this.inputProgram, notifyingDriver, traitCompiler, this.getTypeCheckingConfig(), refEmitter, reflector, this.adapter, this.incrementalCompilation, metaReader, localMetaReader, ngModuleIndex, scopeReader, typeCheckScopeRegistry, this.delegatingPerfRecorder);
8417
8470
  const extendedTemplateChecker = this.constructionDiagnostics.length === 0 ? new ExtendedTemplateCheckerImpl(templateTypeChecker, checker, ALL_DIAGNOSTIC_FACTORIES, this.options) : null;
8471
+ const templateSemanticsChecker = this.constructionDiagnostics.length === 0 ? new TemplateSemanticsCheckerImpl(templateTypeChecker) : null;
8418
8472
  return {
8419
8473
  isCore,
8420
8474
  traitCompiler,
@@ -8429,7 +8483,8 @@ var NgCompiler = class {
8429
8483
  templateTypeChecker,
8430
8484
  resourceRegistry,
8431
8485
  extendedTemplateChecker,
8432
- localCompilationExtraImportsTracker
8486
+ localCompilationExtraImportsTracker,
8487
+ templateSemanticsChecker
8433
8488
  };
8434
8489
  }
8435
8490
  };
@@ -8439,18 +8494,18 @@ function isAngularCorePackage(program) {
8439
8494
  return false;
8440
8495
  }
8441
8496
  return r3Symbols.statements.some((stmt) => {
8442
- if (!ts37.isVariableStatement(stmt)) {
8497
+ if (!ts38.isVariableStatement(stmt)) {
8443
8498
  return false;
8444
8499
  }
8445
- const modifiers = ts37.getModifiers(stmt);
8446
- if (modifiers === void 0 || !modifiers.some((mod) => mod.kind === ts37.SyntaxKind.ExportKeyword)) {
8500
+ const modifiers = ts38.getModifiers(stmt);
8501
+ if (modifiers === void 0 || !modifiers.some((mod) => mod.kind === ts38.SyntaxKind.ExportKeyword)) {
8447
8502
  return false;
8448
8503
  }
8449
8504
  return stmt.declarationList.declarations.some((decl) => {
8450
- if (!ts37.isIdentifier(decl.name) || decl.name.text !== "ITS_JUST_ANGULAR") {
8505
+ if (!ts38.isIdentifier(decl.name) || decl.name.text !== "ITS_JUST_ANGULAR") {
8451
8506
  return false;
8452
8507
  }
8453
- if (decl.initializer === void 0 || decl.initializer.kind !== ts37.SyntaxKind.TrueKeyword) {
8508
+ if (decl.initializer === void 0 || decl.initializer.kind !== ts38.SyntaxKind.TrueKeyword) {
8454
8509
  return false;
8455
8510
  }
8456
8511
  return true;
@@ -8464,7 +8519,7 @@ function* verifyCompatibleTypeCheckOptions(options) {
8464
8519
  var _a, _b, _c;
8465
8520
  if (options.fullTemplateTypeCheck === false && options.strictTemplates === true) {
8466
8521
  yield makeConfigDiagnostic({
8467
- category: ts37.DiagnosticCategory.Error,
8522
+ category: ts38.DiagnosticCategory.Error,
8468
8523
  code: ErrorCode.CONFIG_STRICT_TEMPLATES_IMPLIES_FULL_TEMPLATE_TYPECHECK,
8469
8524
  messageText: `
8470
8525
  Angular compiler option "strictTemplates" is enabled, however "fullTemplateTypeCheck" is disabled.
@@ -8483,7 +8538,7 @@ https://angular.io/guide/template-typecheck
8483
8538
  }
8484
8539
  if (options.extendedDiagnostics && options.strictTemplates === false) {
8485
8540
  yield makeConfigDiagnostic({
8486
- category: ts37.DiagnosticCategory.Error,
8541
+ category: ts38.DiagnosticCategory.Error,
8487
8542
  code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_IMPLIES_STRICT_TEMPLATES,
8488
8543
  messageText: `
8489
8544
  Angular compiler option "extendedDiagnostics" is configured, however "strictTemplates" is disabled.
@@ -8500,7 +8555,7 @@ One of the following actions is required:
8500
8555
  const defaultCategory = (_a = options.extendedDiagnostics) == null ? void 0 : _a.defaultCategory;
8501
8556
  if (defaultCategory && !allowedCategoryLabels.includes(defaultCategory)) {
8502
8557
  yield makeConfigDiagnostic({
8503
- category: ts37.DiagnosticCategory.Error,
8558
+ category: ts38.DiagnosticCategory.Error,
8504
8559
  code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL,
8505
8560
  messageText: `
8506
8561
  Angular compiler option "extendedDiagnostics.defaultCategory" has an unknown diagnostic category: "${defaultCategory}".
@@ -8513,7 +8568,7 @@ ${allowedCategoryLabels.join("\n")}
8513
8568
  for (const [checkName, category] of Object.entries((_c = (_b = options.extendedDiagnostics) == null ? void 0 : _b.checks) != null ? _c : {})) {
8514
8569
  if (!SUPPORTED_DIAGNOSTIC_NAMES.has(checkName)) {
8515
8570
  yield makeConfigDiagnostic({
8516
- category: ts37.DiagnosticCategory.Error,
8571
+ category: ts38.DiagnosticCategory.Error,
8517
8572
  code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CHECK,
8518
8573
  messageText: `
8519
8574
  Angular compiler option "extendedDiagnostics.checks" has an unknown check: "${checkName}".
@@ -8525,7 +8580,7 @@ ${Array.from(SUPPORTED_DIAGNOSTIC_NAMES).join("\n")}
8525
8580
  }
8526
8581
  if (!allowedCategoryLabels.includes(category)) {
8527
8582
  yield makeConfigDiagnostic({
8528
- category: ts37.DiagnosticCategory.Error,
8583
+ category: ts38.DiagnosticCategory.Error,
8529
8584
  code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL,
8530
8585
  messageText: `
8531
8586
  Angular compiler option "extendedDiagnostics.checks['${checkName}']" has an unknown diagnostic category: "${category}".
@@ -8555,7 +8610,7 @@ var ReferenceGraphAdapter = class {
8555
8610
  for (const { node } of references) {
8556
8611
  let sourceFile = node.getSourceFile();
8557
8612
  if (sourceFile === void 0) {
8558
- sourceFile = ts37.getOriginalNode(node).getSourceFile();
8613
+ sourceFile = ts38.getOriginalNode(node).getSourceFile();
8559
8614
  }
8560
8615
  if (sourceFile === void 0 || !isDtsPath(sourceFile.fileName)) {
8561
8616
  this.graph.add(source, node);
@@ -8594,7 +8649,7 @@ function versionMapFromProgram(program, driver) {
8594
8649
  }
8595
8650
 
8596
8651
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/host.mjs
8597
- import ts38 from "typescript";
8652
+ import ts39 from "typescript";
8598
8653
  var DelegatingCompilerHost2 = class {
8599
8654
  get jsDocParsingMode() {
8600
8655
  return this.delegate.jsDocParsingMode;
@@ -8679,7 +8734,7 @@ var NgCompilerHost = class extends DelegatingCompilerHost2 {
8679
8734
  entryPoint = findFlatIndexEntryPoint(normalizedTsInputFiles);
8680
8735
  if (entryPoint === null) {
8681
8736
  diagnostics.push({
8682
- category: ts38.DiagnosticCategory.Error,
8737
+ category: ts39.DiagnosticCategory.Error,
8683
8738
  code: ngErrorCode(ErrorCode.CONFIG_FLAT_MODULE_NO_INDEX),
8684
8739
  file: void 0,
8685
8740
  start: void 0,
@@ -8722,10 +8777,10 @@ var NgCompilerHost = class extends DelegatingCompilerHost2 {
8722
8777
  return this.fileNameToModuleName !== void 0 ? this : null;
8723
8778
  }
8724
8779
  createCachedResolveModuleNamesFunction() {
8725
- const moduleResolutionCache = ts38.createModuleResolutionCache(this.getCurrentDirectory(), this.getCanonicalFileName.bind(this));
8780
+ const moduleResolutionCache = ts39.createModuleResolutionCache(this.getCurrentDirectory(), this.getCanonicalFileName.bind(this));
8726
8781
  return (moduleNames, containingFile, reusedNames, redirectedReference, options) => {
8727
8782
  return moduleNames.map((moduleName) => {
8728
- const module = ts38.resolveModuleName(moduleName, containingFile, options, this, moduleResolutionCache, redirectedReference);
8783
+ const module = ts39.resolveModuleName(moduleName, containingFile, options, this, moduleResolutionCache, redirectedReference);
8729
8784
  return module.resolvedModule;
8730
8785
  });
8731
8786
  };
@@ -8749,7 +8804,7 @@ var NgtscProgram = class {
8749
8804
  if (reuseProgram !== void 0) {
8750
8805
  retagAllTsFiles(reuseProgram);
8751
8806
  }
8752
- this.tsProgram = perfRecorder.inPhase(PerfPhase.TypeScriptProgramCreate, () => ts39.createProgram(this.host.inputFiles, options, this.host, reuseProgram));
8807
+ this.tsProgram = perfRecorder.inPhase(PerfPhase.TypeScriptProgramCreate, () => ts40.createProgram(this.host.inputFiles, options, this.host, reuseProgram));
8753
8808
  perfRecorder.phase(PerfPhase.Unaccounted);
8754
8809
  perfRecorder.memory(PerfCheckpoint.TypeScriptProgramCreate);
8755
8810
  this.host.postProgramCreationCleanup();
@@ -8965,16 +9020,16 @@ function createProgram({ rootNames, options, host, oldProgram }) {
8965
9020
  }
8966
9021
 
8967
9022
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/perform_compile.mjs
8968
- import ts41 from "typescript";
9023
+ import ts42 from "typescript";
8969
9024
 
8970
9025
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/transformers/util.mjs
8971
- import ts40 from "typescript";
9026
+ import ts41 from "typescript";
8972
9027
  function createMessageDiagnostic(messageText) {
8973
9028
  return {
8974
9029
  file: void 0,
8975
9030
  start: void 0,
8976
9031
  length: void 0,
8977
- category: ts40.DiagnosticCategory.Message,
9032
+ category: ts41.DiagnosticCategory.Message,
8978
9033
  messageText,
8979
9034
  code: DEFAULT_ERROR_CODE,
8980
9035
  source: SOURCE
@@ -8983,13 +9038,13 @@ function createMessageDiagnostic(messageText) {
8983
9038
 
8984
9039
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/perform_compile.mjs
8985
9040
  var defaultFormatHost = {
8986
- getCurrentDirectory: () => ts41.sys.getCurrentDirectory(),
9041
+ getCurrentDirectory: () => ts42.sys.getCurrentDirectory(),
8987
9042
  getCanonicalFileName: (fileName) => fileName,
8988
- getNewLine: () => ts41.sys.newLine
9043
+ getNewLine: () => ts42.sys.newLine
8989
9044
  };
8990
9045
  function formatDiagnostics(diags, host = defaultFormatHost) {
8991
9046
  if (diags && diags.length) {
8992
- return diags.map((diagnostic) => replaceTsWithNgInErrors(ts41.formatDiagnosticsWithColorAndContext([diagnostic], host))).join("");
9047
+ return diags.map((diagnostic) => replaceTsWithNgInErrors(ts42.formatDiagnosticsWithColorAndContext([diagnostic], host))).join("");
8993
9048
  } else {
8994
9049
  return "";
8995
9050
  }
@@ -9006,7 +9061,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
9006
9061
  var _a;
9007
9062
  try {
9008
9063
  const fs = getFileSystem();
9009
- const readConfigFile = (configFile) => ts41.readConfigFile(configFile, (file) => host.readFile(host.resolve(file)));
9064
+ const readConfigFile = (configFile) => ts42.readConfigFile(configFile, (file) => host.readFile(host.resolve(file)));
9010
9065
  const readAngularCompilerOptions = (configFile, parentOptions = {}) => {
9011
9066
  const { config: config2, error: error2 } = readConfigFile(configFile);
9012
9067
  if (error2) {
@@ -9041,7 +9096,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
9041
9096
  ...existingOptions
9042
9097
  };
9043
9098
  const parseConfigHost = createParseConfigHost(host, fs);
9044
- const { options, errors, fileNames: rootNames, projectReferences } = ts41.parseJsonConfigFileContent(config, parseConfigHost, basePath, existingCompilerOptions, configFileName);
9099
+ const { options, errors, fileNames: rootNames, projectReferences } = ts42.parseJsonConfigFileContent(config, parseConfigHost, basePath, existingCompilerOptions, configFileName);
9045
9100
  let emitFlags = EmitFlags.Default;
9046
9101
  if (!(options["skipMetadataEmit"] || options["flatModuleOutFile"])) {
9047
9102
  emitFlags |= EmitFlags.Metadata;
@@ -9052,7 +9107,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
9052
9107
  return { project: projectFile, rootNames, projectReferences, options, errors, emitFlags };
9053
9108
  } catch (e) {
9054
9109
  const errors = [{
9055
- category: ts41.DiagnosticCategory.Error,
9110
+ category: ts42.DiagnosticCategory.Error,
9056
9111
  messageText: (_a = e.stack) != null ? _a : e.message,
9057
9112
  file: void 0,
9058
9113
  start: void 0,
@@ -9066,7 +9121,7 @@ function readConfiguration(project, existingOptions, host = getFileSystem()) {
9066
9121
  function createParseConfigHost(host, fs = getFileSystem()) {
9067
9122
  return {
9068
9123
  fileExists: host.exists.bind(host),
9069
- readDirectory: ts41.sys.readDirectory,
9124
+ readDirectory: ts42.sys.readDirectory,
9070
9125
  readFile: host.readFile.bind(host),
9071
9126
  useCaseSensitiveFileNames: fs.isCaseSensitive()
9072
9127
  };
@@ -9086,7 +9141,7 @@ function getExtendedConfigPathWorker(configFile, extendsValue, host, fs) {
9086
9141
  }
9087
9142
  } else {
9088
9143
  const parseConfigHost = createParseConfigHost(host, fs);
9089
- const { resolvedModule } = ts41.nodeModuleNameResolver(extendsValue, configFile, { moduleResolution: ts41.ModuleResolutionKind.Node10, resolveJsonModule: true }, parseConfigHost);
9144
+ const { resolvedModule } = ts42.nodeModuleNameResolver(extendsValue, configFile, { moduleResolution: ts42.ModuleResolutionKind.Node10, resolveJsonModule: true }, parseConfigHost);
9090
9145
  if (resolvedModule) {
9091
9146
  return absoluteFrom(resolvedModule.resolvedFileName);
9092
9147
  }
@@ -9096,7 +9151,7 @@ function getExtendedConfigPathWorker(configFile, extendsValue, host, fs) {
9096
9151
  function exitCodeFromResult(diags) {
9097
9152
  if (!diags)
9098
9153
  return 0;
9099
- if (diags.every((diag) => diag.category !== ts41.DiagnosticCategory.Error)) {
9154
+ if (diags.every((diag) => diag.category !== ts42.DiagnosticCategory.Error)) {
9100
9155
  return 0;
9101
9156
  }
9102
9157
  return diags.some((d) => d.source === "angular" && d.code === UNKNOWN_ERROR_CODE) ? 2 : 1;
@@ -9129,7 +9184,7 @@ function performCompilation({ rootNames, options, host, oldProgram, emitCallback
9129
9184
  } catch (e) {
9130
9185
  program = void 0;
9131
9186
  allDiagnostics.push({
9132
- category: ts41.DiagnosticCategory.Error,
9187
+ category: ts42.DiagnosticCategory.Error,
9133
9188
  messageText: (_a = e.stack) != null ? _a : e.message,
9134
9189
  code: UNKNOWN_ERROR_CODE,
9135
9190
  file: void 0,
@@ -9156,7 +9211,7 @@ function defaultGatherDiagnostics(program) {
9156
9211
  return allDiagnostics;
9157
9212
  }
9158
9213
  function hasErrors(diags) {
9159
- return diags.some((d) => d.category === ts41.DiagnosticCategory.Error);
9214
+ return diags.some((d) => d.category === ts42.DiagnosticCategory.Error);
9160
9215
  }
9161
9216
 
9162
9217
  export {
@@ -9201,4 +9256,4 @@ export {
9201
9256
  * Use of this source code is governed by an MIT-style license that can be
9202
9257
  * found in the LICENSE file at https://angular.io/license
9203
9258
  */
9204
- //# sourceMappingURL=chunk-FH3I22MY.js.map
9259
+ //# sourceMappingURL=chunk-X6GFRI46.js.map