@angular/compiler 21.1.1 → 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.
- package/fesm2022/compiler.mjs +680 -383
- package/fesm2022/compiler.mjs.map +1 -1
- package/package.json +1 -1
- package/types/compiler.d.ts +34 -14
package/fesm2022/compiler.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v21.
|
|
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["
|
|
788
|
-
BinaryOperator[BinaryOperator["
|
|
789
|
-
BinaryOperator[BinaryOperator["
|
|
790
|
-
BinaryOperator[BinaryOperator["
|
|
791
|
-
BinaryOperator[BinaryOperator["
|
|
792
|
-
BinaryOperator[BinaryOperator["
|
|
793
|
-
BinaryOperator[BinaryOperator["
|
|
794
|
-
BinaryOperator[BinaryOperator["
|
|
795
|
-
BinaryOperator[BinaryOperator["
|
|
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);
|
|
@@ -2992,6 +2993,10 @@ class Identifiers {
|
|
|
2992
2993
|
name: 'ɵɵreadContextLet',
|
|
2993
2994
|
moduleName: CORE
|
|
2994
2995
|
};
|
|
2996
|
+
static arrowFunction = {
|
|
2997
|
+
name: 'ɵɵarrowFunction',
|
|
2998
|
+
moduleName: CORE
|
|
2999
|
+
};
|
|
2995
3000
|
static attachSourceLocations = {
|
|
2996
3001
|
name: 'ɵɵattachSourceLocations',
|
|
2997
3002
|
moduleName: CORE
|
|
@@ -3341,7 +3346,7 @@ class _EmittedLine {
|
|
|
3341
3346
|
this.indent = indent;
|
|
3342
3347
|
}
|
|
3343
3348
|
}
|
|
3344
|
-
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, '??=']]);
|
|
3345
3350
|
class EmitterVisitorContext {
|
|
3346
3351
|
_indent;
|
|
3347
3352
|
static createRoot() {
|
|
@@ -3525,7 +3530,7 @@ class AbstractEmitterVisitor {
|
|
|
3525
3530
|
return null;
|
|
3526
3531
|
}
|
|
3527
3532
|
visitInvokeFunctionExpr(expr, ctx) {
|
|
3528
|
-
const shouldParenthesize = expr.fn instanceof ArrowFunctionExpr;
|
|
3533
|
+
const shouldParenthesize = expr.fn instanceof ArrowFunctionExpr$1;
|
|
3529
3534
|
if (shouldParenthesize) {
|
|
3530
3535
|
ctx.print(expr.fn, '(');
|
|
3531
3536
|
}
|
|
@@ -4002,7 +4007,9 @@ class ASTWithName extends AST {
|
|
|
4002
4007
|
}
|
|
4003
4008
|
}
|
|
4004
4009
|
let EmptyExpr$1 = class EmptyExpr extends AST {
|
|
4005
|
-
visit(visitor, context = null) {
|
|
4010
|
+
visit(visitor, context = null) {
|
|
4011
|
+
return visitor.visitEmptyExpr?.(this, context);
|
|
4012
|
+
}
|
|
4006
4013
|
};
|
|
4007
4014
|
class ImplicitReceiver extends AST {
|
|
4008
4015
|
visit(visitor, context = null) {
|
|
@@ -4314,6 +4321,28 @@ class ParenthesizedExpression extends AST {
|
|
|
4314
4321
|
return visitor.visitParenthesizedExpression(this, context);
|
|
4315
4322
|
}
|
|
4316
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
|
+
}
|
|
4317
4346
|
class RegularExpressionLiteral extends AST {
|
|
4318
4347
|
body;
|
|
4319
4348
|
flags;
|
|
@@ -4462,10 +4491,14 @@ class RecursiveAstVisitor {
|
|
|
4462
4491
|
visitParenthesizedExpression(ast, context) {
|
|
4463
4492
|
this.visit(ast.expression, context);
|
|
4464
4493
|
}
|
|
4494
|
+
visitArrowFunction(ast, context) {
|
|
4495
|
+
this.visit(ast.body, context);
|
|
4496
|
+
}
|
|
4465
4497
|
visitRegularExpressionLiteral(ast, context) {}
|
|
4466
4498
|
visitSpreadElement(ast, context) {
|
|
4467
4499
|
this.visit(ast.expression, context);
|
|
4468
4500
|
}
|
|
4501
|
+
visitEmptyExpr(ast, context) {}
|
|
4469
4502
|
visitAll(asts, context) {
|
|
4470
4503
|
for (const ast of asts) {
|
|
4471
4504
|
this.visit(ast, context);
|
|
@@ -7461,6 +7494,7 @@ var ExpressionKind;
|
|
|
7461
7494
|
ExpressionKind[ExpressionKind["ConditionalCase"] = 23] = "ConditionalCase";
|
|
7462
7495
|
ExpressionKind[ExpressionKind["ConstCollected"] = 24] = "ConstCollected";
|
|
7463
7496
|
ExpressionKind[ExpressionKind["TwoWayBindingSet"] = 25] = "TwoWayBindingSet";
|
|
7497
|
+
ExpressionKind[ExpressionKind["ArrowFunction"] = 26] = "ArrowFunction";
|
|
7464
7498
|
})(ExpressionKind || (ExpressionKind = {}));
|
|
7465
7499
|
var VariableFlags;
|
|
7466
7500
|
(function (VariableFlags) {
|
|
@@ -7539,6 +7573,219 @@ var TemplateKind;
|
|
|
7539
7573
|
TemplateKind[TemplateKind["Block"] = 2] = "Block";
|
|
7540
7574
|
})(TemplateKind || (TemplateKind = {}));
|
|
7541
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
|
+
|
|
7542
7789
|
const ConsumesSlot = Symbol('ConsumesSlot');
|
|
7543
7790
|
const DependsOnSlotContext = Symbol('DependsOnSlotContext');
|
|
7544
7791
|
const ConsumesVarsTrait = Symbol('ConsumesVars');
|
|
@@ -7566,29 +7813,6 @@ function hasUsesVarOffsetTrait(expr) {
|
|
|
7566
7813
|
return expr[UsesVarOffset] === true;
|
|
7567
7814
|
}
|
|
7568
7815
|
|
|
7569
|
-
function createStatementOp(statement) {
|
|
7570
|
-
return {
|
|
7571
|
-
kind: OpKind.Statement,
|
|
7572
|
-
statement,
|
|
7573
|
-
...NEW_OP
|
|
7574
|
-
};
|
|
7575
|
-
}
|
|
7576
|
-
function createVariableOp(xref, variable, initializer, flags) {
|
|
7577
|
-
return {
|
|
7578
|
-
kind: OpKind.Variable,
|
|
7579
|
-
xref,
|
|
7580
|
-
variable,
|
|
7581
|
-
initializer,
|
|
7582
|
-
flags,
|
|
7583
|
-
...NEW_OP
|
|
7584
|
-
};
|
|
7585
|
-
}
|
|
7586
|
-
const NEW_OP = {
|
|
7587
|
-
debugListId: null,
|
|
7588
|
-
prev: null,
|
|
7589
|
-
next: null
|
|
7590
|
-
};
|
|
7591
|
-
|
|
7592
7816
|
function createInterpolateTextOp(xref, interpolation, sourceSpan) {
|
|
7593
7817
|
return {
|
|
7594
7818
|
kind: OpKind.InterpolateText,
|
|
@@ -7994,9 +8218,6 @@ class TrackContextExpr extends ExpressionBase {
|
|
|
7994
8218
|
class NextContextExpr extends ExpressionBase {
|
|
7995
8219
|
kind = ExpressionKind.NextContext;
|
|
7996
8220
|
steps = 1;
|
|
7997
|
-
constructor() {
|
|
7998
|
-
super();
|
|
7999
|
-
}
|
|
8000
8221
|
visitExpression() {}
|
|
8001
8222
|
isEquivalent(e) {
|
|
8002
8223
|
return e instanceof NextContextExpr && e.steps === this.steps;
|
|
@@ -8527,6 +8748,48 @@ class ConstCollectedExpr extends ExpressionBase {
|
|
|
8527
8748
|
return new ConstCollectedExpr(this.expr);
|
|
8528
8749
|
}
|
|
8529
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
|
+
}
|
|
8530
8793
|
function visitExpressionsInOp(op, visitor) {
|
|
8531
8794
|
transformExpressionsInOp(op, (expr, flags) => {
|
|
8532
8795
|
visitor(expr, flags);
|
|
@@ -8537,6 +8800,7 @@ var VisitorContextFlag;
|
|
|
8537
8800
|
(function (VisitorContextFlag) {
|
|
8538
8801
|
VisitorContextFlag[VisitorContextFlag["None"] = 0] = "None";
|
|
8539
8802
|
VisitorContextFlag[VisitorContextFlag["InChildOperation"] = 1] = "InChildOperation";
|
|
8803
|
+
VisitorContextFlag[VisitorContextFlag["InArrowFunctionOperation"] = 2] = "InArrowFunctionOperation";
|
|
8540
8804
|
})(VisitorContextFlag || (VisitorContextFlag = {}));
|
|
8541
8805
|
function transformExpressionsInInterpolation(interpolation, transform, flags) {
|
|
8542
8806
|
for (let i = 0; i < interpolation.expressions.length; i++) {
|
|
@@ -8710,266 +8974,76 @@ function transformExpressionsInExpression(expr, transform, flags) {
|
|
|
8710
8974
|
}
|
|
8711
8975
|
} else if (expr instanceof LiteralMapExpr) {
|
|
8712
8976
|
for (const entry of expr.entries) {
|
|
8713
|
-
if (entry instanceof LiteralMapSpreadAssignment) {
|
|
8714
|
-
entry.expression = transformExpressionsInExpression(entry.expression, transform, flags);
|
|
8715
|
-
} else {
|
|
8716
|
-
entry.value = transformExpressionsInExpression(entry.value, transform, flags);
|
|
8717
|
-
}
|
|
8718
|
-
}
|
|
8719
|
-
} else if (expr instanceof ConditionalExpr) {
|
|
8720
|
-
expr.condition = transformExpressionsInExpression(expr.condition, transform, flags);
|
|
8721
|
-
expr.trueCase = transformExpressionsInExpression(expr.trueCase, transform, flags);
|
|
8722
|
-
if (expr.falseCase !== null) {
|
|
8723
|
-
expr.falseCase = transformExpressionsInExpression(expr.falseCase, transform, flags);
|
|
8724
|
-
}
|
|
8725
|
-
} else if (expr instanceof TypeofExpr) {
|
|
8726
|
-
expr.expr = transformExpressionsInExpression(expr.expr, transform, flags);
|
|
8727
|
-
} else if (expr instanceof VoidExpr) {
|
|
8728
|
-
expr.expr = transformExpressionsInExpression(expr.expr, transform, flags);
|
|
8729
|
-
} else if (expr instanceof LocalizedString) {
|
|
8730
|
-
for (let i = 0; i < expr.expressions.length; i++) {
|
|
8731
|
-
expr.expressions[i] = transformExpressionsInExpression(expr.expressions[i], transform, flags);
|
|
8732
|
-
}
|
|
8733
|
-
} else if (expr instanceof NotExpr) {
|
|
8734
|
-
expr.condition = transformExpressionsInExpression(expr.condition, transform, flags);
|
|
8735
|
-
} else if (expr instanceof TaggedTemplateLiteralExpr) {
|
|
8736
|
-
expr.tag = transformExpressionsInExpression(expr.tag, transform, flags);
|
|
8737
|
-
expr.template.expressions = expr.template.expressions.map(e => transformExpressionsInExpression(e, transform, flags));
|
|
8738
|
-
} else if (expr instanceof ArrowFunctionExpr) {
|
|
8739
|
-
if (Array.isArray(expr.body)) {
|
|
8740
|
-
for (let i = 0; i < expr.body.length; i++) {
|
|
8741
|
-
transformExpressionsInStatement(expr.body[i], transform, flags);
|
|
8742
|
-
}
|
|
8743
|
-
} else {
|
|
8744
|
-
expr.body = transformExpressionsInExpression(expr.body, transform, flags);
|
|
8745
|
-
}
|
|
8746
|
-
} else if (expr instanceof WrappedNodeExpr) ; else if (expr instanceof TemplateLiteralExpr) {
|
|
8747
|
-
for (let i = 0; i < expr.expressions.length; i++) {
|
|
8748
|
-
expr.expressions[i] = transformExpressionsInExpression(expr.expressions[i], transform, flags);
|
|
8749
|
-
}
|
|
8750
|
-
} else if (expr instanceof ParenthesizedExpr) {
|
|
8751
|
-
expr.expr = transformExpressionsInExpression(expr.expr, transform, flags);
|
|
8752
|
-
} else if (expr instanceof SpreadElementExpr) {
|
|
8753
|
-
expr.expression = transformExpressionsInExpression(expr.expression, transform, flags);
|
|
8754
|
-
} else if (expr instanceof ReadVarExpr || expr instanceof ExternalExpr || expr instanceof LiteralExpr || expr instanceof RegularExpressionLiteralExpr) ; else {
|
|
8755
|
-
throw new Error(`Unhandled expression kind: ${expr.constructor.name}`);
|
|
8756
|
-
}
|
|
8757
|
-
return transform(expr, flags);
|
|
8758
|
-
}
|
|
8759
|
-
function transformExpressionsInStatement(stmt, transform, flags) {
|
|
8760
|
-
if (stmt instanceof ExpressionStatement) {
|
|
8761
|
-
stmt.expr = transformExpressionsInExpression(stmt.expr, transform, flags);
|
|
8762
|
-
} else if (stmt instanceof ReturnStatement) {
|
|
8763
|
-
stmt.value = transformExpressionsInExpression(stmt.value, transform, flags);
|
|
8764
|
-
} else if (stmt instanceof DeclareVarStmt) {
|
|
8765
|
-
if (stmt.value !== undefined) {
|
|
8766
|
-
stmt.value = transformExpressionsInExpression(stmt.value, transform, flags);
|
|
8767
|
-
}
|
|
8768
|
-
} else if (stmt instanceof IfStmt) {
|
|
8769
|
-
stmt.condition = transformExpressionsInExpression(stmt.condition, transform, flags);
|
|
8770
|
-
for (const caseStatement of stmt.trueCase) {
|
|
8771
|
-
transformExpressionsInStatement(caseStatement, transform, flags);
|
|
8772
|
-
}
|
|
8773
|
-
for (const caseStatement of stmt.falseCase) {
|
|
8774
|
-
transformExpressionsInStatement(caseStatement, transform, flags);
|
|
8775
|
-
}
|
|
8776
|
-
} else {
|
|
8777
|
-
throw new Error(`Unhandled statement kind: ${stmt.constructor.name}`);
|
|
8778
|
-
}
|
|
8779
|
-
}
|
|
8780
|
-
function isStringLiteral(expr) {
|
|
8781
|
-
return expr instanceof LiteralExpr && typeof expr.value === 'string';
|
|
8782
|
-
}
|
|
8783
|
-
|
|
8784
|
-
class OpList {
|
|
8785
|
-
static nextListId = 0;
|
|
8786
|
-
debugListId = OpList.nextListId++;
|
|
8787
|
-
head = {
|
|
8788
|
-
kind: OpKind.ListEnd,
|
|
8789
|
-
next: null,
|
|
8790
|
-
prev: null,
|
|
8791
|
-
debugListId: this.debugListId
|
|
8792
|
-
};
|
|
8793
|
-
tail = {
|
|
8794
|
-
kind: OpKind.ListEnd,
|
|
8795
|
-
next: null,
|
|
8796
|
-
prev: null,
|
|
8797
|
-
debugListId: this.debugListId
|
|
8798
|
-
};
|
|
8799
|
-
constructor() {
|
|
8800
|
-
this.head.next = this.tail;
|
|
8801
|
-
this.tail.prev = this.head;
|
|
8802
|
-
}
|
|
8803
|
-
push(op) {
|
|
8804
|
-
if (Array.isArray(op)) {
|
|
8805
|
-
for (const o of op) {
|
|
8806
|
-
this.push(o);
|
|
8807
|
-
}
|
|
8808
|
-
return;
|
|
8809
|
-
}
|
|
8810
|
-
OpList.assertIsNotEnd(op);
|
|
8811
|
-
OpList.assertIsUnowned(op);
|
|
8812
|
-
op.debugListId = this.debugListId;
|
|
8813
|
-
const oldLast = this.tail.prev;
|
|
8814
|
-
op.prev = oldLast;
|
|
8815
|
-
oldLast.next = op;
|
|
8816
|
-
op.next = this.tail;
|
|
8817
|
-
this.tail.prev = op;
|
|
8818
|
-
}
|
|
8819
|
-
prepend(ops) {
|
|
8820
|
-
if (ops.length === 0) {
|
|
8821
|
-
return;
|
|
8822
|
-
}
|
|
8823
|
-
for (const op of ops) {
|
|
8824
|
-
OpList.assertIsNotEnd(op);
|
|
8825
|
-
OpList.assertIsUnowned(op);
|
|
8826
|
-
op.debugListId = this.debugListId;
|
|
8827
|
-
}
|
|
8828
|
-
const first = this.head.next;
|
|
8829
|
-
let prev = this.head;
|
|
8830
|
-
for (const op of ops) {
|
|
8831
|
-
prev.next = op;
|
|
8832
|
-
op.prev = prev;
|
|
8833
|
-
prev = op;
|
|
8834
|
-
}
|
|
8835
|
-
prev.next = first;
|
|
8836
|
-
first.prev = prev;
|
|
8837
|
-
}
|
|
8838
|
-
*[Symbol.iterator]() {
|
|
8839
|
-
let current = this.head.next;
|
|
8840
|
-
while (current !== this.tail) {
|
|
8841
|
-
OpList.assertIsOwned(current, this.debugListId);
|
|
8842
|
-
const next = current.next;
|
|
8843
|
-
yield current;
|
|
8844
|
-
current = next;
|
|
8845
|
-
}
|
|
8846
|
-
}
|
|
8847
|
-
*reversed() {
|
|
8848
|
-
let current = this.tail.prev;
|
|
8849
|
-
while (current !== this.head) {
|
|
8850
|
-
OpList.assertIsOwned(current, this.debugListId);
|
|
8851
|
-
const prev = current.prev;
|
|
8852
|
-
yield current;
|
|
8853
|
-
current = prev;
|
|
8854
|
-
}
|
|
8855
|
-
}
|
|
8856
|
-
static replace(oldOp, newOp) {
|
|
8857
|
-
OpList.assertIsNotEnd(oldOp);
|
|
8858
|
-
OpList.assertIsNotEnd(newOp);
|
|
8859
|
-
OpList.assertIsOwned(oldOp);
|
|
8860
|
-
OpList.assertIsUnowned(newOp);
|
|
8861
|
-
newOp.debugListId = oldOp.debugListId;
|
|
8862
|
-
if (oldOp.prev !== null) {
|
|
8863
|
-
oldOp.prev.next = newOp;
|
|
8864
|
-
newOp.prev = oldOp.prev;
|
|
8865
|
-
}
|
|
8866
|
-
if (oldOp.next !== null) {
|
|
8867
|
-
oldOp.next.prev = newOp;
|
|
8868
|
-
newOp.next = oldOp.next;
|
|
8869
|
-
}
|
|
8870
|
-
oldOp.debugListId = null;
|
|
8871
|
-
oldOp.prev = null;
|
|
8872
|
-
oldOp.next = null;
|
|
8873
|
-
}
|
|
8874
|
-
static replaceWithMany(oldOp, newOps) {
|
|
8875
|
-
if (newOps.length === 0) {
|
|
8876
|
-
OpList.remove(oldOp);
|
|
8877
|
-
return;
|
|
8878
|
-
}
|
|
8879
|
-
OpList.assertIsNotEnd(oldOp);
|
|
8880
|
-
OpList.assertIsOwned(oldOp);
|
|
8881
|
-
const listId = oldOp.debugListId;
|
|
8882
|
-
oldOp.debugListId = null;
|
|
8883
|
-
for (const newOp of newOps) {
|
|
8884
|
-
OpList.assertIsNotEnd(newOp);
|
|
8885
|
-
OpList.assertIsUnowned(newOp);
|
|
8886
|
-
}
|
|
8887
|
-
const {
|
|
8888
|
-
prev: oldPrev,
|
|
8889
|
-
next: oldNext
|
|
8890
|
-
} = oldOp;
|
|
8891
|
-
oldOp.prev = null;
|
|
8892
|
-
oldOp.next = null;
|
|
8893
|
-
let prev = oldPrev;
|
|
8894
|
-
for (const newOp of newOps) {
|
|
8895
|
-
OpList.assertIsUnowned(newOp);
|
|
8896
|
-
newOp.debugListId = listId;
|
|
8897
|
-
prev.next = newOp;
|
|
8898
|
-
newOp.prev = prev;
|
|
8899
|
-
newOp.next = null;
|
|
8900
|
-
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
|
+
}
|
|
8901
8982
|
}
|
|
8902
|
-
|
|
8903
|
-
|
|
8904
|
-
|
|
8905
|
-
|
|
8906
|
-
|
|
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);
|
|
8907
8988
|
}
|
|
8908
|
-
|
|
8909
|
-
|
|
8910
|
-
|
|
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);
|
|
8911
8996
|
}
|
|
8912
|
-
}
|
|
8913
|
-
|
|
8914
|
-
|
|
8915
|
-
|
|
8916
|
-
|
|
8917
|
-
|
|
8918
|
-
|
|
8919
|
-
|
|
8920
|
-
|
|
8921
|
-
}
|
|
8922
|
-
static insertBefore(op, target) {
|
|
8923
|
-
if (Array.isArray(op)) {
|
|
8924
|
-
for (const o of op) {
|
|
8925
|
-
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);
|
|
8926
9006
|
}
|
|
8927
|
-
|
|
8928
|
-
|
|
8929
|
-
OpList.assertIsOwned(target);
|
|
8930
|
-
if (target.prev === null) {
|
|
8931
|
-
throw new Error(`AssertionError: illegal operation on list start`);
|
|
9007
|
+
} else {
|
|
9008
|
+
expr.body = transformExpressionsInExpression(expr.body, transform, flags | VisitorContextFlag.InChildOperation);
|
|
8932
9009
|
}
|
|
8933
|
-
|
|
8934
|
-
|
|
8935
|
-
|
|
8936
|
-
op.prev = null;
|
|
8937
|
-
target.prev.next = op;
|
|
8938
|
-
op.prev = target.prev;
|
|
8939
|
-
op.next = target;
|
|
8940
|
-
target.prev = op;
|
|
8941
|
-
}
|
|
8942
|
-
static insertAfter(op, target) {
|
|
8943
|
-
OpList.assertIsOwned(target);
|
|
8944
|
-
if (target.next === null) {
|
|
8945
|
-
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);
|
|
8946
9013
|
}
|
|
8947
|
-
|
|
8948
|
-
|
|
8949
|
-
|
|
8950
|
-
|
|
8951
|
-
|
|
8952
|
-
|
|
8953
|
-
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}`);
|
|
8954
9020
|
}
|
|
8955
|
-
|
|
8956
|
-
|
|
8957
|
-
|
|
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);
|
|
8958
9031
|
}
|
|
8959
|
-
}
|
|
8960
|
-
|
|
8961
|
-
|
|
8962
|
-
|
|
8963
|
-
} else if (byList !== undefined && op.debugListId !== byList) {
|
|
8964
|
-
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);
|
|
8965
9036
|
}
|
|
8966
|
-
|
|
8967
|
-
|
|
8968
|
-
if (op.kind === OpKind.ListEnd) {
|
|
8969
|
-
throw new Error(`AssertionError: illegal operation on list head or tail`);
|
|
9037
|
+
for (const caseStatement of stmt.falseCase) {
|
|
9038
|
+
transformExpressionsInStatement(caseStatement, transform, flags);
|
|
8970
9039
|
}
|
|
9040
|
+
} else {
|
|
9041
|
+
throw new Error(`Unhandled statement kind: ${stmt.constructor.name}`);
|
|
8971
9042
|
}
|
|
8972
9043
|
}
|
|
9044
|
+
function isStringLiteral(expr) {
|
|
9045
|
+
return expr instanceof LiteralExpr && typeof expr.value === 'string';
|
|
9046
|
+
}
|
|
8973
9047
|
|
|
8974
9048
|
class SlotHandle {
|
|
8975
9049
|
slot = null;
|
|
@@ -9521,9 +9595,15 @@ class CompilationUnit {
|
|
|
9521
9595
|
}
|
|
9522
9596
|
create = new OpList();
|
|
9523
9597
|
update = new OpList();
|
|
9598
|
+
functions = new Set();
|
|
9524
9599
|
fnName = null;
|
|
9525
9600
|
vars = null;
|
|
9526
9601
|
*ops() {
|
|
9602
|
+
for (const expr of this.functions) {
|
|
9603
|
+
for (const op of expr.ops) {
|
|
9604
|
+
yield op;
|
|
9605
|
+
}
|
|
9606
|
+
}
|
|
9527
9607
|
for (const op of this.create) {
|
|
9528
9608
|
yield op;
|
|
9529
9609
|
if (op.kind === OpKind.Listener || op.kind === OpKind.Animation || op.kind === OpKind.AnimationListener || op.kind === OpKind.TwoWayListener) {
|
|
@@ -9965,7 +10045,7 @@ function generateConditionalExpressions(job) {
|
|
|
9965
10045
|
}
|
|
9966
10046
|
}
|
|
9967
10047
|
|
|
9968
|
-
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]]);
|
|
9969
10049
|
function namespaceForKey(namespacePrefixKey) {
|
|
9970
10050
|
const NAMESPACES = new Map([['svg', Namespace.SVG], ['math', Namespace.Math]]);
|
|
9971
10051
|
if (namespacePrefixKey === null) {
|
|
@@ -10867,6 +10947,9 @@ function recursivelyProcessView(view, parentScope) {
|
|
|
10867
10947
|
}
|
|
10868
10948
|
}
|
|
10869
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
|
+
}
|
|
10870
10953
|
}
|
|
10871
10954
|
function getScopeForView(view, parent) {
|
|
10872
10955
|
const scope = {
|
|
@@ -15369,7 +15452,7 @@ var StringTokenKind;
|
|
|
15369
15452
|
StringTokenKind[StringTokenKind["TemplateLiteralPart"] = 1] = "TemplateLiteralPart";
|
|
15370
15453
|
StringTokenKind[StringTokenKind["TemplateLiteralEnd"] = 2] = "TemplateLiteralEnd";
|
|
15371
15454
|
})(StringTokenKind || (StringTokenKind = {}));
|
|
15372
|
-
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'];
|
|
15373
15456
|
class Lexer {
|
|
15374
15457
|
tokenize(text) {
|
|
15375
15458
|
return new _Scanner(text).scan();
|
|
@@ -15439,6 +15522,9 @@ class Token {
|
|
|
15439
15522
|
isKeywordIn() {
|
|
15440
15523
|
return this.type === TokenType.Keyword && this.strValue === 'in';
|
|
15441
15524
|
}
|
|
15525
|
+
isKeywordInstanceOf() {
|
|
15526
|
+
return this.type === TokenType.Keyword && this.strValue === 'instanceof';
|
|
15527
|
+
}
|
|
15442
15528
|
isError() {
|
|
15443
15529
|
return this.type === TokenType.Error;
|
|
15444
15530
|
}
|
|
@@ -15615,8 +15701,9 @@ class _Scanner {
|
|
|
15615
15701
|
case $GT:
|
|
15616
15702
|
return this.scanComplexOperator(start, String.fromCharCode(peek), $EQ, '=');
|
|
15617
15703
|
case $BANG:
|
|
15704
|
+
return this.scanComplexOperator(start, '!', $EQ, '=', $EQ, '=');
|
|
15618
15705
|
case $EQ:
|
|
15619
|
-
return this.
|
|
15706
|
+
return this.scanEquals(start);
|
|
15620
15707
|
case $AMPERSAND:
|
|
15621
15708
|
return this.scanComplexOperator(start, '&', $AMPERSAND, '&', $EQ, '=');
|
|
15622
15709
|
case $BAR:
|
|
@@ -15663,6 +15750,23 @@ class _Scanner {
|
|
|
15663
15750
|
}
|
|
15664
15751
|
return newOperatorToken(start, this.index, str);
|
|
15665
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
|
+
}
|
|
15666
15770
|
scanIdentifier() {
|
|
15667
15771
|
const start = this.index;
|
|
15668
15772
|
this.advance();
|
|
@@ -16446,7 +16550,7 @@ class _ParseAST {
|
|
|
16446
16550
|
parseRelational() {
|
|
16447
16551
|
const start = this.inputIndex;
|
|
16448
16552
|
let result = this.parseAdditive();
|
|
16449
|
-
while (this.next.type == TokenType.Operator || this.next.isKeywordIn) {
|
|
16553
|
+
while (this.next.type == TokenType.Operator || this.next.isKeywordIn() || this.next.isKeywordInstanceOf()) {
|
|
16450
16554
|
const operator = this.next.strValue;
|
|
16451
16555
|
switch (operator) {
|
|
16452
16556
|
case '<':
|
|
@@ -16454,6 +16558,7 @@ class _ParseAST {
|
|
|
16454
16558
|
case '<=':
|
|
16455
16559
|
case '>=':
|
|
16456
16560
|
case 'in':
|
|
16561
|
+
case 'instanceof':
|
|
16457
16562
|
this.advance();
|
|
16458
16563
|
const right = this.parseAdditive();
|
|
16459
16564
|
result = new Binary(this.span(start), this.sourceSpan(start), operator, result, right);
|
|
@@ -16572,7 +16677,9 @@ class _ParseAST {
|
|
|
16572
16677
|
}
|
|
16573
16678
|
parsePrimary() {
|
|
16574
16679
|
const start = this.inputIndex;
|
|
16575
|
-
if (this.
|
|
16680
|
+
if (this.isArrowFunction()) {
|
|
16681
|
+
return this.parseArrowFunction(start);
|
|
16682
|
+
} else if (this.consumeOptionalCharacter($LPAREN)) {
|
|
16576
16683
|
this.rparensExpected++;
|
|
16577
16684
|
const result = this.parsePipe();
|
|
16578
16685
|
if (!this.consumeOptionalCharacter($RPAREN)) {
|
|
@@ -16586,7 +16693,7 @@ class _ParseAST {
|
|
|
16586
16693
|
return new LiteralPrimitive(this.span(start), this.sourceSpan(start), null);
|
|
16587
16694
|
} else if (this.next.isKeywordUndefined()) {
|
|
16588
16695
|
this.advance();
|
|
16589
|
-
return new LiteralPrimitive(this.span(start), this.sourceSpan(start),
|
|
16696
|
+
return new LiteralPrimitive(this.span(start), this.sourceSpan(start), undefined);
|
|
16590
16697
|
} else if (this.next.isKeywordTrue()) {
|
|
16591
16698
|
this.advance();
|
|
16592
16699
|
return new LiteralPrimitive(this.span(start), this.sourceSpan(start), true);
|
|
@@ -16947,6 +17054,78 @@ class _ParseAST {
|
|
|
16947
17054
|
const end = flagsToken ? flagsToken.end : bodyToken.end;
|
|
16948
17055
|
return new RegularExpressionLiteral(this.span(start, end), this.sourceSpan(start, end), bodyToken.strValue, flagsToken ? flagsToken.strValue : null);
|
|
16949
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
|
+
}
|
|
16950
17129
|
consumeStatementTerminator() {
|
|
16951
17130
|
this.consumeOptionalCharacter($SEMICOLON) || this.consumeOptionalCharacter($COMMA);
|
|
16952
17131
|
}
|
|
@@ -17101,6 +17280,15 @@ class SerializeExpressionVisitor {
|
|
|
17101
17280
|
visitRegularExpressionLiteral(ast, context) {
|
|
17102
17281
|
return `/${ast.body}/${ast.flags || ''}`;
|
|
17103
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
|
+
}
|
|
17104
17292
|
visitASTWithSource(ast, context) {
|
|
17105
17293
|
return ast.ast.visit(this, context);
|
|
17106
17294
|
}
|
|
@@ -18828,7 +19016,7 @@ function getVariableName(unit, variable, state) {
|
|
|
18828
19016
|
break;
|
|
18829
19017
|
case SemanticVariableKind.Identifier:
|
|
18830
19018
|
if (unit.job.compatibility === CompatibilityMode.TemplateDefinitionBuilder) {
|
|
18831
|
-
const compatPrefix = variable.identifier ===
|
|
19019
|
+
const compatPrefix = variable.identifier === CONTEXT_NAME ? 'i' : '';
|
|
18832
19020
|
variable.name = `${variable.identifier}_${compatPrefix}r${++state.index}`;
|
|
18833
19021
|
} else {
|
|
18834
19022
|
variable.name = `${variable.identifier}_i${state.index++}`;
|
|
@@ -18854,6 +19042,9 @@ function stripImportant(name) {
|
|
|
18854
19042
|
|
|
18855
19043
|
function mergeNextContextExpressions(job) {
|
|
18856
19044
|
for (const unit of job.units) {
|
|
19045
|
+
for (const expr of unit.functions) {
|
|
19046
|
+
mergeNextContextsInOps(expr.ops);
|
|
19047
|
+
}
|
|
18857
19048
|
for (const op of unit.create) {
|
|
18858
19049
|
if (op.kind === OpKind.Listener || op.kind === OpKind.Animation || op.kind === OpKind.AnimationListener || op.kind === OpKind.TwoWayListener) {
|
|
18859
19050
|
mergeNextContextsInOps(op.handlerOps);
|
|
@@ -19224,7 +19415,7 @@ class PureFunctionConstant extends GenericKeyFn {
|
|
|
19224
19415
|
}
|
|
19225
19416
|
return variable('a' + expr.index);
|
|
19226
19417
|
}, VisitorContextFlag.None);
|
|
19227
|
-
return new DeclareVarStmt(declName, new ArrowFunctionExpr(fnParams, returnExpr), undefined, StmtModifier.Final);
|
|
19418
|
+
return new DeclareVarStmt(declName, new ArrowFunctionExpr$1(fnParams, returnExpr), undefined, StmtModifier.Final);
|
|
19228
19419
|
}
|
|
19229
19420
|
}
|
|
19230
19421
|
|
|
@@ -19716,6 +19907,9 @@ function pureFunction(varOffset, fn, args) {
|
|
|
19716
19907
|
function attachSourceLocation(templatePath, locations) {
|
|
19717
19908
|
return call(Identifiers.attachSourceLocations, [literal(templatePath), locations], null);
|
|
19718
19909
|
}
|
|
19910
|
+
function arrowFunction(slotOffset, factory, contextRef) {
|
|
19911
|
+
return importExpr(Identifiers.arrowFunction).callFn([literal(slotOffset), factory, contextRef]);
|
|
19912
|
+
}
|
|
19719
19913
|
function collateInterpolationArgs(strings, expressions) {
|
|
19720
19914
|
if (strings.length < 1 || expressions.length !== strings.length - 1) {
|
|
19721
19915
|
throw new Error(`AssertionError: expected specific shape of args for strings/expressions in interpolation`);
|
|
@@ -19800,7 +19994,7 @@ function reify(job) {
|
|
|
19800
19994
|
}
|
|
19801
19995
|
function reifyCreateOperations(unit, ops) {
|
|
19802
19996
|
for (const op of ops) {
|
|
19803
|
-
transformExpressionsInOp(op, reifyIrExpression, VisitorContextFlag.None);
|
|
19997
|
+
transformExpressionsInOp(op, expr => reifyIrExpression(unit, expr), VisitorContextFlag.None);
|
|
19804
19998
|
switch (op.kind) {
|
|
19805
19999
|
case OpKind.Text:
|
|
19806
20000
|
OpList.replace(op, text(op.handle.slot, op.initialValue, op.sourceSpan));
|
|
@@ -20047,7 +20241,7 @@ function reifyCreateOperations(unit, ops) {
|
|
|
20047
20241
|
}
|
|
20048
20242
|
function reifyUpdateOperations(unit, ops) {
|
|
20049
20243
|
for (const op of ops) {
|
|
20050
|
-
transformExpressionsInOp(op, reifyIrExpression, VisitorContextFlag.None);
|
|
20244
|
+
transformExpressionsInOp(op, expr => reifyIrExpression(unit, expr), VisitorContextFlag.None);
|
|
20051
20245
|
switch (op.kind) {
|
|
20052
20246
|
case OpKind.Advance:
|
|
20053
20247
|
OpList.replace(op, advance(op.delta, op.sourceSpan));
|
|
@@ -20132,7 +20326,7 @@ function reifyProperty(op) {
|
|
|
20132
20326
|
function reifyControl(op) {
|
|
20133
20327
|
return control(op.name, op.expression, op.sanitizer, op.sourceSpan);
|
|
20134
20328
|
}
|
|
20135
|
-
function reifyIrExpression(expr) {
|
|
20329
|
+
function reifyIrExpression(unit, expr) {
|
|
20136
20330
|
if (!isIrExpression(expr)) {
|
|
20137
20331
|
return expr;
|
|
20138
20332
|
}
|
|
@@ -20188,6 +20382,11 @@ function reifyIrExpression(expr) {
|
|
|
20188
20382
|
return storeLet(expr.value, expr.sourceSpan);
|
|
20189
20383
|
case ExpressionKind.TrackContext:
|
|
20190
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));
|
|
20191
20390
|
default:
|
|
20192
20391
|
throw new Error(`AssertionError: Unsupported reification of ir.Expression kind: ${ExpressionKind[expr.kind]}`);
|
|
20193
20392
|
}
|
|
@@ -20229,6 +20428,18 @@ function reifyTrackBy(unit, op) {
|
|
|
20229
20428
|
op.trackByFn = unit.job.pool.getSharedFunctionReference(fn$1, '_forTrack');
|
|
20230
20429
|
return op.trackByFn;
|
|
20231
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
|
+
}
|
|
20232
20443
|
|
|
20233
20444
|
function removeEmptyBindings(job) {
|
|
20234
20445
|
for (const unit of job.units) {
|
|
@@ -20304,13 +20515,16 @@ function removeUnusedI18nAttributesOps(job) {
|
|
|
20304
20515
|
|
|
20305
20516
|
function resolveContexts(job) {
|
|
20306
20517
|
for (const unit of job.units) {
|
|
20518
|
+
for (const expr of unit.functions) {
|
|
20519
|
+
processLexicalScope$1(unit, expr.ops);
|
|
20520
|
+
}
|
|
20307
20521
|
processLexicalScope$1(unit, unit.create);
|
|
20308
20522
|
processLexicalScope$1(unit, unit.update);
|
|
20309
20523
|
}
|
|
20310
20524
|
}
|
|
20311
20525
|
function processLexicalScope$1(view, ops) {
|
|
20312
20526
|
const scope = new Map();
|
|
20313
|
-
scope.set(view.xref, variable(
|
|
20527
|
+
scope.set(view.xref, variable(CONTEXT_NAME));
|
|
20314
20528
|
for (const op of ops) {
|
|
20315
20529
|
switch (op.kind) {
|
|
20316
20530
|
case OpKind.Variable:
|
|
@@ -20334,7 +20548,7 @@ function processLexicalScope$1(view, ops) {
|
|
|
20334
20548
|
}
|
|
20335
20549
|
}
|
|
20336
20550
|
if (view === view.job.root) {
|
|
20337
|
-
scope.set(view.xref, variable(
|
|
20551
|
+
scope.set(view.xref, variable(CONTEXT_NAME));
|
|
20338
20552
|
}
|
|
20339
20553
|
for (const op of ops) {
|
|
20340
20554
|
transformExpressionsInOp(op, expr => {
|
|
@@ -20660,6 +20874,9 @@ function updatePlaceholder(op, value, i18nContexts, icuPlaceholders) {
|
|
|
20660
20874
|
|
|
20661
20875
|
function resolveNames(job) {
|
|
20662
20876
|
for (const unit of job.units) {
|
|
20877
|
+
for (const expr of unit.functions) {
|
|
20878
|
+
processLexicalScope(unit, expr.ops, null);
|
|
20879
|
+
}
|
|
20663
20880
|
processLexicalScope(unit, unit.create, null);
|
|
20664
20881
|
processLexicalScope(unit, unit.update, null);
|
|
20665
20882
|
}
|
|
@@ -20710,7 +20927,7 @@ function processLexicalScope(unit, ops, savedView) {
|
|
|
20710
20927
|
}
|
|
20711
20928
|
}
|
|
20712
20929
|
for (const op of ops) {
|
|
20713
|
-
if (op.kind
|
|
20930
|
+
if (op.kind === OpKind.Listener || op.kind === OpKind.TwoWayListener || op.kind === OpKind.Animation || op.kind === OpKind.AnimationListener) {
|
|
20714
20931
|
continue;
|
|
20715
20932
|
}
|
|
20716
20933
|
transformExpressionsInOp(op, expr => {
|
|
@@ -20783,38 +21000,45 @@ function getOnlySecurityContext(securityContext) {
|
|
|
20783
21000
|
|
|
20784
21001
|
function saveAndRestoreView(job) {
|
|
20785
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
|
+
}
|
|
20786
21008
|
unit.create.prepend([createVariableOp(unit.job.allocateXrefId(), {
|
|
20787
21009
|
kind: SemanticVariableKind.SavedView,
|
|
20788
21010
|
name: null,
|
|
20789
21011
|
view: unit.xref
|
|
20790
21012
|
}, new GetCurrentViewExpr(), VariableFlags.None)]);
|
|
20791
21013
|
for (const op of unit.create) {
|
|
20792
|
-
if (op.kind
|
|
20793
|
-
|
|
20794
|
-
|
|
20795
|
-
let needsRestoreView = unit !== job.root;
|
|
20796
|
-
if (!needsRestoreView) {
|
|
20797
|
-
for (const handlerOp of op.handlerOps) {
|
|
20798
|
-
visitExpressionsInOp(handlerOp, expr => {
|
|
20799
|
-
if (expr instanceof ReferenceExpr || expr instanceof ContextLetReferenceExpr) {
|
|
20800
|
-
needsRestoreView = true;
|
|
20801
|
-
}
|
|
20802
|
-
});
|
|
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);
|
|
20803
21017
|
}
|
|
20804
21018
|
}
|
|
20805
|
-
if (needsRestoreView) {
|
|
20806
|
-
addSaveRestoreViewOperationToListener(unit, op);
|
|
20807
|
-
}
|
|
20808
21019
|
}
|
|
20809
21020
|
}
|
|
20810
21021
|
}
|
|
20811
|
-
function
|
|
20812
|
-
|
|
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(), {
|
|
20813
21037
|
kind: SemanticVariableKind.Context,
|
|
20814
21038
|
name: null,
|
|
20815
21039
|
view: unit.xref
|
|
20816
|
-
}, new RestoreViewExpr(
|
|
20817
|
-
for (const handlerOp of
|
|
21040
|
+
}, new RestoreViewExpr(restoreViewTarget), VariableFlags.None)]);
|
|
21041
|
+
for (const handlerOp of opList) {
|
|
20818
21042
|
if (handlerOp.kind === OpKind.Statement && handlerOp.statement instanceof ReturnStatement) {
|
|
20819
21043
|
handlerOp.statement.value = new ResetViewExpr(handlerOp.statement.value);
|
|
20820
21044
|
}
|
|
@@ -20972,6 +21196,9 @@ function generateTemporaryVariables(job) {
|
|
|
20972
21196
|
for (const unit of job.units) {
|
|
20973
21197
|
unit.create.prepend(generateTemporaries(unit.create));
|
|
20974
21198
|
unit.update.prepend(generateTemporaries(unit.update));
|
|
21199
|
+
for (const expr of unit.functions) {
|
|
21200
|
+
expr.ops.prepend(generateTemporaries(expr.ops));
|
|
21201
|
+
}
|
|
20975
21202
|
}
|
|
20976
21203
|
}
|
|
20977
21204
|
function generateTemporaries(ops) {
|
|
@@ -21134,35 +21361,43 @@ function countVariables(job) {
|
|
|
21134
21361
|
varCount += varsUsedByOp(op);
|
|
21135
21362
|
}
|
|
21136
21363
|
}
|
|
21137
|
-
|
|
21138
|
-
|
|
21139
|
-
|
|
21140
|
-
|
|
21141
|
-
|
|
21142
|
-
|
|
21143
|
-
|
|
21144
|
-
|
|
21145
|
-
|
|
21146
|
-
|
|
21147
|
-
|
|
21148
|
-
|
|
21149
|
-
|
|
21150
|
-
|
|
21151
|
-
|
|
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);
|
|
21152
21394
|
}
|
|
21153
21395
|
if (job.compatibility === CompatibilityMode.TemplateDefinitionBuilder) {
|
|
21154
|
-
for (const
|
|
21155
|
-
visitExpressionsInOp(
|
|
21156
|
-
|
|
21157
|
-
|
|
21158
|
-
|
|
21159
|
-
if (hasUsesVarOffsetTrait(expr)) {
|
|
21160
|
-
expr.varOffset = varCount;
|
|
21161
|
-
}
|
|
21162
|
-
if (hasConsumesVarsTrait(expr)) {
|
|
21163
|
-
varCount += varsUsedByIrExpression(expr);
|
|
21164
|
-
}
|
|
21165
|
-
});
|
|
21396
|
+
for (const createOp of unit.create) {
|
|
21397
|
+
visitExpressionsInOp(createOp, secondPassCountExpressionVars);
|
|
21398
|
+
}
|
|
21399
|
+
for (const updateOp of unit.update) {
|
|
21400
|
+
visitExpressionsInOp(updateOp, secondPassCountExpressionVars);
|
|
21166
21401
|
}
|
|
21167
21402
|
}
|
|
21168
21403
|
unit.vars = varCount;
|
|
@@ -21230,6 +21465,7 @@ function varsUsedByIrExpression(expr) {
|
|
|
21230
21465
|
case ExpressionKind.PipeBindingVariadic:
|
|
21231
21466
|
return 1 + expr.numArgs;
|
|
21232
21467
|
case ExpressionKind.StoreLet:
|
|
21468
|
+
case ExpressionKind.ArrowFunction:
|
|
21233
21469
|
return 1;
|
|
21234
21470
|
default:
|
|
21235
21471
|
throw new Error(`AssertionError: unhandled ConsumesVarsTrait expression ${expr.constructor.name}`);
|
|
@@ -21247,6 +21483,9 @@ function isSingletonInterpolation(expr) {
|
|
|
21247
21483
|
|
|
21248
21484
|
function optimizeVariables(job) {
|
|
21249
21485
|
for (const unit of job.units) {
|
|
21486
|
+
for (const expr of unit.functions) {
|
|
21487
|
+
inlineAlwaysInlineVariables(expr.ops);
|
|
21488
|
+
}
|
|
21250
21489
|
inlineAlwaysInlineVariables(unit.create);
|
|
21251
21490
|
inlineAlwaysInlineVariables(unit.update);
|
|
21252
21491
|
for (const op of unit.create) {
|
|
@@ -21256,15 +21495,20 @@ function optimizeVariables(job) {
|
|
|
21256
21495
|
inlineAlwaysInlineVariables(op.trackByOps);
|
|
21257
21496
|
}
|
|
21258
21497
|
}
|
|
21259
|
-
|
|
21260
|
-
|
|
21498
|
+
for (const expr of unit.functions) {
|
|
21499
|
+
optimizeVariablesInOpList(expr.ops, job.compatibility, null);
|
|
21500
|
+
optimizeSaveRestoreView(expr.ops);
|
|
21501
|
+
}
|
|
21261
21502
|
for (const op of unit.create) {
|
|
21262
21503
|
if (op.kind === OpKind.Listener || op.kind === OpKind.Animation || op.kind === OpKind.AnimationListener || op.kind === OpKind.TwoWayListener) {
|
|
21263
|
-
optimizeVariablesInOpList(op.handlerOps, job.compatibility);
|
|
21504
|
+
optimizeVariablesInOpList(op.handlerOps, job.compatibility, skipArrowFunctionOps);
|
|
21505
|
+
optimizeSaveRestoreView(op.handlerOps);
|
|
21264
21506
|
} else if (op.kind === OpKind.RepeaterCreate && op.trackByOps !== null) {
|
|
21265
|
-
optimizeVariablesInOpList(op.trackByOps, job.compatibility);
|
|
21507
|
+
optimizeVariablesInOpList(op.trackByOps, job.compatibility, skipArrowFunctionOps);
|
|
21266
21508
|
}
|
|
21267
21509
|
}
|
|
21510
|
+
optimizeVariablesInOpList(unit.create, job.compatibility, skipArrowFunctionOps);
|
|
21511
|
+
optimizeVariablesInOpList(unit.update, job.compatibility, skipArrowFunctionOps);
|
|
21268
21512
|
}
|
|
21269
21513
|
}
|
|
21270
21514
|
var Fence;
|
|
@@ -21274,6 +21518,9 @@ var Fence;
|
|
|
21274
21518
|
Fence[Fence["ViewContextWrite"] = 2] = "ViewContextWrite";
|
|
21275
21519
|
Fence[Fence["SideEffectful"] = 4] = "SideEffectful";
|
|
21276
21520
|
})(Fence || (Fence = {}));
|
|
21521
|
+
function skipArrowFunctionOps(flags) {
|
|
21522
|
+
return !(flags & VisitorContextFlag.InArrowFunctionOperation);
|
|
21523
|
+
}
|
|
21277
21524
|
function inlineAlwaysInlineVariables(ops) {
|
|
21278
21525
|
const vars = new Map();
|
|
21279
21526
|
for (const op of ops) {
|
|
@@ -21297,7 +21544,7 @@ function inlineAlwaysInlineVariables(ops) {
|
|
|
21297
21544
|
OpList.remove(op);
|
|
21298
21545
|
}
|
|
21299
21546
|
}
|
|
21300
|
-
function optimizeVariablesInOpList(ops, compatibility) {
|
|
21547
|
+
function optimizeVariablesInOpList(ops, compatibility, predicate) {
|
|
21301
21548
|
const varDecls = new Map();
|
|
21302
21549
|
const varUsages = new Map();
|
|
21303
21550
|
const varRemoteUsages = new Set();
|
|
@@ -21310,8 +21557,8 @@ function optimizeVariablesInOpList(ops, compatibility) {
|
|
|
21310
21557
|
varDecls.set(op.xref, op);
|
|
21311
21558
|
varUsages.set(op.xref, 0);
|
|
21312
21559
|
}
|
|
21313
|
-
opMap.set(op, collectOpInfo(op));
|
|
21314
|
-
countVariableUsages(op, varUsages, varRemoteUsages);
|
|
21560
|
+
opMap.set(op, collectOpInfo(op, predicate));
|
|
21561
|
+
countVariableUsages(op, varUsages, varRemoteUsages, predicate);
|
|
21315
21562
|
}
|
|
21316
21563
|
let contextIsUsed = false;
|
|
21317
21564
|
for (const op of ops.reversed()) {
|
|
@@ -21394,19 +21641,17 @@ function fencesForIrExpression(expr) {
|
|
|
21394
21641
|
return Fence.None;
|
|
21395
21642
|
}
|
|
21396
21643
|
}
|
|
21397
|
-
function collectOpInfo(op) {
|
|
21644
|
+
function collectOpInfo(op, predicate) {
|
|
21398
21645
|
let fences = Fence.None;
|
|
21399
21646
|
const variablesUsed = new Set();
|
|
21400
|
-
visitExpressionsInOp(op, expr => {
|
|
21401
|
-
if (!isIrExpression(expr)) {
|
|
21647
|
+
visitExpressionsInOp(op, (expr, flags) => {
|
|
21648
|
+
if (!isIrExpression(expr) || predicate !== null && !predicate(flags)) {
|
|
21402
21649
|
return;
|
|
21403
21650
|
}
|
|
21404
|
-
|
|
21405
|
-
|
|
21406
|
-
|
|
21407
|
-
|
|
21408
|
-
default:
|
|
21409
|
-
fences |= fencesForIrExpression(expr);
|
|
21651
|
+
if (expr.kind === ExpressionKind.ReadVariable) {
|
|
21652
|
+
variablesUsed.add(expr.xref);
|
|
21653
|
+
} else {
|
|
21654
|
+
fences |= fencesForIrExpression(expr);
|
|
21410
21655
|
}
|
|
21411
21656
|
});
|
|
21412
21657
|
return {
|
|
@@ -21414,9 +21659,9 @@ function collectOpInfo(op) {
|
|
|
21414
21659
|
variablesUsed
|
|
21415
21660
|
};
|
|
21416
21661
|
}
|
|
21417
|
-
function countVariableUsages(op, varUsages, varRemoteUsage) {
|
|
21662
|
+
function countVariableUsages(op, varUsages, varRemoteUsage, predicate) {
|
|
21418
21663
|
visitExpressionsInOp(op, (expr, flags) => {
|
|
21419
|
-
if (!isIrExpression(expr)) {
|
|
21664
|
+
if (!isIrExpression(expr) || predicate !== null && !predicate(flags)) {
|
|
21420
21665
|
return;
|
|
21421
21666
|
}
|
|
21422
21667
|
if (expr.kind !== ExpressionKind.ReadVariable) {
|
|
@@ -21492,7 +21737,7 @@ function tryInlineVariableInitializer(id, initializer, target, declFences) {
|
|
|
21492
21737
|
function allowConservativeInlining(decl, target) {
|
|
21493
21738
|
switch (decl.variable.kind) {
|
|
21494
21739
|
case SemanticVariableKind.Identifier:
|
|
21495
|
-
if (decl.initializer instanceof ReadVarExpr && decl.initializer.name ===
|
|
21740
|
+
if (decl.initializer instanceof ReadVarExpr && decl.initializer.name === CONTEXT_NAME) {
|
|
21496
21741
|
return true;
|
|
21497
21742
|
}
|
|
21498
21743
|
return false;
|
|
@@ -21502,6 +21747,14 @@ function allowConservativeInlining(decl, target) {
|
|
|
21502
21747
|
return true;
|
|
21503
21748
|
}
|
|
21504
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
|
+
}
|
|
21505
21758
|
|
|
21506
21759
|
function wrapI18nIcus(job) {
|
|
21507
21760
|
for (const unit of job.units) {
|
|
@@ -21532,6 +21785,32 @@ function wrapI18nIcus(job) {
|
|
|
21532
21785
|
}
|
|
21533
21786
|
}
|
|
21534
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
|
+
|
|
21535
21814
|
/**
|
|
21536
21815
|
*
|
|
21537
21816
|
* @license
|
|
@@ -21600,6 +21879,9 @@ const phases = [{
|
|
|
21600
21879
|
}, {
|
|
21601
21880
|
kind: CompilationJobKind.Tmpl,
|
|
21602
21881
|
fn: createVariadicPipes
|
|
21882
|
+
}, {
|
|
21883
|
+
kind: CompilationJobKind.Both,
|
|
21884
|
+
fn: generateArrowFunctions
|
|
21603
21885
|
}, {
|
|
21604
21886
|
kind: CompilationJobKind.Both,
|
|
21605
21887
|
fn: generatePureLiteralStructures
|
|
@@ -21781,13 +22063,13 @@ function emitView(view) {
|
|
|
21781
22063
|
}
|
|
21782
22064
|
const createCond = maybeGenerateRfBlock(1, createStatements);
|
|
21783
22065
|
const updateCond = maybeGenerateRfBlock(2, updateStatements);
|
|
21784
|
-
return fn([new FnParam(
|
|
22066
|
+
return fn([new FnParam(RENDER_FLAGS), new FnParam(CONTEXT_NAME)], [...createCond, ...updateCond], undefined, undefined, view.fnName);
|
|
21785
22067
|
}
|
|
21786
22068
|
function maybeGenerateRfBlock(flag, statements) {
|
|
21787
22069
|
if (statements.length === 0) {
|
|
21788
22070
|
return [];
|
|
21789
22071
|
}
|
|
21790
|
-
return [ifStmt(new BinaryOperatorExpr(BinaryOperator.BitwiseAnd, variable(
|
|
22072
|
+
return [ifStmt(new BinaryOperatorExpr(BinaryOperator.BitwiseAnd, variable(RENDER_FLAGS), literal(flag)), statements)];
|
|
21791
22073
|
}
|
|
21792
22074
|
function emitHostBindingFunction(job) {
|
|
21793
22075
|
if (job.root.fnName === null) {
|
|
@@ -21812,7 +22094,7 @@ function emitHostBindingFunction(job) {
|
|
|
21812
22094
|
}
|
|
21813
22095
|
const createCond = maybeGenerateRfBlock(1, createStatements);
|
|
21814
22096
|
const updateCond = maybeGenerateRfBlock(2, updateStatements);
|
|
21815
|
-
return fn([new FnParam(
|
|
22097
|
+
return fn([new FnParam(RENDER_FLAGS), new FnParam(CONTEXT_NAME)], [...createCond, ...updateCond], undefined, undefined, job.root.fnName);
|
|
21816
22098
|
}
|
|
21817
22099
|
|
|
21818
22100
|
const compatibilityMode = CompatibilityMode.TemplateDefinitionBuilder;
|
|
@@ -22362,6 +22644,8 @@ function convertAst(ast, job, baseSourceSpan) {
|
|
|
22362
22644
|
return new RegularExpressionLiteralExpr(ast.body, ast.flags, baseSourceSpan);
|
|
22363
22645
|
} else if (ast instanceof SpreadElement) {
|
|
22364
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)));
|
|
22365
22649
|
} else {
|
|
22366
22650
|
throw new Error(`Unhandled expression type "${ast.constructor.name}" in file "${baseSourceSpan?.start.file.url}"`);
|
|
22367
22651
|
}
|
|
@@ -22585,6 +22869,19 @@ function ingestControlFlowInsertionPoint(unit, xref, node) {
|
|
|
22585
22869
|
}
|
|
22586
22870
|
return null;
|
|
22587
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
|
+
}
|
|
22588
22885
|
|
|
22589
22886
|
let ENABLE_TEMPLATE_SOURCE_LOCATIONS = false;
|
|
22590
22887
|
function setEnableTemplateSourceLocations(value) {
|
|
@@ -28202,7 +28499,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
|
|
|
28202
28499
|
function compileDeclareClassMetadata(metadata) {
|
|
28203
28500
|
const definitionMap = new DefinitionMap();
|
|
28204
28501
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
|
|
28205
|
-
definitionMap.set('version', literal('21.
|
|
28502
|
+
definitionMap.set('version', literal('21.2.0-next.0'));
|
|
28206
28503
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
28207
28504
|
definitionMap.set('type', metadata.type);
|
|
28208
28505
|
definitionMap.set('decorators', metadata.decorators);
|
|
@@ -28220,7 +28517,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
|
|
|
28220
28517
|
callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? literal(null));
|
|
28221
28518
|
callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? literal(null));
|
|
28222
28519
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
|
|
28223
|
-
definitionMap.set('version', literal('21.
|
|
28520
|
+
definitionMap.set('version', literal('21.2.0-next.0'));
|
|
28224
28521
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
28225
28522
|
definitionMap.set('type', metadata.type);
|
|
28226
28523
|
definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
|
|
@@ -28293,7 +28590,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
28293
28590
|
const definitionMap = new DefinitionMap();
|
|
28294
28591
|
const minVersion = getMinimumVersionForPartialOutput(meta);
|
|
28295
28592
|
definitionMap.set('minVersion', literal(minVersion));
|
|
28296
|
-
definitionMap.set('version', literal('21.
|
|
28593
|
+
definitionMap.set('version', literal('21.2.0-next.0'));
|
|
28297
28594
|
definitionMap.set('type', meta.type.value);
|
|
28298
28595
|
if (meta.isStandalone !== undefined) {
|
|
28299
28596
|
definitionMap.set('isStandalone', literal(meta.isStandalone));
|
|
@@ -28628,7 +28925,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
|
|
|
28628
28925
|
function compileDeclareFactoryFunction(meta) {
|
|
28629
28926
|
const definitionMap = new DefinitionMap();
|
|
28630
28927
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
|
|
28631
|
-
definitionMap.set('version', literal('21.
|
|
28928
|
+
definitionMap.set('version', literal('21.2.0-next.0'));
|
|
28632
28929
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
28633
28930
|
definitionMap.set('type', meta.type.value);
|
|
28634
28931
|
definitionMap.set('deps', compileDependencies(meta.deps));
|
|
@@ -28654,7 +28951,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
28654
28951
|
function createInjectableDefinitionMap(meta) {
|
|
28655
28952
|
const definitionMap = new DefinitionMap();
|
|
28656
28953
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
|
|
28657
|
-
definitionMap.set('version', literal('21.
|
|
28954
|
+
definitionMap.set('version', literal('21.2.0-next.0'));
|
|
28658
28955
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
28659
28956
|
definitionMap.set('type', meta.type.value);
|
|
28660
28957
|
if (meta.providedIn !== undefined) {
|
|
@@ -28695,7 +28992,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
28695
28992
|
function createInjectorDefinitionMap(meta) {
|
|
28696
28993
|
const definitionMap = new DefinitionMap();
|
|
28697
28994
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
|
|
28698
|
-
definitionMap.set('version', literal('21.
|
|
28995
|
+
definitionMap.set('version', literal('21.2.0-next.0'));
|
|
28699
28996
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
28700
28997
|
definitionMap.set('type', meta.type.value);
|
|
28701
28998
|
definitionMap.set('providers', meta.providers);
|
|
@@ -28722,7 +29019,7 @@ function createNgModuleDefinitionMap(meta) {
|
|
|
28722
29019
|
throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
|
|
28723
29020
|
}
|
|
28724
29021
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
|
|
28725
|
-
definitionMap.set('version', literal('21.
|
|
29022
|
+
definitionMap.set('version', literal('21.2.0-next.0'));
|
|
28726
29023
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
28727
29024
|
definitionMap.set('type', meta.type.value);
|
|
28728
29025
|
if (meta.bootstrap.length > 0) {
|
|
@@ -28760,7 +29057,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
28760
29057
|
function createPipeDefinitionMap(meta) {
|
|
28761
29058
|
const definitionMap = new DefinitionMap();
|
|
28762
29059
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
28763
|
-
definitionMap.set('version', literal('21.
|
|
29060
|
+
definitionMap.set('version', literal('21.2.0-next.0'));
|
|
28764
29061
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
28765
29062
|
definitionMap.set('type', meta.type.value);
|
|
28766
29063
|
if (meta.isStandalone !== undefined) {
|
|
@@ -28834,9 +29131,9 @@ function compileHmrUpdateCallback(definitions, constantStatements, meta) {
|
|
|
28834
29131
|
return new DeclareFunctionStmt(`${meta.className}_UpdateMetadata`, params, body, null, StmtModifier.Final);
|
|
28835
29132
|
}
|
|
28836
29133
|
|
|
28837
|
-
const VERSION = new Version('21.
|
|
29134
|
+
const VERSION = new Version('21.2.0-next.0');
|
|
28838
29135
|
|
|
28839
29136
|
publishFacade(_global);
|
|
28840
29137
|
|
|
28841
|
-
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 };
|
|
28842
29139
|
//# sourceMappingURL=compiler.mjs.map
|