@angular/core 18.1.0-next.4 → 18.1.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 (44) hide show
  1. package/esm2022/primitives/event-dispatch/index.mjs +3 -2
  2. package/esm2022/primitives/event-dispatch/src/action_resolver.mjs +3 -3
  3. package/esm2022/primitives/event-dispatch/src/attribute.mjs +16 -52
  4. package/esm2022/primitives/event-dispatch/src/cache.mjs +17 -6
  5. package/esm2022/primitives/event-dispatch/src/char.mjs +1 -16
  6. package/esm2022/primitives/event-dispatch/src/event.mjs +2 -3
  7. package/esm2022/primitives/event-dispatch/src/eventcontract.mjs +5 -66
  8. package/esm2022/primitives/event-dispatch/src/property.mjs +17 -22
  9. package/esm2022/primitives/signals/index.mjs +3 -3
  10. package/esm2022/primitives/signals/src/signal.mjs +4 -1
  11. package/esm2022/rxjs-interop/src/to_signal.mjs +4 -4
  12. package/esm2022/src/change_detection/scheduling/zoneless_scheduling_impl.mjs +2 -2
  13. package/esm2022/src/core_private_export.mjs +3 -1
  14. package/esm2022/src/defer/instructions.mjs +53 -35
  15. package/esm2022/src/event_delegation_utils.mjs +40 -23
  16. package/esm2022/src/event_dispatch/event_delegation.mjs +38 -0
  17. package/esm2022/src/hydration/annotate.mjs +3 -3
  18. package/esm2022/src/hydration/event_replay.mjs +5 -5
  19. package/esm2022/src/render3/component_ref.mjs +1 -1
  20. package/esm2022/src/render3/debug/framework_injector_profiler.mjs +3 -2
  21. package/esm2022/src/version.mjs +1 -1
  22. package/esm2022/testing/src/logger.mjs +3 -3
  23. package/fesm2022/core.mjs +127 -63
  24. package/fesm2022/core.mjs.map +1 -1
  25. package/fesm2022/primitives/event-dispatch.mjs +53 -242
  26. package/fesm2022/primitives/event-dispatch.mjs.map +1 -1
  27. package/fesm2022/primitives/signals.mjs +5 -2
  28. package/fesm2022/primitives/signals.mjs.map +1 -1
  29. package/fesm2022/rxjs-interop.mjs +4 -4
  30. package/fesm2022/rxjs-interop.mjs.map +1 -1
  31. package/fesm2022/testing.mjs +1 -1
  32. package/index.d.ts +31 -2
  33. package/package.json +1 -1
  34. package/primitives/event-dispatch/index.d.ts +22 -102
  35. package/primitives/signals/index.d.ts +10 -1
  36. package/rxjs-interop/index.d.ts +2 -2
  37. package/schematics/migrations/invalid-two-way-bindings/bundle.js +26 -9
  38. package/schematics/migrations/invalid-two-way-bindings/bundle.js.map +2 -2
  39. package/schematics/ng-generate/control-flow-migration/bundle.js +36 -10
  40. package/schematics/ng-generate/control-flow-migration/bundle.js.map +2 -2
  41. package/schematics/ng-generate/standalone-migration/bundle.js +155 -63
  42. package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
  43. package/testing/index.d.ts +1 -1
  44. package/esm2022/primitives/event-dispatch/src/dom.mjs +0 -48
@@ -8505,7 +8505,7 @@ var scopedAtRuleIdentifiers = [
8505
8505
  ];
