@angular/compiler 22.0.0-next.3 → 22.0.0-next.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v22.0.0-next.3
2
+ * @license Angular v22.0.0-next.4
3
3
  * (c) 2010-2026 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
@@ -536,7 +536,7 @@ function fingerprint(str) {
536
536
  let lo = hash32(view, utf8.length, 102072);
537
537
  if (hi == 0 && (lo == 0 || lo == 1)) {
538
538
  hi = hi ^ 0x130f9bef;
539
- lo = lo ^ -0x6b5f56d8;
539
+ lo = lo ^ -1801410264;
540
540
  }
541
541
  return BigInt.asUintN(32, BigInt(hi)) << BigInt(32) | BigInt.asUintN(32, BigInt(lo));
542
542
  }
@@ -818,9 +818,11 @@ function areAllEquivalent(base, other) {
818
818
  return areAllEquivalentPredicate(base, other, (baseElement, otherElement) => baseElement.isEquivalent(otherElement));
819
819
  }
820
820
  class Expression {
821
+ leadingComments;
821
822
  type;
822
823
  sourceSpan;
823
- constructor(type, sourceSpan) {
824
+ constructor(type, sourceSpan, leadingComments) {
825
+ this.leadingComments = leadingComments;
824
826
  this.type = type || null;
825
827
  this.sourceSpan = sourceSpan || null;
826
828
  }
@@ -830,13 +832,13 @@ class Expression {
830
832
  key(index, type, sourceSpan) {
831
833
  return new ReadKeyExpr(this, index, type, sourceSpan);
832
834
  }
833
- callFn(params, sourceSpan, pure) {
834
- return new InvokeFunctionExpr(this, params, null, sourceSpan, pure);
835
+ callFn(params, sourceSpan, pure, leadingComments) {
836
+ return new InvokeFunctionExpr(this, params, null, sourceSpan, pure, leadingComments);
835
837
  }
836
- instantiate(params, type, sourceSpan) {
838
+ instantiate(params, type, sourceSpan, leadingComments) {
837
839
  return new InstantiateExpr(this, params, type, sourceSpan);
838
840
  }
839
- conditional(trueCase, falseCase = null, sourceSpan) {
841
+ conditional(trueCase, falseCase = null, sourceSpan, leadingComments) {
840
842
  return new ConditionalExpr(this, trueCase, falseCase, null, sourceSpan);
841
843
  }
842
844
  equals(rhs, sourceSpan) {
@@ -899,14 +901,14 @@ class Expression {
899
901
  nullishCoalesce(rhs, sourceSpan) {
900
902
  return new BinaryOperatorExpr(BinaryOperator.NullishCoalesce, this, rhs, null, sourceSpan);
901
903
  }
902
- toStmt() {
903
- return new ExpressionStatement(this, null);
904
+ toStmt(leadingComments) {
905
+ return new ExpressionStatement(this, null, leadingComments);
904
906
  }
905
907
  }
906
908
  class ReadVarExpr extends Expression {
907
909
  name;
908
- constructor(name, type, sourceSpan) {
909
- super(type, sourceSpan);
910
+ constructor(name, type, sourceSpan, leadingComments) {
911
+ super(type, sourceSpan, leadingComments);
910
912
  this.name = name;
911
913
  }
912
914
  isEquivalent(e) {
@@ -927,8 +929,8 @@ class ReadVarExpr extends Expression {
927
929
  }
928
930
  class TypeofExpr extends Expression {
929
931
  expr;
930
- constructor(expr, type, sourceSpan) {
931
- super(type, sourceSpan);
932
+ constructor(expr, type, sourceSpan, leadingComments) {
933
+ super(type, sourceSpan, leadingComments);
932
934
  this.expr = expr;
933
935
  }
934
936
  visitExpression(visitor, context) {
@@ -946,8 +948,8 @@ class TypeofExpr extends Expression {
946
948
  }
947
949
  class VoidExpr extends Expression {
948
950
  expr;
949
- constructor(expr, type, sourceSpan) {
950
- super(type, sourceSpan);
951
+ constructor(expr, type, sourceSpan, leadingComments) {
952
+ super(type, sourceSpan, leadingComments);
951
953
  this.expr = expr;
952
954
  }
953
955
  visitExpression(visitor, context) {
@@ -965,8 +967,8 @@ class VoidExpr extends Expression {
965
967
  }
966
968
  class WrappedNodeExpr extends Expression {
967
969
  node;
968
- constructor(node, type, sourceSpan) {
969
- super(type, sourceSpan);
970
+ constructor(node, type, sourceSpan, leadingComments) {
971
+ super(type, sourceSpan, leadingComments);
970
972
  this.node = node;
971
973
  }
972
974
  isEquivalent(e) {
@@ -986,8 +988,8 @@ class InvokeFunctionExpr extends Expression {
986
988
  fn;
987
989
  args;
988
990
  pure;
989
- constructor(fn, args, type, sourceSpan, pure = false) {
990
- super(type, sourceSpan);
991
+ constructor(fn, args, type, sourceSpan, pure = false, leadingComments) {
992
+ super(type, sourceSpan, leadingComments);
991
993
  this.fn = fn;
992
994
  this.args = args;
993
995
  this.pure = pure;
@@ -1011,8 +1013,8 @@ class InvokeFunctionExpr extends Expression {
1011
1013
  class TaggedTemplateLiteralExpr extends Expression {
1012
1014
  tag;
1013
1015
  template;
1014
- constructor(tag, template, type, sourceSpan) {
1015
- super(type, sourceSpan);
1016
+ constructor(tag, template, type, sourceSpan, leadingComments) {
1017
+ super(type, sourceSpan, leadingComments);
1016
1018
  this.tag = tag;
1017
1019
  this.template = template;
1018
1020
  }
@@ -1032,8 +1034,8 @@ class TaggedTemplateLiteralExpr extends Expression {
1032
1034
  class InstantiateExpr extends Expression {
1033
1035
  classExpr;
1034
1036
  args;
1035
- constructor(classExpr, args, type, sourceSpan) {
1036
- super(type, sourceSpan);
1037
+ constructor(classExpr, args, type, sourceSpan, leadingComments) {
1038
+ super(type, sourceSpan, leadingComments);
1037
1039
  this.classExpr = classExpr;
1038
1040
  this.args = args;
1039
1041
  }
@@ -1053,8 +1055,8 @@ class InstantiateExpr extends Expression {
1053
1055
  class RegularExpressionLiteralExpr extends Expression {
1054
1056
  body;
1055
1057
  flags;
1056
- constructor(body, flags, sourceSpan) {
1057
- super(null, sourceSpan);
1058
+ constructor(body, flags, sourceSpan, leadingComments) {
1059
+ super(null, sourceSpan, leadingComments);
1058
1060
  this.body = body;
1059
1061
  this.flags = flags;
1060
1062
  }
@@ -1073,8 +1075,8 @@ class RegularExpressionLiteralExpr extends Expression {
1073
1075
  }
1074
1076
  class LiteralExpr extends Expression {
1075
1077
  value;
1076
- constructor(value, type, sourceSpan) {
1077
- super(type, sourceSpan);
1078
+ constructor(value, type, sourceSpan, leadingComments) {
1079
+ super(type, sourceSpan, leadingComments);
1078
1080
  this.value = value;
1079
1081
  }
1080
1082
  isEquivalent(e) {
@@ -1093,8 +1095,8 @@ class LiteralExpr extends Expression {
1093
1095
  class TemplateLiteralExpr extends Expression {
1094
1096
  elements;
1095
1097
  expressions;
1096
- constructor(elements, expressions, sourceSpan) {
1097
- super(null, sourceSpan);
1098
+ constructor(elements, expressions, sourceSpan, leadingComments) {
1099
+ super(null, sourceSpan, leadingComments);
1098
1100
  this.elements = elements;
1099
1101
  this.expressions = expressions;
1100
1102
  }
@@ -1114,8 +1116,8 @@ class TemplateLiteralExpr extends Expression {
1114
1116
  class TemplateLiteralElementExpr extends Expression {
1115
1117
  text;
1116
1118
  rawText;
1117
- constructor(text, sourceSpan, rawText) {
1118
- super(STRING_TYPE, sourceSpan);
1119
+ constructor(text, sourceSpan, rawText, leadingComments) {
1120
+ super(STRING_TYPE, sourceSpan, leadingComments);
1119
1121
  this.text = text;
1120
1122
  this.rawText = rawText ?? escapeForTemplateLiteral(escapeSlashes(text));
1121
1123
  }
@@ -1158,8 +1160,8 @@ class LocalizedString extends Expression {
1158
1160
  messageParts;
1159
1161
  placeHolderNames;
1160
1162
  expressions;
1161
- constructor(metaBlock, messageParts, placeHolderNames, expressions, sourceSpan) {
1162
- super(STRING_TYPE, sourceSpan);
1163
+ constructor(metaBlock, messageParts, placeHolderNames, expressions, sourceSpan, leadingComments) {
1164
+ super(STRING_TYPE, sourceSpan, leadingComments);
1163
1165
  this.metaBlock = metaBlock;
1164
1166
  this.messageParts = messageParts;
1165
1167
  this.placeHolderNames = placeHolderNames;
@@ -1230,8 +1232,8 @@ function createCookedRawString(metaBlock, messagePart, range) {
1230
1232
  class ExternalExpr extends Expression {
1231
1233
  value;
1232
1234
  typeParams;
1233
- constructor(value, type, typeParams = null, sourceSpan) {
1234
- super(type, sourceSpan);
1235
+ constructor(value, type, typeParams = null, sourceSpan, leadingComments) {
1236
+ super(type, sourceSpan, leadingComments);
1235
1237
  this.value = value;
1236
1238
  this.typeParams = typeParams;
1237
1239
  }
@@ -1260,8 +1262,8 @@ class ConditionalExpr extends Expression {
1260
1262
  condition;
1261
1263
  falseCase;
1262
1264
  trueCase;
1263
- constructor(condition, trueCase, falseCase = null, type, sourceSpan) {
1264
- super(type || trueCase.type, sourceSpan);
1265
+ constructor(condition, trueCase, falseCase = null, type, sourceSpan, leadingComments) {
1266
+ super(type || trueCase.type, sourceSpan, leadingComments);
1265
1267
  this.condition = condition;
1266
1268
  this.falseCase = falseCase;
1267
1269
  this.trueCase = trueCase;
@@ -1282,8 +1284,8 @@ class ConditionalExpr extends Expression {
1282
1284
  class DynamicImportExpr extends Expression {
1283
1285
  url;
1284
1286
  urlComment;
1285
- constructor(url, sourceSpan, urlComment) {
1286
- super(null, sourceSpan);
1287
+ constructor(url, sourceSpan, urlComment, leadingComments) {
1288
+ super(null, sourceSpan, leadingComments);
1287
1289
  this.url = url;
1288
1290
  this.urlComment = urlComment;
1289
1291
  }
@@ -1302,8 +1304,8 @@ class DynamicImportExpr extends Expression {
1302
1304
  }
1303
1305
  class NotExpr extends Expression {
1304
1306
  condition;
1305
- constructor(condition, sourceSpan) {
1306
- super(BOOL_TYPE, sourceSpan);
1307
+ constructor(condition, sourceSpan, leadingComments) {
1308
+ super(BOOL_TYPE, sourceSpan, leadingComments);
1307
1309
  this.condition = condition;
1308
1310
  }
1309
1311
  isEquivalent(e) {
@@ -1337,8 +1339,8 @@ class FunctionExpr extends Expression {
1337
1339
  params;
1338
1340
  statements;
1339
1341
  name;
1340
- constructor(params, statements, type, sourceSpan, name) {
1341
- super(type, sourceSpan);
1342
+ constructor(params, statements, type, sourceSpan, name, leadingComments) {
1343
+ super(type, sourceSpan, leadingComments);
1342
1344
  this.params = params;
1343
1345
  this.statements = statements;
1344
1346
  this.name = name;
@@ -1362,8 +1364,8 @@ class FunctionExpr extends Expression {
1362
1364
  let ArrowFunctionExpr$1 = class ArrowFunctionExpr extends Expression {
1363
1365
  params;
1364
1366
  body;
1365
- constructor(params, body, type, sourceSpan) {
1366
- super(type, sourceSpan);
1367
+ constructor(params, body, type, sourceSpan, leadingComments) {
1368
+ super(type, sourceSpan, leadingComments);
1367
1369
  this.params = params;
1368
1370
  this.body = body;
1369
1371
  }
@@ -1396,8 +1398,8 @@ class UnaryOperatorExpr extends Expression {
1396
1398
  operator;
1397
1399
  expr;
1398
1400
  parens;
1399
- constructor(operator, expr, type, sourceSpan, parens = true) {
1400
- super(type || NUMBER_TYPE, sourceSpan);
1401
+ constructor(operator, expr, type, sourceSpan, parens = true, leadingComments) {
1402
+ super(type || NUMBER_TYPE, sourceSpan, leadingComments);
1401
1403
  this.operator = operator;
1402
1404
  this.expr = expr;
1403
1405
  this.parens = parens;
@@ -1417,8 +1419,8 @@ class UnaryOperatorExpr extends Expression {
1417
1419
  }
1418
1420
  class ParenthesizedExpr extends Expression {
1419
1421
  expr;
1420
- constructor(expr, type, sourceSpan) {
1421
- super(type, sourceSpan);
1422
+ constructor(expr, type, sourceSpan, leadingComments) {
1423
+ super(type, sourceSpan, leadingComments);
1422
1424
  this.expr = expr;
1423
1425
  }
1424
1426
  visitExpression(visitor, context) {
@@ -1438,8 +1440,8 @@ class BinaryOperatorExpr extends Expression {
1438
1440
  operator;
1439
1441
  rhs;
1440
1442
  lhs;
1441
- constructor(operator, lhs, rhs, type, sourceSpan) {
1442
- super(type || lhs.type, sourceSpan);
1443
+ constructor(operator, lhs, rhs, type, sourceSpan, leadingComments) {
1444
+ super(type || lhs.type, sourceSpan, leadingComments);
1443
1445
  this.operator = operator;
1444
1446
  this.rhs = rhs;
1445
1447
  this.lhs = lhs;
@@ -1464,8 +1466,8 @@ class BinaryOperatorExpr extends Expression {
1464
1466
  class ReadPropExpr extends Expression {
1465
1467
  receiver;
1466
1468
  name;
1467
- constructor(receiver, name, type, sourceSpan) {
1468
- super(type, sourceSpan);
1469
+ constructor(receiver, name, type, sourceSpan, leadingComments) {
1470
+ super(type, sourceSpan, leadingComments);
1469
1471
  this.receiver = receiver;
1470
1472
  this.name = name;
1471
1473
  }
@@ -1491,8 +1493,8 @@ class ReadPropExpr extends Expression {
1491
1493
  class ReadKeyExpr extends Expression {
1492
1494
  receiver;
1493
1495
  index;
1494
- constructor(receiver, index, type, sourceSpan) {
1495
- super(type, sourceSpan);
1496
+ constructor(receiver, index, type, sourceSpan, leadingComments) {
1497
+ super(type, sourceSpan, leadingComments);
1496
1498
  this.receiver = receiver;
1497
1499
  this.index = index;
1498
1500
  }
@@ -1514,8 +1516,8 @@ class ReadKeyExpr extends Expression {
1514
1516
  }
1515
1517
  class LiteralArrayExpr extends Expression {
1516
1518
  entries;
1517
- constructor(entries, type, sourceSpan) {
1518
- super(type, sourceSpan);
1519
+ constructor(entries, type, sourceSpan, leadingComments) {
1520
+ super(type, sourceSpan, leadingComments);
1519
1521
  this.entries = entries;
1520
1522
  }
1521
1523
  isConstant() {
@@ -1568,8 +1570,8 @@ class LiteralMapSpreadAssignment {
1568
1570
  class LiteralMapExpr extends Expression {
1569
1571
  entries;
1570
1572
  valueType = null;
1571
- constructor(entries, type, sourceSpan) {
1572
- super(type, sourceSpan);
1573
+ constructor(entries, type, sourceSpan, leadingComments) {
1574
+ super(type, sourceSpan, leadingComments);
1573
1575
  this.entries = entries;
1574
1576
  if (type) {
1575
1577
  this.valueType = type.valueType;
@@ -1591,8 +1593,8 @@ class LiteralMapExpr extends Expression {
1591
1593
  }
1592
1594
  class CommaExpr extends Expression {
1593
1595
  parts;
1594
- constructor(parts, sourceSpan) {
1595
- super(parts[parts.length - 1].type, sourceSpan);
1596
+ constructor(parts, sourceSpan, leadingComments) {
1597
+ super(parts[parts.length - 1].type, sourceSpan, leadingComments);
1596
1598
  this.parts = parts;
1597
1599
  }
1598
1600
  isEquivalent(e) {
@@ -1610,8 +1612,8 @@ class CommaExpr extends Expression {
1610
1612
  }
1611
1613
  class SpreadElementExpr extends Expression {
1612
1614
  expression;
1613
- constructor(expression, sourceSpan) {
1614
- super(null, sourceSpan);
1615
+ constructor(expression, sourceSpan, leadingComments) {
1616
+ super(null, sourceSpan, leadingComments);
1615
1617
  this.expression = expression;
1616
1618
  }
1617
1619
  isEquivalent(e) {
@@ -1949,8 +1951,8 @@ function leadingComment(text, multiline = false, trailingNewline = true) {
1949
1951
  function jsDocComment(tags = []) {
1950
1952
  return new JSDocComment(tags);
1951
1953
  }
1952
- function variable(name, type, sourceSpan) {
1953
- return new ReadVarExpr(name, type, sourceSpan);
1954
+ function variable(name, type, sourceSpan, leadingComments) {
1955
+ return new ReadVarExpr(name, type, sourceSpan, leadingComments);
1954
1956
  }
1955
1957
  function importExpr(id, typeParams = null, sourceSpan) {
1956
1958
  return new ExternalExpr(id, null, typeParams, sourceSpan);
@@ -3339,10 +3341,10 @@ function toBase64Digit(value) {
3339
3341
  return B64_DIGITS[value];
3340
3342
  }
3341
3343
 
3342
- const _SINGLE_QUOTE_ESCAPE_STRING_RE = /'|\\|\n|\r|\$/g;
3343
- const _LEGAL_IDENTIFIER_RE = /^[$A-Z_][0-9A-Z_$]*$/i;
3344
- const _INDENT_WITH = ' ';
3345
- class _EmittedLine {
3344
+ const SINGLE_QUOTE_ESCAPE_STRING_RE = /'|\\|\n|\r|\$/g;
3345
+ const LEGAL_IDENTIFIER_RE = /^[$A-Z_][0-9A-Z_$]*$/i;
3346
+ const INDENT_WITH = ' ';
3347
+ class EmittedLine {
3346
3348
  indent;
3347
3349
  partsLength = 0;
3348
3350
  parts = [];
@@ -3360,7 +3362,7 @@ class EmitterVisitorContext {
3360
3362
  _lines;
3361
3363
  constructor(_indent) {
3362
3364
  this._indent = _indent;
3363
- this._lines = [new _EmittedLine(_indent)];
3365
+ this._lines = [new EmittedLine(_indent)];
3364
3366
  }
3365
3367
  get _currentLine() {
3366
3368
  return this._lines[this._lines.length - 1];
@@ -3372,7 +3374,7 @@ class EmitterVisitorContext {
3372
3374
  return this._currentLine.parts.length === 0;
3373
3375
  }
3374
3376
  lineLength() {
3375
- return this._currentLine.indent * _INDENT_WITH.length + this._currentLine.partsLength;
3377
+ return this._currentLine.indent * INDENT_WITH.length + this._currentLine.partsLength;
3376
3378
  }
3377
3379
  print(from, part, newLine = false) {
3378
3380
  if (part.length > 0) {
@@ -3381,7 +3383,7 @@ class EmitterVisitorContext {
3381
3383
  this._currentLine.srcSpans.push(from && from.sourceSpan || null);
3382
3384
  }
3383
3385
  if (newLine) {
3384
- this._lines.push(new _EmittedLine(this._indent));
3386
+ this._lines.push(new EmittedLine(this._indent));
3385
3387
  }
3386
3388
  }
3387
3389
  removeEmptyLastLine() {
@@ -3402,7 +3404,7 @@ class EmitterVisitorContext {
3402
3404
  }
3403
3405
  }
3404
3406
  toSource() {
3405
- return this.sourceLines.map(l => l.parts.length > 0 ? _createIndent(l.indent) + l.parts.join('') : '').join('\n');
3407
+ return this.sourceLines.map(l => l.parts.length > 0 ? INDENT_WITH.repeat(l.indent) + l.parts.join('') : '').join('\n');
3406
3408
  }
3407
3409
  toSourceMapGenerator(genFilePath, startsAtLine = 0) {
3408
3410
  const map = new SourceMapGenerator(genFilePath);
@@ -3421,7 +3423,7 @@ class EmitterVisitorContext {
3421
3423
  map.addLine();
3422
3424
  const spans = line.srcSpans;
3423
3425
  const parts = line.parts;
3424
- let col0 = line.indent * _INDENT_WITH.length;
3426
+ let col0 = line.indent * INDENT_WITH.length;
3425
3427
  let spanIdx = 0;
3426
3428
  while (spanIdx < spans.length && !spans[spanIdx]) {
3427
3429
  col0 += parts[spanIdx].length;
@@ -3451,7 +3453,7 @@ class EmitterVisitorContext {
3451
3453
  spanOf(line, column) {
3452
3454
  const emittedLine = this._lines[line];
3453
3455
  if (emittedLine) {
3454
- let columnsLeft = column - _createIndent(emittedLine.indent).length;
3456
+ let columnsLeft = column - INDENT_WITH.repeat(emittedLine.indent).length;
3455
3457
  for (let partIndex = 0; partIndex < emittedLine.parts.length; partIndex++) {
3456
3458
  const part = emittedLine.parts[partIndex];
3457
3459
  if (part.length > columnsLeft) {
@@ -3470,41 +3472,23 @@ class EmitterVisitorContext {
3470
3472
  }
3471
3473
  }
3472
3474
  class AbstractEmitterVisitor {
3473
- _escapeDollarInStrings;
3475
+ printComments;
3476
+ printTypes;
3474
3477
  lastIfCondition = null;
3475
- constructor(_escapeDollarInStrings) {
3476
- this._escapeDollarInStrings = _escapeDollarInStrings;
3477
- }
3478
- printLeadingComments(stmt, ctx) {
3479
- if (stmt.leadingComments === undefined) {
3480
- return;
3481
- }
3482
- for (const comment of stmt.leadingComments) {
3483
- if (comment instanceof JSDocComment) {
3484
- ctx.print(stmt, `/*${comment.toString()}*/`, comment.trailingNewline);
3485
- } else {
3486
- if (comment.multiline) {
3487
- ctx.print(stmt, `/* ${comment.text} */`, comment.trailingNewline);
3488
- } else {
3489
- comment.text.split('\n').forEach(line => {
3490
- ctx.println(stmt, `// ${line}`);
3491
- });
3492
- }
3493
- }
3494
- }
3478
+ constructor(printComments, printTypes) {
3479
+ this.printComments = printComments;
3480
+ this.printTypes = printTypes;
3495
3481
  }
3496
3482
  visitExpressionStmt(stmt, ctx) {
3497
3483
  this.printLeadingComments(stmt, ctx);
3498
3484
  stmt.expr.visitExpression(this, ctx);
3499
3485
  ctx.println(stmt, ';');
3500
- return null;
3501
3486
  }
3502
3487
  visitReturnStmt(stmt, ctx) {
3503
3488
  this.printLeadingComments(stmt, ctx);
3504
3489
  ctx.print(stmt, `return `);
3505
3490
  stmt.value.visitExpression(this, ctx);
3506
3491
  ctx.println(stmt, ';');
3507
- return null;
3508
3492
  }
3509
3493
  visitIfStmt(stmt, ctx) {
3510
3494
  this.printLeadingComments(stmt, ctx);
@@ -3532,10 +3516,21 @@ class AbstractEmitterVisitor {
3532
3516
  }
3533
3517
  }
3534
3518
  ctx.println(stmt, `}`);
3535
- return null;
3519
+ }
3520
+ visitDeclareVarStmt(stmt, ctx) {
3521
+ const varKind = stmt.hasModifier(StmtModifier.Final) ? 'const' : 'let';
3522
+ this.printLeadingComments(stmt, ctx);
3523
+ ctx.print(stmt, `${varKind} ${stmt.name}`);
3524
+ stmt.type?.visitType(this, ctx);
3525
+ if (stmt.value) {
3526
+ ctx.print(stmt, ' = ');
3527
+ stmt.value.visitExpression(this, ctx);
3528
+ }
3529
+ ctx.println(stmt, `;`);
3536
3530
  }
3537
3531
  visitInvokeFunctionExpr(expr, ctx) {
3538
- const shouldParenthesize = expr.fn instanceof ArrowFunctionExpr$1;
3532
+ this.printLeadingComments(expr, ctx);
3533
+ const shouldParenthesize = this.shouldParenthesize(expr.fn, expr);
3539
3534
  if (shouldParenthesize) {
3540
3535
  ctx.print(expr.fn, '(');
3541
3536
  }
@@ -3546,14 +3541,14 @@ class AbstractEmitterVisitor {
3546
3541
  ctx.print(expr, `(`);
3547
3542
  this.visitAllExpressions(expr.args, ctx, ',');
3548
3543
  ctx.print(expr, `)`);
3549
- return null;
3550
3544
  }
3551
3545
  visitTaggedTemplateLiteralExpr(expr, ctx) {
3546
+ this.printLeadingComments(expr, ctx);
3552
3547
  expr.tag.visitExpression(this, ctx);
3553
3548
  expr.template.visitExpression(this, ctx);
3554
- return null;
3555
3549
  }
3556
3550
  visitTemplateLiteralExpr(expr, ctx) {
3551
+ this.printLeadingComments(expr, ctx);
3557
3552
  ctx.print(expr, '`');
3558
3553
  for (let i = 0; i < expr.elements.length; i++) {
3559
3554
  expr.elements[i].visitExpression(this, ctx);
@@ -3567,45 +3562,46 @@ class AbstractEmitterVisitor {
3567
3562
  ctx.print(expr, '`');
3568
3563
  }
3569
3564
  visitTemplateLiteralElementExpr(expr, ctx) {
3565
+ this.printLeadingComments(expr, ctx);
3570
3566
  ctx.print(expr, expr.rawText);
3571
3567
  }
3572
- visitWrappedNodeExpr(ast, ctx) {
3573
- throw new Error('Abstract emitter cannot visit WrappedNodeExpr.');
3574
- }
3575
3568
  visitTypeofExpr(expr, ctx) {
3569
+ this.printLeadingComments(expr, ctx);
3576
3570
  ctx.print(expr, 'typeof ');
3577
3571
  expr.expr.visitExpression(this, ctx);
3578
3572
  }
3579
3573
  visitVoidExpr(expr, ctx) {
3574
+ this.printLeadingComments(expr, ctx);
3580
3575
  ctx.print(expr, 'void ');
3581
3576
  expr.expr.visitExpression(this, ctx);
3582
3577
  }
3583
3578
  visitReadVarExpr(ast, ctx) {
3579
+ this.printLeadingComments(ast, ctx);
3584
3580
  ctx.print(ast, ast.name);
3585
- return null;
3586
3581
  }
3587
3582
  visitInstantiateExpr(ast, ctx) {
3583
+ this.printLeadingComments(ast, ctx);
3588
3584
  ctx.print(ast, `new `);
3589
3585
  ast.classExpr.visitExpression(this, ctx);
3590
3586
  ctx.print(ast, `(`);
3591
3587
  this.visitAllExpressions(ast.args, ctx, ',');
3592
3588
  ctx.print(ast, `)`);
3593
- return null;
3594
3589
  }
3595
3590
  visitLiteralExpr(ast, ctx) {
3591
+ this.printLeadingComments(ast, ctx);
3596
3592
  const value = ast.value;
3597
3593
  if (typeof value === 'string') {
3598
- ctx.print(ast, escapeIdentifier(value, this._escapeDollarInStrings));
3594
+ ctx.print(ast, escapeIdentifier(value));
3599
3595
  } else {
3600
3596
  ctx.print(ast, `${value}`);
3601
3597
  }
3602
- return null;
3603
3598
  }
3604
3599
  visitRegularExpressionLiteral(ast, ctx) {
3600
+ this.printLeadingComments(ast, ctx);
3605
3601
  ctx.print(ast, `/${ast.body}/${ast.flags || ''}`);
3606
- return null;
3607
3602
  }
3608
3603
  visitLocalizedString(ast, ctx) {
3604
+ this.printLeadingComments(ast, ctx);
3609
3605
  const head = ast.serializeI18nHead();
3610
3606
  ctx.print(ast, '$localize `' + head.raw);
3611
3607
  for (let i = 1; i < ast.messageParts.length; i++) {
@@ -3614,27 +3610,76 @@ class AbstractEmitterVisitor {
3614
3610
  ctx.print(ast, `}${ast.serializeI18nTemplatePart(i).raw}`);
3615
3611
  }
3616
3612
  ctx.print(ast, '`');
3617
- return null;
3618
3613
  }
3619
3614
  visitConditionalExpr(ast, ctx) {
3615
+ this.printLeadingComments(ast, ctx);
3620
3616
  ctx.print(ast, `(`);
3621
3617
  ast.condition.visitExpression(this, ctx);
3622
- ctx.print(ast, '? ');
3618
+ ctx.print(ast, ' ? ');
3623
3619
  ast.trueCase.visitExpression(this, ctx);
3624
- ctx.print(ast, ': ');
3625
- ast.falseCase.visitExpression(this, ctx);
3620
+ ctx.print(ast, ' : ');
3621
+ ast.falseCase?.visitExpression(this, ctx);
3626
3622
  ctx.print(ast, `)`);
3627
- return null;
3628
3623
  }
3629
3624
  visitDynamicImportExpr(ast, ctx) {
3625
+ this.printLeadingComments(ast, ctx);
3630
3626
  ctx.print(ast, `import(${ast.url})`);
3631
3627
  }
3632
3628
  visitNotExpr(ast, ctx) {
3629
+ this.printLeadingComments(ast, ctx);
3633
3630
  ctx.print(ast, '!');
3634
3631
  ast.condition.visitExpression(this, ctx);
3635
- return null;
3632
+ }
3633
+ visitFunctionExpr(ast, ctx) {
3634
+ this.printLeadingComments(ast, ctx);
3635
+ ctx.print(ast, `function${ast.name ? ' ' + ast.name : ''}(`);
3636
+ this.visitParams(ast.params, ctx);
3637
+ ctx.println(ast, `)`);
3638
+ ast.type?.visitType(this, ctx);
3639
+ ctx.println(ast, ` {`);
3640
+ ctx.incIndent();
3641
+ this.visitAllStatements(ast.statements, ctx);
3642
+ ctx.decIndent();
3643
+ ctx.print(ast, `}`);
3644
+ }
3645
+ visitArrowFunctionExpr(ast, ctx) {
3646
+ this.printLeadingComments(ast, ctx);
3647
+ ctx.print(ast, '(');
3648
+ this.visitParams(ast.params, ctx);
3649
+ ctx.print(ast, ')');
3650
+ ast.type?.visitType(this, ctx);
3651
+ ctx.print(ast, ' =>');
3652
+ if (Array.isArray(ast.body)) {
3653
+ ctx.println(ast, `{`);
3654
+ ctx.incIndent();
3655
+ this.visitAllStatements(ast.body, ctx);
3656
+ ctx.decIndent();
3657
+ ctx.print(ast, `}`);
3658
+ } else {
3659
+ const shouldParenthesize = this.shouldParenthesize(ast.body, ast);
3660
+ if (shouldParenthesize) {
3661
+ ctx.print(ast, '(');
3662
+ }
3663
+ ast.body.visitExpression(this, ctx);
3664
+ if (shouldParenthesize) {
3665
+ ctx.print(ast, ')');
3666
+ }
3667
+ }
3668
+ }
3669
+ visitDeclareFunctionStmt(stmt, ctx) {
3670
+ this.printLeadingComments(stmt, ctx);
3671
+ ctx.print(stmt, `function ${stmt.name}(`);
3672
+ this.visitParams(stmt.params, ctx);
3673
+ ctx.println(stmt, `)`);
3674
+ stmt.type?.visitType(this, ctx);
3675
+ ctx.println(stmt, ` {`);
3676
+ ctx.incIndent();
3677
+ this.visitAllStatements(stmt.statements, ctx);
3678
+ ctx.decIndent();
3679
+ ctx.println(stmt, `}`);
3636
3680
  }
3637
3681
  visitUnaryOperatorExpr(ast, ctx) {
3682
+ this.printLeadingComments(ast, ctx);
3638
3683
  let opStr;
3639
3684
  switch (ast.operator) {
3640
3685
  case UnaryOperator.Plus:
@@ -3651,9 +3696,9 @@ class AbstractEmitterVisitor {
3651
3696
  ctx.print(ast, opStr);
3652
3697
  ast.expr.visitExpression(this, ctx);
3653
3698
  if (parens) ctx.print(ast, `)`);
3654
- return null;
3655
3699
  }
3656
3700
  visitBinaryOperatorExpr(ast, ctx) {
3701
+ this.printLeadingComments(ast, ctx);
3657
3702
  const operator = BINARY_OPERATORS$1.get(ast.operator);
3658
3703
  if (!operator) {
3659
3704
  throw new Error(`Unknown operator ${ast.operator}`);
@@ -3664,54 +3709,121 @@ class AbstractEmitterVisitor {
3664
3709
  ctx.print(ast, ` ${operator} `);
3665
3710
  ast.rhs.visitExpression(this, ctx);
3666
3711
  if (parens) ctx.print(ast, `)`);
3667
- return null;
3668
3712
  }
3669
3713
  visitReadPropExpr(ast, ctx) {
3714
+ this.printLeadingComments(ast, ctx);
3670
3715
  ast.receiver.visitExpression(this, ctx);
3671
3716
  ctx.print(ast, `.`);
3672
3717
  ctx.print(ast, ast.name);
3673
- return null;
3674
3718
  }
3675
3719
  visitReadKeyExpr(ast, ctx) {
3720
+ this.printLeadingComments(ast, ctx);
3676
3721
  ast.receiver.visitExpression(this, ctx);
3677
3722
  ctx.print(ast, `[`);
3678
3723
  ast.index.visitExpression(this, ctx);
3679
3724
  ctx.print(ast, `]`);
3680
- return null;
3681
3725
  }
3682
3726
  visitLiteralArrayExpr(ast, ctx) {
3727
+ this.printLeadingComments(ast, ctx);
3683
3728
  ctx.print(ast, `[`);
3684
- this.visitAllExpressions(ast.entries, ctx, ',');
3729
+ this.visitAllExpressions(ast.entries, ctx, ', ');
3685
3730
  ctx.print(ast, `]`);
3686
- return null;
3687
3731
  }
3688
3732
  visitLiteralMapExpr(ast, ctx) {
3733
+ this.printLeadingComments(ast, ctx);
3689
3734
  ctx.print(ast, `{`);
3690
3735
  this.visitAllObjects(entry => {
3691
3736
  if (entry instanceof LiteralMapSpreadAssignment) {
3692
3737
  ctx.print(ast, '...');
3693
3738
  entry.expression.visitExpression(this, ctx);
3694
3739
  } else {
3695
- ctx.print(ast, `${escapeIdentifier(entry.key, this._escapeDollarInStrings, entry.quoted)}:`);
3740
+ ctx.print(ast, `${escapeIdentifier(entry.key, entry.quoted)}: `);
3696
3741
  entry.value.visitExpression(this, ctx);
3697
3742
  }
3698
- }, ast.entries, ctx, ',');
3743
+ }, ast.entries, ctx, ', ');
3699
3744
  ctx.print(ast, `}`);
3700
- return null;
3701
3745
  }
3702
3746
  visitCommaExpr(ast, ctx) {
3747
+ this.printLeadingComments(ast, ctx);
3703
3748
  ctx.print(ast, '(');
3704
- this.visitAllExpressions(ast.parts, ctx, ',');
3749
+ this.visitAllExpressions(ast.parts, ctx, ', ');
3705
3750
  ctx.print(ast, ')');
3706
- return null;
3707
3751
  }
3708
3752
  visitParenthesizedExpr(ast, ctx) {
3753
+ this.printLeadingComments(ast, ctx);
3709
3754
  ast.expr.visitExpression(this, ctx);
3710
3755
  }
3711
3756
  visitSpreadElementExpr(ast, ctx) {
3757
+ this.printLeadingComments(ast, ctx);
3712
3758
  ctx.print(ast, '...');
3713
3759
  ast.expression.visitExpression(this, ctx);
3714
3760
  }
3761
+ visitBuiltinType(type, ctx) {
3762
+ if (!this.printTypes) {
3763
+ return;
3764
+ }
3765
+ switch (type.name) {
3766
+ case BuiltinTypeName.Bool:
3767
+ ctx.print(null, ': boolean');
3768
+ break;
3769
+ case BuiltinTypeName.Dynamic:
3770
+ ctx.print(null, ': any');
3771
+ break;
3772
+ case BuiltinTypeName.Int:
3773
+ case BuiltinTypeName.Number:
3774
+ ctx.print(null, ': number');
3775
+ break;
3776
+ case BuiltinTypeName.String:
3777
+ ctx.print(null, ': string');
3778
+ break;
3779
+ case BuiltinTypeName.None:
3780
+ ctx.print(null, ': void');
3781
+ break;
3782
+ case BuiltinTypeName.Inferred:
3783
+ break;
3784
+ case BuiltinTypeName.Function:
3785
+ ctx.print(null, ': Function');
3786
+ break;
3787
+ default:
3788
+ ctx.print(null, ': any');
3789
+ break;
3790
+ }
3791
+ }
3792
+ visitExpressionType(type, ctx) {
3793
+ if (!this.printTypes) {
3794
+ return;
3795
+ }
3796
+ ctx.print(null, ': ');
3797
+ type.value.visitExpression(this, ctx);
3798
+ if (type.typeParams && type.typeParams.length > 0) {
3799
+ ctx.print(null, '<');
3800
+ this.visitAllObjects(param => param.visitType(this, ctx), type.typeParams, ctx, ',');
3801
+ ctx.print(null, '>');
3802
+ }
3803
+ }
3804
+ visitArrayType(type, ctx) {
3805
+ if (!this.printTypes) {
3806
+ return;
3807
+ }
3808
+ ctx.print(null, ': ');
3809
+ type.of.visitType(this, ctx);
3810
+ ctx.print(null, '[]');
3811
+ }
3812
+ visitMapType(type, ctx) {
3813
+ if (!this.printTypes) {
3814
+ return;
3815
+ }
3816
+ ctx.print(null, ': { [key: string]: ');
3817
+ if (type.valueType) {
3818
+ type.valueType.visitType(this, ctx);
3819
+ } else {
3820
+ ctx.print(null, 'any');
3821
+ }
3822
+ ctx.print(null, '}');
3823
+ }
3824
+ visitTransplantedType(type, ctx) {
3825
+ throw new Error('TransplantedType nodes are not supported');
3826
+ }
3715
3827
  visitAllExpressions(expressions, ctx, separator) {
3716
3828
  this.visitAllObjects(expr => expr.visitExpression(this, ctx), expressions, ctx, separator);
3717
3829
  }
@@ -3740,15 +3852,39 @@ class AbstractEmitterVisitor {
3740
3852
  visitAllStatements(statements, ctx) {
3741
3853
  statements.forEach(stmt => stmt.visitStatement(this, ctx));
3742
3854
  }
3855
+ visitParams(params, ctx) {
3856
+ this.visitAllObjects(param => {
3857
+ ctx.print(null, param.name);
3858
+ param.type?.visitType(this, ctx);
3859
+ }, params, ctx, ', ');
3860
+ }
3861
+ shouldParenthesize(expression, containingExpression) {
3862
+ return ((expression instanceof ArrowFunctionExpr$1 || expression instanceof FunctionExpr) && containingExpression instanceof InvokeFunctionExpr || expression instanceof LiteralMapExpr && containingExpression instanceof ArrowFunctionExpr$1
3863
+ );
3864
+ }
3865
+ printLeadingComments(node, ctx) {
3866
+ if (!this.printComments || node.leadingComments === undefined) {
3867
+ return;
3868
+ }
3869
+ for (const comment of node.leadingComments) {
3870
+ if (comment instanceof JSDocComment) {
3871
+ ctx.print(node, `/*${comment.toString()}*/`, comment.trailingNewline);
3872
+ } else {
3873
+ if (comment.multiline) {
3874
+ ctx.print(node, `/* ${comment.text} */`, comment.trailingNewline);
3875
+ } else {
3876
+ comment.text.split('\n').forEach(line => ctx.println(node, `// ${line}`));
3877
+ }
3878
+ }
3879
+ }
3880
+ }
3743
3881
  }
3744
- function escapeIdentifier(input, escapeDollar, alwaysQuote = true) {
3882
+ function escapeIdentifier(input, alwaysQuote = true) {
3745
3883
  if (input == null) {
3746
3884
  return null;
3747
3885
  }
3748
- const body = input.replace(_SINGLE_QUOTE_ESCAPE_STRING_RE, (...match) => {
3749
- if (match[0] == '$') {
3750
- return escapeDollar ? '\\$' : '$';
3751
- } else if (match[0] == '\n') {
3886
+ const body = input.replace(SINGLE_QUOTE_ESCAPE_STRING_RE, (...match) => {
3887
+ if (match[0] == '\n') {
3752
3888
  return '\\n';
3753
3889
  } else if (match[0] == '\r') {
3754
3890
  return '\\r';
@@ -3756,16 +3892,9 @@ function escapeIdentifier(input, escapeDollar, alwaysQuote = true) {
3756
3892
  return `\\${match[0]}`;
3757
3893
  }
3758
3894
  });
3759
- const requiresQuotes = alwaysQuote || !_LEGAL_IDENTIFIER_RE.test(body);
3895
+ const requiresQuotes = alwaysQuote || !LEGAL_IDENTIFIER_RE.test(body);
3760
3896
  return requiresQuotes ? `'${body}'` : body;
3761
3897
  }
3762
- function _createIndent(count) {
3763
- let res = '';
3764
- for (let i = 0; i < count; i++) {
3765
- res += _INDENT_WITH;
3766
- }
3767
- return res;
3768
- }
3769
3898
 
3770
3899
  function typeWithParameters(type, numParams) {
3771
3900
  if (numParams === 0) {
@@ -3778,7 +3907,7 @@ function typeWithParameters(type, numParams) {
3778
3907
  return expressionType(type, undefined, params);
3779
3908
  }
3780
3909
  function getSafePropertyAccessString(accessor, name) {
3781
- const escapedName = escapeIdentifier(name, false, false);
3910
+ const escapedName = escapeIdentifier(name, false);
3782
3911
  return escapedName !== name ? `${accessor}[${escapedName}]` : `${accessor}.${name}`;
3783
3912
  }
3784
3913
  function jitOnlyGuardedExpression(expr) {
@@ -3807,6 +3936,9 @@ function refsToArray(refs, shouldForwardDeclare) {
3807
3936
  const values = literalArr(refs.map(ref => ref.value));
3808
3937
  return shouldForwardDeclare ? arrowFn([], values) : values;
3809
3938
  }
3939
+ function tsIgnoreComment() {
3940
+ return leadingComment('@ts-ignore', true, true);
3941
+ }
3810
3942
  function createMayBeForwardRefExpression(expression, forwardRef) {
3811
3943
  return {
3812
3944
  expression,
@@ -3839,6 +3971,7 @@ function compileFactoryFunction(meta) {
3839
3971
  let baseFactoryVar = null;
3840
3972
  const typeForCtor = !isDelegatedFactoryMetadata(meta) ? new BinaryOperatorExpr(BinaryOperator.Or, t, meta.type.value) : t;
3841
3973
  let ctorExpr = null;
3974
+ const factoryComments = meta.deps !== null && meta.deps !== 'invalid' && meta.deps.length > 0 ? [tsIgnoreComment()] : undefined;
3842
3975
  if (meta.deps !== null) {
3843
3976
  if (meta.deps !== 'invalid') {
3844
3977
  ctorExpr = new InstantiateExpr(typeForCtor, injectDependencies(meta.deps, meta.target));
@@ -3851,9 +3984,9 @@ function compileFactoryFunction(meta) {
3851
3984
  let retExpr = null;
3852
3985
  function makeConditionalFactory(nonCtorExpr) {
3853
3986
  const r = variable('__ngConditionalFactory__');
3854
- body.push(new DeclareVarStmt(r.name, NULL_EXPR, INFERRED_TYPE));
3855
- const ctorStmt = ctorExpr !== null ? r.set(ctorExpr).toStmt() : importExpr(Identifiers.invalidFactory).callFn([]).toStmt();
3856
- body.push(ifStmt(t, [ctorStmt], [r.set(nonCtorExpr).toStmt()]));
3987
+ body.push(new DeclareVarStmt(r.name, NULL_EXPR, DYNAMIC_TYPE));
3988
+ const ctorStmt = ctorExpr !== null ? r.set(ctorExpr).toStmt(factoryComments) : importExpr(Identifiers.invalidFactory).callFn([]).toStmt();
3989
+ body.push(ifStmt(t, [ctorStmt], [r.set(nonCtorExpr).toStmt([tsIgnoreComment()])]));
3857
3990
  return r;
3858
3991
  }
3859
3992
  if (isDelegatedFactoryMetadata(meta)) {
@@ -3872,11 +4005,11 @@ function compileFactoryFunction(meta) {
3872
4005
  const baseFactory = new BinaryOperatorExpr(BinaryOperator.Or, baseFactoryVar, baseFactoryVar.set(getInheritedFactoryCall));
3873
4006
  body.push(new ReturnStatement(baseFactory.callFn([typeForCtor])));
3874
4007
  } else {
3875
- body.push(new ReturnStatement(retExpr));
4008
+ body.push(new ReturnStatement(retExpr, null, factoryComments));
3876
4009
  }
3877
4010
  let factoryFn = fn([new FnParam(t.name, DYNAMIC_TYPE)], body, INFERRED_TYPE, undefined, `${meta.name}_Factory`);
3878
4011
  if (baseFactoryVar !== null) {
3879
- factoryFn = arrowFn([], [new DeclareVarStmt(baseFactoryVar.name), new ReturnStatement(factoryFn)]).callFn([], undefined, true);
4012
+ factoryFn = arrowFn([], [new DeclareVarStmt(baseFactoryVar.name, undefined, DYNAMIC_TYPE), new ReturnStatement(factoryFn)]).callFn([], undefined, true);
3880
4013
  }
3881
4014
  return {
3882
4015
  expression: factoryFn,
@@ -6412,7 +6545,7 @@ function sanitizeIdentifier(name) {
6412
6545
  const makeTemplateObjectPolyfill = '(this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e})';
6413
6546
  class AbstractJsEmitterVisitor extends AbstractEmitterVisitor {
6414
6547
  constructor() {
6415
- super(false);
6548
+ super(false, false);
6416
6549
  }
6417
6550
  visitWrappedNodeExpr(ast, ctx) {
6418
6551
  throw new Error('Cannot emit a WrappedNodeExpr in Javascript.');
@@ -6424,20 +6557,18 @@ class AbstractJsEmitterVisitor extends AbstractEmitterVisitor {
6424
6557
  stmt.value.visitExpression(this, ctx);
6425
6558
  }
6426
6559
  ctx.println(stmt, `;`);
6427
- return null;
6428
6560
  }
6429
6561
  visitTaggedTemplateLiteralExpr(ast, ctx) {
6430
6562
  const elements = ast.template.elements;
6431
6563
  ast.tag.visitExpression(this, ctx);
6432
6564
  ctx.print(ast, `(${makeTemplateObjectPolyfill}(`);
6433
- ctx.print(ast, `[${elements.map(part => escapeIdentifier(part.text, false)).join(', ')}], `);
6434
- ctx.print(ast, `[${elements.map(part => escapeIdentifier(part.rawText, false)).join(', ')}])`);
6565
+ ctx.print(ast, `[${elements.map(part => escapeIdentifier(part.text)).join(', ')}], `);
6566
+ ctx.print(ast, `[${elements.map(part => escapeIdentifier(part.rawText)).join(', ')}])`);
6435
6567
  ast.template.expressions.forEach(expression => {
6436
6568
  ctx.print(ast, ', ');
6437
6569
  expression.visitExpression(this, ctx);
6438
6570
  });
6439
6571
  ctx.print(ast, ')');
6440
- return null;
6441
6572
  }
6442
6573
  visitTemplateLiteralExpr(expr, ctx) {
6443
6574
  ctx.print(expr, '`');
@@ -6454,49 +6585,6 @@ class AbstractJsEmitterVisitor extends AbstractEmitterVisitor {
6454
6585
  }
6455
6586
  visitTemplateLiteralElementExpr(expr, ctx) {
6456
6587
  ctx.print(expr, expr.rawText);
6457
- return null;
6458
- }
6459
- visitFunctionExpr(ast, ctx) {
6460
- ctx.print(ast, `function${ast.name ? ' ' + ast.name : ''}(`);
6461
- this._visitParams(ast.params, ctx);
6462
- ctx.println(ast, `) {`);
6463
- ctx.incIndent();
6464
- this.visitAllStatements(ast.statements, ctx);
6465
- ctx.decIndent();
6466
- ctx.print(ast, `}`);
6467
- return null;
6468
- }
6469
- visitArrowFunctionExpr(ast, ctx) {
6470
- ctx.print(ast, '(');
6471
- this._visitParams(ast.params, ctx);
6472
- ctx.print(ast, ') =>');
6473
- if (Array.isArray(ast.body)) {
6474
- ctx.println(ast, `{`);
6475
- ctx.incIndent();
6476
- this.visitAllStatements(ast.body, ctx);
6477
- ctx.decIndent();
6478
- ctx.print(ast, `}`);
6479
- } else {
6480
- const isObjectLiteral = ast.body instanceof LiteralMapExpr;
6481
- if (isObjectLiteral) {
6482
- ctx.print(ast, '(');
6483
- }
6484
- ast.body.visitExpression(this, ctx);
6485
- if (isObjectLiteral) {
6486
- ctx.print(ast, ')');
6487
- }
6488
- }
6489
- return null;
6490
- }
6491
- visitDeclareFunctionStmt(stmt, ctx) {
6492
- ctx.print(stmt, `function ${stmt.name}(`);
6493
- this._visitParams(stmt.params, ctx);
6494
- ctx.println(stmt, `) {`);
6495
- ctx.incIndent();
6496
- this.visitAllStatements(stmt.statements, ctx);
6497
- ctx.decIndent();
6498
- ctx.println(stmt, `}`);
6499
- return null;
6500
6588
  }
6501
6589
  visitLocalizedString(ast, ctx) {
6502
6590
  ctx.print(ast, `$localize(${makeTemplateObjectPolyfill}(`);
@@ -6504,17 +6592,13 @@ class AbstractJsEmitterVisitor extends AbstractEmitterVisitor {
6504
6592
  for (let i = 1; i < ast.messageParts.length; i++) {
6505
6593
  parts.push(ast.serializeI18nTemplatePart(i));
6506
6594
  }
6507
- ctx.print(ast, `[${parts.map(part => escapeIdentifier(part.cooked, false)).join(', ')}], `);
6508
- ctx.print(ast, `[${parts.map(part => escapeIdentifier(part.raw, false)).join(', ')}])`);
6595
+ ctx.print(ast, `[${parts.map(part => escapeIdentifier(part.cooked)).join(', ')}], `);
6596
+ ctx.print(ast, `[${parts.map(part => escapeIdentifier(part.raw)).join(', ')}])`);
6509
6597
  ast.expressions.forEach(expression => {
6510
6598
  ctx.print(ast, ', ');
6511
6599
  expression.visitExpression(this, ctx);
6512
6600
  });
6513
6601
  ctx.print(ast, ')');
6514
- return null;
6515
- }
6516
- _visitParams(params, ctx) {
6517
- this.visitAllObjects(param => ctx.print(null, param.name), params, ctx, ',');
6518
6602
  }
6519
6603
  }
6520
6604
 
@@ -6756,12 +6840,12 @@ function createNgModuleType(meta) {
6756
6840
  const {
6757
6841
  type: moduleType,
6758
6842
  declarations,
6759
- exports,
6843
+ exports: exports$1,
6760
6844
  imports,
6761
6845
  includeImportTypes,
6762
6846
  publicDeclarationTypes
6763
6847
  } = meta;
6764
- return new ExpressionType(importExpr(Identifiers.NgModuleDeclaration, [new ExpressionType(moduleType.type), publicDeclarationTypes === null ? tupleTypeOf(declarations) : tupleOfTypes(publicDeclarationTypes), includeImportTypes ? tupleTypeOf(imports) : NONE_TYPE, tupleTypeOf(exports)]));
6848
+ return new ExpressionType(importExpr(Identifiers.NgModuleDeclaration, [new ExpressionType(moduleType.type), publicDeclarationTypes === null ? tupleTypeOf(declarations) : tupleOfTypes(publicDeclarationTypes), includeImportTypes ? tupleTypeOf(imports) : NONE_TYPE, tupleTypeOf(exports$1)]));
6765
6849
  }
6766
6850
  function generateSetNgModuleScopeCall(meta) {
6767
6851
  const scopeMap = new DefinitionMap();
@@ -14451,7 +14535,7 @@ function isDigitEntityEnd(code) {
14451
14535
  return code === $SEMICOLON || code === $EOF || !isAsciiHexDigit(code);
14452
14536
  }
14453
14537
  function isNamedEntityEnd(code) {
14454
- return code === $SEMICOLON || code === $EOF || !isAsciiLetter(code);
14538
+ return code === $SEMICOLON || code === $EOF || !(isAsciiLetter(code) || isDigit(code));
14455
14539
  }
14456
14540
  function isExpansionCaseStart(peek) {
14457
14541
  return peek !== $RBRACE;
@@ -18347,7 +18431,6 @@ function i18nMetaToJSDoc(meta) {
18347
18431
  return jsDocComment(tags);
18348
18432
  }
18349
18433
 
18350
- const GOOG_GET_MSG = 'goog.getMsg';
18351
18434
  function createGoogleGetMsgStatements(variable$1, message, closureVar, placeholderValues) {
18352
18435
  const messageString = serializeI18nMessageForGetMsg(message);
18353
18436
  const args = [literal(messageString)];
@@ -18361,7 +18444,7 @@ function createGoogleGetMsgStatements(variable$1, message, closureVar, placehold
18361
18444
  })))
18362
18445
  }));
18363
18446
  }
18364
- const googGetMsgStmt = new DeclareVarStmt(closureVar.name, variable(GOOG_GET_MSG).callFn(args), INFERRED_TYPE, StmtModifier.Final);
18447
+ const googGetMsgStmt = new DeclareVarStmt(closureVar.name, variable('goog').prop('getMsg').callFn(args, null, undefined, [tsIgnoreComment()]), INFERRED_TYPE, StmtModifier.Final);
18365
18448
  googGetMsgStmt.addLeadingComment(i18nMetaToJSDoc(message));
18366
18449
  const i18nAssignmentStmt = new ExpressionStatement(variable$1.set(closureVar));
18367
18450
  return [googGetMsgStmt, i18nAssignmentStmt];
@@ -18406,7 +18489,7 @@ function createLocalizeStatements(variable, message, params) {
18406
18489
  const expressions = placeHolders.map(ph => params[ph.text]);
18407
18490
  const localizedString$1 = localizedString(message, messageParts, placeHolders, expressions, sourceSpan);
18408
18491
  const variableInitialization = variable.set(localizedString$1);
18409
- return [new ExpressionStatement(variableInitialization)];
18492
+ return [new ExpressionStatement(variableInitialization, null, [tsIgnoreComment()])];
18410
18493
  }
18411
18494
  class LocalizeSerializerVisitor {
18412
18495
  placeholderToMessage;
@@ -18609,7 +18692,7 @@ function collectMessage(job, fileBasedI18nSuffix, messages, messageOp) {
18609
18692
  }
18610
18693
  addSubMessageParams(messageOp, subMessagePlaceholders);
18611
18694
  messageOp.params = new Map([...messageOp.params.entries()].sort());
18612
- const mainVar = variable(job.pool.uniqueName(TRANSLATION_VAR_PREFIX));
18695
+ const mainVar = variable(job.pool.uniqueName(TRANSLATION_VAR_PREFIX), DYNAMIC_TYPE);
18613
18696
  const closureVar = i18nGenerateClosureVar(job.pool, messageOp.message.id, fileBasedI18nSuffix, job.i18nUseExternalIds);
18614
18697
  let transformFn = undefined;
18615
18698
  if (messageOp.needsPostprocessing || messageOp.postprocessingParams.size > 0) {
@@ -19389,7 +19472,7 @@ class PureFunctionConstant extends GenericKeyFn {
19389
19472
  toSharedConstantDeclaration(declName, keyExpr) {
19390
19473
  const fnParams = [];
19391
19474
  for (let idx = 0; idx < this.numArgs; idx++) {
19392
- fnParams.push(new FnParam('a' + idx));
19475
+ fnParams.push(new FnParam('a' + idx, DYNAMIC_TYPE));
19393
19476
  }
19394
19477
  const returnExpr = transformExpressionsInExpression(keyExpr, expr => {
19395
19478
  if (!(expr instanceof PureFunctionParameterExpr)) {
@@ -20052,7 +20135,7 @@ function reifyCreateOperations(unit, ops) {
20052
20135
  if (op.variable.name === null) {
20053
20136
  throw new Error(`AssertionError: unnamed variable ${op.xref}`);
20054
20137
  }
20055
- OpList.replace(op, createStatementOp(new DeclareVarStmt(op.variable.name, op.initializer, undefined, StmtModifier.Final)));
20138
+ OpList.replace(op, createStatementOp(new DeclareVarStmt(op.variable.name, op.initializer, DYNAMIC_TYPE, StmtModifier.Final)));
20056
20139
  break;
20057
20140
  case OpKind.Namespace:
20058
20141
  switch (op.active) {
@@ -20270,7 +20353,7 @@ function reifyUpdateOperations(unit, ops) {
20270
20353
  if (op.variable.name === null) {
20271
20354
  throw new Error(`AssertionError: unnamed variable ${op.xref}`);
20272
20355
  }
20273
- OpList.replace(op, createStatementOp(new DeclareVarStmt(op.variable.name, op.initializer, undefined, StmtModifier.Final)));
20356
+ OpList.replace(op, createStatementOp(new DeclareVarStmt(op.variable.name, op.initializer, DYNAMIC_TYPE, StmtModifier.Final)));
20274
20357
  break;
20275
20358
  case OpKind.Conditional:
20276
20359
  if (op.processed === null) {
@@ -20378,7 +20461,7 @@ function reifyListenerHandler(unit, name, handlerOps, consumesDollarEvent) {
20378
20461
  }
20379
20462
  const params = [];
20380
20463
  if (consumesDollarEvent) {
20381
- params.push(new FnParam('$event'));
20464
+ params.push(new FnParam('$event', DYNAMIC_TYPE));
20382
20465
  }
20383
20466
  return fn(params, handlerStmts, undefined, undefined, name);
20384
20467
  }
@@ -20386,7 +20469,7 @@ function reifyTrackBy(unit, op) {
20386
20469
  if (op.trackByFn !== null) {
20387
20470
  return op.trackByFn;
20388
20471
  }
20389
- const params = [new FnParam('$index'), new FnParam('$item')];
20472
+ const params = [new FnParam('$index', NUMBER_TYPE), new FnParam('$item', DYNAMIC_TYPE)];
20390
20473
  let fn$1;
20391
20474
  if (op.trackByOps === null) {
20392
20475
  fn$1 = op.usesComponentInstance ? fn(params, [new ReturnStatement(op.track)]) : arrowFn(params, op.track);
@@ -20414,7 +20497,7 @@ function getArrowFunctionFactory(unit, expr) {
20414
20497
  statements.push(op.statement);
20415
20498
  }
20416
20499
  const body = statements.length === 1 && statements[0] instanceof ReturnStatement ? statements[0].value : statements;
20417
- return arrowFn([new FnParam(expr.contextName), new FnParam(expr.currentViewName)], arrowFn(expr.parameters, body));
20500
+ return arrowFn([new FnParam(expr.contextName, DYNAMIC_TYPE), new FnParam(expr.currentViewName, DYNAMIC_TYPE)], arrowFn(expr.parameters, body));
20418
20501
  }
20419
20502
 
20420
20503
  function removeEmptyBindings(job) {
@@ -21259,7 +21342,7 @@ function optimizeTrackFns(job) {
21259
21342
  return expr;
21260
21343
  }, VisitorContextFlag.None);
21261
21344
  const trackOpList = new OpList();
21262
- trackOpList.push(createStatementOp(new ReturnStatement(op.track, op.track.sourceSpan)));
21345
+ trackOpList.push(createStatementOp(new ReturnStatement(op.track, op.track.sourceSpan, [tsIgnoreComment()])));
21263
21346
  op.trackByOps = trackOpList;
21264
21347
  }
21265
21348
  }
@@ -21785,7 +21868,7 @@ function addArrowFunctions(unit, op) {
21785
21868
  }, VisitorContextFlag.None);
21786
21869
  }
21787
21870
 
21788
- const ELIGIBLE_CONTROL_PROPERTIES = new Set(['formField']);
21871
+ const ELIGIBLE_CONTROL_PROPERTIES = new Map([['formField', new Set([OpKind.Property])], ['formControl', new Set([OpKind.Property])], ['formControlName', new Set([OpKind.Property, OpKind.Attribute])], ['ngModel', new Set([OpKind.Attribute, OpKind.Property, OpKind.TwoWayProperty])]]);
21789
21872
  function specializeControlProperties(job) {
21790
21873
  for (const unit of job.units) {
21791
21874
  processView(unit);
@@ -21793,10 +21876,11 @@ function specializeControlProperties(job) {
21793
21876
  }
21794
21877
  function processView(view) {
21795
21878
  for (const op of view.update) {
21796
- if (op.kind !== OpKind.Property) {
21879
+ if (op.kind !== OpKind.Property && op.kind !== OpKind.TwoWayProperty && op.kind !== OpKind.Attribute) {
21797
21880
  continue;
21798
21881
  }
21799
- if (ELIGIBLE_CONTROL_PROPERTIES.has(op.name)) {
21882
+ const eligibleOps = ELIGIBLE_CONTROL_PROPERTIES.get(op.name);
21883
+ if (eligibleOps !== undefined && eligibleOps.has(op.kind)) {
21800
21884
  addControlInstruction(view, op);
21801
21885
  }
21802
21886
  }
@@ -21818,7 +21902,7 @@ function findCreateInstruction(view, target) {
21818
21902
  function addControlInstruction(view, propertyOp) {
21819
21903
  const targetCreateOp = findCreateInstruction(view, propertyOp.target);
21820
21904
  if (targetCreateOp === null) {
21821
- throw new Error(`No create instruction found for control target ${propertyOp.target}`);
21905
+ return;
21822
21906
  }
21823
21907
  const controlCreateOp = createControlCreateOp(propertyOp.sourceSpan);
21824
21908
  OpList.insertAfter(controlCreateOp, targetCreateOp);
@@ -22080,7 +22164,7 @@ function emitView(view) {
22080
22164
  }
22081
22165
  const createCond = maybeGenerateRfBlock(1, createStatements);
22082
22166
  const updateCond = maybeGenerateRfBlock(2, updateStatements);
22083
- return fn([new FnParam(RENDER_FLAGS), new FnParam(CONTEXT_NAME)], [...createCond, ...updateCond], undefined, undefined, view.fnName);
22167
+ return fn([new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, DYNAMIC_TYPE)], [...createCond, ...updateCond], undefined, undefined, view.fnName);
22084
22168
  }
22085
22169
  function maybeGenerateRfBlock(flag, statements) {
22086
22170
  if (statements.length === 0) {
@@ -22111,7 +22195,7 @@ function emitHostBindingFunction(job) {
22111
22195
  }
22112
22196
  const createCond = maybeGenerateRfBlock(1, createStatements);
22113
22197
  const updateCond = maybeGenerateRfBlock(2, updateStatements);
22114
- return fn([new FnParam(RENDER_FLAGS), new FnParam(CONTEXT_NAME)], [...createCond, ...updateCond], undefined, undefined, job.root.fnName);
22198
+ return fn([new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, DYNAMIC_TYPE)], [...createCond, ...updateCond], undefined, undefined, job.root.fnName);
22115
22199
  }
22116
22200
 
22117
22201
  const domSchema = new DomElementSchemaRegistry();
@@ -22658,7 +22742,7 @@ function convertAst(ast, job, baseSourceSpan) {
22658
22742
  } else if (ast instanceof SpreadElement) {
22659
22743
  return new SpreadElementExpr(convertAst(ast.expression, job, baseSourceSpan));
22660
22744
  } else if (ast instanceof ArrowFunction) {
22661
- return updateParameterReferences(arrowFn(ast.parameters.map(arg => new FnParam(arg.name)), convertAst(ast.body, job, baseSourceSpan)));
22745
+ return updateParameterReferences(arrowFn(ast.parameters.map(arg => new FnParam(arg.name, DYNAMIC_TYPE)), convertAst(ast.body, job, baseSourceSpan)));
22662
22746
  } else {
22663
22747
  throw new Error(`Unhandled expression type "${ast.constructor.name}" in file "${baseSourceSpan?.start.file.url}"`);
22664
22748
  }
@@ -22996,7 +23080,7 @@ function createViewQueriesFunction(viewQueries, constantPool, name) {
22996
23080
  createStatements.push(new ExpressionStatement(viewQueryCall));
22997
23081
  }
22998
23082
  const viewQueryFnName = name ? `${name}_Query` : null;
22999
- return fn([new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, null)], [renderFlagCheckIfStmt(1, createStatements), renderFlagCheckIfStmt(2, collapseAdvanceStatements(updateStatements))], INFERRED_TYPE, null, viewQueryFnName);
23083
+ return fn([new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, DYNAMIC_TYPE)], [renderFlagCheckIfStmt(1, createStatements), renderFlagCheckIfStmt(2, collapseAdvanceStatements(updateStatements))], INFERRED_TYPE, null, viewQueryFnName);
23000
23084
  }
23001
23085
  function createContentQueriesFunction(queries, constantPool, name) {
23002
23086
  const createStatements = [];
@@ -23030,7 +23114,7 @@ function createContentQueriesFunction(queries, constantPool, name) {
23030
23114
  createStatements.push(new ExpressionStatement(contentQueryCall));
23031
23115
  }
23032
23116
  const contentQueriesFnName = name ? `${name}_ContentQueries` : null;
23033
- return fn([new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, null), new FnParam('dirIndex', null)], [renderFlagCheckIfStmt(1, createStatements), renderFlagCheckIfStmt(2, collapseAdvanceStatements(updateStatements))], INFERRED_TYPE, null, contentQueriesFnName);
23117
+ return fn([new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, DYNAMIC_TYPE), new FnParam('dirIndex', NUMBER_TYPE)], [renderFlagCheckIfStmt(1, createStatements), renderFlagCheckIfStmt(2, collapseAdvanceStatements(updateStatements))], INFERRED_TYPE, null, contentQueriesFnName);
23034
23118
  }
23035
23119
 
23036
23120
  class HtmlParser extends Parser$1 {
@@ -25167,14 +25251,6 @@ function compileDirectiveFromMetadata(meta, constantPool, bindingParser) {
25167
25251
  function compileComponentFromMetadata(meta, constantPool, bindingParser) {
25168
25252
  const definitionMap = baseDirectiveFields(meta, constantPool, bindingParser);
25169
25253
  addFeatures(definitionMap, meta);
25170
- const selector = meta.selector && CssSelector.parse(meta.selector);
25171
- const firstSelector = selector && selector[0];
25172
- if (firstSelector) {
25173
- const selectorAttributes = firstSelector.getAttrs();
25174
- if (selectorAttributes.length) {
25175
- definitionMap.set('attrs', constantPool.getConstLiteral(literalArr(selectorAttributes.map(value => value != null ? literal(value) : literal(undefined))), true));
25176
- }
25177
- }
25178
25254
  const templateTypeName = meta.name;
25179
25255
  let allDeferrableDepsFn = null;
25180
25256
  if (meta.defer.mode === 1 && meta.defer.dependenciesFn !== null) {
@@ -25497,7 +25573,7 @@ function compileDeferResolverFunction(meta) {
25497
25573
  for (const dep of meta.dependencies) {
25498
25574
  if (dep.isDeferrable) {
25499
25575
  const innerFn = arrowFn([new FnParam('m', DYNAMIC_TYPE)], variable('m').prop(dep.isDefaultImport ? 'default' : dep.symbolName));
25500
- const importExpr = new DynamicImportExpr(dep.importPath).prop('then').callFn([innerFn]);
25576
+ const importExpr = new DynamicImportExpr(dep.importPath).prop('then').callFn([innerFn], undefined, undefined, [tsIgnoreComment()]);
25501
25577
  depExpressions.push(importExpr);
25502
25578
  } else {
25503
25579
  depExpressions.push(dep.typeReference);
@@ -25510,7 +25586,7 @@ function compileDeferResolverFunction(meta) {
25510
25586
  isDefaultImport
25511
25587
  } of meta.dependencies) {
25512
25588
  const innerFn = arrowFn([new FnParam('m', DYNAMIC_TYPE)], variable('m').prop(isDefaultImport ? 'default' : symbolName));
25513
- const importExpr = new DynamicImportExpr(importPath).prop('then').callFn([innerFn]);
25589
+ const importExpr = new DynamicImportExpr(importPath).prop('then').callFn([innerFn], undefined, undefined, [tsIgnoreComment()]);
25514
25590
  depExpressions.push(importExpr);
25515
25591
  }
25516
25592
  }
@@ -26388,7 +26464,6 @@ class CompilerFacadeImpl {
26388
26464
  name: facade.name,
26389
26465
  type: wrapReference(facade.type),
26390
26466
  typeArgumentCount: 0,
26391
- deps: null,
26392
26467
  pipeName: facade.pipeName,
26393
26468
  pure: facade.pure,
26394
26469
  isStandalone: facade.isStandalone
@@ -26437,7 +26512,6 @@ class CompilerFacadeImpl {
26437
26512
  }
26438
26513
  compileInjector(angularCoreEnv, sourceMapUrl, facade) {
26439
26514
  const meta = {
26440
- name: facade.name,
26441
26515
  type: wrapReference(facade.type),
26442
26516
  providers: facade.providers && facade.providers.length > 0 ? new WrappedNodeExpr(facade.providers) : null,
26443
26517
  imports: facade.imports.map(i => new WrappedNodeExpr(i))
@@ -28530,7 +28604,7 @@ function compileComponentMetadataAsyncResolver(dependencies) {
28530
28604
  isDefaultImport
28531
28605
  }) => {
28532
28606
  const innerFn = arrowFn([new FnParam('m', DYNAMIC_TYPE)], variable('m').prop(isDefaultImport ? 'default' : symbolName));
28533
- return new DynamicImportExpr(importPath).prop('then').callFn([innerFn]);
28607
+ return new DynamicImportExpr(importPath).prop('then').callFn([innerFn], undefined, undefined, [tsIgnoreComment()]);
28534
28608
  });
28535
28609
  return arrowFn([], literalArr(dynamicImports));
28536
28610
  }
@@ -28540,7 +28614,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
28540
28614
  function compileDeclareClassMetadata(metadata) {
28541
28615
  const definitionMap = new DefinitionMap();
28542
28616
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
28543
- definitionMap.set('version', literal('22.0.0-next.3'));
28617
+ definitionMap.set('version', literal('22.0.0-next.4'));
28544
28618
  definitionMap.set('ngImport', importExpr(Identifiers.core));
28545
28619
  definitionMap.set('type', metadata.type);
28546
28620
  definitionMap.set('decorators', metadata.decorators);
@@ -28558,7 +28632,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
28558
28632
  callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? literal(null));
28559
28633
  callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? literal(null));
28560
28634
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
28561
- definitionMap.set('version', literal('22.0.0-next.3'));
28635
+ definitionMap.set('version', literal('22.0.0-next.4'));
28562
28636
  definitionMap.set('ngImport', importExpr(Identifiers.core));
28563
28637
  definitionMap.set('type', metadata.type);
28564
28638
  definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
@@ -28631,7 +28705,7 @@ function createDirectiveDefinitionMap(meta) {
28631
28705
  const definitionMap = new DefinitionMap();
28632
28706
  const minVersion = getMinimumVersionForPartialOutput(meta);
28633
28707
  definitionMap.set('minVersion', literal(minVersion));
28634
- definitionMap.set('version', literal('22.0.0-next.3'));
28708
+ definitionMap.set('version', literal('22.0.0-next.4'));
28635
28709
  definitionMap.set('type', meta.type.value);
28636
28710
  if (meta.isStandalone !== undefined) {
28637
28711
  definitionMap.set('isStandalone', literal(meta.isStandalone));
@@ -28973,7 +29047,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
28973
29047
  function compileDeclareFactoryFunction(meta) {
28974
29048
  const definitionMap = new DefinitionMap();
28975
29049
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
28976
- definitionMap.set('version', literal('22.0.0-next.3'));
29050
+ definitionMap.set('version', literal('22.0.0-next.4'));
28977
29051
  definitionMap.set('ngImport', importExpr(Identifiers.core));
28978
29052
  definitionMap.set('type', meta.type.value);
28979
29053
  definitionMap.set('deps', compileDependencies(meta.deps));
@@ -28999,7 +29073,7 @@ function compileDeclareInjectableFromMetadata(meta) {
28999
29073
  function createInjectableDefinitionMap(meta) {
29000
29074
  const definitionMap = new DefinitionMap();
29001
29075
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
29002
- definitionMap.set('version', literal('22.0.0-next.3'));
29076
+ definitionMap.set('version', literal('22.0.0-next.4'));
29003
29077
  definitionMap.set('ngImport', importExpr(Identifiers.core));
29004
29078
  definitionMap.set('type', meta.type.value);
29005
29079
  if (meta.providedIn !== undefined) {
@@ -29040,7 +29114,7 @@ function compileDeclareInjectorFromMetadata(meta) {
29040
29114
  function createInjectorDefinitionMap(meta) {
29041
29115
  const definitionMap = new DefinitionMap();
29042
29116
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
29043
- definitionMap.set('version', literal('22.0.0-next.3'));
29117
+ definitionMap.set('version', literal('22.0.0-next.4'));
29044
29118
  definitionMap.set('ngImport', importExpr(Identifiers.core));
29045
29119
  definitionMap.set('type', meta.type.value);
29046
29120
  definitionMap.set('providers', meta.providers);
@@ -29067,7 +29141,7 @@ function createNgModuleDefinitionMap(meta) {
29067
29141
  throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
29068
29142
  }
29069
29143
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
29070
- definitionMap.set('version', literal('22.0.0-next.3'));
29144
+ definitionMap.set('version', literal('22.0.0-next.4'));
29071
29145
  definitionMap.set('ngImport', importExpr(Identifiers.core));
29072
29146
  definitionMap.set('type', meta.type.value);
29073
29147
  if (meta.bootstrap.length > 0) {
@@ -29105,7 +29179,7 @@ function compileDeclarePipeFromMetadata(meta) {
29105
29179
  function createPipeDefinitionMap(meta) {
29106
29180
  const definitionMap = new DefinitionMap();
29107
29181
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
29108
- definitionMap.set('version', literal('22.0.0-next.3'));
29182
+ definitionMap.set('version', literal('22.0.0-next.4'));
29109
29183
  definitionMap.set('ngImport', importExpr(Identifiers.core));
29110
29184
  definitionMap.set('type', meta.type.value);
29111
29185
  if (meta.isStandalone !== undefined) {
@@ -29148,10 +29222,10 @@ function compileHmrInitializer(meta) {
29148
29222
  });
29149
29223
  const defaultRead = variable(moduleName).prop('default');
29150
29224
  const replaceCall = importExpr(Identifiers.replaceMetadata).callFn([meta.type, defaultRead, literalArr(namespaces), literalArr(meta.localDependencies.map(l => l.runtimeRepresentation)), variable('import').prop('meta'), variable(idName)]);
29151
- const replaceCallback = arrowFn([new FnParam(moduleName)], defaultRead.and(replaceCall));
29225
+ const replaceCallback = arrowFn([new FnParam(moduleName, DYNAMIC_TYPE)], defaultRead.and(replaceCall));
29152
29226
  const url = importExpr(Identifiers.getReplaceMetadataURL).callFn([variable(idName), variable(timestampName), variable('import').prop('meta').prop('url')]);
29153
- const importCallback = new DeclareFunctionStmt(importCallbackName, [new FnParam(timestampName)], [new DynamicImportExpr(url, null, '@vite-ignore').prop('then').callFn([replaceCallback]).toStmt()], null, StmtModifier.Final);
29154
- const updateCallback = arrowFn([new FnParam(dataName)], variable(dataName).prop('id').identical(variable(idName)).and(variable(importCallbackName).callFn([variable(dataName).prop('timestamp')])));
29227
+ const importCallback = new DeclareFunctionStmt(importCallbackName, [new FnParam(timestampName, DYNAMIC_TYPE)], [new DynamicImportExpr(url, null, '@vite-ignore').prop('then').callFn([replaceCallback]).toStmt()], null, StmtModifier.Final);
29228
+ const updateCallback = arrowFn([new FnParam(dataName, DYNAMIC_TYPE)], variable(dataName).prop('id').identical(variable(idName)).and(variable(importCallbackName).callFn([variable(dataName).prop('timestamp')])));
29155
29229
  const initialCall = variable(importCallbackName).callFn([variable('Date').prop('now').callFn([])]);
29156
29230
  const hotRead = variable('import').prop('meta').prop('hot');
29157
29231
  const hotListener = hotRead.clone().prop('on').callFn([literal('angular:component-update'), updateCallback]);
@@ -29162,7 +29236,7 @@ function compileHmrUpdateCallback(definitions, constantStatements, meta) {
29162
29236
  const params = [meta.className, namespaces].map(name => new FnParam(name, DYNAMIC_TYPE));
29163
29237
  const body = [];
29164
29238
  for (const local of meta.localDependencies) {
29165
- params.push(new FnParam(local.name));
29239
+ params.push(new FnParam(local.name, DYNAMIC_TYPE));
29166
29240
  }
29167
29241
  for (let i = 0; i < meta.namespaceDependencies.length; i++) {
29168
29242
  body.push(new DeclareVarStmt(meta.namespaceDependencies[i].assignedName, variable(namespaces).key(literal(i)), DYNAMIC_TYPE, StmtModifier.Final));
@@ -29179,9 +29253,9 @@ function compileHmrUpdateCallback(definitions, constantStatements, meta) {
29179
29253
  return new DeclareFunctionStmt(`${meta.className}_UpdateMetadata`, params, body, null, StmtModifier.Final);
29180
29254
  }
29181
29255
 
29182
- const VERSION = new Version('22.0.0-next.3');
29256
+ const VERSION = new Version('22.0.0-next.4');
29183
29257
 
29184
29258
  publishFacade(_global);
29185
29259
 
29186
- export { AST, ASTWithName, ASTWithSource, AbsoluteSourceSpan, ArrayType, ArrowFunction, ArrowFunctionExpr$1 as ArrowFunctionExpr, ArrowFunctionIdentifierParameter, Attribute, Binary, BinaryOperator, BinaryOperatorExpr, BindingPipe, BindingPipeType, BindingType, Block, BlockParameter, BoundElementProperty, BuiltinType, BuiltinTypeName, CUSTOM_ELEMENTS_SCHEMA, Call, Chain, ChangeDetectionStrategy, CombinedRecursiveAstVisitor, CommaExpr, Comment, CompilerConfig, CompilerFacadeImpl, Component, Conditional, ConditionalExpr, ConstantPool, CssSelector, DYNAMIC_TYPE, DeclareFunctionStmt, DeclareVarStmt, Directive, DomElementSchemaRegistry, DynamicImportExpr, EOF, Element, ElementSchemaRegistry, EmitterVisitorContext, EmptyExpr$1 as EmptyExpr, Expansion, ExpansionCase, Expression, ExpressionBinding, ExpressionStatement, ExpressionType, ExternalExpr, ExternalReference, FactoryTarget, FunctionExpr, HtmlParser, HtmlTagDefinition, I18NHtmlParser, IfStmt, ImplicitReceiver, InstantiateExpr, Interpolation$1 as Interpolation, InvokeFunctionExpr, JSDocComment, JitEvaluator, KeyedRead, LeadingComment, LetDeclaration, Lexer, LiteralArray, LiteralArrayExpr, LiteralExpr, LiteralMap, LiteralMapExpr, LiteralMapPropertyAssignment, LiteralMapSpreadAssignment, LiteralPrimitive, LocalizedString, MapType, MessageBundle, NONE_TYPE, NO_ERRORS_SCHEMA, NodeWithI18n, NonNullAssert, NotExpr, ParenthesizedExpr, ParenthesizedExpression, ParseError, ParseErrorLevel, ParseLocation, ParseSourceFile, ParseSourceSpan, ParseSpan, ParseTreeResult, ParsedEvent, ParsedEventType, ParsedProperty, ParsedPropertyType, ParsedVariable, Parser, PrefixNot, PropertyRead, Identifiers as R3Identifiers, R3NgModuleMetadataKind, R3SelectorScopeMode, R3TargetBinder, R3TemplateDependencyKind, ReadKeyExpr, ReadPropExpr, ReadVarExpr, RecursiveAstVisitor, RecursiveVisitor, RegularExpressionLiteral, RegularExpressionLiteralExpr, ResourceLoader, ReturnStatement, SCHEMA, SECURITY_SCHEMA, STRING_TYPE, SafeCall, SafeKeyedRead, SafePropertyRead, SelectorContext, SelectorListContext, SelectorMatcher, SelectorlessMatcher, Serializer, SplitInterpolation, SpreadElement, SpreadElementExpr, Statement, StmtModifier, StringToken, StringTokenKind, TagContentType, TaggedTemplateLiteral, TaggedTemplateLiteralExpr, TemplateBindingParseResult, TemplateLiteral, TemplateLiteralElement, TemplateLiteralElementExpr, TemplateLiteralExpr, Text, ThisReceiver, BlockNode as TmplAstBlockNode, BoundAttribute as TmplAstBoundAttribute, BoundDeferredTrigger as TmplAstBoundDeferredTrigger, BoundEvent as TmplAstBoundEvent, BoundText as TmplAstBoundText, Component$1 as TmplAstComponent, Content as TmplAstContent, DeferredBlock as TmplAstDeferredBlock, DeferredBlockError as TmplAstDeferredBlockError, DeferredBlockLoading as TmplAstDeferredBlockLoading, DeferredBlockPlaceholder as TmplAstDeferredBlockPlaceholder, DeferredTrigger as TmplAstDeferredTrigger, Directive$1 as TmplAstDirective, Element$1 as TmplAstElement, ForLoopBlock as TmplAstForLoopBlock, ForLoopBlockEmpty as TmplAstForLoopBlockEmpty, HostElement as TmplAstHostElement, HoverDeferredTrigger as TmplAstHoverDeferredTrigger, Icu$1 as TmplAstIcu, IdleDeferredTrigger as TmplAstIdleDeferredTrigger, IfBlock as TmplAstIfBlock, IfBlockBranch as TmplAstIfBlockBranch, ImmediateDeferredTrigger as TmplAstImmediateDeferredTrigger, InteractionDeferredTrigger as TmplAstInteractionDeferredTrigger, LetDeclaration$1 as TmplAstLetDeclaration, NeverDeferredTrigger as TmplAstNeverDeferredTrigger, RecursiveVisitor$1 as TmplAstRecursiveVisitor, Reference as TmplAstReference, SwitchBlock as TmplAstSwitchBlock, SwitchBlockCase as TmplAstSwitchBlockCase, SwitchBlockCaseGroup as TmplAstSwitchBlockCaseGroup, SwitchExhaustiveCheck as TmplAstSwitchExhaustiveCheck, Template as TmplAstTemplate, Text$3 as TmplAstText, TextAttribute as TmplAstTextAttribute, TimerDeferredTrigger as TmplAstTimerDeferredTrigger, UnknownBlock as TmplAstUnknownBlock, Variable as TmplAstVariable, ViewportDeferredTrigger as TmplAstViewportDeferredTrigger, Token, TokenType, TransplantedType, TreeError, Type, TypeModifier, TypeofExpr, TypeofExpression, Unary, UnaryOperator, UnaryOperatorExpr, VERSION, VariableBinding, Version, ViewEncapsulation$1 as ViewEncapsulation, VoidExpr, VoidExpression, WrappedNodeExpr, Xliff, Xliff2, Xmb, XmlParser, Xtb, _ATTR_TO_PROP, compileClassDebugInfo, compileClassMetadata, compileComponentClassMetadata, compileComponentDeclareClassMetadata, compileComponentFromMetadata, compileDeclareClassMetadata, compileDeclareComponentFromMetadata, compileDeclareDirectiveFromMetadata, compileDeclareFactoryFunction, compileDeclareInjectableFromMetadata, compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileDeclarePipeFromMetadata, compileDeferResolverFunction, compileDirectiveFromMetadata, compileFactoryFunction, compileHmrInitializer, compileHmrUpdateCallback, compileInjectable, compileInjector, compileNgModule, compileOpaqueAsyncClassMetadata, compilePipeFromMetadata, computeMsgId, core, createCssSelectorFromNode, createInjectableType, createMayBeForwardRefExpression, devOnlyGuardedExpression, emitDistinctChangesOnlyDefaultValue, encapsulateStyle, escapeRegExp, findMatchingDirectivesAndPipes, getHtmlTagDefinition, getNsPrefix, getSafePropertyAccessString, identifierName, isNgContainer, isNgContent, isNgTemplate, jsDocComment, leadingComment, literal, literalMap, makeBindingParser, mergeNsAndName, output_ast as outputAst, parseHostBindings, parseTemplate, preserveWhitespacesDefault, publishFacade, r3JitTypeSourceSpan, sanitizeIdentifier, setEnableTemplateSourceLocations, splitNsName, visitAll$1 as tmplAstVisitAll, verifyHostBindings, visitAll };
29260
+ export { AST, ASTWithName, ASTWithSource, AbsoluteSourceSpan, AbstractEmitterVisitor, ArrayType, ArrowFunction, ArrowFunctionExpr$1 as ArrowFunctionExpr, ArrowFunctionIdentifierParameter, Attribute, Binary, BinaryOperator, BinaryOperatorExpr, BindingPipe, BindingPipeType, BindingType, Block, BlockParameter, BoundElementProperty, BuiltinType, BuiltinTypeName, CUSTOM_ELEMENTS_SCHEMA, Call, Chain, ChangeDetectionStrategy, CombinedRecursiveAstVisitor, CommaExpr, Comment, CompilerConfig, CompilerFacadeImpl, Component, Conditional, ConditionalExpr, ConstantPool, CssSelector, DYNAMIC_TYPE, DeclareFunctionStmt, DeclareVarStmt, Directive, DomElementSchemaRegistry, DynamicImportExpr, EOF, Element, ElementSchemaRegistry, EmitterVisitorContext, EmptyExpr$1 as EmptyExpr, Expansion, ExpansionCase, Expression, ExpressionBinding, ExpressionStatement, ExpressionType, ExternalExpr, ExternalReference, FactoryTarget, FunctionExpr, HtmlParser, HtmlTagDefinition, I18NHtmlParser, IfStmt, ImplicitReceiver, InstantiateExpr, Interpolation$1 as Interpolation, InvokeFunctionExpr, JSDocComment, JitEvaluator, KeyedRead, LeadingComment, LetDeclaration, Lexer, LiteralArray, LiteralArrayExpr, LiteralExpr, LiteralMap, LiteralMapExpr, LiteralMapPropertyAssignment, LiteralMapSpreadAssignment, LiteralPrimitive, LocalizedString, MapType, MessageBundle, NONE_TYPE, NO_ERRORS_SCHEMA, NodeWithI18n, NonNullAssert, NotExpr, ParenthesizedExpr, ParenthesizedExpression, ParseError, ParseErrorLevel, ParseLocation, ParseSourceFile, ParseSourceSpan, ParseSpan, ParseTreeResult, ParsedEvent, ParsedEventType, ParsedProperty, ParsedPropertyType, ParsedVariable, Parser, PrefixNot, PropertyRead, Identifiers as R3Identifiers, R3NgModuleMetadataKind, R3SelectorScopeMode, R3TargetBinder, R3TemplateDependencyKind, ReadKeyExpr, ReadPropExpr, ReadVarExpr, RecursiveAstVisitor, RecursiveVisitor, RegularExpressionLiteral, RegularExpressionLiteralExpr, ResourceLoader, ReturnStatement, SCHEMA, SECURITY_SCHEMA, STRING_TYPE, SafeCall, SafeKeyedRead, SafePropertyRead, SelectorContext, SelectorListContext, SelectorMatcher, SelectorlessMatcher, Serializer, SplitInterpolation, SpreadElement, SpreadElementExpr, Statement, StmtModifier, StringToken, StringTokenKind, TagContentType, TaggedTemplateLiteral, TaggedTemplateLiteralExpr, TemplateBindingParseResult, TemplateLiteral, TemplateLiteralElement, TemplateLiteralElementExpr, TemplateLiteralExpr, Text, ThisReceiver, BlockNode as TmplAstBlockNode, BoundAttribute as TmplAstBoundAttribute, BoundDeferredTrigger as TmplAstBoundDeferredTrigger, BoundEvent as TmplAstBoundEvent, BoundText as TmplAstBoundText, Component$1 as TmplAstComponent, Content as TmplAstContent, DeferredBlock as TmplAstDeferredBlock, DeferredBlockError as TmplAstDeferredBlockError, DeferredBlockLoading as TmplAstDeferredBlockLoading, DeferredBlockPlaceholder as TmplAstDeferredBlockPlaceholder, DeferredTrigger as TmplAstDeferredTrigger, Directive$1 as TmplAstDirective, Element$1 as TmplAstElement, ForLoopBlock as TmplAstForLoopBlock, ForLoopBlockEmpty as TmplAstForLoopBlockEmpty, HostElement as TmplAstHostElement, HoverDeferredTrigger as TmplAstHoverDeferredTrigger, Icu$1 as TmplAstIcu, IdleDeferredTrigger as TmplAstIdleDeferredTrigger, IfBlock as TmplAstIfBlock, IfBlockBranch as TmplAstIfBlockBranch, ImmediateDeferredTrigger as TmplAstImmediateDeferredTrigger, InteractionDeferredTrigger as TmplAstInteractionDeferredTrigger, LetDeclaration$1 as TmplAstLetDeclaration, NeverDeferredTrigger as TmplAstNeverDeferredTrigger, RecursiveVisitor$1 as TmplAstRecursiveVisitor, Reference as TmplAstReference, SwitchBlock as TmplAstSwitchBlock, SwitchBlockCase as TmplAstSwitchBlockCase, SwitchBlockCaseGroup as TmplAstSwitchBlockCaseGroup, SwitchExhaustiveCheck as TmplAstSwitchExhaustiveCheck, Template as TmplAstTemplate, Text$3 as TmplAstText, TextAttribute as TmplAstTextAttribute, TimerDeferredTrigger as TmplAstTimerDeferredTrigger, UnknownBlock as TmplAstUnknownBlock, Variable as TmplAstVariable, ViewportDeferredTrigger as TmplAstViewportDeferredTrigger, Token, TokenType, TransplantedType, TreeError, Type, TypeModifier, TypeofExpr, TypeofExpression, Unary, UnaryOperator, UnaryOperatorExpr, VERSION, VariableBinding, Version, ViewEncapsulation$1 as ViewEncapsulation, VoidExpr, VoidExpression, WrappedNodeExpr, Xliff, Xliff2, Xmb, XmlParser, Xtb, _ATTR_TO_PROP, compileClassDebugInfo, compileClassMetadata, compileComponentClassMetadata, compileComponentDeclareClassMetadata, compileComponentFromMetadata, compileDeclareClassMetadata, compileDeclareComponentFromMetadata, compileDeclareDirectiveFromMetadata, compileDeclareFactoryFunction, compileDeclareInjectableFromMetadata, compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileDeclarePipeFromMetadata, compileDeferResolverFunction, compileDirectiveFromMetadata, compileFactoryFunction, compileHmrInitializer, compileHmrUpdateCallback, compileInjectable, compileInjector, compileNgModule, compileOpaqueAsyncClassMetadata, compilePipeFromMetadata, computeMsgId, core, createCssSelectorFromNode, createInjectableType, createMayBeForwardRefExpression, devOnlyGuardedExpression, emitDistinctChangesOnlyDefaultValue, encapsulateStyle, escapeRegExp, findMatchingDirectivesAndPipes, getHtmlTagDefinition, getNsPrefix, getSafePropertyAccessString, identifierName, isNgContainer, isNgContent, isNgTemplate, jsDocComment, leadingComment, literal, literalMap, makeBindingParser, mergeNsAndName, output_ast as outputAst, parseHostBindings, parseTemplate, preserveWhitespacesDefault, publishFacade, r3JitTypeSourceSpan, sanitizeIdentifier, setEnableTemplateSourceLocations, splitNsName, visitAll$1 as tmplAstVisitAll, verifyHostBindings, visitAll };
29187
29261
  //# sourceMappingURL=compiler.mjs.map