@angular/compiler 21.1.0 → 21.2.0-next.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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.1.0
2
+ * @license Angular v21.2.0-next.0
3
3
  * (c) 2010-2026 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
@@ -784,15 +784,16 @@ var BinaryOperator;
784
784
  BinaryOperator[BinaryOperator["NullishCoalesce"] = 18] = "NullishCoalesce";
785
785
  BinaryOperator[BinaryOperator["Exponentiation"] = 19] = "Exponentiation";
786
786
  BinaryOperator[BinaryOperator["In"] = 20] = "In";
787
- BinaryOperator[BinaryOperator["AdditionAssignment"] = 21] = "AdditionAssignment";
788
- BinaryOperator[BinaryOperator["SubtractionAssignment"] = 22] = "SubtractionAssignment";
789
- BinaryOperator[BinaryOperator["MultiplicationAssignment"] = 23] = "MultiplicationAssignment";
790
- BinaryOperator[BinaryOperator["DivisionAssignment"] = 24] = "DivisionAssignment";
791
- BinaryOperator[BinaryOperator["RemainderAssignment"] = 25] = "RemainderAssignment";
792
- BinaryOperator[BinaryOperator["ExponentiationAssignment"] = 26] = "ExponentiationAssignment";
793
- BinaryOperator[BinaryOperator["AndAssignment"] = 27] = "AndAssignment";
794
- BinaryOperator[BinaryOperator["OrAssignment"] = 28] = "OrAssignment";
795
- BinaryOperator[BinaryOperator["NullishCoalesceAssignment"] = 29] = "NullishCoalesceAssignment";
787
+ BinaryOperator[BinaryOperator["InstanceOf"] = 21] = "InstanceOf";
788
+ BinaryOperator[BinaryOperator["AdditionAssignment"] = 22] = "AdditionAssignment";
789
+ BinaryOperator[BinaryOperator["SubtractionAssignment"] = 23] = "SubtractionAssignment";
790
+ BinaryOperator[BinaryOperator["MultiplicationAssignment"] = 24] = "MultiplicationAssignment";
791
+ BinaryOperator[BinaryOperator["DivisionAssignment"] = 25] = "DivisionAssignment";
792
+ BinaryOperator[BinaryOperator["RemainderAssignment"] = 26] = "RemainderAssignment";
793
+ BinaryOperator[BinaryOperator["ExponentiationAssignment"] = 27] = "ExponentiationAssignment";
794
+ BinaryOperator[BinaryOperator["AndAssignment"] = 28] = "AndAssignment";
795
+ BinaryOperator[BinaryOperator["OrAssignment"] = 29] = "OrAssignment";
796
+ BinaryOperator[BinaryOperator["NullishCoalesceAssignment"] = 30] = "NullishCoalesceAssignment";
796
797
  })(BinaryOperator || (BinaryOperator = {}));