8506
8506
  var ShadowCss = class {
8507
8507
  constructor() {
8508
- this._animationDeclarationKeyframesRe = /(^|\s+)(?:(?:(['"])((?:\\\\|\\\2|(?!\2).)+)\2)|(-?[A-Za-z][\w\-]*))(?=[,\s]|$)/g;
8508
+ this._animationDeclarationKeyframesRe = /(^|\s+|,)(?:(?:(['"])((?:\\\\|\\\2|(?!\2).)+)\2)|(-?[A-Za-z][\w\-]*))(?=[,\s]|$)/g;
8509
8509
  }
8510
8510
  shimCssText(cssText, selector, hostSelector = "") {
8511
8511
  const comments = [];
@@ -8548,7 +8548,7 @@ var ShadowCss = class {
8548
8548
  });
8549
8549
  }
8550
8550
  _scopeAnimationRule(rule, scopeSelector, unscopedKeyframesSet) {
8551
- let content = rule.content.replace(/((?:^|\s+|;)(?:-webkit-)?animation(?:\s*):(?:\s*))([^;]+)/g, (_, start, animationDeclarations) => start + animationDeclarations.replace(this._animationDeclarationKeyframesRe, (original, leadingSpaces, quote = "", quotedName, nonQuotedName) => {
8551
+ let content = rule.content.replace(/((?:^|\s+|;)(?:-webkit-)?animation\s*:\s*),*([^;]+)/g, (_, start, animationDeclarations) => start + animationDeclarations.replace(this._animationDeclarationKeyframesRe, (original, leadingSpaces, quote = "", quotedName, nonQuotedName) => {
8552
8552
  if (quotedName) {
8553
8553
  return `${leadingSpaces}${this._scopeAnimationKeyframe(`${quote}${quotedName}${quote}`, scopeSelector, unscopedKeyframesSet)}`;
8554
8554
  } else {
@@ -12237,7 +12237,8 @@ function getScopeForView(view, parent) {
12237
12237
  scope.contextVariables.set(identifier, {
12238
12238
  kind: SemanticVariableKind.Identifier,
12239
12239
  name: null,
12240
- identifier
12240
+ identifier,
12241
+ local: false
12241
12242
  });
12242
12243
  }
12243
12244
  for (const op of view.create) {
@@ -12256,7 +12257,8 @@ function getScopeForView(view, parent) {
12256
12257
  variable: {
12257
12258
  kind: SemanticVariableKind.Identifier,
12258
12259
  name: null,
12259
- identifier: op.localRefs[offset].name
12260
+ identifier: op.localRefs[offset].name,
12261
+ local: false
12260
12262
  }
12261
12263
  });
12262
12264
  }
@@ -12268,7 +12270,8 @@ function getScopeForView(view, parent) {
12268
12270
  variable: {
12269
12271
  kind: SemanticVariableKind.Identifier,
12270
12272
  name: null,
12271
- identifier: op.declaredName
12273
+ identifier: op.declaredName,
12274
+ local: false
12272
12275
  }
12273
12276
  });
12274
12277
  break;
@@ -17025,7 +17028,7 @@ var _Tokenizer = class {
17025
17028
  const nameCursor = this._cursor.clone();
17026
17029
  let allowDigit = false;
17027
17030
  this._attemptCharCodeUntilFn((code) => {
17028
- if (isAsciiLetter(code) || code === $_ || allowDigit && isDigit(code)) {
17031
+ if (isAsciiLetter(code) || code == $$ || code === $_ || allowDigit && isDigit(code)) {
17029
17032
  allowDigit = true;
17030
17033
  return false;
17031
17034
  }
@@ -20768,11 +20771,22 @@ function resolveNames(job) {
20768
20771
  }
20769
20772
  function processLexicalScope2(unit, ops, savedView) {
20770
20773
  const scope = /* @__PURE__ */ new Map();
20774
+ const localDefinitions = /* @__PURE__ */ new Map();
20771
20775
  for (const op of ops) {
20772
20776
  switch (op.kind) {
20773
20777
  case OpKind.Variable:
20774
20778
  switch (op.variable.kind) {
20775
20779
  case SemanticVariableKind.Identifier:
20780
+ if (op.variable.local) {
20781
+ if (localDefinitions.has(op.variable.identifier)) {
20782
+ continue;
20783
+ }
20784
+ localDefinitions.set(op.variable.identifier, op.xref);
20785
+ } else if (scope.has(op.variable.identifier)) {
20786
+ continue;
20787
+ }
20788
+ scope.set(op.variable.identifier, op.xref);
20789
+ break;
20776
20790
  case SemanticVariableKind.Alias:
20777
20791
  if (scope.has(op.variable.identifier)) {
20778
20792
  continue;
@@ -20799,7 +20813,9 @@ function processLexicalScope2(unit, ops, savedView) {
20799
20813
  }
20800
20814
  transformExpressionsInOp(op, (expr) => {
20801
20815
  if (expr instanceof LexicalReadExpr) {
20802
- if (scope.has(expr.name)) {
20816
+ if (localDefinitions.has(expr.name)) {
20817
+ return new ReadVariableExpr(localDefinitions.get(expr.name));
20818
+ } else if (scope.has(expr.name)) {
20803
20819
  return new ReadVariableExpr(scope.get(expr.name));
20804
20820
  } else {
20805
20821
  return new ReadPropExpr(new ContextExpr(unit.job.root.xref), expr.name);
@@ -21620,7 +21636,8 @@ function generateLocalLetReferences(job) {
21620
21636
  const variable2 = {
21621
21637
  kind: SemanticVariableKind.Identifier,
21622
21638
  name: null,
21623
- identifier: op.declaredName
21639
+ identifier: op.declaredName,
21640
+ local: true
21624
21641
  };
21625
21642
  OpList.replace(op, createVariableOp(job.allocateXrefId(), variable2, new StoreLetExpr(op.target, op.value, op.sourceSpan), VariableFlags.None));
21626
21643
  }
@@ -26054,7 +26071,7 @@ function publishFacade(global) {
26054
26071
  }
26055
26072
 
26056
26073
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/version.mjs
26057
- var VERSION2 = new Version("18.1.0-next.4");
26074
+ var VERSION2 = new Version("18.1.0");
26058
26075
 
26059
26076
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
26060
26077
  var _I18N_ATTR = "i18n";
@@ -27158,7 +27175,7 @@ var MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = "18.0.0";
27158
27175
  function compileDeclareClassMetadata(metadata) {
27159
27176
  const definitionMap = new DefinitionMap();
27160
27177
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION));
27161
- definitionMap.set("version", literal("18.1.0-next.4"));
27178
+ definitionMap.set("version", literal("18.1.0"));
27162
27179
  definitionMap.set("ngImport", importExpr(Identifiers.core));
27163
27180
  definitionMap.set("type", metadata.type);
27164
27181
  definitionMap.set("decorators", metadata.decorators);
@@ -27177,7 +27194,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
27177
27194
  callbackReturnDefinitionMap.set("ctorParameters", (_a2 = metadata.ctorParameters) != null ? _a2 : literal(null));
27178
27195
  callbackReturnDefinitionMap.set("propDecorators", (_b2 = metadata.propDecorators) != null ? _b2 : literal(null));
27179
27196
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
27180
- definitionMap.set("version", literal("18.1.0-next.4"));
27197
+ definitionMap.set("version", literal("18.1.0"));
27181
27198
  definitionMap.set("ngImport", importExpr(Identifiers.core));
27182
27199
  definitionMap.set("type", metadata.type);
27183
27200
  definitionMap.set("resolveDeferredDeps", compileComponentMetadataAsyncResolver(dependencies));
@@ -27245,7 +27262,7 @@ function createDirectiveDefinitionMap(meta) {
27245
27262
  const definitionMap = new DefinitionMap();
27246
27263
  const minVersion = getMinimumVersionForPartialOutput(meta);
27247
27264
  definitionMap.set("minVersion", literal(minVersion));
27248
- definitionMap.set("version", literal("18.1.0-next.4"));
27265
+ definitionMap.set("version", literal("18.1.0"));
27249
27266
  definitionMap.set("type", meta.type.value);
27250
27267
  if (meta.isStandalone) {
27251
27268
  definitionMap.set("isStandalone", literal(meta.isStandalone));
@@ -27563,7 +27580,7 @@ var MINIMUM_PARTIAL_LINKER_VERSION2 = "12.0.0";
27563
27580
  function compileDeclareFactoryFunction(meta) {
27564
27581
  const definitionMap = new DefinitionMap();
27565
27582
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION2));
27566
- definitionMap.set("version", literal("18.1.0-next.4"));
27583
+ definitionMap.set("version", literal("18.1.0"));
27567
27584
  definitionMap.set("ngImport", importExpr(Identifiers.core));
27568
27585
  definitionMap.set("type", meta.type.value);
27569
27586
  definitionMap.set("deps", compileDependencies(meta.deps));
@@ -27586,7 +27603,7 @@ function compileDeclareInjectableFromMetadata(meta) {
27586
27603
  function createInjectableDefinitionMap(meta) {
27587
27604
  const definitionMap = new DefinitionMap();
27588
27605
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION3));
27589
- definitionMap.set("version", literal("18.1.0-next.4"));
27606
+ definitionMap.set("version", literal("18.1.0"));
27590
27607
  definitionMap.set("ngImport", importExpr(Identifiers.core));
27591
27608
  definitionMap.set("type", meta.type.value);
27592
27609
  if (meta.providedIn !== void 0) {
@@ -27624,7 +27641,7 @@ function compileDeclareInjectorFromMetadata(meta) {
27624
27641
  function createInjectorDefinitionMap(meta) {
27625
27642
  const definitionMap = new DefinitionMap();
27626
27643
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION4));
27627
- definitionMap.set("version", literal("18.1.0-next.4"));
27644
+ definitionMap.set("version", literal("18.1.0"));
27628
27645
  definitionMap.set("ngImport", importExpr(Identifiers.core));
27629
27646
  definitionMap.set("type", meta.type.value);
27630
27647
  definitionMap.set("providers", meta.providers);
@@ -27648,7 +27665,7 @@ function createNgModuleDefinitionMap(meta) {
27648
27665
  throw new Error("Invalid path! Local compilation mode should not get into the partial compilation path");
27649
27666
  }
27650
27667
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION5));
27651
- definitionMap.set("version", literal("18.1.0-next.4"));
27668
+ definitionMap.set("version", literal("18.1.0"));
27652
27669
  definitionMap.set("ngImport", importExpr(Identifiers.core));
27653
27670
  definitionMap.set("type", meta.type.value);
27654
27671
  if (meta.bootstrap.length > 0) {
@@ -27683,7 +27700,7 @@ function compileDeclarePipeFromMetadata(meta) {
27683
27700
  function createPipeDefinitionMap(meta) {
27684
27701
  const definitionMap = new DefinitionMap();
27685
27702
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION6));
27686
- definitionMap.set("version", literal("18.1.0-next.4"));
27703
+ definitionMap.set("version", literal("18.1.0"));
27687
27704
  definitionMap.set("ngImport", importExpr(Identifiers.core));
27688
27705
  definitionMap.set("type", meta.type.value);
27689
27706
  if (meta.isStandalone) {
@@ -27700,7 +27717,7 @@ function createPipeDefinitionMap(meta) {
27700
27717
  publishFacade(_global);
27701
27718
 
27702
27719
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/version.mjs
27703
- var VERSION3 = new Version("18.1.0-next.4");
27720
+ var VERSION3 = new Version("18.1.0");
27704
27721
 
27705
27722
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/emitter.mjs
27706
27723
  var import_typescript5 = __toESM(require("typescript"), 1);
@@ -27778,7 +27795,7 @@ var ErrorCode;
27778
27795
  ErrorCode2[ErrorCode2["DEFERRED_DEPENDENCY_IMPORTED_EAGERLY"] = 8014] = "DEFERRED_DEPENDENCY_IMPORTED_EAGERLY";
27779
27796
  ErrorCode2[ErrorCode2["ILLEGAL_LET_WRITE"] = 8015] = "ILLEGAL_LET_WRITE";
27780
27797
  ErrorCode2[ErrorCode2["LET_USED_BEFORE_DEFINITION"] = 8016] = "LET_USED_BEFORE_DEFINITION";
27781
- ErrorCode2[ErrorCode2["DUPLICATE_LET_DECLARATION"] = 8017] = "DUPLICATE_LET_DECLARATION";
27798
+ ErrorCode2[ErrorCode2["CONFLICTING_LET_DECLARATION"] = 8017] = "CONFLICTING_LET_DECLARATION";
27782
27799
  ErrorCode2[ErrorCode2["INVALID_BANANA_IN_BOX"] = 8101] = "INVALID_BANANA_IN_BOX";
27783
27800
  ErrorCode2[ErrorCode2["NULLISH_COALESCING_NOT_NULLABLE"] = 8102] = "NULLISH_COALESCING_NOT_NULLABLE";
27784
27801
  ErrorCode2[ErrorCode2["MISSING_CONTROL_FLOW_DIRECTIVE"] = 8103] = "MISSING_CONTROL_FLOW_DIRECTIVE";
@@ -27789,6 +27806,7 @@ var ErrorCode;
27789
27806
  ErrorCode2[ErrorCode2["SKIP_HYDRATION_NOT_STATIC"] = 8108] = "SKIP_HYDRATION_NOT_STATIC";
27790
27807
  ErrorCode2[ErrorCode2["INTERPOLATED_SIGNAL_NOT_INVOKED"] = 8109] = "INTERPOLATED_SIGNAL_NOT_INVOKED";
27791
27808
  ErrorCode2[ErrorCode2["UNSUPPORTED_INITIALIZER_API_USAGE"] = 8110] = "UNSUPPORTED_INITIALIZER_API_USAGE";
27809
+ ErrorCode2[ErrorCode2["UNINVOKED_FUNCTION_IN_EVENT_BINDING"] = 8111] = "UNINVOKED_FUNCTION_IN_EVENT_BINDING";
27792
27810
  ErrorCode2[ErrorCode2["INLINE_TCB_REQUIRED"] = 8900] = "INLINE_TCB_REQUIRED";
27793
27811
  ErrorCode2[ErrorCode2["INLINE_TYPE_CTOR_REQUIRED"] = 8901] = "INLINE_TYPE_CTOR_REQUIRED";
27794
27812
  ErrorCode2[ErrorCode2["INJECTABLE_DUPLICATE_PROV"] = 9001] = "INJECTABLE_DUPLICATE_PROV";
@@ -27890,6 +27908,7 @@ var ExtendedTemplateDiagnosticName;
27890
27908
  ExtendedTemplateDiagnosticName2["OPTIONAL_CHAIN_NOT_NULLABLE"] = "optionalChainNotNullable";
27891
27909
  ExtendedTemplateDiagnosticName2["MISSING_CONTROL_FLOW_DIRECTIVE"] = "missingControlFlowDirective";
27892
27910
  ExtendedTemplateDiagnosticName2["TEXT_ATTRIBUTE_NOT_BINDING"] = "textAttributeNotBinding";
27911
+ ExtendedTemplateDiagnosticName2["UNINVOKED_FUNCTION_IN_EVENT_BINDING"] = "uninvokedFunctionInEventBinding";
27893
27912
  ExtendedTemplateDiagnosticName2["MISSING_NGFOROF_LET"] = "missingNgForOfLet";
27894
27913
  ExtendedTemplateDiagnosticName2["SUFFIX_NOT_SUPPORTED"] = "suffixNotSupported";
27895
27914
  ExtendedTemplateDiagnosticName2["SKIP_HYDRATION_NOT_STATIC"] = "skipHydrationNotStatic";
@@ -32708,8 +32727,8 @@ var BINARY_OPERATORS3 = /* @__PURE__ */ new Map([
32708
32727
  [BinaryOperator.NullishCoalesce, "??"]
32709
32728
  ]);
32710
32729
  var ExpressionTranslatorVisitor = class {
32711
- constructor(factory9, imports, contextFile, options) {
32712
- this.factory = factory9;
32730
+ constructor(factory10, imports, contextFile, options) {
32731
+ this.factory = factory10;
32713
32732
  this.imports = imports;
32714
32733
  this.contextFile = contextFile;
32715
32734
  this.downlevelTaggedTemplates = options.downlevelTaggedTemplates === true;
@@ -40324,10 +40343,10 @@ Deferred blocks can only access triggers in same view, a parent embedded view or
40324
40343
  }
40325
40344
  this._diagnostics.push(makeTemplateDiagnostic(templateId, this.resolver.getSourceMapping(templateId), sourceSpan, import_typescript78.default.DiagnosticCategory.Error, ngErrorCode(ErrorCode.LET_USED_BEFORE_DEFINITION), `Cannot read @let declaration '${target.name}' before it has been defined.`));
40326
40345
  }
40327
- duplicateLetDeclaration(templateId, current) {
40346
+ conflictingDeclaration(templateId, decl) {
40328
40347
  const mapping = this.resolver.getSourceMapping(templateId);
40329
- const errorMsg = `Cannot declare @let called '${current.name}' as there is another @let declaration with the same name.`;
40330
- this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, current.sourceSpan, import_typescript78.default.DiagnosticCategory.Error, ngErrorCode(ErrorCode.DUPLICATE_LET_DECLARATION), errorMsg));
40348
+ const errorMsg = `Cannot declare @let called '${decl.name}' as there is another symbol in the template with the same name.`;
40349
+ this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, decl.sourceSpan, import_typescript78.default.DiagnosticCategory.Error, ngErrorCode(ErrorCode.CONFLICTING_LET_DECLARATION), errorMsg));
40331
40350
  }
40332
40351
  };
40333
40352
  function makeInlineDiagnostic(templateId, code, node, messageText, relatedInformation) {
@@ -41541,14 +41560,14 @@ var TcbIfOp = class extends TcbOp {
41541
41560
  const branchScope = this.getBranchScope(this.scope, branch, index);
41542
41561
  return import_typescript82.default.factory.createBlock(branchScope.render());
41543
41562
  }
41544
- const expressionScope = Scope3.forNodes(this.tcb, this.scope, branch, [], null);
41545
- expressionScope.render().forEach((stmt) => this.scope.addStatement(stmt));
41546
- this.expressionScopes.set(branch, expressionScope);
41547
- let expression = tcbExpression(branch.expression, this.tcb, expressionScope);
41563
+ const outerScope = Scope3.forNodes(this.tcb, this.scope, branch, [], null);
41564
+ outerScope.render().forEach((stmt) => this.scope.addStatement(stmt));
41565
+ this.expressionScopes.set(branch, outerScope);
41566
+ let expression = tcbExpression(branch.expression, this.tcb, this.scope);
41548
41567
  if (branch.expressionAlias !== null) {
41549
- expression = import_typescript82.default.factory.createBinaryExpression(import_typescript82.default.factory.createParenthesizedExpression(expression), import_typescript82.default.SyntaxKind.AmpersandAmpersandToken, expressionScope.resolve(branch.expressionAlias));
41568
+ expression = import_typescript82.default.factory.createBinaryExpression(import_typescript82.default.factory.createParenthesizedExpression(expression), import_typescript82.default.SyntaxKind.AmpersandAmpersandToken, outerScope.resolve(branch.expressionAlias));
41550
41569
  }
41551
- const bodyScope = this.getBranchScope(expressionScope, branch, index);
41570
+ const bodyScope = this.getBranchScope(outerScope, branch, index);
41552
41571
  return import_typescript82.default.factory.createIfStatement(expression, import_typescript82.default.factory.createBlock(bodyScope.render()), this.generateBranch(index + 1));
41553
41572
  }
41554
41573
  getBranchScope(parentScope, branch, index) {
@@ -41640,7 +41659,7 @@ var TcbForOfOp = class extends TcbOp {
41640
41659
  }
41641
41660
  const initializer = import_typescript82.default.factory.createVariableDeclarationList([import_typescript82.default.factory.createVariableDeclaration(initializerId)], import_typescript82.default.NodeFlags.Const);
41642
41661
  addParseSpanInfo(initializer, this.block.item.keySpan);
41643
- const expression = import_typescript82.default.factory.createNonNullExpression(tcbExpression(this.block.expression, this.tcb, loopScope));
41662
+ const expression = import_typescript82.default.factory.createNonNullExpression(tcbExpression(this.block.expression, this.tcb, this.scope));
41644
41663
  const trackTranslator = new TcbForLoopTrackTranslator(this.tcb, loopScope, this.block);
41645
41664
  const trackExpression = trackTranslator.translate(this.block.trackBy);
41646
41665
  const statements = [
@@ -41724,14 +41743,12 @@ var _Scope = class {
41724
41743
  }
41725
41744
  for (const node of children) {
41726
41745
  scope.appendNode(node);
41727
- if (node instanceof LetDeclaration) {
41728
- const opIndex = scope.opQueue.push(new TcbLetDeclarationOp(tcb, scope, node)) - 1;
41729
- if (scope.letDeclOpMap.has(node.name)) {
41730
- tcb.oobRecorder.duplicateLetDeclaration(tcb.id, node);
41731
- } else {
41732
- scope.letDeclOpMap.set(node.name, opIndex);
41733
- }
41734
- }
41746
+ }
41747
+ for (const variable2 of scope.varMap.keys()) {
41748
+ _Scope.checkConflictingLet(scope, variable2);
41749
+ }
41750
+ for (const ref of scope.referenceOpMap.keys()) {
41751
+ _Scope.checkConflictingLet(scope, ref);
41735
41752
  }
41736
41753
  return scope;
41737
41754
  }
@@ -41795,7 +41812,7 @@ var _Scope = class {
41795
41812
  if (ref instanceof Reference && this.referenceOpMap.has(ref)) {
41796
41813
  return this.resolveOp(this.referenceOpMap.get(ref));
41797
41814
  } else if (ref instanceof LetDeclaration && this.letDeclOpMap.has(ref.name)) {
41798
- return this.resolveOp(this.letDeclOpMap.get(ref.name));
41815
+ return this.resolveOp(this.letDeclOpMap.get(ref.name).opIndex);
41799
41816
  } else if (ref instanceof Variable && this.varMap.has(ref)) {
41800
41817
  const opIndexOrNode = this.varMap.get(ref);
41801
41818
  return typeof opIndexOrNode === "number" ? this.resolveOp(opIndexOrNode) : opIndexOrNode;
@@ -41871,6 +41888,13 @@ var _Scope = class {
41871
41888
  this.appendIcuExpressions(node);
41872
41889
  } else if (node instanceof Content) {
41873
41890
  this.appendChildren(node);
41891
+ } else if (node instanceof LetDeclaration) {
41892
+ const opIndex = this.opQueue.push(new TcbLetDeclarationOp(this.tcb, this, node)) - 1;
41893
+ if (this.isLocal(node)) {
41894
+ this.tcb.oobRecorder.conflictingDeclaration(this.tcb.id, node);
41895
+ } else {
41896
+ this.letDeclOpMap.set(node.name, { opIndex, node });
41897
+ }
41874
41898
  }
41875
41899
  }
41876
41900
  appendChildren(node) {
@@ -42036,6 +42060,11 @@ var _Scope = class {
42036
42060
  this.tcb.oobRecorder.inaccessibleDeferredTriggerElement(this.tcb.id, trigger);
42037
42061
  }
42038
42062
  }
42063
+ static checkConflictingLet(scope, node) {
42064
+ if (scope.letDeclOpMap.has(node.name)) {
42065
+ scope.tcb.oobRecorder.conflictingDeclaration(scope.tcb.id, scope.letDeclOpMap.get(node.name).node);
42066
+ }
42067
+ }
42039
42068
  };
42040
42069
  var Scope3 = _Scope;
42041
42070
  (() => {
@@ -42073,10 +42102,14 @@ var TcbExpressionTranslator = class {
42073
42102
  resolve(ast) {
42074
42103
  if (ast instanceof PropertyRead && ast.receiver instanceof ImplicitReceiver) {
42075
42104
  const target = this.tcb.boundTarget.getExpressionTarget(ast);
42076
- if (target instanceof LetDeclaration) {
42077
- this.validateLetDeclarationAccess(target, ast);
42105
+ const targetExpression = target === null ? null : this.getTargetNodeExpression(target, ast);
42106
+ if (target instanceof LetDeclaration && !this.isValidLetDeclarationAccess(target, ast)) {
42107
+ this.tcb.oobRecorder.letUsedBeforeDefinition(this.tcb.id, ast, target);
42108
+ if (targetExpression !== null) {
42109
+ return import_typescript82.default.factory.createAsExpression(targetExpression, import_typescript82.default.factory.createKeywordTypeNode(import_typescript82.default.SyntaxKind.AnyKeyword));
42110
+ }
42078
42111
  }
42079
- return target === null ? null : this.getTargetNodeExpression(target, ast);
42112
+ return targetExpression;
42080
42113
  } else if (ast instanceof PropertyWrite && ast.receiver instanceof ImplicitReceiver) {
42081
42114
  const target = this.tcb.boundTarget.getExpressionTarget(ast);
42082
42115
  if (target === null) {
@@ -42147,13 +42180,11 @@ var TcbExpressionTranslator = class {
42147
42180
  addParseSpanInfo(expr, expressionNode.sourceSpan);
42148
42181
  return expr;
42149
42182
  }
42150
- validateLetDeclarationAccess(target, ast) {
42183
+ isValidLetDeclarationAccess(target, ast) {
42151
42184
  const targetStart = target.sourceSpan.start.offset;
42152
42185
  const targetEnd = target.sourceSpan.end.offset;
42153
42186
  const astStart = ast.sourceSpan.start;
42154
- if ((targetStart > astStart || astStart >= targetStart && astStart <= targetEnd) && this.scope.isLocal(target)) {
42155
- this.tcb.oobRecorder.letUsedBeforeDefinition(this.tcb.id, ast, target);
42156
- }
42187
+ return targetStart < astStart && astStart > targetEnd || !this.scope.isLocal(target);
42157
42188
  }
42158
42189
  };
42159
42190
  function tcbCallTypeCtor(dir, tcb, inputs) {
@@ -42297,7 +42328,8 @@ var TcbEventHandlerTranslator = class extends TcbExpressionTranslator {
42297
42328
  }
42298
42329
  return super.resolve(ast);
42299
42330
  }
42300
- validateLetDeclarationAccess() {
42331
+ isValidLetDeclarationAccess() {
42332
+ return true;
42301
42333
  }
42302
42334
  };
42303
42335
  var TcbForLoopTrackTranslator = class extends TcbExpressionTranslator {
@@ -45751,7 +45783,7 @@ function extractGenerics(declaration) {
45751
45783
 
45752
45784
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/jsdoc_extractor.mjs
45753
45785
  var import_typescript99 = __toESM(require("typescript"), 1);
45754
- var decoratorExpression = /@(?=(Injectable|Component|Directive|Pipe|NgModule|Input|Output|HostBinding|HostListener|Inject|Optional|Self|Host|SkipSelf))/g;
45786
+ var decoratorExpression = /@(?=(Injectable|Component|Directive|Pipe|NgModule|Input|Output|HostBinding|HostListener|Inject|Optional|Self|Host|SkipSelf|ViewChild|ViewChildren|ContentChild|ContentChildren))/g;
45755
45787
  function extractJsDocTags(node) {
45756
45788
  const escapedNode = getEscapedNode(node);
45757
45789
  return import_typescript99.default.getJSDocTags(escapedNode).map((t) => {
@@ -45808,7 +45840,11 @@ var FunctionExtractor = class {
45808
45840
  extract() {
45809
45841
  var _a2;
45810
45842
  const signature = this.typeChecker.getSignatureFromDeclaration(this.declaration);
45811
- const returnType = signature ? this.typeChecker.typeToString(this.typeChecker.getReturnTypeOfSignature(signature)) : "unknown";
45843
+ const returnType = signature ? this.typeChecker.typeToString(
45844
+ this.typeChecker.getReturnTypeOfSignature(signature),
45845
+ void 0,
45846
+ import_typescript100.default.TypeFormatFlags.NoTypeReduction | import_typescript100.default.TypeFormatFlags.NoTruncation
45847
+ ) : "unknown";
45812
45848
  const jsdocsTags = extractJsDocTags(this.declaration);
45813
45849
  return {
45814
45850
  params: extractAllParams(this.declaration.parameters, this.typeChecker),
@@ -46396,7 +46432,7 @@ function filterSignatureDeclarations(signatures) {
46396
46432
  for (const signature of signatures) {
46397
46433
  const decl = signature.getDeclaration();
46398
46434
  if (import_typescript106.default.isFunctionDeclaration(decl) || import_typescript106.default.isCallSignatureDeclaration(decl)) {
46399
- result.push(decl);
46435
+ result.push({ signature, decl });
46400
46436
  }
46401
46437
  }
46402
46438
  return result;
@@ -46404,16 +46440,20 @@ function filterSignatureDeclarations(signatures) {
46404
46440
  function extractFunctionWithOverloads(name, signatures, typeChecker) {
46405
46441
  return {
46406
46442
  name,
46407
- signatures: filterSignatureDeclarations(signatures).map((s) => ({
46443
+ signatures: filterSignatureDeclarations(signatures).map(({ decl, signature }) => ({
46408
46444
  name,
46409
46445
  entryType: EntryType.Function,
46410
- description: extractJsDocDescription(s),
46411
- generics: extractGenerics(s),
46446
+ description: extractJsDocDescription(decl),
46447
+ generics: extractGenerics(decl),
46412
46448
  isNewType: false,
46413
- jsdocTags: extractJsDocTags(s),
46414
- params: extractAllParams(s.parameters, typeChecker),
46415
- rawComment: extractRawJsDoc(s),
46416
- returnType: typeChecker.typeToString(typeChecker.getReturnTypeOfSignature(typeChecker.getSignatureFromDeclaration(s)))
46449
+ jsdocTags: extractJsDocTags(decl),
46450
+ params: extractAllParams(decl.parameters, typeChecker),
46451
+ rawComment: extractRawJsDoc(decl),
46452
+ returnType: typeChecker.typeToString(
46453
+ typeChecker.getReturnTypeOfSignature(signature),
46454
+ void 0,
46455
+ import_typescript106.default.TypeFormatFlags.NoTypeReduction | import_typescript106.default.TypeFormatFlags.NoTruncation
46456
+ )
46417
46457
  })),
46418
46458
  implementation: null
46419
46459
  };
@@ -48141,6 +48181,57 @@ var factory8 = {
48141
48181
  create: () => new TextAttributeNotBindingSpec()
48142
48182
  };
48143
48183
 
48184
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/uninvoked_function_in_event_binding/index.mjs
48185
+ var UninvokedFunctionInEventBindingSpec = class extends TemplateCheckWithVisitor {
48186
+ constructor() {
48187
+ super(...arguments);
48188
+ this.code = ErrorCode.UNINVOKED_FUNCTION_IN_EVENT_BINDING;
48189
+ }
48190
+ visitNode(ctx, component, node) {
48191
+ if (!(node instanceof BoundEvent))
48192
+ return [];
48193
+ if (node.type !== ParsedEventType.Regular && node.type !== ParsedEventType.Animation)
48194
+ return [];
48195
+ if (!(node.handler instanceof ASTWithSource))
48196
+ return [];
48197
+ const sourceExpressionText = node.handler.source || "";
48198
+ if (node.handler.ast instanceof Chain) {
48199
+ return node.handler.ast.expressions.flatMap((expression) => assertExpressionInvoked(expression, component, node, sourceExpressionText, ctx));
48200
+ }
48201
+ if (node.handler.ast instanceof Conditional) {
48202
+ const { trueExp, falseExp } = node.handler.ast;
48203
+ return [trueExp, falseExp].flatMap((expression) => assertExpressionInvoked(expression, component, node, sourceExpressionText, ctx));
48204
+ }
48205
+ return assertExpressionInvoked(node.handler.ast, component, node, sourceExpressionText, ctx);
48206
+ }
48207
+ };
48208
+ function assertExpressionInvoked(expression, component, node, expressionText, ctx) {
48209
+ var _a2;
48210
+ if (expression instanceof Call || expression instanceof SafeCall) {
48211
+ return [];
48212
+ }
48213
+ if (!(expression instanceof PropertyRead) && !(expression instanceof SafePropertyRead)) {
48214
+ return [];
48215
+ }
48216
+ const symbol = ctx.templateTypeChecker.getSymbolOfNode(expression, component);
48217
+ if (symbol !== null && symbol.kind === SymbolKind.Expression) {
48218
+ if (((_a2 = symbol.tsType.getCallSignatures()) == null ? void 0 : _a2.length) > 0) {
48219
+ const fullExpressionText = generateStringFromExpression(expression, expressionText);
48220
+ const errorString = `Function in event binding should be invoked: ${fullExpressionText}()`;
48221
+ return [ctx.makeTemplateDiagnostic(node.sourceSpan, errorString)];
48222
+ }
48223
+ }
48224
+ return [];
48225
+ }
48226
+ function generateStringFromExpression(expression, source) {
48227
+ return source.substring(expression.span.start, expression.span.end);
48228
+ }
48229
+ var factory9 = {
48230
+ code: ErrorCode.UNINVOKED_FUNCTION_IN_EVENT_BINDING,
48231
+ name: ExtendedTemplateDiagnosticName.UNINVOKED_FUNCTION_IN_EVENT_BINDING,
48232
+ create: () => new UninvokedFunctionInEventBindingSpec()
48233
+ };
48234
+
48144
48235
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/src/extended_template_checker.mjs
48145
48236
  var import_typescript116 = __toESM(require("typescript"), 1);
48146
48237
 
@@ -48158,12 +48249,12 @@ var ExtendedTemplateCheckerImpl = class {
48158
48249
  var _a2, _b2, _c2, _d2, _e2;
48159
48250
  this.partialCtx = { templateTypeChecker, typeChecker };
48160
48251
  this.templateChecks = /* @__PURE__ */ new Map();
48161
- for (const factory9 of templateCheckFactories) {
48162
- const category = diagnosticLabelToCategory((_e2 = (_d2 = (_b2 = (_a2 = options == null ? void 0 : options.extendedDiagnostics) == null ? void 0 : _a2.checks) == null ? void 0 : _b2[factory9.name]) != null ? _d2 : (_c2 = options == null ? void 0 : options.extendedDiagnostics) == null ? void 0 : _c2.defaultCategory) != null ? _e2 : DiagnosticCategoryLabel.Warning);
48252
+ for (const factory10 of templateCheckFactories) {
48253
+ const category = diagnosticLabelToCategory((_e2 = (_d2 = (_b2 = (_a2 = options == null ? void 0 : options.extendedDiagnostics) == null ? void 0 : _a2.checks) == null ? void 0 : _b2[factory10.name]) != null ? _d2 : (_c2 = options == null ? void 0 : options.extendedDiagnostics) == null ? void 0 : _c2.defaultCategory) != null ? _e2 : DiagnosticCategoryLabel.Warning);
48163
48254
  if (category === null) {
48164
48255
  continue;
48165
48256
  }
48166
- const check = factory9.create(options);
48257
+ const check = factory10.create(options);
48167
48258
  if (check === null) {
48168
48259
  continue;
48169
48260
  }
@@ -48213,11 +48304,12 @@ var ALL_DIAGNOSTIC_FACTORIES = [
48213
48304
  factory8,
48214
48305
  factory4,
48215
48306
  factory7,
48216
- factory
48307
+ factory,
48308
+ factory9
48217
48309
  ];
48218
48310
  var SUPPORTED_DIAGNOSTIC_NAMES = /* @__PURE__ */ new Set([
48219
48311
  ExtendedTemplateDiagnosticName.CONTROL_FLOW_PREVENTING_CONTENT_PROJECTION,
48220
- ...ALL_DIAGNOSTIC_FACTORIES.map((factory9) => factory9.name)
48312
+ ...ALL_DIAGNOSTIC_FACTORIES.map((factory10) => factory10.name)
48221
48313
  ]);
48222
48314
 
48223
48315
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/template_semantics/src/template_semantics_checker.mjs