@angular/compiler-cli 18.0.0-rc.2 → 18.0.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.
@@ -299,7 +299,7 @@ import { compileDirectiveFromMetadata, makeBindingParser, ParseLocation, ParseSo
299
299
 
300
300
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/util.mjs
301
301
  import { createMayBeForwardRefExpression, outputAst as o2 } from "@angular/compiler";
302
- var PLACEHOLDER_VERSION = "18.0.0-rc.2";
302
+ var PLACEHOLDER_VERSION = "18.0.0";
303
303
  function wrapReference(wrapped) {
304
304
  return { value: wrapped, type: wrapped };
305
305
  }
@@ -6130,7 +6130,10 @@ var TcbIfOp = class extends TcbOp {
6130
6130
  const expressionScope = Scope.forNodes(this.tcb, this.scope, branch, [], null);
6131
6131
  expressionScope.render().forEach((stmt) => this.scope.addStatement(stmt));
6132
6132
  this.expressionScopes.set(branch, expressionScope);
6133
- const expression = branch.expressionAlias === null ? tcbExpression(branch.expression, this.tcb, expressionScope) : expressionScope.resolve(branch.expressionAlias);
6133
+ let expression = tcbExpression(branch.expression, this.tcb, expressionScope);
6134
+ if (branch.expressionAlias !== null) {
6135
+ expression = ts31.factory.createBinaryExpression(ts31.factory.createParenthesizedExpression(expression), ts31.SyntaxKind.AmpersandAmpersandToken, expressionScope.resolve(branch.expressionAlias));
6136
+ }
6134
6137
  const bodyScope = this.getBranchScope(expressionScope, branch, index);
6135
6138
  return ts31.factory.createIfStatement(expression, ts31.factory.createBlock(bodyScope.render()), this.generateBranch(index + 1));
6136
6139
  }
@@ -6150,12 +6153,11 @@ var TcbIfOp = class extends TcbOp {
6150
6153
  }
6151
6154
  const expressionScope = this.expressionScopes.get(branch);
6152
6155
  let expression;
6153
- if (branch.expressionAlias === null) {
6154
- expression = tcbExpression(branch.expression, this.tcb, expressionScope);
6155
- markIgnoreDiagnostics(expression);
6156
- } else {
6157
- expression = expressionScope.resolve(branch.expressionAlias);
6156
+ expression = tcbExpression(branch.expression, this.tcb, expressionScope);
6157
+ if (branch.expressionAlias !== null) {
6158
+ expression = ts31.factory.createBinaryExpression(ts31.factory.createParenthesizedExpression(expression), ts31.SyntaxKind.AmpersandAmpersandToken, expressionScope.resolve(branch.expressionAlias));
6158
6159
  }
6160
+ markIgnoreDiagnostics(expression);
6159
6161
  const comparisonExpression = i === index ? expression : ts31.factory.createPrefixUnaryExpression(ts31.SyntaxKind.ExclamationToken, ts31.factory.createParenthesizedExpression(expression));
6160
6162
  guard = guard === null ? comparisonExpression : ts31.factory.createBinaryExpression(guard, ts31.SyntaxKind.AmpersandAmpersandToken, comparisonExpression);
6161
6163
  }
@@ -7514,7 +7516,6 @@ var SymbolBuilder = class {
7514
7516
  return { kind: SymbolKind.Output, bindings };
7515
7517
  }
7516
7518
  getSymbolOfInputBinding(binding) {
7517
- var _a;
7518
7519
  const consumer = this.templateData.boundTarget.getConsumerOfBinding(binding);
7519
7520
  if (consumer === null) {
7520
7521
  return null;
@@ -7533,22 +7534,28 @@ var SymbolBuilder = class {
7533
7534
  continue;
7534
7535
  }
7535
7536
  const signalInputAssignment = unwrapSignalInputWriteTAccessor(node.left);
7537
+ let fieldAccessExpr;
7536
7538
  let symbolInfo = null;
7537
7539
  if (signalInputAssignment !== null) {
7540
+ if (ts34.isIdentifier(signalInputAssignment.fieldExpr)) {
7541
+ continue;
7542
+ }
7538
7543
  const fieldSymbol = this.getSymbolOfTsNode(signalInputAssignment.fieldExpr);
7539
7544
  const typeSymbol = this.getSymbolOfTsNode(signalInputAssignment.typeExpr);
7545
+ fieldAccessExpr = signalInputAssignment.fieldExpr;
7540
7546
  symbolInfo = fieldSymbol === null || typeSymbol === null ? null : {
7541
7547
  tcbLocation: fieldSymbol.tcbLocation,
7542
7548
  tsSymbol: fieldSymbol.tsSymbol,
7543
7549
  tsType: typeSymbol.tsType
7544
7550
  };
7545
7551
  } else {
7552
+ fieldAccessExpr = node.left;
7546
7553
  symbolInfo = this.getSymbolOfTsNode(node.left);
7547
7554
  }
7548
7555
  if (symbolInfo === null || symbolInfo.tsSymbol === null) {
7549
7556
  continue;
7550
7557
  }
7551
- const target = this.getDirectiveSymbolForAccessExpression((_a = signalInputAssignment == null ? void 0 : signalInputAssignment.fieldExpr) != null ? _a : node.left, consumer);
7558
+ const target = this.getDirectiveSymbolForAccessExpression(fieldAccessExpr, consumer);
7552
7559
  if (target === null) {
7553
7560
  continue;
7554
7561
  }
@@ -7798,7 +7805,7 @@ function unwrapSignalInputWriteTAccessor(expr) {
7798
7805
  if (!ts34.isIdentifier(expr.argumentExpression.name) || expr.argumentExpression.name.text !== R3Identifiers4.InputSignalBrandWriteType.name) {
7799
7806
  return null;
7800
7807
  }
7801
- if (!ts34.isPropertyAccessExpression(expr.expression) && !ts34.isElementAccessExpression(expr.expression)) {
7808
+ if (!ts34.isPropertyAccessExpression(expr.expression) && !ts34.isElementAccessExpression(expr.expression) && !ts34.isIdentifier(expr.expression)) {
7802
7809
  throw new Error("Unexpected expression for signal input write type.");
7803
7810
  }
7804
7811
  return {
@@ -8509,7 +8516,7 @@ var SingleShimTypeCheckingHost = class extends SingleFileTypeCheckingHost {
8509
8516
  };
8510
8517
 
8511
8518
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/interpolated_signal_not_invoked/index.mjs
8512
- import { Interpolation, PropertyRead as PropertyRead6 } from "@angular/compiler";
8519
+ import { ASTWithSource as ASTWithSource5, BindingType as BindingType2, Interpolation, PropertyRead as PropertyRead6, TmplAstBoundAttribute as TmplAstBoundAttribute3 } from "@angular/compiler";
8513
8520
 
8514
8521
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/symbol_util.mjs
8515
8522
  import ts35 from "typescript";
@@ -8667,6 +8674,14 @@ var InterpolatedSignalCheck = class extends TemplateCheckWithVisitor {
8667
8674
  visitNode(ctx, component, node) {
8668
8675
  if (node instanceof Interpolation) {
8669
8676
  return node.expressions.filter((item) => item instanceof PropertyRead6).flatMap((item) => buildDiagnosticForSignal(ctx, item, component));
8677
+ } else if (node instanceof TmplAstBoundAttribute3) {
8678
+ const symbol = ctx.templateTypeChecker.getSymbolOfNode(node, component);
8679
+ if (symbol !== null && symbol.kind === SymbolKind.Input) {
8680
+ return [];
8681
+ }
8682
+ if (node.type === BindingType2.Property && node.value instanceof ASTWithSource5 && node.value.ast instanceof PropertyRead6) {
8683
+ return buildDiagnosticForSignal(ctx, node.value.ast, component);
8684
+ }
8670
8685
  }
8671
8686
  return [];
8672
8687
  }
@@ -8896,7 +8911,7 @@ var factory6 = {
8896
8911
  };
8897
8912
 
8898
8913
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/suffix_not_supported/index.mjs
8899
- import { TmplAstBoundAttribute as TmplAstBoundAttribute3 } from "@angular/compiler";
8914
+ import { TmplAstBoundAttribute as TmplAstBoundAttribute4 } from "@angular/compiler";
8900
8915
  var STYLE_SUFFIXES = ["px", "%", "em"];
8901
8916
  var SuffixNotSupportedCheck = class extends TemplateCheckWithVisitor {
8902
8917
  constructor() {
@@ -8904,7 +8919,7 @@ var SuffixNotSupportedCheck = class extends TemplateCheckWithVisitor {
8904
8919
  this.code = ErrorCode.SUFFIX_NOT_SUPPORTED;
8905
8920
  }
8906
8921
  visitNode(ctx, component, node) {
8907
- if (!(node instanceof TmplAstBoundAttribute3))
8922
+ if (!(node instanceof TmplAstBoundAttribute4))
8908
8923
  return [];
8909
8924
  if (!node.keySpan.toString().startsWith("attr.") || !STYLE_SUFFIXES.some((suffix) => node.name.endsWith(`.${suffix}`))) {
8910
8925
  return [];
@@ -9039,7 +9054,7 @@ var SUPPORTED_DIAGNOSTIC_NAMES = /* @__PURE__ */ new Set([
9039
9054
  ]);
9040
9055
 
9041
9056
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/template_semantics/src/template_semantics_checker.mjs
9042
- import { ASTWithSource as ASTWithSource5, ImplicitReceiver as ImplicitReceiver4, ParsedEventType as ParsedEventType2, RecursiveAstVisitor as RecursiveAstVisitor3, TmplAstBoundEvent as TmplAstBoundEvent3, TmplAstRecursiveVisitor as TmplAstRecursiveVisitor2, TmplAstVariable as TmplAstVariable3 } from "@angular/compiler";
9057
+ import { ASTWithSource as ASTWithSource6, ImplicitReceiver as ImplicitReceiver4, ParsedEventType as ParsedEventType2, RecursiveAstVisitor as RecursiveAstVisitor3, TmplAstBoundEvent as TmplAstBoundEvent3, TmplAstRecursiveVisitor as TmplAstRecursiveVisitor2, TmplAstVariable as TmplAstVariable3 } from "@angular/compiler";
9043
9058
  import ts39 from "typescript";
9044
9059
  var TemplateSemanticsCheckerImpl = class {
9045
9060
  constructor(templateTypeChecker) {
@@ -9119,7 +9134,7 @@ var ExpressionsSemanticsVisitor = class extends RecursiveAstVisitor3 {
9119
9134
  }
9120
9135
  };
9121
9136
  function unwrapAstWithSource(ast) {
9122
- return ast instanceof ASTWithSource5 ? ast.ast : ast;
9137
+ return ast instanceof ASTWithSource6 ? ast.ast : ast;
9123
9138
  }
9124
9139
 
9125
9140
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/validation/src/rules/initializer_api_usage_rule.mjs
@@ -10658,4 +10673,4 @@ export {
10658
10673
  * Use of this source code is governed by an MIT-style license that can be
10659
10674
  * found in the LICENSE file at https://angular.io/license
10660
10675
  */
10661
- //# sourceMappingURL=chunk-BKFFZXM2.js.map
10676
+ //# sourceMappingURL=chunk-D7XZVDL2.js.map