797
798
  function nullSafeIsEquivalent(base, other) {
798
799
  if (base == null || other == null) {
@@ -1357,7 +1358,7 @@ class FunctionExpr extends Expression {
1357
1358
  return new FunctionExpr(this.params.map(p => p.clone()), this.statements, this.type, this.sourceSpan, this.name);
1358
1359
  }
1359
1360
  }
1360
- class ArrowFunctionExpr extends Expression {
1361
+ let ArrowFunctionExpr$1 = class ArrowFunctionExpr extends Expression {
1361
1362
  params;
1362
1363
  body;
1363
1364
  constructor(params, body, type, sourceSpan) {
@@ -1389,7 +1390,7 @@ class ArrowFunctionExpr extends Expression {
1389
1390
  toDeclStmt(name, modifiers) {
1390
1391
  return new DeclareVarStmt(name, this, INFERRED_TYPE, modifiers, this.sourceSpan);
1391
1392
  }
1392
- }
1393
+ };
1393
1394
  class UnaryOperatorExpr extends Expression {
1394
1395
  operator;
1395
1396
  expr;
@@ -1981,7 +1982,7 @@ function fn(params, body, type, sourceSpan, name) {
1981
1982
  return new FunctionExpr(params, body, type, sourceSpan, name);
1982
1983
  }
1983
1984
  function arrowFn(params, body, type, sourceSpan) {
1984
- return new ArrowFunctionExpr(params, body, type, sourceSpan);
1985
+ return new ArrowFunctionExpr$1(params, body, type, sourceSpan);
1985
1986
  }
1986
1987
  function ifStmt(condition, thenClause, elseClause, sourceSpan, leadingComments) {
1987
1988
  return new IfStmt(condition, thenClause, elseClause, sourceSpan, leadingComments);
@@ -2029,7 +2030,7 @@ function serializeTags(tags) {
2029
2030
  var output_ast = /*#__PURE__*/Object.freeze({
2030
2031
  __proto__: null,
2031
2032
  ArrayType: ArrayType,
2032
- ArrowFunctionExpr: ArrowFunctionExpr,
2033
+ ArrowFunctionExpr: ArrowFunctionExpr$1,
2033
2034
  BOOL_TYPE: BOOL_TYPE,
2034
2035
  get BinaryOperator () { return BinaryOperator; },
2035
2036
  BinaryOperatorExpr: BinaryOperatorExpr,
@@ -2197,7 +2198,7 @@ class ConstantPool {
2197
2198
  return this.sharedConstants.get(key);
2198
2199
  }
2199
2200
  getSharedFunctionReference(fn, prefix, useUniqueName = true) {
2200
- const isArrow = fn instanceof ArrowFunctionExpr;
2201
+ const isArrow = fn instanceof ArrowFunctionExpr$1;
2201
2202
  for (const current of this.statements) {
2202
2203
  if (isArrow && current instanceof DeclareVarStmt && current.value?.isEquivalent(fn)) {
2203
2204
  return variable(current.name);
@@ -2268,9 +2269,6 @@ function isLongStringLiteral(expr) {
2268
2269
 
2269
2270
  const CORE = '@angular/core';
2270
2271
  class Identifiers {
2271
- static NEW_METHOD = 'factory';
2272
- static TRANSFORM_METHOD = 'transform';
2273
- static PATCH_DEPS = 'patchedDeps';
2274
2272
  static core = {
2275
2273
  name: null,
2276
2274
  moduleName: CORE
@@ -2995,6 +2993,10 @@ class Identifiers {
2995
2993
  name: 'ɵɵreadContextLet',
2996
2994
  moduleName: CORE
2997
2995
  };
2996
+ static arrowFunction = {
2997
+ name: 'ɵɵarrowFunction',
2998
+ moduleName: CORE
2999
+ };
2998
3000
  static attachSourceLocations = {
2999
3001
  name: 'ɵɵattachSourceLocations',
3000
3002
  moduleName: CORE
@@ -3344,7 +3346,7 @@ class _EmittedLine {
3344
3346
  this.indent = indent;
3345
3347
  }
3346
3348
  }
3347
- const BINARY_OPERATORS$1 = new Map([[BinaryOperator.And, '&&'], [BinaryOperator.Bigger, '>'], [BinaryOperator.BiggerEquals, '>='], [BinaryOperator.BitwiseOr, '|'], [BinaryOperator.BitwiseAnd, '&'], [BinaryOperator.Divide, '/'], [BinaryOperator.Assign, '='], [BinaryOperator.Equals, '=='], [BinaryOperator.Identical, '==='], [BinaryOperator.Lower, '<'], [BinaryOperator.LowerEquals, '<='], [BinaryOperator.Minus, '-'], [BinaryOperator.Modulo, '%'], [BinaryOperator.Exponentiation, '**'], [BinaryOperator.Multiply, '*'], [BinaryOperator.NotEquals, '!='], [BinaryOperator.NotIdentical, '!=='], [BinaryOperator.NullishCoalesce, '??'], [BinaryOperator.Or, '||'], [BinaryOperator.Plus, '+'], [BinaryOperator.In, 'in'], [BinaryOperator.AdditionAssignment, '+='], [BinaryOperator.SubtractionAssignment, '-='], [BinaryOperator.MultiplicationAssignment, '*='], [BinaryOperator.DivisionAssignment, '/='], [BinaryOperator.RemainderAssignment, '%='], [BinaryOperator.ExponentiationAssignment, '**='], [BinaryOperator.AndAssignment, '&&='], [BinaryOperator.OrAssignment, '||='], [BinaryOperator.NullishCoalesceAssignment, '??=']]);
3349
+ const BINARY_OPERATORS$1 = new Map([[BinaryOperator.And, '&&'], [BinaryOperator.Bigger, '>'], [BinaryOperator.BiggerEquals, '>='], [BinaryOperator.BitwiseOr, '|'], [BinaryOperator.BitwiseAnd, '&'], [BinaryOperator.Divide, '/'], [BinaryOperator.Assign, '='], [BinaryOperator.Equals, '=='], [BinaryOperator.Identical, '==='], [BinaryOperator.Lower, '<'], [BinaryOperator.LowerEquals, '<='], [BinaryOperator.Minus, '-'], [BinaryOperator.Modulo, '%'], [BinaryOperator.Exponentiation, '**'], [BinaryOperator.Multiply, '*'], [BinaryOperator.NotEquals, '!='], [BinaryOperator.NotIdentical, '!=='], [BinaryOperator.NullishCoalesce, '??'], [BinaryOperator.Or, '||'], [BinaryOperator.Plus, '+'], [BinaryOperator.In, 'in'], [BinaryOperator.InstanceOf, 'instanceof'], [BinaryOperator.AdditionAssignment, '+='], [BinaryOperator.SubtractionAssignment, '-='], [BinaryOperator.MultiplicationAssignment, '*='], [BinaryOperator.DivisionAssignment, '/='], [BinaryOperator.RemainderAssignment, '%='], [BinaryOperator.ExponentiationAssignment, '**='], [BinaryOperator.AndAssignment, '&&='], [BinaryOperator.OrAssignment, '||='], [BinaryOperator.NullishCoalesceAssignment, '??=']]);
3348
3350
  class EmitterVisitorContext {
3349
3351
  _indent;
3350
3352
  static createRoot() {
@@ -3528,7 +3530,7 @@ class AbstractEmitterVisitor {
3528
3530
  return null;
3529
3531
  }
3530
3532
  visitInvokeFunctionExpr(expr, ctx) {
3531
- const shouldParenthesize = expr.fn instanceof ArrowFunctionExpr;
3533
+ const shouldParenthesize = expr.fn instanceof ArrowFunctionExpr$1;
3532
3534
  if (shouldParenthesize) {
3533
3535
  ctx.print(expr.fn, '(');
3534
3536
  }
@@ -4005,7 +4007,9 @@ class ASTWithName extends AST {
4005
4007
  }
4006
4008
  }
4007
4009
  let EmptyExpr$1 = class EmptyExpr extends AST {
4008
- visit(visitor, context = null) {}
4010
+ visit(visitor, context = null) {
4011
+ return visitor.visitEmptyExpr?.(this, context);
4012
+ }
4009
4013
  };
4010
4014
  class ImplicitReceiver extends AST {
4011
4015
  visit(visitor, context = null) {
@@ -4317,6 +4321,28 @@ class ParenthesizedExpression extends AST {
4317
4321
  return visitor.visitParenthesizedExpression(this, context);
4318
4322
  }
4319
4323
  }
4324
+ class ArrowFunctionIdentifierParameter {
4325
+ name;
4326
+ span;
4327
+ sourceSpan;
4328
+ constructor(name, span, sourceSpan) {
4329
+ this.name = name;
4330
+ this.span = span;
4331
+ this.sourceSpan = sourceSpan;
4332
+ }
4333
+ }
4334
+ class ArrowFunction extends AST {
4335
+ parameters;
4336
+ body;
4337
+ constructor(span, sourceSpan, parameters, body) {
4338
+ super(span, sourceSpan);
4339
+ this.parameters = parameters;
4340
+ this.body = body;
4341
+ }
4342
+ visit(visitor, context) {
4343
+ return visitor.visitArrowFunction(this, context);
4344
+ }
4345
+ }
4320
4346
  class RegularExpressionLiteral extends AST {
4321
4347
  body;
4322
4348
  flags;
@@ -4465,10 +4491,14 @@ class RecursiveAstVisitor {
4465
4491
  visitParenthesizedExpression(ast, context) {
4466
4492
  this.visit(ast.expression, context);
4467
4493
  }
4494
+ visitArrowFunction(ast, context) {
4495
+ this.visit(ast.body, context);
4496
+ }
4468
4497
  visitRegularExpressionLiteral(ast, context) {}
4469
4498
  visitSpreadElement(ast, context) {
4470
4499
  this.visit(ast.expression, context);
4471
4500
  }
4501
+ visitEmptyExpr(ast, context) {}
4472
4502
  visitAll(asts, context) {
4473
4503
  for (const ast of asts) {
4474
4504
  this.visit(ast, context);
@@ -7464,6 +7494,7 @@ var ExpressionKind;
7464
7494
  ExpressionKind[ExpressionKind["ConditionalCase"] = 23] = "ConditionalCase";
7465
7495
  ExpressionKind[ExpressionKind["ConstCollected"] = 24] = "ConstCollected";
7466
7496
  ExpressionKind[ExpressionKind["TwoWayBindingSet"] = 25] = "TwoWayBindingSet";
7497
+ ExpressionKind[ExpressionKind["ArrowFunction"] = 26] = "ArrowFunction";
7467
7498
  })(ExpressionKind || (ExpressionKind = {}));
7468
7499
  var VariableFlags;
7469
7500
  (function (VariableFlags) {
@@ -7542,6 +7573,219 @@ var TemplateKind;
7542
7573
  TemplateKind[TemplateKind["Block"] = 2] = "Block";
7543
7574
  })(TemplateKind || (TemplateKind = {}));
7544
7575
 
7576
+ class OpList {
7577
+ static nextListId = 0;
7578
+ debugListId = OpList.nextListId++;
7579
+ head = {
7580
+ kind: OpKind.ListEnd,
7581
+ next: null,
7582
+ prev: null,
7583
+ debugListId: this.debugListId
7584
+ };
7585
+ tail = {
7586
+ kind: OpKind.ListEnd,
7587
+ next: null,
7588
+ prev: null,
7589
+ debugListId: this.debugListId
7590
+ };
7591
+ constructor() {
7592
+ this.head.next = this.tail;
7593
+ this.tail.prev = this.head;
7594
+ }
7595
+ push(op) {
7596
+ if (Array.isArray(op)) {
7597
+ for (const o of op) {
7598
+ this.push(o);
7599
+ }
7600
+ return;
7601
+ }
7602
+ OpList.assertIsNotEnd(op);
7603
+ OpList.assertIsUnowned(op);
7604
+ op.debugListId = this.debugListId;
7605
+ const oldLast = this.tail.prev;
7606
+ op.prev = oldLast;
7607
+ oldLast.next = op;
7608
+ op.next = this.tail;
7609
+ this.tail.prev = op;
7610
+ }
7611
+ prepend(ops) {
7612
+ if (ops.length === 0) {
7613
+ return;
7614
+ }
7615
+ for (const op of ops) {
7616
+ OpList.assertIsNotEnd(op);
7617
+ OpList.assertIsUnowned(op);
7618
+ op.debugListId = this.debugListId;
7619
+ }
7620
+ const first = this.head.next;
7621
+ let prev = this.head;
7622
+ for (const op of ops) {
7623
+ prev.next = op;
7624
+ op.prev = prev;
7625
+ prev = op;
7626
+ }
7627
+ prev.next = first;
7628
+ first.prev = prev;
7629
+ }
7630
+ *[Symbol.iterator]() {
7631
+ let current = this.head.next;
7632
+ while (current !== this.tail) {
7633
+ OpList.assertIsOwned(current, this.debugListId);
7634
+ const next = current.next;
7635
+ yield current;
7636
+ current = next;
7637
+ }
7638
+ }
7639
+ *reversed() {
7640
+ let current = this.tail.prev;
7641
+ while (current !== this.head) {
7642
+ OpList.assertIsOwned(current, this.debugListId);
7643
+ const prev = current.prev;
7644
+ yield current;
7645
+ current = prev;
7646
+ }
7647
+ }
7648
+ static replace(oldOp, newOp) {
7649
+ OpList.assertIsNotEnd(oldOp);
7650
+ OpList.assertIsNotEnd(newOp);
7651
+ OpList.assertIsOwned(oldOp);
7652
+ OpList.assertIsUnowned(newOp);
7653
+ newOp.debugListId = oldOp.debugListId;
7654
+ if (oldOp.prev !== null) {
7655
+ oldOp.prev.next = newOp;
7656
+ newOp.prev = oldOp.prev;
7657
+ }
7658
+ if (oldOp.next !== null) {
7659
+ oldOp.next.prev = newOp;
7660
+ newOp.next = oldOp.next;
7661
+ }
7662
+ oldOp.debugListId = null;
7663
+ oldOp.prev = null;
7664
+ oldOp.next = null;
7665
+ }
7666
+ static replaceWithMany(oldOp, newOps) {
7667
+ if (newOps.length === 0) {
7668
+ OpList.remove(oldOp);
7669
+ return;
7670
+ }
7671
+ OpList.assertIsNotEnd(oldOp);
7672
+ OpList.assertIsOwned(oldOp);
7673
+ const listId = oldOp.debugListId;
7674
+ oldOp.debugListId = null;
7675
+ for (const newOp of newOps) {
7676
+ OpList.assertIsNotEnd(newOp);
7677
+ OpList.assertIsUnowned(newOp);
7678
+ }
7679
+ const {
7680
+ prev: oldPrev,
7681
+ next: oldNext
7682
+ } = oldOp;
7683
+ oldOp.prev = null;
7684
+ oldOp.next = null;
7685
+ let prev = oldPrev;
7686
+ for (const newOp of newOps) {
7687
+ OpList.assertIsUnowned(newOp);
7688
+ newOp.debugListId = listId;
7689
+ prev.next = newOp;
7690
+ newOp.prev = prev;
7691
+ newOp.next = null;
7692
+ prev = newOp;
7693
+ }
7694
+ const first = newOps[0];
7695
+ const last = prev;
7696
+ if (oldPrev !== null) {
7697
+ oldPrev.next = first;
7698
+ first.prev = oldPrev;
7699
+ }
7700
+ if (oldNext !== null) {
7701
+ oldNext.prev = last;
7702
+ last.next = oldNext;
7703
+ }
7704
+ }
7705
+ static remove(op) {
7706
+ OpList.assertIsNotEnd(op);
7707
+ OpList.assertIsOwned(op);
7708
+ op.prev.next = op.next;
7709
+ op.next.prev = op.prev;
7710
+ op.debugListId = null;
7711
+ op.prev = null;
7712
+ op.next = null;
7713
+ }
7714
+ static insertBefore(op, target) {
7715
+ if (Array.isArray(op)) {
7716
+ for (const o of op) {
7717
+ OpList.insertBefore(o, target);
7718
+ }
7719
+ return;
7720
+ }
7721
+ OpList.assertIsOwned(target);
7722
+ if (target.prev === null) {
7723
+ throw new Error(`AssertionError: illegal operation on list start`);
7724
+ }
7725
+ OpList.assertIsNotEnd(op);
7726
+ OpList.assertIsUnowned(op);
7727
+ op.debugListId = target.debugListId;
7728
+ op.prev = null;
7729
+ target.prev.next = op;
7730
+ op.prev = target.prev;
7731
+ op.next = target;
7732
+ target.prev = op;
7733
+ }
7734
+ static insertAfter(op, target) {
7735
+ OpList.assertIsOwned(target);
7736
+ if (target.next === null) {
7737
+ throw new Error(`AssertionError: illegal operation on list end`);
7738
+ }
7739
+ OpList.assertIsNotEnd(op);
7740
+ OpList.assertIsUnowned(op);
7741
+ op.debugListId = target.debugListId;
7742
+ target.next.prev = op;
7743
+ op.next = target.next;
7744
+ op.prev = target;
7745
+ target.next = op;
7746
+ }
7747
+ static assertIsUnowned(op) {
7748
+ if (op.debugListId !== null) {
7749
+ throw new Error(`AssertionError: illegal operation on owned node: ${OpKind[op.kind]}`);
7750
+ }
7751
+ }
7752
+ static assertIsOwned(op, byList) {
7753
+ if (op.debugListId === null) {
7754
+ throw new Error(`AssertionError: illegal operation on unowned node: ${OpKind[op.kind]}`);
7755
+ } else if (byList !== undefined && op.debugListId !== byList) {
7756
+ throw new Error(`AssertionError: node belongs to the wrong list (expected ${byList}, actual ${op.debugListId})`);
7757
+ }
7758
+ }
7759
+ static assertIsNotEnd(op) {
7760
+ if (op.kind === OpKind.ListEnd) {
7761
+ throw new Error(`AssertionError: illegal operation on list head or tail`);
7762
+ }
7763
+ }
7764
+ }
7765
+
7766
+ function createStatementOp(statement) {
7767
+ return {
7768
+ kind: OpKind.Statement,
7769
+ statement,
7770
+ ...NEW_OP
7771
+ };
7772
+ }
7773
+ function createVariableOp(xref, variable, initializer, flags) {
7774
+ return {
7775
+ kind: OpKind.Variable,
7776
+ xref,
7777
+ variable,
7778
+ initializer,
7779
+ flags,
7780
+ ...NEW_OP
7781
+ };
7782
+ }
7783
+ const NEW_OP = {
7784
+ debugListId: null,
7785
+ prev: null,
7786
+ next: null
7787
+ };
7788
+
7545
7789
  const ConsumesSlot = Symbol('ConsumesSlot');
7546
7790
  const DependsOnSlotContext = Symbol('DependsOnSlotContext');
7547
7791
  const ConsumesVarsTrait = Symbol('ConsumesVars');
@@ -7569,29 +7813,6 @@ function hasUsesVarOffsetTrait(expr) {
7569
7813
  return expr[UsesVarOffset] === true;
7570
7814
  }
7571
7815
 
7572
- function createStatementOp(statement) {
7573
- return {
7574
- kind: OpKind.Statement,
7575
- statement,
7576
- ...NEW_OP
7577
- };
7578
- }
7579
- function createVariableOp(xref, variable, initializer, flags) {
7580
- return {
7581
- kind: OpKind.Variable,
7582
- xref,
7583
- variable,
7584
- initializer,
7585
- flags,
7586
- ...NEW_OP
7587
- };
7588
- }
7589
- const NEW_OP = {
7590
- debugListId: null,
7591
- prev: null,
7592
- next: null
7593
- };
7594
-
7595
7816
  function createInterpolateTextOp(xref, interpolation, sourceSpan) {
7596
7817
  return {
7597
7818
  kind: OpKind.InterpolateText,
@@ -7997,9 +8218,6 @@ class TrackContextExpr extends ExpressionBase {
7997
8218
  class NextContextExpr extends ExpressionBase {
7998
8219
  kind = ExpressionKind.NextContext;
7999
8220
  steps = 1;
8000
- constructor() {
8001
- super();
8002
- }
8003
8221
  visitExpression() {}
8004
8222
  isEquivalent(e) {
8005
8223
  return e instanceof NextContextExpr && e.steps === this.steps;
@@ -8530,6 +8748,48 @@ class ConstCollectedExpr extends ExpressionBase {
8530
8748
  return new ConstCollectedExpr(this.expr);
8531
8749
  }
8532
8750
  }
8751
+ class ArrowFunctionExpr extends ExpressionBase {
8752
+ parameters;
8753
+ body;
8754
+ kind = ExpressionKind.ArrowFunction;
8755
+ [ConsumesVarsTrait] = true;
8756
+ [UsesVarOffset] = true;
8757
+ contextName = CONTEXT_NAME;
8758
+ currentViewName = 'view';
8759
+ varOffset = null;
8760
+ ops;
8761
+ constructor(parameters, body) {
8762
+ super();
8763
+ this.parameters = parameters;
8764
+ this.body = body;
8765
+ this.ops = new OpList();
8766
+ this.ops.push([createStatementOp(new ReturnStatement(body, body.sourceSpan))]);
8767
+ }
8768
+ visitExpression(visitor, context) {
8769
+ for (const op of this.ops) {
8770
+ visitExpressionsInOp(op, expr => {
8771
+ expr.visitExpression(visitor, context);
8772
+ });
8773
+ }
8774
+ }
8775
+ isEquivalent(e) {
8776
+ return e instanceof ArrowFunctionExpr && e.parameters.length === this.parameters.length && e.parameters.every((param, index) => param.isEquivalent(this.parameters[index])) && e.body.isEquivalent(this.body);
8777
+ }
8778
+ isConstant() {
8779
+ return false;
8780
+ }
8781
+ transformInternalExpressions(transform, flags) {
8782
+ for (const op of this.ops) {
8783
+ transformExpressionsInOp(op, transform, flags | (VisitorContextFlag.InChildOperation | VisitorContextFlag.InArrowFunctionOperation));
8784
+ }
8785
+ }
8786
+ clone() {
8787
+ const expr = new ArrowFunctionExpr(this.parameters, this.body);
8788
+ expr.varOffset = this.varOffset;
8789
+ expr.ops = this.ops;
8790
+ return expr;
8791
+ }
8792
+ }
8533
8793
  function visitExpressionsInOp(op, visitor) {
8534
8794
  transformExpressionsInOp(op, (expr, flags) => {
8535
8795
  visitor(expr, flags);
@@ -8540,6 +8800,7 @@ var VisitorContextFlag;
8540
8800
  (function (VisitorContextFlag) {
8541
8801
  VisitorContextFlag[VisitorContextFlag["None"] = 0] = "None";
8542
8802
  VisitorContextFlag[VisitorContextFlag["InChildOperation"] = 1] = "InChildOperation";
8803
+ VisitorContextFlag[VisitorContextFlag["InArrowFunctionOperation"] = 2] = "InArrowFunctionOperation";
8543
8804
  })(VisitorContextFlag || (VisitorContextFlag = {}));
8544
8805
  function transformExpressionsInInterpolation(interpolation, transform, flags) {
8545
8806
  for (let i = 0; i < interpolation.expressions.length; i++) {
@@ -8713,266 +8974,76 @@ function transformExpressionsInExpression(expr, transform, flags) {
8713
8974
  }
8714
8975
  } else if (expr instanceof LiteralMapExpr) {
8715
8976
  for (const entry of expr.entries) {
8716
- if (entry instanceof LiteralMapSpreadAssignment) {
8717
- entry.expression = transformExpressionsInExpression(entry.expression, transform, flags);
8718
- } else {
8719
- entry.value = transformExpressionsInExpression(entry.value, transform, flags);
8720
- }
8721
- }
8722
- } else if (expr instanceof ConditionalExpr) {
8723
- expr.condition = transformExpressionsInExpression(expr.condition, transform, flags);
8724
- expr.trueCase = transformExpressionsInExpression(expr.trueCase, transform, flags);
8725
- if (expr.falseCase !== null) {
8726
- expr.falseCase = transformExpressionsInExpression(expr.falseCase, transform, flags);
8727
- }
8728
- } else if (expr instanceof TypeofExpr) {
8729
- expr.expr = transformExpressionsInExpression(expr.expr, transform, flags);
8730
- } else if (expr instanceof VoidExpr) {
8731
- expr.expr = transformExpressionsInExpression(expr.expr, transform, flags);
8732
- } else if (expr instanceof LocalizedString) {
8733
- for (let i = 0; i < expr.expressions.length; i++) {
8734
- expr.expressions[i] = transformExpressionsInExpression(expr.expressions[i], transform, flags);
8735
- }
8736
- } else if (expr instanceof NotExpr) {
8737
- expr.condition = transformExpressionsInExpression(expr.condition, transform, flags);
8738
- } else if (expr instanceof TaggedTemplateLiteralExpr) {
8739
- expr.tag = transformExpressionsInExpression(expr.tag, transform, flags);
8740
- expr.template.expressions = expr.template.expressions.map(e => transformExpressionsInExpression(e, transform, flags));
8741
- } else if (expr instanceof ArrowFunctionExpr) {
8742
- if (Array.isArray(expr.body)) {
8743
- for (let i = 0; i < expr.body.length; i++) {
8744
- transformExpressionsInStatement(expr.body[i], transform, flags);
8745
- }
8746
- } else {
8747
- expr.body = transformExpressionsInExpression(expr.body, transform, flags);
8748
- }
8749
- } else if (expr instanceof WrappedNodeExpr) ; else if (expr instanceof TemplateLiteralExpr) {
8750
- for (let i = 0; i < expr.expressions.length; i++) {
8751
- expr.expressions[i] = transformExpressionsInExpression(expr.expressions[i], transform, flags);
8752
- }
8753
- } else if (expr instanceof ParenthesizedExpr) {
8754
- expr.expr = transformExpressionsInExpression(expr.expr, transform, flags);
8755
- } else if (expr instanceof SpreadElementExpr) {
8756
- expr.expression = transformExpressionsInExpression(expr.expression, transform, flags);
8757
- } else if (expr instanceof ReadVarExpr || expr instanceof ExternalExpr || expr instanceof LiteralExpr || expr instanceof RegularExpressionLiteralExpr) ; else {
8758
- throw new Error(`Unhandled expression kind: ${expr.constructor.name}`);
8759
- }
8760
- return transform(expr, flags);
8761
- }
8762
- function transformExpressionsInStatement(stmt, transform, flags) {
8763
- if (stmt instanceof ExpressionStatement) {
8764
- stmt.expr = transformExpressionsInExpression(stmt.expr, transform, flags);
8765
- } else if (stmt instanceof ReturnStatement) {
8766
- stmt.value = transformExpressionsInExpression(stmt.value, transform, flags);
8767
- } else if (stmt instanceof DeclareVarStmt) {
8768
- if (stmt.value !== undefined) {
8769
- stmt.value = transformExpressionsInExpression(stmt.value, transform, flags);
8770
- }
8771
- } else if (stmt instanceof IfStmt) {
8772
- stmt.condition = transformExpressionsInExpression(stmt.condition, transform, flags);
8773
- for (const caseStatement of stmt.trueCase) {
8774
- transformExpressionsInStatement(caseStatement, transform, flags);
8775
- }
8776
- for (const caseStatement of stmt.falseCase) {
8777
- transformExpressionsInStatement(caseStatement, transform, flags);
8778
- }
8779
- } else {
8780
- throw new Error(`Unhandled statement kind: ${stmt.constructor.name}`);
8781
- }
8782
- }
8783
- function isStringLiteral(expr) {
8784
- return expr instanceof LiteralExpr && typeof expr.value === 'string';
8785
- }
8786
-
8787
- class OpList {
8788
- static nextListId = 0;
8789
- debugListId = OpList.nextListId++;
8790
- head = {
8791
- kind: OpKind.ListEnd,
8792
- next: null,
8793
- prev: null,
8794
- debugListId: this.debugListId
8795
- };
8796
- tail = {
8797
- kind: OpKind.ListEnd,
8798
- next: null,
8799
- prev: null,
8800
- debugListId: this.debugListId
8801
- };
8802
- constructor() {
8803
- this.head.next = this.tail;
8804
- this.tail.prev = this.head;
8805
- }
8806
- push(op) {
8807
- if (Array.isArray(op)) {
8808
- for (const o of op) {
8809
- this.push(o);
8810
- }
8811
- return;
8812
- }
8813
- OpList.assertIsNotEnd(op);
8814
- OpList.assertIsUnowned(op);
8815
- op.debugListId = this.debugListId;
8816
- const oldLast = this.tail.prev;
8817
- op.prev = oldLast;
8818
- oldLast.next = op;
8819
- op.next = this.tail;
8820
- this.tail.prev = op;
8821
- }
8822
- prepend(ops) {
8823
- if (ops.length === 0) {
8824
- return;
8825
- }
8826
- for (const op of ops) {
8827
- OpList.assertIsNotEnd(op);
8828
- OpList.assertIsUnowned(op);
8829
- op.debugListId = this.debugListId;
8830
- }
8831
- const first = this.head.next;
8832
- let prev = this.head;
8833
- for (const op of ops) {
8834
- prev.next = op;
8835
- op.prev = prev;
8836
- prev = op;
8837
- }
8838
- prev.next = first;
8839
- first.prev = prev;
8840
- }
8841
- *[Symbol.iterator]() {
8842
- let current = this.head.next;
8843
- while (current !== this.tail) {
8844
- OpList.assertIsOwned(current, this.debugListId);
8845
- const next = current.next;
8846
- yield current;
8847
- current = next;
8848
- }
8849
- }
8850
- *reversed() {
8851
- let current = this.tail.prev;
8852
- while (current !== this.head) {
8853
- OpList.assertIsOwned(current, this.debugListId);
8854
- const prev = current.prev;
8855
- yield current;
8856
- current = prev;
8857
- }
8858
- }
8859
- static replace(oldOp, newOp) {
8860
- OpList.assertIsNotEnd(oldOp);
8861
- OpList.assertIsNotEnd(newOp);
8862
- OpList.assertIsOwned(oldOp);
8863
- OpList.assertIsUnowned(newOp);
8864
- newOp.debugListId = oldOp.debugListId;
8865
- if (oldOp.prev !== null) {
8866
- oldOp.prev.next = newOp;
8867
- newOp.prev = oldOp.prev;
8868
- }
8869
- if (oldOp.next !== null) {
8870
- oldOp.next.prev = newOp;
8871
- newOp.next = oldOp.next;
8872
- }
8873
- oldOp.debugListId = null;
8874
- oldOp.prev = null;
8875
- oldOp.next = null;
8876
- }
8877
- static replaceWithMany(oldOp, newOps) {
8878
- if (newOps.length === 0) {
8879
- OpList.remove(oldOp);
8880
- return;
8881
- }
8882
- OpList.assertIsNotEnd(oldOp);
8883
- OpList.assertIsOwned(oldOp);
8884
- const listId = oldOp.debugListId;
8885
- oldOp.debugListId = null;
8886
- for (const newOp of newOps) {
8887
- OpList.assertIsNotEnd(newOp);
8888
- OpList.assertIsUnowned(newOp);
8889
- }
8890
- const {
8891
- prev: oldPrev,
8892
- next: oldNext
8893
- } = oldOp;
8894
- oldOp.prev = null;
8895
- oldOp.next = null;
8896
- let prev = oldPrev;
8897
- for (const newOp of newOps) {
8898
- OpList.assertIsUnowned(newOp);
8899
- newOp.debugListId = listId;
8900
- prev.next = newOp;
8901
- newOp.prev = prev;
8902
- newOp.next = null;
8903
- prev = newOp;
8977
+ if (entry instanceof LiteralMapSpreadAssignment) {
8978
+ entry.expression = transformExpressionsInExpression(entry.expression, transform, flags);
8979
+ } else {
8980
+ entry.value = transformExpressionsInExpression(entry.value, transform, flags);
8981
+ }
8904
8982
  }
8905
- const first = newOps[0];
8906
- const last = prev;
8907
- if (oldPrev !== null) {
8908
- oldPrev.next = first;
8909
- first.prev = oldPrev;
8983
+ } else if (expr instanceof ConditionalExpr) {
8984
+ expr.condition = transformExpressionsInExpression(expr.condition, transform, flags);
8985
+ expr.trueCase = transformExpressionsInExpression(expr.trueCase, transform, flags);
8986
+ if (expr.falseCase !== null) {
8987
+ expr.falseCase = transformExpressionsInExpression(expr.falseCase, transform, flags);
8910
8988
  }
8911
- if (oldNext !== null) {
8912
- oldNext.prev = last;
8913
- last.next = oldNext;
8989
+ } else if (expr instanceof TypeofExpr) {
8990
+ expr.expr = transformExpressionsInExpression(expr.expr, transform, flags);
8991
+ } else if (expr instanceof VoidExpr) {
8992
+ expr.expr = transformExpressionsInExpression(expr.expr, transform, flags);
8993
+ } else if (expr instanceof LocalizedString) {
8994
+ for (let i = 0; i < expr.expressions.length; i++) {
8995
+ expr.expressions[i] = transformExpressionsInExpression(expr.expressions[i], transform, flags);
8914
8996
  }
8915
- }
8916
- static remove(op) {
8917
- OpList.assertIsNotEnd(op);
8918
- OpList.assertIsOwned(op);
8919
- op.prev.next = op.next;
8920
- op.next.prev = op.prev;
8921
- op.debugListId = null;
8922
- op.prev = null;
8923
- op.next = null;
8924
- }
8925
- static insertBefore(op, target) {
8926
- if (Array.isArray(op)) {
8927
- for (const o of op) {
8928
- OpList.insertBefore(o, target);
8997
+ } else if (expr instanceof NotExpr) {
8998
+ expr.condition = transformExpressionsInExpression(expr.condition, transform, flags);
8999
+ } else if (expr instanceof TaggedTemplateLiteralExpr) {
9000
+ expr.tag = transformExpressionsInExpression(expr.tag, transform, flags);
9001
+ expr.template.expressions = expr.template.expressions.map(e => transformExpressionsInExpression(e, transform, flags));
9002
+ } else if (expr instanceof ArrowFunctionExpr$1) {
9003
+ if (Array.isArray(expr.body)) {
9004
+ for (let i = 0; i < expr.body.length; i++) {
9005
+ transformExpressionsInStatement(expr.body[i], transform, flags | VisitorContextFlag.InChildOperation);
8929
9006
  }
8930
- return;
8931
- }
8932
- OpList.assertIsOwned(target);
8933
- if (target.prev === null) {
8934
- throw new Error(`AssertionError: illegal operation on list start`);
9007
+ } else {
9008
+ expr.body = transformExpressionsInExpression(expr.body, transform, flags | VisitorContextFlag.InChildOperation);
8935
9009
  }
8936
- OpList.assertIsNotEnd(op);
8937
- OpList.assertIsUnowned(op);
8938
- op.debugListId = target.debugListId;
8939
- op.prev = null;
8940
- target.prev.next = op;
8941
- op.prev = target.prev;
8942
- op.next = target;
8943
- target.prev = op;
8944
- }
8945
- static insertAfter(op, target) {
8946
- OpList.assertIsOwned(target);
8947
- if (target.next === null) {
8948
- throw new Error(`AssertionError: illegal operation on list end`);
9010
+ } else if (expr instanceof WrappedNodeExpr) ; else if (expr instanceof TemplateLiteralExpr) {
9011
+ for (let i = 0; i < expr.expressions.length; i++) {
9012
+ expr.expressions[i] = transformExpressionsInExpression(expr.expressions[i], transform, flags);
8949
9013
  }
8950
- OpList.assertIsNotEnd(op);
8951
- OpList.assertIsUnowned(op);
8952
- op.debugListId = target.debugListId;
8953
- target.next.prev = op;
8954
- op.next = target.next;
8955
- op.prev = target;
8956
- target.next = op;
9014
+ } else if (expr instanceof ParenthesizedExpr) {
9015
+ expr.expr = transformExpressionsInExpression(expr.expr, transform, flags);
9016
+ } else if (expr instanceof SpreadElementExpr) {
9017
+ expr.expression = transformExpressionsInExpression(expr.expression, transform, flags);
9018
+ } else if (expr instanceof ReadVarExpr || expr instanceof ExternalExpr || expr instanceof LiteralExpr || expr instanceof RegularExpressionLiteralExpr) ; else {
9019
+ throw new Error(`Unhandled expression kind: ${expr.constructor.name}`);
8957
9020
  }
8958
- static assertIsUnowned(op) {
8959
- if (op.debugListId !== null) {
8960
- throw new Error(`AssertionError: illegal operation on owned node: ${OpKind[op.kind]}`);
9021
+ return transform(expr, flags);
9022
+ }
9023
+ function transformExpressionsInStatement(stmt, transform, flags) {
9024
+ if (stmt instanceof ExpressionStatement) {
9025
+ stmt.expr = transformExpressionsInExpression(stmt.expr, transform, flags);
9026
+ } else if (stmt instanceof ReturnStatement) {
9027
+ stmt.value = transformExpressionsInExpression(stmt.value, transform, flags);
9028
+ } else if (stmt instanceof DeclareVarStmt) {
9029
+ if (stmt.value !== undefined) {
9030
+ stmt.value = transformExpressionsInExpression(stmt.value, transform, flags);
8961
9031
  }
8962
- }
8963
- static assertIsOwned(op, byList) {
8964
- if (op.debugListId === null) {
8965
- throw new Error(`AssertionError: illegal operation on unowned node: ${OpKind[op.kind]}`);
8966
- } else if (byList !== undefined && op.debugListId !== byList) {
8967
- throw new Error(`AssertionError: node belongs to the wrong list (expected ${byList}, actual ${op.debugListId})`);
9032
+ } else if (stmt instanceof IfStmt) {
9033
+ stmt.condition = transformExpressionsInExpression(stmt.condition, transform, flags);
9034
+ for (const caseStatement of stmt.trueCase) {
9035
+ transformExpressionsInStatement(caseStatement, transform, flags);
8968
9036
  }
8969
- }
8970
- static assertIsNotEnd(op) {
8971
- if (op.kind === OpKind.ListEnd) {
8972
- throw new Error(`AssertionError: illegal operation on list head or tail`);
9037
+ for (const caseStatement of stmt.falseCase) {
9038
+ transformExpressionsInStatement(caseStatement, transform, flags);
8973
9039
  }
9040
+ } else {
9041
+ throw new Error(`Unhandled statement kind: ${stmt.constructor.name}`);
8974
9042
  }
8975
9043
  }
9044
+ function isStringLiteral(expr) {
9045
+ return expr instanceof LiteralExpr && typeof expr.value === 'string';
9046
+ }
8976
9047
 
8977
9048
  class SlotHandle {
8978
9049
  slot = null;
@@ -9524,9 +9595,15 @@ class CompilationUnit {
9524
9595
  }
9525
9596
  create = new OpList();
9526
9597
  update = new OpList();
9598
+ functions = new Set();
9527
9599
  fnName = null;
9528
9600
  vars = null;
9529
9601
  *ops() {
9602
+ for (const expr of this.functions) {
9603
+ for (const op of expr.ops) {
9604
+ yield op;
9605
+ }
9606
+ }
9530
9607
  for (const op of this.create) {
9531
9608
  yield op;
9532
9609
  if (op.kind === OpKind.Listener || op.kind === OpKind.Animation || op.kind === OpKind.AnimationListener || op.kind === OpKind.TwoWayListener) {
@@ -9968,7 +10045,7 @@ function generateConditionalExpressions(job) {
9968
10045
  }
9969
10046
  }
9970
10047
 
9971
- const BINARY_OPERATORS = new Map([['&&', BinaryOperator.And], ['>', BinaryOperator.Bigger], ['>=', BinaryOperator.BiggerEquals], ['|', BinaryOperator.BitwiseOr], ['&', BinaryOperator.BitwiseAnd], ['/', BinaryOperator.Divide], ['=', BinaryOperator.Assign], ['==', BinaryOperator.Equals], ['===', BinaryOperator.Identical], ['<', BinaryOperator.Lower], ['<=', BinaryOperator.LowerEquals], ['-', BinaryOperator.Minus], ['%', BinaryOperator.Modulo], ['**', BinaryOperator.Exponentiation], ['*', BinaryOperator.Multiply], ['!=', BinaryOperator.NotEquals], ['!==', BinaryOperator.NotIdentical], ['??', BinaryOperator.NullishCoalesce], ['||', BinaryOperator.Or], ['+', BinaryOperator.Plus], ['in', BinaryOperator.In], ['+=', BinaryOperator.AdditionAssignment], ['-=', BinaryOperator.SubtractionAssignment], ['*=', BinaryOperator.MultiplicationAssignment], ['/=', BinaryOperator.DivisionAssignment], ['%=', BinaryOperator.RemainderAssignment], ['**=', BinaryOperator.ExponentiationAssignment], ['&&=', BinaryOperator.AndAssignment], ['||=', BinaryOperator.OrAssignment], ['??=', BinaryOperator.NullishCoalesceAssignment]]);
10048
+ const BINARY_OPERATORS = new Map([['&&', BinaryOperator.And], ['>', BinaryOperator.Bigger], ['>=', BinaryOperator.BiggerEquals], ['|', BinaryOperator.BitwiseOr], ['&', BinaryOperator.BitwiseAnd], ['/', BinaryOperator.Divide], ['=', BinaryOperator.Assign], ['==', BinaryOperator.Equals], ['===', BinaryOperator.Identical], ['<', BinaryOperator.Lower], ['<=', BinaryOperator.LowerEquals], ['-', BinaryOperator.Minus], ['%', BinaryOperator.Modulo], ['**', BinaryOperator.Exponentiation], ['*', BinaryOperator.Multiply], ['!=', BinaryOperator.NotEquals], ['!==', BinaryOperator.NotIdentical], ['??', BinaryOperator.NullishCoalesce], ['||', BinaryOperator.Or], ['+', BinaryOperator.Plus], ['in', BinaryOperator.In], ['instanceof', BinaryOperator.InstanceOf], ['+=', BinaryOperator.AdditionAssignment], ['-=', BinaryOperator.SubtractionAssignment], ['*=', BinaryOperator.MultiplicationAssignment], ['/=', BinaryOperator.DivisionAssignment], ['%=', BinaryOperator.RemainderAssignment], ['**=', BinaryOperator.ExponentiationAssignment], ['&&=', BinaryOperator.AndAssignment], ['||=', BinaryOperator.OrAssignment], ['??=', BinaryOperator.NullishCoalesceAssignment]]);
9972
10049
  function namespaceForKey(namespacePrefixKey) {
9973
10050
  const NAMESPACES = new Map([['svg', Namespace.SVG], ['math', Namespace.Math]]);
9974
10051
  if (namespacePrefixKey === null) {
@@ -10870,6 +10947,9 @@ function recursivelyProcessView(view, parentScope) {
10870
10947
  }
10871
10948
  }
10872
10949
  view.update.prepend(generateVariablesInScopeForView(view, scope, false));
10950
+ for (const expr of view.functions) {
10951
+ expr.ops.prepend(generateVariablesInScopeForView(view, getScopeForView(view, parentScope), true));
10952
+ }
10873
10953
  }
10874
10954
  function getScopeForView(view, parent) {
10875
10955
  const scope = {
@@ -15372,7 +15452,7 @@ var StringTokenKind;
15372
15452
  StringTokenKind[StringTokenKind["TemplateLiteralPart"] = 1] = "TemplateLiteralPart";
15373
15453
  StringTokenKind[StringTokenKind["TemplateLiteralEnd"] = 2] = "TemplateLiteralEnd";
15374
15454
  })(StringTokenKind || (StringTokenKind = {}));
15375
- const KEYWORDS = ['var', 'let', 'as', 'null', 'undefined', 'true', 'false', 'if', 'else', 'this', 'typeof', 'void', 'in'];
15455
+ const KEYWORDS = ['var', 'let', 'as', 'null', 'undefined', 'true', 'false', 'if', 'else', 'this', 'typeof', 'void', 'in', 'instanceof'];
15376
15456
  class Lexer {
15377
15457
  tokenize(text) {
15378
15458
  return new _Scanner(text).scan();
@@ -15442,6 +15522,9 @@ class Token {
15442
15522
  isKeywordIn() {
15443
15523
  return this.type === TokenType.Keyword && this.strValue === 'in';
15444
15524
  }
15525
+ isKeywordInstanceOf() {
15526
+ return this.type === TokenType.Keyword && this.strValue === 'instanceof';
15527
+ }
15445
15528
  isError() {
15446
15529
  return this.type === TokenType.Error;
15447
15530
  }
@@ -15618,8 +15701,9 @@ class _Scanner {
15618
15701
  case $GT:
15619
15702
  return this.scanComplexOperator(start, String.fromCharCode(peek), $EQ, '=');
15620
15703
  case $BANG:
15704
+ return this.scanComplexOperator(start, '!', $EQ, '=', $EQ, '=');
15621
15705
  case $EQ:
15622
- return this.scanComplexOperator(start, String.fromCharCode(peek), $EQ, '=', $EQ, '=');
15706
+ return this.scanEquals(start);
15623
15707
  case $AMPERSAND:
15624
15708
  return this.scanComplexOperator(start, '&', $AMPERSAND, '&', $EQ, '=');
15625
15709
  case $BAR:
@@ -15666,6 +15750,23 @@ class _Scanner {
15666
15750
  }
15667
15751
  return newOperatorToken(start, this.index, str);
15668
15752
  }
15753
+ scanEquals(start) {
15754
+ this.advance();
15755
+ let str = '=';
15756
+ if (this.peek === $EQ) {
15757
+ this.advance();
15758
+ str += '=';
15759
+ } else if (this.peek === $GT) {
15760
+ this.advance();
15761
+ str += '>';
15762
+ return newOperatorToken(start, this.index, str);
15763
+ }
15764
+ if (this.peek === $EQ) {
15765
+ this.advance();
15766
+ str += '=';
15767
+ }
15768
+ return newOperatorToken(start, this.index, str);
15769
+ }
15669
15770
  scanIdentifier() {
15670
15771
  const start = this.index;
15671
15772
  this.advance();
@@ -16449,7 +16550,7 @@ class _ParseAST {
16449
16550
  parseRelational() {
16450
16551
  const start = this.inputIndex;
16451
16552
  let result = this.parseAdditive();
16452
- while (this.next.type == TokenType.Operator || this.next.isKeywordIn) {
16553
+ while (this.next.type == TokenType.Operator || this.next.isKeywordIn() || this.next.isKeywordInstanceOf()) {
16453
16554
  const operator = this.next.strValue;
16454
16555
  switch (operator) {
16455
16556
  case '<':
@@ -16457,6 +16558,7 @@ class _ParseAST {
16457
16558
  case '<=':
16458
16559
  case '>=':
16459
16560
  case 'in':
16561
+ case 'instanceof':
16460
16562
  this.advance();
16461
16563
  const right = this.parseAdditive();
16462
16564
  result = new Binary(this.span(start), this.sourceSpan(start), operator, result, right);
@@ -16575,7 +16677,9 @@ class _ParseAST {
16575
16677
  }
16576
16678
  parsePrimary() {
16577
16679
  const start = this.inputIndex;
16578
- if (this.consumeOptionalCharacter($LPAREN)) {
16680
+ if (this.isArrowFunction()) {
16681
+ return this.parseArrowFunction(start);
16682
+ } else if (this.consumeOptionalCharacter($LPAREN)) {
16579
16683
  this.rparensExpected++;
16580
16684
  const result = this.parsePipe();
16581
16685
  if (!this.consumeOptionalCharacter($RPAREN)) {
@@ -16589,7 +16693,7 @@ class _ParseAST {
16589
16693
  return new LiteralPrimitive(this.span(start), this.sourceSpan(start), null);
16590
16694
  } else if (this.next.isKeywordUndefined()) {
16591
16695
  this.advance();
16592
- return new LiteralPrimitive(this.span(start), this.sourceSpan(start), void 0);
16696
+ return new LiteralPrimitive(this.span(start), this.sourceSpan(start), undefined);
16593
16697
  } else if (this.next.isKeywordTrue()) {
16594
16698
  this.advance();
16595
16699
  return new LiteralPrimitive(this.span(start), this.sourceSpan(start), true);
@@ -16950,6 +17054,78 @@ class _ParseAST {
16950
17054
  const end = flagsToken ? flagsToken.end : bodyToken.end;
16951
17055
  return new RegularExpressionLiteral(this.span(start, end), this.sourceSpan(start, end), bodyToken.strValue, flagsToken ? flagsToken.strValue : null);
16952
17056
  }
17057
+ parseArrowFunction(start) {
17058
+ let params;
17059
+ if (this.next.isIdentifier()) {
17060
+ const token = this.next;
17061
+ this.advance();
17062
+ params = [this.getArrowFunctionIdentifierArg(token)];
17063
+ } else if (this.next.isCharacter($LPAREN)) {
17064
+ this.rparensExpected++;
17065
+ this.advance();
17066
+ params = this.parseArrowFunctionParameters();
17067
+ this.rparensExpected--;
17068
+ } else {
17069
+ params = [];
17070
+ this.error(`Unexpected token ${this.next}`);
17071
+ }
17072
+ this.expectOperator('=>');
17073
+ let body;
17074
+ if (this.next.isCharacter($LBRACE)) {
17075
+ this.error('Multi-line arrow functions are not supported. If you meant to return an object literal, wrap it with parentheses.');
17076
+ body = new EmptyExpr$1(this.span(start), this.sourceSpan(start));
17077
+ } else {
17078
+ const prevFlags = this.parseFlags;
17079
+ this.parseFlags = 1;
17080
+ body = this.parseExpression();
17081
+ this.parseFlags = prevFlags;
17082
+ }
17083
+ return new ArrowFunction(this.span(start), this.sourceSpan(start), params, body);
17084
+ }
17085
+ parseArrowFunctionParameters() {
17086
+ const params = [];
17087
+ if (!this.consumeOptionalCharacter($RPAREN)) {
17088
+ while (this.next !== EOF) {
17089
+ if (this.next.isIdentifier()) {
17090
+ const token = this.next;
17091
+ this.advance();
17092
+ params.push(this.getArrowFunctionIdentifierArg(token));
17093
+ if (this.consumeOptionalCharacter($RPAREN)) {
17094
+ break;
17095
+ } else {
17096
+ this.expectCharacter($COMMA);
17097
+ }
17098
+ } else {
17099
+ this.error(`Unexpected token ${this.next}`);
17100
+ break;
17101
+ }
17102
+ }
17103
+ }
17104
+ return params;
17105
+ }
17106
+ getArrowFunctionIdentifierArg(token) {
17107
+ return new ArrowFunctionIdentifierParameter(token.strValue, this.span(token.index), this.sourceSpan(token.index));
17108
+ }
17109
+ isArrowFunction() {
17110
+ const start = this.index;
17111
+ const tokens = this.tokens;
17112
+ if (start > tokens.length - 2) {
17113
+ return false;
17114
+ }
17115
+ if (tokens[start].isIdentifier() && tokens[start + 1].isOperator('=>')) {
17116
+ return true;
17117
+ }
17118
+ if (tokens[start].isCharacter($LPAREN)) {
17119
+ let i = start + 1;
17120
+ for (i; i < tokens.length; i++) {
17121
+ if (!tokens[i].isIdentifier() && !tokens[i].isCharacter($COMMA)) {
17122
+ break;
17123
+ }
17124
+ }
17125
+ return i < tokens.length - 1 && tokens[i].isCharacter($RPAREN) && tokens[i + 1].isOperator('=>');
17126
+ }
17127
+ return false;
17128
+ }
16953
17129
  consumeStatementTerminator() {
16954
17130
  this.consumeOptionalCharacter($SEMICOLON) || this.consumeOptionalCharacter($COMMA);
16955
17131
  }
@@ -17104,6 +17280,15 @@ class SerializeExpressionVisitor {
17104
17280
  visitRegularExpressionLiteral(ast, context) {
17105
17281
  return `/${ast.body}/${ast.flags || ''}`;
17106
17282
  }
17283
+ visitArrowFunction(ast, context) {
17284
+ let params;
17285
+ if (ast.parameters.length === 1) {
17286
+ params = ast.parameters[0].name;
17287
+ } else {
17288
+ params = `(${ast.parameters.map(e => e.name).join(', ')})`;
17289
+ }
17290
+ return `${params} => ${ast.body.visit(this, context)}`;
17291
+ }
17107
17292
  visitASTWithSource(ast, context) {
17108
17293
  return ast.ast.visit(this, context);
17109
17294
  }
@@ -18831,7 +19016,7 @@ function getVariableName(unit, variable, state) {
18831
19016
  break;
18832
19017
  case SemanticVariableKind.Identifier:
18833
19018
  if (unit.job.compatibility === CompatibilityMode.TemplateDefinitionBuilder) {
18834
- const compatPrefix = variable.identifier === 'ctx' ? 'i' : '';
19019
+ const compatPrefix = variable.identifier === CONTEXT_NAME ? 'i' : '';
18835
19020
  variable.name = `${variable.identifier}_${compatPrefix}r${++state.index}`;
18836
19021
  } else {
18837
19022
  variable.name = `${variable.identifier}_i${state.index++}`;
@@ -18857,6 +19042,9 @@ function stripImportant(name) {
18857
19042
 
18858
19043
  function mergeNextContextExpressions(job) {
18859
19044
  for (const unit of job.units) {
19045
+ for (const expr of unit.functions) {
19046
+ mergeNextContextsInOps(expr.ops);
19047
+ }
18860
19048
  for (const op of unit.create) {
18861
19049
  if (op.kind === OpKind.Listener || op.kind === OpKind.Animation || op.kind === OpKind.AnimationListener || op.kind === OpKind.TwoWayListener) {
18862
19050
  mergeNextContextsInOps(op.handlerOps);
@@ -19227,7 +19415,7 @@ class PureFunctionConstant extends GenericKeyFn {
19227
19415
  }
19228
19416
  return variable('a' + expr.index);
19229
19417
  }, VisitorContextFlag.None);
19230
- return new DeclareVarStmt(declName, new ArrowFunctionExpr(fnParams, returnExpr), undefined, StmtModifier.Final);
19418
+ return new DeclareVarStmt(declName, new ArrowFunctionExpr$1(fnParams, returnExpr), undefined, StmtModifier.Final);
19231
19419
  }
19232
19420
  }
19233
19421
 
@@ -19719,6 +19907,9 @@ function pureFunction(varOffset, fn, args) {
19719
19907
  function attachSourceLocation(templatePath, locations) {
19720
19908
  return call(Identifiers.attachSourceLocations, [literal(templatePath), locations], null);
19721
19909
  }
19910
+ function arrowFunction(slotOffset, factory, contextRef) {
19911
+ return importExpr(Identifiers.arrowFunction).callFn([literal(slotOffset), factory, contextRef]);
19912
+ }
19722
19913
  function collateInterpolationArgs(strings, expressions) {
19723
19914
  if (strings.length < 1 || expressions.length !== strings.length - 1) {
19724
19915
  throw new Error(`AssertionError: expected specific shape of args for strings/expressions in interpolation`);
@@ -19803,7 +19994,7 @@ function reify(job) {
19803
19994
  }
19804
19995
  function reifyCreateOperations(unit, ops) {
19805
19996
  for (const op of ops) {
19806
- transformExpressionsInOp(op, reifyIrExpression, VisitorContextFlag.None);
19997
+ transformExpressionsInOp(op, expr => reifyIrExpression(unit, expr), VisitorContextFlag.None);
19807
19998
  switch (op.kind) {
19808
19999
  case OpKind.Text:
19809
20000
  OpList.replace(op, text(op.handle.slot, op.initialValue, op.sourceSpan));
@@ -20050,7 +20241,7 @@ function reifyCreateOperations(unit, ops) {
20050
20241
  }
20051
20242
  function reifyUpdateOperations(unit, ops) {
20052
20243
  for (const op of ops) {
20053
- transformExpressionsInOp(op, reifyIrExpression, VisitorContextFlag.None);
20244
+ transformExpressionsInOp(op, expr => reifyIrExpression(unit, expr), VisitorContextFlag.None);
20054
20245
  switch (op.kind) {
20055
20246
  case OpKind.Advance:
20056
20247
  OpList.replace(op, advance(op.delta, op.sourceSpan));
@@ -20135,7 +20326,7 @@ function reifyProperty(op) {
20135
20326
  function reifyControl(op) {
20136
20327
  return control(op.name, op.expression, op.sanitizer, op.sourceSpan);
20137
20328
  }
20138
- function reifyIrExpression(expr) {
20329
+ function reifyIrExpression(unit, expr) {
20139
20330
  if (!isIrExpression(expr)) {
20140
20331
  return expr;
20141
20332
  }
@@ -20191,6 +20382,11 @@ function reifyIrExpression(expr) {
20191
20382
  return storeLet(expr.value, expr.sourceSpan);
20192
20383
  case ExpressionKind.TrackContext:
20193
20384
  return variable('this');
20385
+ case ExpressionKind.ArrowFunction:
20386
+ if (expr.varOffset === null) {
20387
+ throw new Error(`AssertionError: variable offset was not assigned to arrow function`);
20388
+ }
20389
+ return arrowFunction(expr.varOffset, unit.job.pool.getSharedFunctionReference(getArrowFunctionFactory(unit, expr), 'arrowFn'), variable(CONTEXT_NAME));
20194
20390
  default:
20195
20391
  throw new Error(`AssertionError: Unsupported reification of ir.Expression kind: ${ExpressionKind[expr.kind]}`);
20196
20392
  }
@@ -20232,6 +20428,18 @@ function reifyTrackBy(unit, op) {
20232
20428
  op.trackByFn = unit.job.pool.getSharedFunctionReference(fn$1, '_forTrack');
20233
20429
  return op.trackByFn;
20234
20430
  }
20431
+ function getArrowFunctionFactory(unit, expr) {
20432
+ reifyUpdateOperations(unit, expr.ops);
20433
+ const statements = [];
20434
+ for (const op of expr.ops) {
20435
+ if (op.kind !== OpKind.Statement) {
20436
+ throw new Error(`AssertionError: expected reified statements, but found op ${OpKind[op.kind]}`);
20437
+ }
20438
+ statements.push(op.statement);
20439
+ }
20440
+ const body = statements.length === 1 && statements[0] instanceof ReturnStatement ? statements[0].value : statements;
20441
+ return arrowFn([new FnParam(expr.contextName), new FnParam(expr.currentViewName)], arrowFn(expr.parameters, body));
20442
+ }
20235
20443
 
20236
20444
  function removeEmptyBindings(job) {
20237
20445
  for (const unit of job.units) {
@@ -20307,13 +20515,16 @@ function removeUnusedI18nAttributesOps(job) {
20307
20515
 
20308
20516
  function resolveContexts(job) {
20309
20517
  for (const unit of job.units) {
20518
+ for (const expr of unit.functions) {
20519
+ processLexicalScope$1(unit, expr.ops);
20520
+ }
20310
20521
  processLexicalScope$1(unit, unit.create);
20311
20522
  processLexicalScope$1(unit, unit.update);
20312
20523
  }
20313
20524
  }
20314
20525
  function processLexicalScope$1(view, ops) {
20315
20526
  const scope = new Map();
20316
- scope.set(view.xref, variable('ctx'));
20527
+ scope.set(view.xref, variable(CONTEXT_NAME));
20317
20528
  for (const op of ops) {
20318
20529
  switch (op.kind) {
20319
20530
  case OpKind.Variable:
@@ -20337,7 +20548,7 @@ function processLexicalScope$1(view, ops) {
20337
20548
  }
20338
20549
  }
20339
20550
  if (view === view.job.root) {
20340
- scope.set(view.xref, variable('ctx'));
20551
+ scope.set(view.xref, variable(CONTEXT_NAME));
20341
20552
  }
20342
20553
  for (const op of ops) {
20343
20554
  transformExpressionsInOp(op, expr => {
@@ -20663,6 +20874,9 @@ function updatePlaceholder(op, value, i18nContexts, icuPlaceholders) {
20663
20874
 
20664
20875
  function resolveNames(job) {
20665
20876
  for (const unit of job.units) {
20877
+ for (const expr of unit.functions) {
20878
+ processLexicalScope(unit, expr.ops, null);
20879
+ }
20666
20880
  processLexicalScope(unit, unit.create, null);
20667
20881
  processLexicalScope(unit, unit.update, null);
20668
20882
  }
@@ -20713,7 +20927,7 @@ function processLexicalScope(unit, ops, savedView) {
20713
20927
  }
20714
20928
  }
20715
20929
  for (const op of ops) {
20716
- if (op.kind == OpKind.Listener || op.kind === OpKind.TwoWayListener || op.kind === OpKind.Animation || op.kind === OpKind.AnimationListener) {
20930
+ if (op.kind === OpKind.Listener || op.kind === OpKind.TwoWayListener || op.kind === OpKind.Animation || op.kind === OpKind.AnimationListener) {
20717
20931
  continue;
20718
20932
  }
20719
20933
  transformExpressionsInOp(op, expr => {
@@ -20786,38 +21000,45 @@ function getOnlySecurityContext(securityContext) {
20786
21000
 
20787
21001
  function saveAndRestoreView(job) {
20788
21002
  for (const unit of job.units) {
21003
+ for (const expr of unit.functions) {
21004
+ if (needsRestoreView(job, unit, expr.ops)) {
21005
+ addSaveRestoreViewOperation(unit, expr.ops, variable(expr.currentViewName));
21006
+ }
21007
+ }
20789
21008
  unit.create.prepend([createVariableOp(unit.job.allocateXrefId(), {
20790
21009
  kind: SemanticVariableKind.SavedView,
20791
21010
  name: null,
20792
21011
  view: unit.xref
20793
21012
  }, new GetCurrentViewExpr(), VariableFlags.None)]);
20794
21013
  for (const op of unit.create) {
20795
- if (op.kind !== OpKind.Listener && op.kind !== OpKind.TwoWayListener && op.kind !== OpKind.Animation && op.kind !== OpKind.AnimationListener) {
20796
- continue;
20797
- }
20798
- let needsRestoreView = unit !== job.root;
20799
- if (!needsRestoreView) {
20800
- for (const handlerOp of op.handlerOps) {
20801
- visitExpressionsInOp(handlerOp, expr => {
20802
- if (expr instanceof ReferenceExpr || expr instanceof ContextLetReferenceExpr) {
20803
- needsRestoreView = true;
20804
- }
20805
- });
21014
+ if (op.kind === OpKind.Listener || op.kind === OpKind.TwoWayListener || op.kind === OpKind.Animation || op.kind === OpKind.AnimationListener) {
21015
+ if (needsRestoreView(job, unit, op.handlerOps)) {
21016
+ addSaveRestoreViewOperation(unit, op.handlerOps, unit.xref);
20806
21017
  }
20807
21018
  }
20808
- if (needsRestoreView) {
20809
- addSaveRestoreViewOperationToListener(unit, op);
20810
- }
20811
21019
  }
20812
21020
  }
20813
21021
  }
20814
- function addSaveRestoreViewOperationToListener(unit, op) {
20815
- op.handlerOps.prepend([createVariableOp(unit.job.allocateXrefId(), {
21022
+ function needsRestoreView(job, unit, opList) {
21023
+ let result = unit !== job.root;
21024
+ if (!result) {
21025
+ for (const innerOp of opList) {
21026
+ visitExpressionsInOp(innerOp, expr => {
21027
+ if (expr instanceof ReferenceExpr || expr instanceof ContextLetReferenceExpr) {
21028
+ result = true;
21029
+ }
21030
+ });
21031
+ }
21032
+ }
21033
+ return result;
21034
+ }
21035
+ function addSaveRestoreViewOperation(unit, opList, restoreViewTarget) {
21036
+ opList.prepend([createVariableOp(unit.job.allocateXrefId(), {
20816
21037
  kind: SemanticVariableKind.Context,
20817
21038
  name: null,
20818
21039
  view: unit.xref
20819
- }, new RestoreViewExpr(unit.xref), VariableFlags.None)]);
20820
- for (const handlerOp of op.handlerOps) {
21040
+ }, new RestoreViewExpr(restoreViewTarget), VariableFlags.None)]);
21041
+ for (const handlerOp of opList) {
20821
21042
  if (handlerOp.kind === OpKind.Statement && handlerOp.statement instanceof ReturnStatement) {
20822
21043
  handlerOp.statement.value = new ResetViewExpr(handlerOp.statement.value);
20823
21044
  }
@@ -20975,6 +21196,9 @@ function generateTemporaryVariables(job) {
20975
21196
  for (const unit of job.units) {
20976
21197
  unit.create.prepend(generateTemporaries(unit.create));
20977
21198
  unit.update.prepend(generateTemporaries(unit.update));
21199
+ for (const expr of unit.functions) {
21200
+ expr.ops.prepend(generateTemporaries(expr.ops));
21201
+ }
20978
21202
  }
20979
21203
  }
20980
21204
  function generateTemporaries(ops) {
@@ -21137,35 +21361,43 @@ function countVariables(job) {
21137
21361
  varCount += varsUsedByOp(op);
21138
21362
  }
21139
21363
  }
21140
- for (const op of unit.ops()) {
21141
- visitExpressionsInOp(op, expr => {
21142
- if (!isIrExpression(expr)) {
21143
- return;
21144
- }
21145
- if (job.compatibility === CompatibilityMode.TemplateDefinitionBuilder && expr instanceof PureFunctionExpr) {
21146
- return;
21147
- }
21148
- if (hasUsesVarOffsetTrait(expr)) {
21149
- expr.varOffset = varCount;
21150
- }
21151
- if (hasConsumesVarsTrait(expr)) {
21152
- varCount += varsUsedByIrExpression(expr);
21153
- }
21154
- });
21364
+ const firstPassCountExpressionVars = expr => {
21365
+ if (!isIrExpression(expr)) {
21366
+ return;
21367
+ }
21368
+ if (job.compatibility === CompatibilityMode.TemplateDefinitionBuilder && expr instanceof PureFunctionExpr) {
21369
+ return;
21370
+ }
21371
+ if (hasUsesVarOffsetTrait(expr)) {
21372
+ expr.varOffset = varCount;
21373
+ }
21374
+ if (hasConsumesVarsTrait(expr)) {
21375
+ varCount += varsUsedByIrExpression(expr);
21376
+ }
21377
+ };
21378
+ const secondPassCountExpressionVars = expr => {
21379
+ if (!isIrExpression(expr) || !(expr instanceof PureFunctionExpr)) {
21380
+ return;
21381
+ }
21382
+ if (hasUsesVarOffsetTrait(expr)) {
21383
+ expr.varOffset = varCount;
21384
+ }
21385
+ if (hasConsumesVarsTrait(expr)) {
21386
+ varCount += varsUsedByIrExpression(expr);
21387
+ }
21388
+ };
21389
+ for (const createOp of unit.create) {
21390
+ visitExpressionsInOp(createOp, firstPassCountExpressionVars);
21391
+ }
21392
+ for (const updateOp of unit.update) {
21393
+ visitExpressionsInOp(updateOp, firstPassCountExpressionVars);
21155
21394
  }
21156
21395
  if (job.compatibility === CompatibilityMode.TemplateDefinitionBuilder) {
21157
- for (const op of unit.ops()) {
21158
- visitExpressionsInOp(op, expr => {
21159
- if (!isIrExpression(expr) || !(expr instanceof PureFunctionExpr)) {
21160
- return;
21161
- }
21162
- if (hasUsesVarOffsetTrait(expr)) {
21163
- expr.varOffset = varCount;
21164
- }
21165
- if (hasConsumesVarsTrait(expr)) {
21166
- varCount += varsUsedByIrExpression(expr);
21167
- }
21168
- });
21396
+ for (const createOp of unit.create) {
21397
+ visitExpressionsInOp(createOp, secondPassCountExpressionVars);
21398
+ }
21399
+ for (const updateOp of unit.update) {
21400
+ visitExpressionsInOp(updateOp, secondPassCountExpressionVars);
21169
21401
  }
21170
21402
  }
21171
21403
  unit.vars = varCount;
@@ -21233,6 +21465,7 @@ function varsUsedByIrExpression(expr) {
21233
21465
  case ExpressionKind.PipeBindingVariadic:
21234
21466
  return 1 + expr.numArgs;
21235
21467
  case ExpressionKind.StoreLet:
21468
+ case ExpressionKind.ArrowFunction:
21236
21469
  return 1;
21237
21470
  default:
21238
21471
  throw new Error(`AssertionError: unhandled ConsumesVarsTrait expression ${expr.constructor.name}`);
@@ -21250,6 +21483,9 @@ function isSingletonInterpolation(expr) {
21250
21483
 
21251
21484
  function optimizeVariables(job) {
21252
21485
  for (const unit of job.units) {
21486
+ for (const expr of unit.functions) {
21487
+ inlineAlwaysInlineVariables(expr.ops);
21488
+ }
21253
21489
  inlineAlwaysInlineVariables(unit.create);
21254
21490
  inlineAlwaysInlineVariables(unit.update);
21255
21491
  for (const op of unit.create) {
@@ -21259,15 +21495,20 @@ function optimizeVariables(job) {
21259
21495
  inlineAlwaysInlineVariables(op.trackByOps);
21260
21496
  }
21261
21497
  }
21262
- optimizeVariablesInOpList(unit.create, job.compatibility);
21263
- optimizeVariablesInOpList(unit.update, job.compatibility);
21498
+ for (const expr of unit.functions) {
21499
+ optimizeVariablesInOpList(expr.ops, job.compatibility, null);
21500
+ optimizeSaveRestoreView(expr.ops);
21501
+ }
21264
21502
  for (const op of unit.create) {
21265
21503
  if (op.kind === OpKind.Listener || op.kind === OpKind.Animation || op.kind === OpKind.AnimationListener || op.kind === OpKind.TwoWayListener) {
21266
- optimizeVariablesInOpList(op.handlerOps, job.compatibility);
21504
+ optimizeVariablesInOpList(op.handlerOps, job.compatibility, skipArrowFunctionOps);
21505
+ optimizeSaveRestoreView(op.handlerOps);
21267
21506
  } else if (op.kind === OpKind.RepeaterCreate && op.trackByOps !== null) {
21268
- optimizeVariablesInOpList(op.trackByOps, job.compatibility);
21507
+ optimizeVariablesInOpList(op.trackByOps, job.compatibility, skipArrowFunctionOps);
21269
21508
  }
21270
21509
  }
21510
+ optimizeVariablesInOpList(unit.create, job.compatibility, skipArrowFunctionOps);
21511
+ optimizeVariablesInOpList(unit.update, job.compatibility, skipArrowFunctionOps);
21271
21512
  }
21272
21513
  }
21273
21514
  var Fence;
@@ -21277,6 +21518,9 @@ var Fence;
21277
21518
  Fence[Fence["ViewContextWrite"] = 2] = "ViewContextWrite";
21278
21519
  Fence[Fence["SideEffectful"] = 4] = "SideEffectful";
21279
21520
  })(Fence || (Fence = {}));
21521
+ function skipArrowFunctionOps(flags) {
21522
+ return !(flags & VisitorContextFlag.InArrowFunctionOperation);
21523
+ }
21280
21524
  function inlineAlwaysInlineVariables(ops) {
21281
21525
  const vars = new Map();
21282
21526
  for (const op of ops) {
@@ -21300,7 +21544,7 @@ function inlineAlwaysInlineVariables(ops) {
21300
21544
  OpList.remove(op);
21301
21545
  }
21302
21546
  }
21303
- function optimizeVariablesInOpList(ops, compatibility) {
21547
+ function optimizeVariablesInOpList(ops, compatibility, predicate) {
21304
21548
  const varDecls = new Map();
21305
21549
  const varUsages = new Map();
21306
21550
  const varRemoteUsages = new Set();
@@ -21313,8 +21557,8 @@ function optimizeVariablesInOpList(ops, compatibility) {
21313
21557
  varDecls.set(op.xref, op);
21314
21558
  varUsages.set(op.xref, 0);
21315
21559
  }
21316
- opMap.set(op, collectOpInfo(op));
21317
- countVariableUsages(op, varUsages, varRemoteUsages);
21560
+ opMap.set(op, collectOpInfo(op, predicate));
21561
+ countVariableUsages(op, varUsages, varRemoteUsages, predicate);
21318
21562
  }
21319
21563
  let contextIsUsed = false;
21320
21564
  for (const op of ops.reversed()) {
@@ -21397,19 +21641,17 @@ function fencesForIrExpression(expr) {
21397
21641
  return Fence.None;
21398
21642
  }
21399
21643
  }
21400
- function collectOpInfo(op) {
21644
+ function collectOpInfo(op, predicate) {
21401
21645
  let fences = Fence.None;
21402
21646
  const variablesUsed = new Set();
21403
- visitExpressionsInOp(op, expr => {
21404
- if (!isIrExpression(expr)) {
21647
+ visitExpressionsInOp(op, (expr, flags) => {
21648
+ if (!isIrExpression(expr) || predicate !== null && !predicate(flags)) {
21405
21649
  return;
21406
21650
  }
21407
- switch (expr.kind) {
21408
- case ExpressionKind.ReadVariable:
21409
- variablesUsed.add(expr.xref);
21410
- break;
21411
- default:
21412
- fences |= fencesForIrExpression(expr);
21651
+ if (expr.kind === ExpressionKind.ReadVariable) {
21652
+ variablesUsed.add(expr.xref);
21653
+ } else {
21654
+ fences |= fencesForIrExpression(expr);
21413
21655
  }
21414
21656
  });
21415
21657
  return {
@@ -21417,9 +21659,9 @@ function collectOpInfo(op) {
21417
21659
  variablesUsed
21418
21660
  };
21419
21661
  }
21420
- function countVariableUsages(op, varUsages, varRemoteUsage) {
21662
+ function countVariableUsages(op, varUsages, varRemoteUsage, predicate) {
21421
21663
  visitExpressionsInOp(op, (expr, flags) => {
21422
- if (!isIrExpression(expr)) {
21664
+ if (!isIrExpression(expr) || predicate !== null && !predicate(flags)) {
21423
21665
  return;
21424
21666
  }
21425
21667
  if (expr.kind !== ExpressionKind.ReadVariable) {
@@ -21495,7 +21737,7 @@ function tryInlineVariableInitializer(id, initializer, target, declFences) {
21495
21737
  function allowConservativeInlining(decl, target) {
21496
21738
  switch (decl.variable.kind) {
21497
21739
  case SemanticVariableKind.Identifier:
21498
- if (decl.initializer instanceof ReadVarExpr && decl.initializer.name === 'ctx') {
21740
+ if (decl.initializer instanceof ReadVarExpr && decl.initializer.name === CONTEXT_NAME) {
21499
21741
  return true;
21500
21742
  }
21501
21743
  return false;
@@ -21505,6 +21747,14 @@ function allowConservativeInlining(decl, target) {
21505
21747
  return true;
21506
21748
  }
21507
21749
  }
21750
+ function optimizeSaveRestoreView(ops) {
21751
+ const head = ops.head.next;
21752
+ const tail = ops.tail.prev;
21753
+ if (head !== null && tail !== null && head.next === tail && head.kind === OpKind.Statement && head.statement instanceof ExpressionStatement && head.statement.expr instanceof RestoreViewExpr && tail.kind === OpKind.Statement && tail.statement instanceof ReturnStatement && tail.statement.value instanceof ResetViewExpr) {
21754
+ OpList.remove(head);
21755
+ tail.statement.value = tail.statement.value.expr;
21756
+ }
21757
+ }
21508
21758
 
21509
21759
  function wrapI18nIcus(job) {
21510
21760
  for (const unit of job.units) {
@@ -21535,6 +21785,32 @@ function wrapI18nIcus(job) {
21535
21785
  }
21536
21786
  }
21537
21787
 
21788
+ function generateArrowFunctions(job) {
21789
+ for (const unit of job.units) {
21790
+ for (const op of unit.create) {
21791
+ if (op.kind !== OpKind.Animation && op.kind !== OpKind.AnimationListener && op.kind !== OpKind.Listener && op.kind !== OpKind.TwoWayListener) {
21792
+ addArrowFunctions(unit, op);
21793
+ }
21794
+ }
21795
+ for (const op of unit.update) {
21796
+ addArrowFunctions(unit, op);
21797
+ }
21798
+ }
21799
+ }
21800
+ function addArrowFunctions(unit, op) {
21801
+ transformExpressionsInOp(op, (expr, flags) => {
21802
+ if (!(expr instanceof ArrowFunctionExpr$1) || flags & VisitorContextFlag.InChildOperation) {
21803
+ return expr;
21804
+ }
21805
+ if (Array.isArray(expr.body)) {
21806
+ throw new Error('AssertionError: unexpected multi-line arrow function');
21807
+ }
21808
+ const arrowFunction = new ArrowFunctionExpr(expr.params, expr.body);
21809
+ unit.functions.add(arrowFunction);
21810
+ return arrowFunction;
21811
+ }, VisitorContextFlag.None);
21812
+ }
21813
+
21538
21814
  /**
21539
21815
  *
21540
21816
  * @license
@@ -21603,6 +21879,9 @@ const phases = [{
21603
21879
  }, {
21604
21880
  kind: CompilationJobKind.Tmpl,
21605
21881
  fn: createVariadicPipes
21882
+ }, {
21883
+ kind: CompilationJobKind.Both,
21884
+ fn: generateArrowFunctions
21606
21885
  }, {
21607
21886
  kind: CompilationJobKind.Both,
21608
21887
  fn: generatePureLiteralStructures
@@ -21784,13 +22063,13 @@ function emitView(view) {
21784
22063
  }
21785
22064
  const createCond = maybeGenerateRfBlock(1, createStatements);
21786
22065
  const updateCond = maybeGenerateRfBlock(2, updateStatements);
21787
- return fn([new FnParam('rf'), new FnParam('ctx')], [...createCond, ...updateCond], undefined, undefined, view.fnName);
22066
+ return fn([new FnParam(RENDER_FLAGS), new FnParam(CONTEXT_NAME)], [...createCond, ...updateCond], undefined, undefined, view.fnName);
21788
22067
  }
21789
22068
  function maybeGenerateRfBlock(flag, statements) {
21790
22069
  if (statements.length === 0) {
21791
22070
  return [];
21792
22071
  }
21793
- return [ifStmt(new BinaryOperatorExpr(BinaryOperator.BitwiseAnd, variable('rf'), literal(flag)), statements)];
22072
+ return [ifStmt(new BinaryOperatorExpr(BinaryOperator.BitwiseAnd, variable(RENDER_FLAGS), literal(flag)), statements)];
21794
22073
  }
21795
22074
  function emitHostBindingFunction(job) {
21796
22075
  if (job.root.fnName === null) {
@@ -21815,7 +22094,7 @@ function emitHostBindingFunction(job) {
21815
22094
  }
21816
22095
  const createCond = maybeGenerateRfBlock(1, createStatements);
21817
22096
  const updateCond = maybeGenerateRfBlock(2, updateStatements);
21818
- return fn([new FnParam('rf'), new FnParam('ctx')], [...createCond, ...updateCond], undefined, undefined, job.root.fnName);
22097
+ return fn([new FnParam(RENDER_FLAGS), new FnParam(CONTEXT_NAME)], [...createCond, ...updateCond], undefined, undefined, job.root.fnName);
21819
22098
  }
21820
22099
 
21821
22100
  const compatibilityMode = CompatibilityMode.TemplateDefinitionBuilder;
@@ -22365,6 +22644,8 @@ function convertAst(ast, job, baseSourceSpan) {
22365
22644
  return new RegularExpressionLiteralExpr(ast.body, ast.flags, baseSourceSpan);
22366
22645
  } else if (ast instanceof SpreadElement) {
22367
22646
  return new SpreadElementExpr(convertAst(ast.expression, job, baseSourceSpan));
22647
+ } else if (ast instanceof ArrowFunction) {
22648
+ return updateParameterReferences(arrowFn(ast.parameters.map(arg => new FnParam(arg.name)), convertAst(ast.body, job, baseSourceSpan)));
22368
22649
  } else {
22369
22650
  throw new Error(`Unhandled expression type "${ast.constructor.name}" in file "${baseSourceSpan?.start.file.url}"`);
22370
22651
  }
@@ -22588,6 +22869,19 @@ function ingestControlFlowInsertionPoint(unit, xref, node) {
22588
22869
  }
22589
22870
  return null;
22590
22871
  }
22872
+ function updateParameterReferences(root) {
22873
+ const parameterNames = new Set(root.params.map(param => param.name));
22874
+ return transformExpressionsInExpression(root, expr => {
22875
+ if (expr instanceof ArrowFunctionExpr$1) {
22876
+ for (const param of expr.params) {
22877
+ parameterNames.add(param.name);
22878
+ }
22879
+ } else if (expr instanceof LexicalReadExpr && parameterNames.has(expr.name)) {
22880
+ return variable(expr.name);
22881
+ }
22882
+ return expr;
22883
+ }, VisitorContextFlag.None);
22884
+ }
22591
22885
 
22592
22886
  let ENABLE_TEMPLATE_SOURCE_LOCATIONS = false;
22593
22887
  function setEnableTemplateSourceLocations(value) {
@@ -28205,7 +28499,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
28205
28499
  function compileDeclareClassMetadata(metadata) {
28206
28500
  const definitionMap = new DefinitionMap();
28207
28501
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
28208
- definitionMap.set('version', literal('21.1.0'));
28502
+ definitionMap.set('version', literal('21.2.0-next.0'));
28209
28503
  definitionMap.set('ngImport', importExpr(Identifiers.core));
28210
28504
  definitionMap.set('type', metadata.type);
28211
28505
  definitionMap.set('decorators', metadata.decorators);
@@ -28223,7 +28517,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
28223
28517
  callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? literal(null));
28224
28518
  callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? literal(null));
28225
28519
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
28226
- definitionMap.set('version', literal('21.1.0'));
28520
+ definitionMap.set('version', literal('21.2.0-next.0'));
28227
28521
  definitionMap.set('ngImport', importExpr(Identifiers.core));
28228
28522
  definitionMap.set('type', metadata.type);
28229
28523
  definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
@@ -28296,7 +28590,7 @@ function createDirectiveDefinitionMap(meta) {
28296
28590
  const definitionMap = new DefinitionMap();
28297
28591
  const minVersion = getMinimumVersionForPartialOutput(meta);
28298
28592
  definitionMap.set('minVersion', literal(minVersion));
28299
- definitionMap.set('version', literal('21.1.0'));
28593
+ definitionMap.set('version', literal('21.2.0-next.0'));
28300
28594
  definitionMap.set('type', meta.type.value);
28301
28595
  if (meta.isStandalone !== undefined) {
28302
28596
  definitionMap.set('isStandalone', literal(meta.isStandalone));
@@ -28631,7 +28925,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
28631
28925
  function compileDeclareFactoryFunction(meta) {
28632
28926
  const definitionMap = new DefinitionMap();
28633
28927
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
28634
- definitionMap.set('version', literal('21.1.0'));
28928
+ definitionMap.set('version', literal('21.2.0-next.0'));
28635
28929
  definitionMap.set('ngImport', importExpr(Identifiers.core));
28636
28930
  definitionMap.set('type', meta.type.value);
28637
28931
  definitionMap.set('deps', compileDependencies(meta.deps));
@@ -28657,7 +28951,7 @@ function compileDeclareInjectableFromMetadata(meta) {
28657
28951
  function createInjectableDefinitionMap(meta) {
28658
28952
  const definitionMap = new DefinitionMap();
28659
28953
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
28660
- definitionMap.set('version', literal('21.1.0'));
28954
+ definitionMap.set('version', literal('21.2.0-next.0'));
28661
28955
  definitionMap.set('ngImport', importExpr(Identifiers.core));
28662
28956
  definitionMap.set('type', meta.type.value);
28663
28957
  if (meta.providedIn !== undefined) {
@@ -28698,7 +28992,7 @@ function compileDeclareInjectorFromMetadata(meta) {
28698
28992
  function createInjectorDefinitionMap(meta) {
28699
28993
  const definitionMap = new DefinitionMap();
28700
28994
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
28701
- definitionMap.set('version', literal('21.1.0'));
28995
+ definitionMap.set('version', literal('21.2.0-next.0'));
28702
28996
  definitionMap.set('ngImport', importExpr(Identifiers.core));
28703
28997
  definitionMap.set('type', meta.type.value);
28704
28998
  definitionMap.set('providers', meta.providers);
@@ -28725,7 +29019,7 @@ function createNgModuleDefinitionMap(meta) {
28725
29019
  throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
28726
29020
  }
28727
29021
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
28728
- definitionMap.set('version', literal('21.1.0'));
29022
+ definitionMap.set('version', literal('21.2.0-next.0'));
28729
29023
  definitionMap.set('ngImport', importExpr(Identifiers.core));
28730
29024
  definitionMap.set('type', meta.type.value);
28731
29025
  if (meta.bootstrap.length > 0) {
@@ -28763,7 +29057,7 @@ function compileDeclarePipeFromMetadata(meta) {
28763
29057
  function createPipeDefinitionMap(meta) {
28764
29058
  const definitionMap = new DefinitionMap();
28765
29059
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
28766
- definitionMap.set('version', literal('21.1.0'));
29060
+ definitionMap.set('version', literal('21.2.0-next.0'));
28767
29061
  definitionMap.set('ngImport', importExpr(Identifiers.core));
28768
29062
  definitionMap.set('type', meta.type.value);
28769
29063
  if (meta.isStandalone !== undefined) {
@@ -28837,9 +29131,9 @@ function compileHmrUpdateCallback(definitions, constantStatements, meta) {
28837
29131
  return new DeclareFunctionStmt(`${meta.className}_UpdateMetadata`, params, body, null, StmtModifier.Final);
28838
29132
  }
28839
29133
 
28840
- const VERSION = new Version('21.1.0');
29134
+ const VERSION = new Version('21.2.0-next.0');
28841
29135
 
28842
29136
  publishFacade(_global);
28843
29137
 
28844
- export { AST, ASTWithName, ASTWithSource, AbsoluteSourceSpan, ArrayType, ArrowFunctionExpr, 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, 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 };
29138
+ 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, 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 };
28845
29139
  //# sourceMappingURL=compiler.mjs.map