@angular/compiler 20.0.1 → 20.1.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 +312 -390
- package/fesm2022/compiler.mjs.map +1 -1
- package/index.d.ts +141 -99
- package/package.json +1 -1
package/fesm2022/compiler.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v20.0.
|
|
2
|
+
* @license Angular v20.1.0-next.0
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -698,7 +698,7 @@ function fingerprint(str) {
|
|
|
698
698
|
let lo = hash32(view, utf8.length, 102072);
|
|
699
699
|
if (hi == 0 && (lo == 0 || lo == 1)) {
|
|
700
700
|
hi = hi ^ 0x130f9bef;
|
|
701
|
-
lo = lo ^ -
|
|
701
|
+
lo = lo ^ -0x6b5f56d8;
|
|
702
702
|
}
|
|
703
703
|
return (BigInt.asUintN(32, BigInt(hi)) << BigInt(32)) | BigInt.asUintN(32, BigInt(lo));
|
|
704
704
|
}
|
|
@@ -942,24 +942,25 @@ var BinaryOperator;
|
|
|
942
942
|
(function (BinaryOperator) {
|
|
943
943
|
BinaryOperator[BinaryOperator["Equals"] = 0] = "Equals";
|
|
944
944
|
BinaryOperator[BinaryOperator["NotEquals"] = 1] = "NotEquals";
|
|
945
|
-
BinaryOperator[BinaryOperator["
|
|
946
|
-
BinaryOperator[BinaryOperator["
|
|
947
|
-
BinaryOperator[BinaryOperator["
|
|
948
|
-
BinaryOperator[BinaryOperator["
|
|
949
|
-
BinaryOperator[BinaryOperator["
|
|
950
|
-
BinaryOperator[BinaryOperator["
|
|
951
|
-
BinaryOperator[BinaryOperator["
|
|
952
|
-
BinaryOperator[BinaryOperator["
|
|
953
|
-
BinaryOperator[BinaryOperator["
|
|
954
|
-
BinaryOperator[BinaryOperator["
|
|
955
|
-
BinaryOperator[BinaryOperator["
|
|
956
|
-
BinaryOperator[BinaryOperator["
|
|
957
|
-
BinaryOperator[BinaryOperator["
|
|
958
|
-
BinaryOperator[BinaryOperator["
|
|
959
|
-
BinaryOperator[BinaryOperator["
|
|
960
|
-
BinaryOperator[BinaryOperator["
|
|
961
|
-
BinaryOperator[BinaryOperator["
|
|
962
|
-
BinaryOperator[BinaryOperator["
|
|
945
|
+
BinaryOperator[BinaryOperator["Assign"] = 2] = "Assign";
|
|
946
|
+
BinaryOperator[BinaryOperator["Identical"] = 3] = "Identical";
|
|
947
|
+
BinaryOperator[BinaryOperator["NotIdentical"] = 4] = "NotIdentical";
|
|
948
|
+
BinaryOperator[BinaryOperator["Minus"] = 5] = "Minus";
|
|
949
|
+
BinaryOperator[BinaryOperator["Plus"] = 6] = "Plus";
|
|
950
|
+
BinaryOperator[BinaryOperator["Divide"] = 7] = "Divide";
|
|
951
|
+
BinaryOperator[BinaryOperator["Multiply"] = 8] = "Multiply";
|
|
952
|
+
BinaryOperator[BinaryOperator["Modulo"] = 9] = "Modulo";
|
|
953
|
+
BinaryOperator[BinaryOperator["And"] = 10] = "And";
|
|
954
|
+
BinaryOperator[BinaryOperator["Or"] = 11] = "Or";
|
|
955
|
+
BinaryOperator[BinaryOperator["BitwiseOr"] = 12] = "BitwiseOr";
|
|
956
|
+
BinaryOperator[BinaryOperator["BitwiseAnd"] = 13] = "BitwiseAnd";
|
|
957
|
+
BinaryOperator[BinaryOperator["Lower"] = 14] = "Lower";
|
|
958
|
+
BinaryOperator[BinaryOperator["LowerEquals"] = 15] = "LowerEquals";
|
|
959
|
+
BinaryOperator[BinaryOperator["Bigger"] = 16] = "Bigger";
|
|
960
|
+
BinaryOperator[BinaryOperator["BiggerEquals"] = 17] = "BiggerEquals";
|
|
961
|
+
BinaryOperator[BinaryOperator["NullishCoalesce"] = 18] = "NullishCoalesce";
|
|
962
|
+
BinaryOperator[BinaryOperator["Exponentiation"] = 19] = "Exponentiation";
|
|
963
|
+
BinaryOperator[BinaryOperator["In"] = 20] = "In";
|
|
963
964
|
})(BinaryOperator || (BinaryOperator = {}));
|
|
964
965
|
function nullSafeIsEquivalent(base, other) {
|
|
965
966
|
if (base == null || other == null) {
|
|
@@ -1089,7 +1090,7 @@ class ReadVarExpr extends Expression {
|
|
|
1089
1090
|
return new ReadVarExpr(this.name, this.type, this.sourceSpan);
|
|
1090
1091
|
}
|
|
1091
1092
|
set(value) {
|
|
1092
|
-
return new
|
|
1093
|
+
return new BinaryOperatorExpr(BinaryOperator.Assign, this, value, null, this.sourceSpan);
|
|
1093
1094
|
}
|
|
1094
1095
|
}
|
|
1095
1096
|
class TypeofExpr extends Expression {
|
|
@@ -1149,85 +1150,6 @@ class WrappedNodeExpr extends Expression {
|
|
|
1149
1150
|
return new WrappedNodeExpr(this.node, this.type, this.sourceSpan);
|
|
1150
1151
|
}
|
|
1151
1152
|
}
|
|
1152
|
-
class WriteVarExpr extends Expression {
|
|
1153
|
-
name;
|
|
1154
|
-
value;
|
|
1155
|
-
constructor(name, value, type, sourceSpan) {
|
|
1156
|
-
super(type || value.type, sourceSpan);
|
|
1157
|
-
this.name = name;
|
|
1158
|
-
this.value = value;
|
|
1159
|
-
}
|
|
1160
|
-
isEquivalent(e) {
|
|
1161
|
-
return e instanceof WriteVarExpr && this.name === e.name && this.value.isEquivalent(e.value);
|
|
1162
|
-
}
|
|
1163
|
-
isConstant() {
|
|
1164
|
-
return false;
|
|
1165
|
-
}
|
|
1166
|
-
visitExpression(visitor, context) {
|
|
1167
|
-
return visitor.visitWriteVarExpr(this, context);
|
|
1168
|
-
}
|
|
1169
|
-
clone() {
|
|
1170
|
-
return new WriteVarExpr(this.name, this.value.clone(), this.type, this.sourceSpan);
|
|
1171
|
-
}
|
|
1172
|
-
toDeclStmt(type, modifiers) {
|
|
1173
|
-
return new DeclareVarStmt(this.name, this.value, type, modifiers, this.sourceSpan);
|
|
1174
|
-
}
|
|
1175
|
-
toConstDecl() {
|
|
1176
|
-
return this.toDeclStmt(INFERRED_TYPE, StmtModifier.Final);
|
|
1177
|
-
}
|
|
1178
|
-
}
|
|
1179
|
-
class WriteKeyExpr extends Expression {
|
|
1180
|
-
receiver;
|
|
1181
|
-
index;
|
|
1182
|
-
value;
|
|
1183
|
-
constructor(receiver, index, value, type, sourceSpan) {
|
|
1184
|
-
super(type || value.type, sourceSpan);
|
|
1185
|
-
this.receiver = receiver;
|
|
1186
|
-
this.index = index;
|
|
1187
|
-
this.value = value;
|
|
1188
|
-
}
|
|
1189
|
-
isEquivalent(e) {
|
|
1190
|
-
return (e instanceof WriteKeyExpr &&
|
|
1191
|
-
this.receiver.isEquivalent(e.receiver) &&
|
|
1192
|
-
this.index.isEquivalent(e.index) &&
|
|
1193
|
-
this.value.isEquivalent(e.value));
|
|
1194
|
-
}
|
|
1195
|
-
isConstant() {
|
|
1196
|
-
return false;
|
|
1197
|
-
}
|
|
1198
|
-
visitExpression(visitor, context) {
|
|
1199
|
-
return visitor.visitWriteKeyExpr(this, context);
|
|
1200
|
-
}
|
|
1201
|
-
clone() {
|
|
1202
|
-
return new WriteKeyExpr(this.receiver.clone(), this.index.clone(), this.value.clone(), this.type, this.sourceSpan);
|
|
1203
|
-
}
|
|
1204
|
-
}
|
|
1205
|
-
class WritePropExpr extends Expression {
|
|
1206
|
-
receiver;
|
|
1207
|
-
name;
|
|
1208
|
-
value;
|
|
1209
|
-
constructor(receiver, name, value, type, sourceSpan) {
|
|
1210
|
-
super(type || value.type, sourceSpan);
|
|
1211
|
-
this.receiver = receiver;
|
|
1212
|
-
this.name = name;
|
|
1213
|
-
this.value = value;
|
|
1214
|
-
}
|
|
1215
|
-
isEquivalent(e) {
|
|
1216
|
-
return (e instanceof WritePropExpr &&
|
|
1217
|
-
this.receiver.isEquivalent(e.receiver) &&
|
|
1218
|
-
this.name === e.name &&
|
|
1219
|
-
this.value.isEquivalent(e.value));
|
|
1220
|
-
}
|
|
1221
|
-
isConstant() {
|
|
1222
|
-
return false;
|
|
1223
|
-
}
|
|
1224
|
-
visitExpression(visitor, context) {
|
|
1225
|
-
return visitor.visitWritePropExpr(this, context);
|
|
1226
|
-
}
|
|
1227
|
-
clone() {
|
|
1228
|
-
return new WritePropExpr(this.receiver.clone(), this.name, this.value.clone(), this.type, this.sourceSpan);
|
|
1229
|
-
}
|
|
1230
|
-
}
|
|
1231
1153
|
class InvokeFunctionExpr extends Expression {
|
|
1232
1154
|
fn;
|
|
1233
1155
|
args;
|
|
@@ -1781,7 +1703,7 @@ class ReadPropExpr extends Expression {
|
|
|
1781
1703
|
return visitor.visitReadPropExpr(this, context);
|
|
1782
1704
|
}
|
|
1783
1705
|
set(value) {
|
|
1784
|
-
return new
|
|
1706
|
+
return new BinaryOperatorExpr(BinaryOperator.Assign, this.receiver.prop(this.name), value, null, this.sourceSpan);
|
|
1785
1707
|
}
|
|
1786
1708
|
clone() {
|
|
1787
1709
|
return new ReadPropExpr(this.receiver.clone(), this.name, this.type, this.sourceSpan);
|
|
@@ -1807,7 +1729,7 @@ class ReadKeyExpr extends Expression {
|
|
|
1807
1729
|
return visitor.visitReadKeyExpr(this, context);
|
|
1808
1730
|
}
|
|
1809
1731
|
set(value) {
|
|
1810
|
-
return new
|
|
1732
|
+
return new BinaryOperatorExpr(BinaryOperator.Assign, this.receiver.key(this.index), value, null, this.sourceSpan);
|
|
1811
1733
|
}
|
|
1812
1734
|
clone() {
|
|
1813
1735
|
return new ReadKeyExpr(this.receiver.clone(), this.index.clone(), this.type, this.sourceSpan);
|
|
@@ -2063,21 +1985,6 @@ let RecursiveAstVisitor$1 = class RecursiveAstVisitor {
|
|
|
2063
1985
|
visitReadVarExpr(ast, context) {
|
|
2064
1986
|
return this.visitExpression(ast, context);
|
|
2065
1987
|
}
|
|
2066
|
-
visitWriteVarExpr(ast, context) {
|
|
2067
|
-
ast.value.visitExpression(this, context);
|
|
2068
|
-
return this.visitExpression(ast, context);
|
|
2069
|
-
}
|
|
2070
|
-
visitWriteKeyExpr(ast, context) {
|
|
2071
|
-
ast.receiver.visitExpression(this, context);
|
|
2072
|
-
ast.index.visitExpression(this, context);
|
|
2073
|
-
ast.value.visitExpression(this, context);
|
|
2074
|
-
return this.visitExpression(ast, context);
|
|
2075
|
-
}
|
|
2076
|
-
visitWritePropExpr(ast, context) {
|
|
2077
|
-
ast.receiver.visitExpression(this, context);
|
|
2078
|
-
ast.value.visitExpression(this, context);
|
|
2079
|
-
return this.visitExpression(ast, context);
|
|
2080
|
-
}
|
|
2081
1988
|
visitDynamicImportExpr(ast, context) {
|
|
2082
1989
|
return this.visitExpression(ast, context);
|
|
2083
1990
|
}
|
|
@@ -2375,9 +2282,6 @@ var output_ast = /*#__PURE__*/Object.freeze({
|
|
|
2375
2282
|
UnaryOperatorExpr: UnaryOperatorExpr,
|
|
2376
2283
|
VoidExpr: VoidExpr,
|
|
2377
2284
|
WrappedNodeExpr: WrappedNodeExpr,
|
|
2378
|
-
WriteKeyExpr: WriteKeyExpr,
|
|
2379
|
-
WritePropExpr: WritePropExpr,
|
|
2380
|
-
WriteVarExpr: WriteVarExpr,
|
|
2381
2285
|
areAllEquivalent: areAllEquivalent,
|
|
2382
2286
|
arrowFn: arrowFn,
|
|
2383
2287
|
expressionType: expressionType,
|
|
@@ -2505,7 +2409,7 @@ class ConstantPool {
|
|
|
2505
2409
|
if ((!newValue && !fixup.shared) || (newValue && forceShared)) {
|
|
2506
2410
|
// Replace the expression with a variable
|
|
2507
2411
|
const name = this.freshName();
|
|
2508
|
-
let
|
|
2412
|
+
let value;
|
|
2509
2413
|
let usage;
|
|
2510
2414
|
if (this.isClosureCompilerEnabled && isLongStringLiteral(literal)) {
|
|
2511
2415
|
// For string literals, Closure will **always** inline the string at
|
|
@@ -2521,20 +2425,20 @@ class ConstantPool {
|
|
|
2521
2425
|
// const myStr = function() { return "very very very long string"; };
|
|
2522
2426
|
// const usage1 = myStr();
|
|
2523
2427
|
// const usage2 = myStr();
|
|
2524
|
-
|
|
2428
|
+
value = new FunctionExpr([], // Params.
|
|
2525
2429
|
[
|
|
2526
2430
|
// Statements.
|
|
2527
2431
|
new ReturnStatement(literal),
|
|
2528
|
-
])
|
|
2432
|
+
]);
|
|
2529
2433
|
usage = variable(name).callFn([]);
|
|
2530
2434
|
}
|
|
2531
2435
|
else {
|
|
2532
2436
|
// Just declare and use the variable directly, without a function call
|
|
2533
2437
|
// indirection. This saves a few bytes and avoids an unnecessary call.
|
|
2534
|
-
|
|
2438
|
+
value = literal;
|
|
2535
2439
|
usage = variable(name);
|
|
2536
2440
|
}
|
|
2537
|
-
this.statements.push(
|
|
2441
|
+
this.statements.push(new DeclareVarStmt(name, value, INFERRED_TYPE, StmtModifier.Final));
|
|
2538
2442
|
fixup.fixup(usage);
|
|
2539
2443
|
}
|
|
2540
2444
|
return fixup;
|
|
@@ -2605,9 +2509,7 @@ class ConstantPool {
|
|
|
2605
2509
|
.map((e) => new FnParam(e.name, DYNAMIC_TYPE));
|
|
2606
2510
|
const pureFunctionDeclaration = arrowFn(parameters, resultMap(resultExpressions), INFERRED_TYPE);
|
|
2607
2511
|
const name = this.freshName();
|
|
2608
|
-
this.statements.push(
|
|
2609
|
-
.set(pureFunctionDeclaration)
|
|
2610
|
-
.toDeclStmt(INFERRED_TYPE, StmtModifier.Final));
|
|
2512
|
+
this.statements.push(new DeclareVarStmt(name, pureFunctionDeclaration, INFERRED_TYPE, StmtModifier.Final));
|
|
2611
2513
|
literalFactory = variable(name);
|
|
2612
2514
|
this.literalFactories.set(key, literalFactory);
|
|
2613
2515
|
}
|
|
@@ -3511,46 +3413,6 @@ class AbstractEmitterVisitor {
|
|
|
3511
3413
|
ctx.println(stmt, `}`);
|
|
3512
3414
|
return null;
|
|
3513
3415
|
}
|
|
3514
|
-
visitWriteVarExpr(expr, ctx) {
|
|
3515
|
-
const lineWasEmpty = ctx.lineIsEmpty();
|
|
3516
|
-
if (!lineWasEmpty) {
|
|
3517
|
-
ctx.print(expr, '(');
|
|
3518
|
-
}
|
|
3519
|
-
ctx.print(expr, `${expr.name} = `);
|
|
3520
|
-
expr.value.visitExpression(this, ctx);
|
|
3521
|
-
if (!lineWasEmpty) {
|
|
3522
|
-
ctx.print(expr, ')');
|
|
3523
|
-
}
|
|
3524
|
-
return null;
|
|
3525
|
-
}
|
|
3526
|
-
visitWriteKeyExpr(expr, ctx) {
|
|
3527
|
-
const lineWasEmpty = ctx.lineIsEmpty();
|
|
3528
|
-
if (!lineWasEmpty) {
|
|
3529
|
-
ctx.print(expr, '(');
|
|
3530
|
-
}
|
|
3531
|
-
expr.receiver.visitExpression(this, ctx);
|
|
3532
|
-
ctx.print(expr, `[`);
|
|
3533
|
-
expr.index.visitExpression(this, ctx);
|
|
3534
|
-
ctx.print(expr, `] = `);
|
|
3535
|
-
expr.value.visitExpression(this, ctx);
|
|
3536
|
-
if (!lineWasEmpty) {
|
|
3537
|
-
ctx.print(expr, ')');
|
|
3538
|
-
}
|
|
3539
|
-
return null;
|
|
3540
|
-
}
|
|
3541
|
-
visitWritePropExpr(expr, ctx) {
|
|
3542
|
-
const lineWasEmpty = ctx.lineIsEmpty();
|
|
3543
|
-
if (!lineWasEmpty) {
|
|
3544
|
-
ctx.print(expr, '(');
|
|
3545
|
-
}
|
|
3546
|
-
expr.receiver.visitExpression(this, ctx);
|
|
3547
|
-
ctx.print(expr, `.${expr.name} = `);
|
|
3548
|
-
expr.value.visitExpression(this, ctx);
|
|
3549
|
-
if (!lineWasEmpty) {
|
|
3550
|
-
ctx.print(expr, ')');
|
|
3551
|
-
}
|
|
3552
|
-
return null;
|
|
3553
|
-
}
|
|
3554
3416
|
visitInvokeFunctionExpr(expr, ctx) {
|
|
3555
3417
|
const shouldParenthesize = expr.fn instanceof ArrowFunctionExpr;
|
|
3556
3418
|
if (shouldParenthesize) {
|
|
@@ -3672,6 +3534,9 @@ class AbstractEmitterVisitor {
|
|
|
3672
3534
|
visitBinaryOperatorExpr(ast, ctx) {
|
|
3673
3535
|
let opStr;
|
|
3674
3536
|
switch (ast.operator) {
|
|
3537
|
+
case BinaryOperator.Assign:
|
|
3538
|
+
opStr = '=';
|
|
3539
|
+
break;
|
|
3675
3540
|
case BinaryOperator.Equals:
|
|
3676
3541
|
opStr = '==';
|
|
3677
3542
|
break;
|
|
@@ -3951,7 +3816,7 @@ function compileFactoryFunction(meta) {
|
|
|
3951
3816
|
let retExpr = null;
|
|
3952
3817
|
function makeConditionalFactory(nonCtorExpr) {
|
|
3953
3818
|
const r = variable('__ngConditionalFactory__');
|
|
3954
|
-
body.push(r.
|
|
3819
|
+
body.push(new DeclareVarStmt(r.name, NULL_EXPR, INFERRED_TYPE));
|
|
3955
3820
|
const ctorStmt = ctorExpr !== null
|
|
3956
3821
|
? r.set(ctorExpr).toStmt()
|
|
3957
3822
|
: importExpr(Identifiers.invalidFactory).callFn([]).toStmt();
|
|
@@ -4211,20 +4076,6 @@ class PropertyRead extends ASTWithName {
|
|
|
4211
4076
|
return visitor.visitPropertyRead(this, context);
|
|
4212
4077
|
}
|
|
4213
4078
|
}
|
|
4214
|
-
class PropertyWrite extends ASTWithName {
|
|
4215
|
-
receiver;
|
|
4216
|
-
name;
|
|
4217
|
-
value;
|
|
4218
|
-
constructor(span, sourceSpan, nameSpan, receiver, name, value) {
|
|
4219
|
-
super(span, sourceSpan, nameSpan);
|
|
4220
|
-
this.receiver = receiver;
|
|
4221
|
-
this.name = name;
|
|
4222
|
-
this.value = value;
|
|
4223
|
-
}
|
|
4224
|
-
visit(visitor, context = null) {
|
|
4225
|
-
return visitor.visitPropertyWrite(this, context);
|
|
4226
|
-
}
|
|
4227
|
-
}
|
|
4228
4079
|
class SafePropertyRead extends ASTWithName {
|
|
4229
4080
|
receiver;
|
|
4230
4081
|
name;
|
|
@@ -4261,29 +4112,31 @@ class SafeKeyedRead extends AST {
|
|
|
4261
4112
|
return visitor.visitSafeKeyedRead(this, context);
|
|
4262
4113
|
}
|
|
4263
4114
|
}
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
}
|
|
4115
|
+
/** Possible types for a pipe. */
|
|
4116
|
+
var BindingPipeType;
|
|
4117
|
+
(function (BindingPipeType) {
|
|
4118
|
+
/**
|
|
4119
|
+
* Pipe is being referenced by its name, for example:
|
|
4120
|
+
* `@Pipe({name: 'foo'}) class FooPipe` and `{{123 | foo}}`.
|
|
4121
|
+
*/
|
|
4122
|
+
BindingPipeType[BindingPipeType["ReferencedByName"] = 0] = "ReferencedByName";
|
|
4123
|
+
/**
|
|
4124
|
+
* Pipe is being referenced by its class name, for example:
|
|
4125
|
+
* `@Pipe() class FooPipe` and `{{123 | FooPipe}}`.
|
|
4126
|
+
*/
|
|
4127
|
+
BindingPipeType[BindingPipeType["ReferencedDirectly"] = 1] = "ReferencedDirectly";
|
|
4128
|
+
})(BindingPipeType || (BindingPipeType = {}));
|
|
4278
4129
|
class BindingPipe extends ASTWithName {
|
|
4279
4130
|
exp;
|
|
4280
4131
|
name;
|
|
4281
4132
|
args;
|
|
4282
|
-
|
|
4133
|
+
type;
|
|
4134
|
+
constructor(span, sourceSpan, exp, name, args, type, nameSpan) {
|
|
4283
4135
|
super(span, sourceSpan, nameSpan);
|
|
4284
4136
|
this.exp = exp;
|
|
4285
4137
|
this.name = name;
|
|
4286
4138
|
this.args = args;
|
|
4139
|
+
this.type = type;
|
|
4287
4140
|
}
|
|
4288
4141
|
visit(visitor, context = null) {
|
|
4289
4142
|
return visitor.visitPipe(this, context);
|
|
@@ -4604,11 +4457,6 @@ class RecursiveAstVisitor {
|
|
|
4604
4457
|
this.visit(ast.receiver, context);
|
|
4605
4458
|
this.visit(ast.key, context);
|
|
4606
4459
|
}
|
|
4607
|
-
visitKeyedWrite(ast, context) {
|
|
4608
|
-
this.visit(ast.receiver, context);
|
|
4609
|
-
this.visit(ast.key, context);
|
|
4610
|
-
this.visit(ast.value, context);
|
|
4611
|
-
}
|
|
4612
4460
|
visitLiteralArray(ast, context) {
|
|
4613
4461
|
this.visitAll(ast.expressions, context);
|
|
4614
4462
|
}
|
|
@@ -4631,10 +4479,6 @@ class RecursiveAstVisitor {
|
|
|
4631
4479
|
visitPropertyRead(ast, context) {
|
|
4632
4480
|
this.visit(ast.receiver, context);
|
|
4633
4481
|
}
|
|
4634
|
-
visitPropertyWrite(ast, context) {
|
|
4635
|
-
this.visit(ast.receiver, context);
|
|
4636
|
-
this.visit(ast.value, context);
|
|
4637
|
-
}
|
|
4638
4482
|
visitSafePropertyRead(ast, context) {
|
|
4639
4483
|
this.visit(ast.receiver, context);
|
|
4640
4484
|
}
|
|
@@ -4960,11 +4804,12 @@ let Element$1 = class Element {
|
|
|
4960
4804
|
directives;
|
|
4961
4805
|
children;
|
|
4962
4806
|
references;
|
|
4807
|
+
isSelfClosing;
|
|
4963
4808
|
sourceSpan;
|
|
4964
4809
|
startSourceSpan;
|
|
4965
4810
|
endSourceSpan;
|
|
4966
4811
|
i18n;
|
|
4967
|
-
constructor(name, attributes, inputs, outputs, directives, children, references, sourceSpan, startSourceSpan, endSourceSpan, i18n) {
|
|
4812
|
+
constructor(name, attributes, inputs, outputs, directives, children, references, isSelfClosing, sourceSpan, startSourceSpan, endSourceSpan, i18n) {
|
|
4968
4813
|
this.name = name;
|
|
4969
4814
|
this.attributes = attributes;
|
|
4970
4815
|
this.inputs = inputs;
|
|
@@ -4972,6 +4817,7 @@ let Element$1 = class Element {
|
|
|
4972
4817
|
this.directives = directives;
|
|
4973
4818
|
this.children = children;
|
|
4974
4819
|
this.references = references;
|
|
4820
|
+
this.isSelfClosing = isSelfClosing;
|
|
4975
4821
|
this.sourceSpan = sourceSpan;
|
|
4976
4822
|
this.startSourceSpan = startSourceSpan;
|
|
4977
4823
|
this.endSourceSpan = endSourceSpan;
|
|
@@ -5278,11 +5124,12 @@ let Component$1 = class Component {
|
|
|
5278
5124
|
directives;
|
|
5279
5125
|
children;
|
|
5280
5126
|
references;
|
|
5127
|
+
isSelfClosing;
|
|
5281
5128
|
sourceSpan;
|
|
5282
5129
|
startSourceSpan;
|
|
5283
5130
|
endSourceSpan;
|
|
5284
5131
|
i18n;
|
|
5285
|
-
constructor(componentName, tagName, fullName, attributes, inputs, outputs, directives, children, references, sourceSpan, startSourceSpan, endSourceSpan, i18n) {
|
|
5132
|
+
constructor(componentName, tagName, fullName, attributes, inputs, outputs, directives, children, references, isSelfClosing, sourceSpan, startSourceSpan, endSourceSpan, i18n) {
|
|
5286
5133
|
this.componentName = componentName;
|
|
5287
5134
|
this.tagName = tagName;
|
|
5288
5135
|
this.fullName = fullName;
|
|
@@ -5292,6 +5139,7 @@ let Component$1 = class Component {
|
|
|
5292
5139
|
this.directives = directives;
|
|
5293
5140
|
this.children = children;
|
|
5294
5141
|
this.references = references;
|
|
5142
|
+
this.isSelfClosing = isSelfClosing;
|
|
5295
5143
|
this.sourceSpan = sourceSpan;
|
|
5296
5144
|
this.startSourceSpan = startSourceSpan;
|
|
5297
5145
|
this.endSourceSpan = endSourceSpan;
|
|
@@ -5336,6 +5184,7 @@ class Template {
|
|
|
5336
5184
|
children;
|
|
5337
5185
|
references;
|
|
5338
5186
|
variables;
|
|
5187
|
+
isSelfClosing;
|
|
5339
5188
|
sourceSpan;
|
|
5340
5189
|
startSourceSpan;
|
|
5341
5190
|
endSourceSpan;
|
|
@@ -5345,7 +5194,7 @@ class Template {
|
|
|
5345
5194
|
// `null` is a special case for when there is a structural directive on an `ng-template` so
|
|
5346
5195
|
// the renderer can differentiate between the synthetic template and the one written in the
|
|
5347
5196
|
// file.
|
|
5348
|
-
tagName, attributes, inputs, outputs, directives, templateAttrs, children, references, variables, sourceSpan, startSourceSpan, endSourceSpan, i18n) {
|
|
5197
|
+
tagName, attributes, inputs, outputs, directives, templateAttrs, children, references, variables, isSelfClosing, sourceSpan, startSourceSpan, endSourceSpan, i18n) {
|
|
5349
5198
|
this.tagName = tagName;
|
|
5350
5199
|
this.attributes = attributes;
|
|
5351
5200
|
this.inputs = inputs;
|
|
@@ -5355,6 +5204,7 @@ class Template {
|
|
|
5355
5204
|
this.children = children;
|
|
5356
5205
|
this.references = references;
|
|
5357
5206
|
this.variables = variables;
|
|
5207
|
+
this.isSelfClosing = isSelfClosing;
|
|
5358
5208
|
this.sourceSpan = sourceSpan;
|
|
5359
5209
|
this.startSourceSpan = startSourceSpan;
|
|
5360
5210
|
this.endSourceSpan = endSourceSpan;
|
|
@@ -5368,15 +5218,17 @@ class Content {
|
|
|
5368
5218
|
selector;
|
|
5369
5219
|
attributes;
|
|
5370
5220
|
children;
|
|
5221
|
+
isSelfClosing;
|
|
5371
5222
|
sourceSpan;
|
|
5372
5223
|
startSourceSpan;
|
|
5373
5224
|
endSourceSpan;
|
|
5374
5225
|
i18n;
|
|
5375
5226
|
name = 'ng-content';
|
|
5376
|
-
constructor(selector, attributes, children, sourceSpan, startSourceSpan, endSourceSpan, i18n) {
|
|
5227
|
+
constructor(selector, attributes, children, isSelfClosing, sourceSpan, startSourceSpan, endSourceSpan, i18n) {
|
|
5377
5228
|
this.selector = selector;
|
|
5378
5229
|
this.attributes = attributes;
|
|
5379
5230
|
this.children = children;
|
|
5231
|
+
this.isSelfClosing = isSelfClosing;
|
|
5380
5232
|
this.sourceSpan = sourceSpan;
|
|
5381
5233
|
this.startSourceSpan = startSourceSpan;
|
|
5382
5234
|
this.endSourceSpan = endSourceSpan;
|
|
@@ -5542,7 +5394,7 @@ function visitAll$1(visitor, nodes) {
|
|
|
5542
5394
|
const result = [];
|
|
5543
5395
|
if (visitor.visit) {
|
|
5544
5396
|
for (const node of nodes) {
|
|
5545
|
-
visitor.visit(node)
|
|
5397
|
+
visitor.visit(node);
|
|
5546
5398
|
}
|
|
5547
5399
|
}
|
|
5548
5400
|
else {
|
|
@@ -7438,7 +7290,11 @@ function tupleOfTypes(types) {
|
|
|
7438
7290
|
function compilePipeFromMetadata(metadata) {
|
|
7439
7291
|
const definitionMapValues = [];
|
|
7440
7292
|
// e.g. `name: 'myPipe'`
|
|
7441
|
-
definitionMapValues.push({
|
|
7293
|
+
definitionMapValues.push({
|
|
7294
|
+
key: 'name',
|
|
7295
|
+
value: literal(metadata.pipeName ?? metadata.name),
|
|
7296
|
+
quoted: false,
|
|
7297
|
+
});
|
|
7442
7298
|
// e.g. `type: MyPipe`
|
|
7443
7299
|
definitionMapValues.push({ key: 'type', value: metadata.type.value, quoted: false });
|
|
7444
7300
|
// e.g. `pure: true`
|
|
@@ -10454,15 +10310,6 @@ function transformExpressionsInExpression(expr, transform, flags) {
|
|
|
10454
10310
|
expr.receiver = transformExpressionsInExpression(expr.receiver, transform, flags);
|
|
10455
10311
|
expr.index = transformExpressionsInExpression(expr.index, transform, flags);
|
|
10456
10312
|
}
|
|
10457
|
-
else if (expr instanceof WritePropExpr) {
|
|
10458
|
-
expr.receiver = transformExpressionsInExpression(expr.receiver, transform, flags);
|
|
10459
|
-
expr.value = transformExpressionsInExpression(expr.value, transform, flags);
|
|
10460
|
-
}
|
|
10461
|
-
else if (expr instanceof WriteKeyExpr) {
|
|
10462
|
-
expr.receiver = transformExpressionsInExpression(expr.receiver, transform, flags);
|
|
10463
|
-
expr.index = transformExpressionsInExpression(expr.index, transform, flags);
|
|
10464
|
-
expr.value = transformExpressionsInExpression(expr.value, transform, flags);
|
|
10465
|
-
}
|
|
10466
10313
|
else if (expr instanceof InvokeFunctionExpr) {
|
|
10467
10314
|
expr.fn = transformExpressionsInExpression(expr.fn, transform, flags);
|
|
10468
10315
|
for (let i = 0; i < expr.args.length; i++) {
|
|
@@ -10492,9 +10339,6 @@ function transformExpressionsInExpression(expr, transform, flags) {
|
|
|
10492
10339
|
else if (expr instanceof VoidExpr) {
|
|
10493
10340
|
expr.expr = transformExpressionsInExpression(expr.expr, transform, flags);
|
|
10494
10341
|
}
|
|
10495
|
-
else if (expr instanceof WriteVarExpr) {
|
|
10496
|
-
expr.value = transformExpressionsInExpression(expr.value, transform, flags);
|
|
10497
|
-
}
|
|
10498
10342
|
else if (expr instanceof LocalizedString) {
|
|
10499
10343
|
for (let i = 0; i < expr.expressions.length; i++) {
|
|
10500
10344
|
expr.expressions[i] = transformExpressionsInExpression(expr.expressions[i], transform, flags);
|
|
@@ -12077,6 +11921,7 @@ const BINARY_OPERATORS = new Map([
|
|
|
12077
11921
|
['|', BinaryOperator.BitwiseOr],
|
|
12078
11922
|
['&', BinaryOperator.BitwiseAnd],
|
|
12079
11923
|
['/', BinaryOperator.Divide],
|
|
11924
|
+
['=', BinaryOperator.Assign],
|
|
12080
11925
|
['==', BinaryOperator.Equals],
|
|
12081
11926
|
['===', BinaryOperator.Identical],
|
|
12082
11927
|
['<', BinaryOperator.Lower],
|
|
@@ -13551,14 +13396,16 @@ class Element extends NodeWithI18n {
|
|
|
13551
13396
|
attrs;
|
|
13552
13397
|
directives;
|
|
13553
13398
|
children;
|
|
13399
|
+
isSelfClosing;
|
|
13554
13400
|
startSourceSpan;
|
|
13555
13401
|
endSourceSpan;
|
|
13556
|
-
constructor(name, attrs, directives, children, sourceSpan, startSourceSpan, endSourceSpan = null, i18n) {
|
|
13402
|
+
constructor(name, attrs, directives, children, isSelfClosing, sourceSpan, startSourceSpan, endSourceSpan = null, i18n) {
|
|
13557
13403
|
super(sourceSpan, i18n);
|
|
13558
13404
|
this.name = name;
|
|
13559
13405
|
this.attrs = attrs;
|
|
13560
13406
|
this.directives = directives;
|
|
13561
13407
|
this.children = children;
|
|
13408
|
+
this.isSelfClosing = isSelfClosing;
|
|
13562
13409
|
this.startSourceSpan = startSourceSpan;
|
|
13563
13410
|
this.endSourceSpan = endSourceSpan;
|
|
13564
13411
|
}
|
|
@@ -13604,9 +13451,10 @@ class Component extends NodeWithI18n {
|
|
|
13604
13451
|
attrs;
|
|
13605
13452
|
directives;
|
|
13606
13453
|
children;
|
|
13454
|
+
isSelfClosing;
|
|
13607
13455
|
startSourceSpan;
|
|
13608
13456
|
endSourceSpan;
|
|
13609
|
-
constructor(componentName, tagName, fullName, attrs, directives, children, sourceSpan, startSourceSpan, endSourceSpan = null, i18n) {
|
|
13457
|
+
constructor(componentName, tagName, fullName, attrs, directives, children, isSelfClosing, sourceSpan, startSourceSpan, endSourceSpan = null, i18n) {
|
|
13610
13458
|
super(sourceSpan, i18n);
|
|
13611
13459
|
this.componentName = componentName;
|
|
13612
13460
|
this.tagName = tagName;
|
|
@@ -13614,6 +13462,7 @@ class Component extends NodeWithI18n {
|
|
|
13614
13462
|
this.attrs = attrs;
|
|
13615
13463
|
this.directives = directives;
|
|
13616
13464
|
this.children = children;
|
|
13465
|
+
this.isSelfClosing = isSelfClosing;
|
|
13617
13466
|
this.startSourceSpan = startSourceSpan;
|
|
13618
13467
|
this.endSourceSpan = endSourceSpan;
|
|
13619
13468
|
}
|
|
@@ -17525,7 +17374,7 @@ class _TreeBuilder {
|
|
|
17525
17374
|
const span = new ParseSourceSpan(startTagToken.sourceSpan.start, end, startTagToken.sourceSpan.fullStart);
|
|
17526
17375
|
// Create a separate `startSpan` because `span` will be modified when there is an `end` span.
|
|
17527
17376
|
const startSpan = new ParseSourceSpan(startTagToken.sourceSpan.start, end, startTagToken.sourceSpan.fullStart);
|
|
17528
|
-
const el = new Element(fullName, attrs, directives, [], span, startSpan, undefined);
|
|
17377
|
+
const el = new Element(fullName, attrs, directives, [], selfClosing, span, startSpan, undefined);
|
|
17529
17378
|
const parent = this._getContainer();
|
|
17530
17379
|
const isClosedByChild = parent !== null && !!this._getTagDefinition(parent)?.isClosedByChild(el.name);
|
|
17531
17380
|
this._pushContainer(el, isClosedByChild);
|
|
@@ -17554,7 +17403,7 @@ class _TreeBuilder {
|
|
|
17554
17403
|
const end = this._peek.sourceSpan.fullStart;
|
|
17555
17404
|
const span = new ParseSourceSpan(startToken.sourceSpan.start, end, startToken.sourceSpan.fullStart);
|
|
17556
17405
|
const startSpan = new ParseSourceSpan(startToken.sourceSpan.start, end, startToken.sourceSpan.fullStart);
|
|
17557
|
-
const node = new Component(componentName, tagName, fullName, attrs, directives, [], span, startSpan, undefined);
|
|
17406
|
+
const node = new Component(componentName, tagName, fullName, attrs, directives, [], selfClosing, span, startSpan, undefined);
|
|
17558
17407
|
const parent = this._getContainer();
|
|
17559
17408
|
const isClosedByChild = parent !== null &&
|
|
17560
17409
|
node.tagName !== null &&
|
|
@@ -17968,11 +17817,11 @@ class WhitespaceVisitor {
|
|
|
17968
17817
|
if (SKIP_WS_TRIM_TAGS.has(element.name) || hasPreserveWhitespacesAttr(element.attrs)) {
|
|
17969
17818
|
// don't descent into elements where we need to preserve whitespaces
|
|
17970
17819
|
// but still visit all attributes to eliminate one used as a market to preserve WS
|
|
17971
|
-
const newElement = new Element(element.name, visitAllWithSiblings(this, element.attrs), visitAllWithSiblings(this, element.directives), element.children, element.sourceSpan, element.startSourceSpan, element.endSourceSpan, element.i18n);
|
|
17820
|
+
const newElement = new Element(element.name, visitAllWithSiblings(this, element.attrs), visitAllWithSiblings(this, element.directives), element.children, element.isSelfClosing, element.sourceSpan, element.startSourceSpan, element.endSourceSpan, element.i18n);
|
|
17972
17821
|
this.originalNodeMap?.set(newElement, element);
|
|
17973
17822
|
return newElement;
|
|
17974
17823
|
}
|
|
17975
|
-
const newElement = new Element(element.name, element.attrs, element.directives, visitAllWithSiblings(this, element.children), element.sourceSpan, element.startSourceSpan, element.endSourceSpan, element.i18n);
|
|
17824
|
+
const newElement = new Element(element.name, element.attrs, element.directives, visitAllWithSiblings(this, element.children), element.isSelfClosing, element.sourceSpan, element.startSourceSpan, element.endSourceSpan, element.i18n);
|
|
17976
17825
|
this.originalNodeMap?.set(newElement, element);
|
|
17977
17826
|
return newElement;
|
|
17978
17827
|
}
|
|
@@ -18051,11 +17900,11 @@ class WhitespaceVisitor {
|
|
|
18051
17900
|
hasPreserveWhitespacesAttr(node.attrs)) {
|
|
18052
17901
|
// don't descent into elements where we need to preserve whitespaces
|
|
18053
17902
|
// but still visit all attributes to eliminate one used as a market to preserve WS
|
|
18054
|
-
const newElement = new Component(node.componentName, node.tagName, node.fullName, visitAllWithSiblings(this, node.attrs), visitAllWithSiblings(this, node.directives), node.children, node.sourceSpan, node.startSourceSpan, node.endSourceSpan, node.i18n);
|
|
17903
|
+
const newElement = new Component(node.componentName, node.tagName, node.fullName, visitAllWithSiblings(this, node.attrs), visitAllWithSiblings(this, node.directives), node.children, node.isSelfClosing, node.sourceSpan, node.startSourceSpan, node.endSourceSpan, node.i18n);
|
|
18055
17904
|
this.originalNodeMap?.set(newElement, node);
|
|
18056
17905
|
return newElement;
|
|
18057
17906
|
}
|
|
18058
|
-
const newElement = new Component(node.componentName, node.tagName, node.fullName, node.attrs, node.directives, visitAllWithSiblings(this, node.children), node.sourceSpan, node.startSourceSpan, node.endSourceSpan, node.i18n);
|
|
17907
|
+
const newElement = new Component(node.componentName, node.tagName, node.fullName, node.attrs, node.directives, visitAllWithSiblings(this, node.children), node.isSelfClosing, node.sourceSpan, node.startSourceSpan, node.endSourceSpan, node.i18n);
|
|
18059
17908
|
this.originalNodeMap?.set(newElement, node);
|
|
18060
17909
|
return newElement;
|
|
18061
17910
|
}
|
|
@@ -18655,20 +18504,23 @@ class TemplateBindingParseResult {
|
|
|
18655
18504
|
}
|
|
18656
18505
|
class Parser {
|
|
18657
18506
|
_lexer;
|
|
18658
|
-
|
|
18659
|
-
constructor(_lexer) {
|
|
18507
|
+
_supportsDirectPipeReferences;
|
|
18508
|
+
constructor(_lexer, _supportsDirectPipeReferences = false) {
|
|
18660
18509
|
this._lexer = _lexer;
|
|
18510
|
+
this._supportsDirectPipeReferences = _supportsDirectPipeReferences;
|
|
18661
18511
|
}
|
|
18662
18512
|
parseAction(input, location, absoluteOffset, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
|
|
18663
|
-
|
|
18513
|
+
const errors = [];
|
|
18514
|
+
this._checkNoInterpolation(errors, input, location, interpolationConfig);
|
|
18664
18515
|
const sourceToLex = this._stripComments(input);
|
|
18665
18516
|
const tokens = this._lexer.tokenize(sourceToLex);
|
|
18666
|
-
const ast = new _ParseAST(input, location, absoluteOffset, tokens, 1 /* ParseFlags.Action */,
|
|
18667
|
-
return new ASTWithSource(ast, input, location, absoluteOffset,
|
|
18517
|
+
const ast = new _ParseAST(input, location, absoluteOffset, tokens, 1 /* ParseFlags.Action */, errors, 0, this._supportsDirectPipeReferences).parseChain();
|
|
18518
|
+
return new ASTWithSource(ast, input, location, absoluteOffset, errors);
|
|
18668
18519
|
}
|
|
18669
18520
|
parseBinding(input, location, absoluteOffset, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
|
|
18670
|
-
const
|
|
18671
|
-
|
|
18521
|
+
const errors = [];
|
|
18522
|
+
const ast = this._parseBindingAst(input, location, absoluteOffset, interpolationConfig, errors);
|
|
18523
|
+
return new ASTWithSource(ast, input, location, absoluteOffset, errors);
|
|
18672
18524
|
}
|
|
18673
18525
|
checkSimpleExpression(ast) {
|
|
18674
18526
|
const checker = new SimpleExpressionChecker();
|
|
@@ -18677,21 +18529,19 @@ class Parser {
|
|
|
18677
18529
|
}
|
|
18678
18530
|
// Host bindings parsed here
|
|
18679
18531
|
parseSimpleBinding(input, location, absoluteOffset, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
|
|
18680
|
-
const
|
|
18681
|
-
const
|
|
18682
|
-
|
|
18683
|
-
|
|
18532
|
+
const errors = [];
|
|
18533
|
+
const ast = this._parseBindingAst(input, location, absoluteOffset, interpolationConfig, errors);
|
|
18534
|
+
const simplExpressionErrors = this.checkSimpleExpression(ast);
|
|
18535
|
+
if (simplExpressionErrors.length > 0) {
|
|
18536
|
+
errors.push(new ParserError(`Host binding expression cannot contain ${simplExpressionErrors.join(' ')}`, input, location));
|
|
18684
18537
|
}
|
|
18685
|
-
return new ASTWithSource(ast, input, location, absoluteOffset,
|
|
18538
|
+
return new ASTWithSource(ast, input, location, absoluteOffset, errors);
|
|
18686
18539
|
}
|
|
18687
|
-
|
|
18688
|
-
this.errors
|
|
18689
|
-
}
|
|
18690
|
-
_parseBindingAst(input, location, absoluteOffset, interpolationConfig) {
|
|
18691
|
-
this._checkNoInterpolation(input, location, interpolationConfig);
|
|
18540
|
+
_parseBindingAst(input, location, absoluteOffset, interpolationConfig, errors) {
|
|
18541
|
+
this._checkNoInterpolation(errors, input, location, interpolationConfig);
|
|
18692
18542
|
const sourceToLex = this._stripComments(input);
|
|
18693
18543
|
const tokens = this._lexer.tokenize(sourceToLex);
|
|
18694
|
-
return new _ParseAST(input, location, absoluteOffset, tokens, 0 /* ParseFlags.None */,
|
|
18544
|
+
return new _ParseAST(input, location, absoluteOffset, tokens, 0 /* ParseFlags.None */, errors, 0, this._supportsDirectPipeReferences).parseChain();
|
|
18695
18545
|
}
|
|
18696
18546
|
/**
|
|
18697
18547
|
* Parse microsyntax template expression and return a list of bindings or
|
|
@@ -18721,14 +18571,16 @@ class Parser {
|
|
|
18721
18571
|
*/
|
|
18722
18572
|
parseTemplateBindings(templateKey, templateValue, templateUrl, absoluteKeyOffset, absoluteValueOffset) {
|
|
18723
18573
|
const tokens = this._lexer.tokenize(templateValue);
|
|
18724
|
-
const
|
|
18574
|
+
const errors = [];
|
|
18575
|
+
const parser = new _ParseAST(templateValue, templateUrl, absoluteValueOffset, tokens, 0 /* ParseFlags.None */, errors, 0 /* relative offset */, this._supportsDirectPipeReferences);
|
|
18725
18576
|
return parser.parseTemplateBindings({
|
|
18726
18577
|
source: templateKey,
|
|
18727
18578
|
span: new AbsoluteSourceSpan(absoluteKeyOffset, absoluteKeyOffset + templateKey.length),
|
|
18728
18579
|
});
|
|
18729
18580
|
}
|
|
18730
18581
|
parseInterpolation(input, location, absoluteOffset, interpolatedTokens, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
|
|
18731
|
-
const
|
|
18582
|
+
const errors = [];
|
|
18583
|
+
const { strings, expressions, offsets } = this.splitInterpolation(input, location, errors, interpolatedTokens, interpolationConfig);
|
|
18732
18584
|
if (expressions.length === 0)
|
|
18733
18585
|
return null;
|
|
18734
18586
|
const expressionNodes = [];
|
|
@@ -18736,10 +18588,10 @@ class Parser {
|
|
|
18736
18588
|
const expressionText = expressions[i].text;
|
|
18737
18589
|
const sourceToLex = this._stripComments(expressionText);
|
|
18738
18590
|
const tokens = this._lexer.tokenize(sourceToLex);
|
|
18739
|
-
const ast = new _ParseAST(input, location, absoluteOffset, tokens, 0 /* ParseFlags.None */,
|
|
18591
|
+
const ast = new _ParseAST(input, location, absoluteOffset, tokens, 0 /* ParseFlags.None */, errors, offsets[i], this._supportsDirectPipeReferences).parseChain();
|
|
18740
18592
|
expressionNodes.push(ast);
|
|
18741
18593
|
}
|
|
18742
|
-
return this.createInterpolationAst(strings.map((s) => s.text), expressionNodes, input, location, absoluteOffset);
|
|
18594
|
+
return this.createInterpolationAst(strings.map((s) => s.text), expressionNodes, input, location, absoluteOffset, errors);
|
|
18743
18595
|
}
|
|
18744
18596
|
/**
|
|
18745
18597
|
* Similar to `parseInterpolation`, but treats the provided string as a single expression
|
|
@@ -18749,14 +18601,15 @@ class Parser {
|
|
|
18749
18601
|
parseInterpolationExpression(expression, location, absoluteOffset) {
|
|
18750
18602
|
const sourceToLex = this._stripComments(expression);
|
|
18751
18603
|
const tokens = this._lexer.tokenize(sourceToLex);
|
|
18752
|
-
const
|
|
18604
|
+
const errors = [];
|
|
18605
|
+
const ast = new _ParseAST(expression, location, absoluteOffset, tokens, 0 /* ParseFlags.None */, errors, 0, this._supportsDirectPipeReferences).parseChain();
|
|
18753
18606
|
const strings = ['', '']; // The prefix and suffix strings are both empty
|
|
18754
|
-
return this.createInterpolationAst(strings, [ast], expression, location, absoluteOffset);
|
|
18607
|
+
return this.createInterpolationAst(strings, [ast], expression, location, absoluteOffset, errors);
|
|
18755
18608
|
}
|
|
18756
|
-
createInterpolationAst(strings, expressions, input, location, absoluteOffset) {
|
|
18609
|
+
createInterpolationAst(strings, expressions, input, location, absoluteOffset, errors) {
|
|
18757
18610
|
const span = new ParseSpan(0, input.length);
|
|
18758
18611
|
const interpolation = new Interpolation$1(span, span.toAbsolute(absoluteOffset), strings, expressions);
|
|
18759
|
-
return new ASTWithSource(interpolation, input, location, absoluteOffset,
|
|
18612
|
+
return new ASTWithSource(interpolation, input, location, absoluteOffset, errors);
|
|
18760
18613
|
}
|
|
18761
18614
|
/**
|
|
18762
18615
|
* Splits a string of text into "raw" text segments and expressions present in interpolations in
|
|
@@ -18765,7 +18618,7 @@ class Parser {
|
|
|
18765
18618
|
* `SplitInterpolation` with splits that look like
|
|
18766
18619
|
* <raw text> <expression> <raw text> ... <raw text> <expression> <raw text>
|
|
18767
18620
|
*/
|
|
18768
|
-
splitInterpolation(input, location, interpolatedTokens, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
|
|
18621
|
+
splitInterpolation(input, location, errors, interpolatedTokens, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
|
|
18769
18622
|
const strings = [];
|
|
18770
18623
|
const expressions = [];
|
|
18771
18624
|
const offsets = [];
|
|
@@ -18803,7 +18656,7 @@ class Parser {
|
|
|
18803
18656
|
const fullEnd = exprEnd + interpEnd.length;
|
|
18804
18657
|
const text = input.substring(exprStart, exprEnd);
|
|
18805
18658
|
if (text.trim().length === 0) {
|
|
18806
|
-
|
|
18659
|
+
errors.push(new ParserError('Blank expressions are not allowed in interpolated strings', input, `at column ${i} in`, location));
|
|
18807
18660
|
}
|
|
18808
18661
|
expressions.push({ text, start: fullStart, end: fullEnd });
|
|
18809
18662
|
const startInOriginalTemplate = inputToTemplateIndexMap?.get(fullStart) ?? fullStart;
|
|
@@ -18828,7 +18681,7 @@ class Parser {
|
|
|
18828
18681
|
}
|
|
18829
18682
|
wrapLiteralPrimitive(input, location, absoluteOffset) {
|
|
18830
18683
|
const span = new ParseSpan(0, input == null ? 0 : input.length);
|
|
18831
|
-
return new ASTWithSource(new LiteralPrimitive(span, span.toAbsolute(absoluteOffset), input), input, location, absoluteOffset,
|
|
18684
|
+
return new ASTWithSource(new LiteralPrimitive(span, span.toAbsolute(absoluteOffset), input), input, location, absoluteOffset, []);
|
|
18832
18685
|
}
|
|
18833
18686
|
_stripComments(input) {
|
|
18834
18687
|
const i = this._commentStart(input);
|
|
@@ -18850,7 +18703,7 @@ class Parser {
|
|
|
18850
18703
|
}
|
|
18851
18704
|
return null;
|
|
18852
18705
|
}
|
|
18853
|
-
_checkNoInterpolation(input, location, { start, end }) {
|
|
18706
|
+
_checkNoInterpolation(errors, input, location, { start, end }) {
|
|
18854
18707
|
let startIndex = -1;
|
|
18855
18708
|
let endIndex = -1;
|
|
18856
18709
|
for (const charIndex of this._forEachUnquotedChar(input, 0)) {
|
|
@@ -18867,7 +18720,7 @@ class Parser {
|
|
|
18867
18720
|
}
|
|
18868
18721
|
}
|
|
18869
18722
|
if (startIndex > -1 && endIndex > -1) {
|
|
18870
|
-
|
|
18723
|
+
errors.push(new ParserError(`Got interpolation (${start}${end}) where expression was expected`, input, `at column ${startIndex} in`, location));
|
|
18871
18724
|
}
|
|
18872
18725
|
}
|
|
18873
18726
|
/**
|
|
@@ -18932,6 +18785,7 @@ class _ParseAST {
|
|
|
18932
18785
|
parseFlags;
|
|
18933
18786
|
errors;
|
|
18934
18787
|
offset;
|
|
18788
|
+
supportsDirectPipeReferences;
|
|
18935
18789
|
rparensExpected = 0;
|
|
18936
18790
|
rbracketsExpected = 0;
|
|
18937
18791
|
rbracesExpected = 0;
|
|
@@ -18942,7 +18796,7 @@ class _ParseAST {
|
|
|
18942
18796
|
// and may change for subsequent expressions visited by the parser.
|
|
18943
18797
|
sourceSpanCache = new Map();
|
|
18944
18798
|
index = 0;
|
|
18945
|
-
constructor(input, location, absoluteOffset, tokens, parseFlags, errors, offset) {
|
|
18799
|
+
constructor(input, location, absoluteOffset, tokens, parseFlags, errors, offset, supportsDirectPipeReferences) {
|
|
18946
18800
|
this.input = input;
|
|
18947
18801
|
this.location = location;
|
|
18948
18802
|
this.absoluteOffset = absoluteOffset;
|
|
@@ -18950,6 +18804,7 @@ class _ParseAST {
|
|
|
18950
18804
|
this.parseFlags = parseFlags;
|
|
18951
18805
|
this.errors = errors;
|
|
18952
18806
|
this.offset = offset;
|
|
18807
|
+
this.supportsDirectPipeReferences = supportsDirectPipeReferences;
|
|
18953
18808
|
}
|
|
18954
18809
|
peek(offset) {
|
|
18955
18810
|
const i = this.index + offset;
|
|
@@ -19178,7 +19033,18 @@ class _ParseAST {
|
|
|
19178
19033
|
// If there are additional expressions beyond the name, then the artificial end for the
|
|
19179
19034
|
// name is no longer relevant.
|
|
19180
19035
|
}
|
|
19181
|
-
|
|
19036
|
+
let type;
|
|
19037
|
+
if (this.supportsDirectPipeReferences) {
|
|
19038
|
+
const charCode = nameId.charCodeAt(0);
|
|
19039
|
+
type =
|
|
19040
|
+
charCode === $_ || (charCode >= $A && charCode <= $Z)
|
|
19041
|
+
? BindingPipeType.ReferencedDirectly
|
|
19042
|
+
: BindingPipeType.ReferencedByName;
|
|
19043
|
+
}
|
|
19044
|
+
else {
|
|
19045
|
+
type = BindingPipeType.ReferencedByName;
|
|
19046
|
+
}
|
|
19047
|
+
result = new BindingPipe(this.span(start), this.sourceSpan(start, fullSpanEnd), result, nameId, args, type, nameSpan);
|
|
19182
19048
|
} while (this.consumeOptionalOperator('|'));
|
|
19183
19049
|
}
|
|
19184
19050
|
return result;
|
|
@@ -19542,14 +19408,13 @@ class _ParseAST {
|
|
|
19542
19408
|
return id;
|
|
19543
19409
|
});
|
|
19544
19410
|
const nameSpan = this.sourceSpan(nameStart);
|
|
19545
|
-
let receiver;
|
|
19546
19411
|
if (isSafe) {
|
|
19547
19412
|
if (this.consumeOptionalOperator('=')) {
|
|
19548
19413
|
this.error("The '?.' operator cannot be used in the assignment");
|
|
19549
|
-
|
|
19414
|
+
return new EmptyExpr$1(this.span(start), this.sourceSpan(start));
|
|
19550
19415
|
}
|
|
19551
19416
|
else {
|
|
19552
|
-
|
|
19417
|
+
return new SafePropertyRead(this.span(start), this.sourceSpan(start), nameSpan, readReceiver, id);
|
|
19553
19418
|
}
|
|
19554
19419
|
}
|
|
19555
19420
|
else {
|
|
@@ -19558,14 +19423,14 @@ class _ParseAST {
|
|
|
19558
19423
|
this.error('Bindings cannot contain assignments');
|
|
19559
19424
|
return new EmptyExpr$1(this.span(start), this.sourceSpan(start));
|
|
19560
19425
|
}
|
|
19426
|
+
const receiver = new PropertyRead(this.span(start), this.sourceSpan(start), nameSpan, readReceiver, id);
|
|
19561
19427
|
const value = this.parseConditional();
|
|
19562
|
-
|
|
19428
|
+
return new Binary(this.span(start), this.sourceSpan(start), '=', receiver, value);
|
|
19563
19429
|
}
|
|
19564
19430
|
else {
|
|
19565
|
-
|
|
19431
|
+
return new PropertyRead(this.span(start), this.sourceSpan(start), nameSpan, readReceiver, id);
|
|
19566
19432
|
}
|
|
19567
19433
|
}
|
|
19568
|
-
return receiver;
|
|
19569
19434
|
}
|
|
19570
19435
|
parseCall(receiver, start, isSafe) {
|
|
19571
19436
|
const argumentStart = this.inputIndex;
|
|
@@ -19680,8 +19545,9 @@ class _ParseAST {
|
|
|
19680
19545
|
this.error("The '?.' operator cannot be used in the assignment");
|
|
19681
19546
|
}
|
|
19682
19547
|
else {
|
|
19548
|
+
const binaryReceiver = new KeyedRead(this.span(start), this.sourceSpan(start), receiver, key);
|
|
19683
19549
|
const value = this.parseConditional();
|
|
19684
|
-
return new
|
|
19550
|
+
return new Binary(this.span(start), this.sourceSpan(start), '=', binaryReceiver, value);
|
|
19685
19551
|
}
|
|
19686
19552
|
}
|
|
19687
19553
|
else {
|
|
@@ -19984,9 +19850,6 @@ class SerializeExpressionVisitor {
|
|
|
19984
19850
|
visitKeyedRead(ast, context) {
|
|
19985
19851
|
return `${ast.receiver.visit(this, context)}[${ast.key.visit(this, context)}]`;
|
|
19986
19852
|
}
|
|
19987
|
-
visitKeyedWrite(ast, context) {
|
|
19988
|
-
return `${ast.receiver.visit(this, context)}[${ast.key.visit(this, context)}] = ${ast.value.visit(this, context)}`;
|
|
19989
|
-
}
|
|
19990
19853
|
visitLiteralArray(ast, context) {
|
|
19991
19854
|
return `[${ast.expressions.map((e) => e.visit(this, context)).join(', ')}]`;
|
|
19992
19855
|
}
|
|
@@ -20027,14 +19890,6 @@ class SerializeExpressionVisitor {
|
|
|
20027
19890
|
return `${ast.receiver.visit(this, context)}.${ast.name}`;
|
|
20028
19891
|
}
|
|
20029
19892
|
}
|
|
20030
|
-
visitPropertyWrite(ast, context) {
|
|
20031
|
-
if (ast.receiver instanceof ImplicitReceiver) {
|
|
20032
|
-
return `${ast.name} = ${ast.value.visit(this, context)}`;
|
|
20033
|
-
}
|
|
20034
|
-
else {
|
|
20035
|
-
return `${ast.receiver.visit(this, context)}.${ast.name} = ${ast.value.visit(this, context)}`;
|
|
20036
|
-
}
|
|
20037
|
-
}
|
|
20038
19893
|
visitSafePropertyRead(ast, context) {
|
|
20039
19894
|
return `${ast.receiver.visit(this, context)}?.${ast.name}`;
|
|
20040
19895
|
}
|
|
@@ -21651,7 +21506,7 @@ function createGoogleGetMsgStatements(variable$1, message, closureVar, placehold
|
|
|
21651
21506
|
// */
|
|
21652
21507
|
// const MSG_... = goog.getMsg(..);
|
|
21653
21508
|
// I18N_X = MSG_...;
|
|
21654
|
-
const googGetMsgStmt = closureVar.
|
|
21509
|
+
const googGetMsgStmt = new DeclareVarStmt(closureVar.name, variable(GOOG_GET_MSG).callFn(args), INFERRED_TYPE, StmtModifier.Final);
|
|
21655
21510
|
googGetMsgStmt.addLeadingComment(i18nMetaToJSDoc(message));
|
|
21656
21511
|
const i18nAssignmentStmt = new ExpressionStatement(variable$1.set(closureVar));
|
|
21657
21512
|
return [googGetMsgStmt, i18nAssignmentStmt];
|
|
@@ -26699,17 +26554,6 @@ function convertAst(ast, job, baseSourceSpan) {
|
|
|
26699
26554
|
return new ReadPropExpr(convertAst(ast.receiver, job, baseSourceSpan), ast.name, null, convertSourceSpan(ast.span, baseSourceSpan));
|
|
26700
26555
|
}
|
|
26701
26556
|
}
|
|
26702
|
-
else if (ast instanceof PropertyWrite) {
|
|
26703
|
-
if (ast.receiver instanceof ImplicitReceiver) {
|
|
26704
|
-
return new WritePropExpr(
|
|
26705
|
-
// TODO: Is it correct to always use the root context in place of the implicit receiver?
|
|
26706
|
-
new ContextExpr(job.root.xref), ast.name, convertAst(ast.value, job, baseSourceSpan), null, convertSourceSpan(ast.span, baseSourceSpan));
|
|
26707
|
-
}
|
|
26708
|
-
return new WritePropExpr(convertAst(ast.receiver, job, baseSourceSpan), ast.name, convertAst(ast.value, job, baseSourceSpan), undefined, convertSourceSpan(ast.span, baseSourceSpan));
|
|
26709
|
-
}
|
|
26710
|
-
else if (ast instanceof KeyedWrite) {
|
|
26711
|
-
return new WriteKeyExpr(convertAst(ast.receiver, job, baseSourceSpan), convertAst(ast.key, job, baseSourceSpan), convertAst(ast.value, job, baseSourceSpan), undefined, convertSourceSpan(ast.span, baseSourceSpan));
|
|
26712
|
-
}
|
|
26713
26557
|
else if (ast instanceof Call) {
|
|
26714
26558
|
if (ast.receiver instanceof ImplicitReceiver) {
|
|
26715
26559
|
throw new Error(`Unexpected ImplicitReceiver`);
|
|
@@ -27200,6 +27044,12 @@ function ingestControlFlowInsertionPoint(unit, xref, node) {
|
|
|
27200
27044
|
* internal tooling as well.
|
|
27201
27045
|
*/
|
|
27202
27046
|
let ENABLE_TEMPLATE_SOURCE_LOCATIONS = false;
|
|
27047
|
+
/**
|
|
27048
|
+
* Utility function to enable source locations. Intended to be used **only** inside unit tests.
|
|
27049
|
+
*/
|
|
27050
|
+
function setEnableTemplateSourceLocations(value) {
|
|
27051
|
+
ENABLE_TEMPLATE_SOURCE_LOCATIONS = value;
|
|
27052
|
+
}
|
|
27203
27053
|
/** Gets whether template source locations are enabled. */
|
|
27204
27054
|
function getTemplateSourceLocationsEnabled() {
|
|
27205
27055
|
return ENABLE_TEMPLATE_SOURCE_LOCATIONS;
|
|
@@ -28986,7 +28836,7 @@ class HtmlAstToIvyAst {
|
|
|
28986
28836
|
if (preparsedElement.type === PreparsedElementType.NG_CONTENT) {
|
|
28987
28837
|
const selector = preparsedElement.selectAttr;
|
|
28988
28838
|
const attrs = element.attrs.map((attr) => this.visitAttribute(attr));
|
|
28989
|
-
parsedElement = new Content(selector, attrs, children, element.sourceSpan, element.startSourceSpan, element.endSourceSpan, element.i18n);
|
|
28839
|
+
parsedElement = new Content(selector, attrs, children, element.isSelfClosing, element.sourceSpan, element.startSourceSpan, element.endSourceSpan, element.i18n);
|
|
28990
28840
|
this.ngContentSelectors.push(selector);
|
|
28991
28841
|
}
|
|
28992
28842
|
else if (isTemplateElement) {
|
|
@@ -28994,11 +28844,11 @@ class HtmlAstToIvyAst {
|
|
|
28994
28844
|
const attrs = this.categorizePropertyAttributes(element.name, parsedProperties, i18nAttrsMeta);
|
|
28995
28845
|
parsedElement = new Template(element.name, attributes, attrs.bound, boundEvents, directives, [
|
|
28996
28846
|
/* no template attributes */
|
|
28997
|
-
], children, references, variables, element.sourceSpan, element.startSourceSpan, element.endSourceSpan, element.i18n);
|
|
28847
|
+
], children, references, variables, element.isSelfClosing, element.sourceSpan, element.startSourceSpan, element.endSourceSpan, element.i18n);
|
|
28998
28848
|
}
|
|
28999
28849
|
else {
|
|
29000
28850
|
const attrs = this.categorizePropertyAttributes(element.name, parsedProperties, i18nAttrsMeta);
|
|
29001
|
-
parsedElement = new Element$1(element.name, attributes, attrs.bound, boundEvents, directives, children, references, element.sourceSpan, element.startSourceSpan, element.endSourceSpan, element.i18n);
|
|
28851
|
+
parsedElement = new Element$1(element.name, attributes, attrs.bound, boundEvents, directives, children, references, element.isSelfClosing, element.sourceSpan, element.startSourceSpan, element.endSourceSpan, element.i18n);
|
|
29002
28852
|
}
|
|
29003
28853
|
if (elementHasInlineTemplate) {
|
|
29004
28854
|
// If this node is an inline-template (e.g. has *ngFor) then we need to create a template
|
|
@@ -29093,7 +28943,7 @@ class HtmlAstToIvyAst {
|
|
|
29093
28943
|
children = visitAll(this, component.children, component.children);
|
|
29094
28944
|
}
|
|
29095
28945
|
const attrs = this.categorizePropertyAttributes(component.tagName, parsedProperties, i18nAttrsMeta);
|
|
29096
|
-
let node = new Component$1(component.componentName, component.tagName, component.fullName, attributes, attrs.bound, boundEvents, directives, children, references, component.sourceSpan, component.startSourceSpan, component.endSourceSpan, component.i18n);
|
|
28946
|
+
let node = new Component$1(component.componentName, component.tagName, component.fullName, attributes, attrs.bound, boundEvents, directives, children, references, component.isSelfClosing, component.sourceSpan, component.startSourceSpan, component.endSourceSpan, component.i18n);
|
|
29097
28947
|
if (elementHasInlineTemplate) {
|
|
29098
28948
|
node = this.wrapInTemplate(node, templateParsedProperties, templateVariables, i18nAttrsMeta, false, isI18nRootElement);
|
|
29099
28949
|
}
|
|
@@ -29433,7 +29283,7 @@ class HtmlAstToIvyAst {
|
|
|
29433
29283
|
// Do not copy over the directives.
|
|
29434
29284
|
], templateAttrs, [node], [
|
|
29435
29285
|
// Do not copy over the references.
|
|
29436
|
-
], templateVariables, node.sourceSpan, node.startSourceSpan, node.endSourceSpan, i18n);
|
|
29286
|
+
], templateVariables, false, node.sourceSpan, node.startSourceSpan, node.endSourceSpan, i18n);
|
|
29437
29287
|
}
|
|
29438
29288
|
_visitTextWithInterpolation(value, sourceSpan, interpolatedTokens, i18n) {
|
|
29439
29289
|
const valueNoNgsp = replaceNgsp(value);
|
|
@@ -29504,7 +29354,7 @@ class NonBindableVisitor {
|
|
|
29504
29354
|
/* inputs */ [],
|
|
29505
29355
|
/* outputs */ [],
|
|
29506
29356
|
/* directives */ [], children,
|
|
29507
|
-
/* references */ [], ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan);
|
|
29357
|
+
/* references */ [], ast.isSelfClosing, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan);
|
|
29508
29358
|
}
|
|
29509
29359
|
visitComment(comment) {
|
|
29510
29360
|
return null;
|
|
@@ -29545,7 +29395,7 @@ class NonBindableVisitor {
|
|
|
29545
29395
|
/* inputs */ [],
|
|
29546
29396
|
/* outputs */ [],
|
|
29547
29397
|
/* directives */ [], children,
|
|
29548
|
-
/* references */ [], ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan);
|
|
29398
|
+
/* references */ [], ast.isSelfClosing, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan);
|
|
29549
29399
|
}
|
|
29550
29400
|
visitDirective(directive, context) {
|
|
29551
29401
|
return null;
|
|
@@ -29577,7 +29427,8 @@ const LEADING_TRIVIA_CHARS = [' ', '\n', '\r', '\t'];
|
|
|
29577
29427
|
*/
|
|
29578
29428
|
function parseTemplate(template, templateUrl, options = {}) {
|
|
29579
29429
|
const { interpolationConfig, preserveWhitespaces, enableI18nLegacyMessageIdFormat } = options;
|
|
29580
|
-
const
|
|
29430
|
+
const selectorlessEnabled = options.enableSelectorless ?? false;
|
|
29431
|
+
const bindingParser = makeBindingParser(interpolationConfig, selectorlessEnabled);
|
|
29581
29432
|
const htmlParser = new HtmlParser();
|
|
29582
29433
|
const parseResult = htmlParser.parse(template, templateUrl, {
|
|
29583
29434
|
leadingTriviaChars: LEADING_TRIVIA_CHARS,
|
|
@@ -29585,7 +29436,7 @@ function parseTemplate(template, templateUrl, options = {}) {
|
|
|
29585
29436
|
tokenizeExpansionForms: true,
|
|
29586
29437
|
tokenizeBlocks: options.enableBlockSyntax ?? true,
|
|
29587
29438
|
tokenizeLet: options.enableLetSyntax ?? true,
|
|
29588
|
-
selectorlessEnabled
|
|
29439
|
+
selectorlessEnabled,
|
|
29589
29440
|
});
|
|
29590
29441
|
if (!options.alwaysAttemptHtmlToR3AstConversion &&
|
|
29591
29442
|
parseResult.errors &&
|
|
@@ -29684,8 +29535,8 @@ const elementRegistry = new DomElementSchemaRegistry();
|
|
|
29684
29535
|
/**
|
|
29685
29536
|
* Construct a `BindingParser` with a default configuration.
|
|
29686
29537
|
*/
|
|
29687
|
-
function makeBindingParser(interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
|
|
29688
|
-
return new BindingParser(new Parser(new Lexer()), interpolationConfig, elementRegistry, []);
|
|
29538
|
+
function makeBindingParser(interpolationConfig = DEFAULT_INTERPOLATION_CONFIG, selectorlessEnabled = false) {
|
|
29539
|
+
return new BindingParser(new Parser(new Lexer(), selectorlessEnabled), interpolationConfig, elementRegistry, []);
|
|
29689
29540
|
}
|
|
29690
29541
|
|
|
29691
29542
|
const COMPONENT_VARIABLE = '%COMP%';
|
|
@@ -30214,6 +30065,132 @@ function compileDeferResolverFunction(meta) {
|
|
|
30214
30065
|
return arrowFn([], literalArr(depExpressions));
|
|
30215
30066
|
}
|
|
30216
30067
|
|
|
30068
|
+
/*!
|
|
30069
|
+
* @license
|
|
30070
|
+
* Copyright Google LLC All Rights Reserved.
|
|
30071
|
+
*
|
|
30072
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
30073
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
30074
|
+
*/
|
|
30075
|
+
/**
|
|
30076
|
+
* Visitor that traverses all template and expression AST nodes in a template.
|
|
30077
|
+
* Useful for cases where every single node needs to be visited.
|
|
30078
|
+
*/
|
|
30079
|
+
class CombinedRecursiveAstVisitor extends RecursiveAstVisitor {
|
|
30080
|
+
visit(node) {
|
|
30081
|
+
if (node instanceof ASTWithSource) {
|
|
30082
|
+
this.visit(node.ast);
|
|
30083
|
+
}
|
|
30084
|
+
else {
|
|
30085
|
+
node.visit(this);
|
|
30086
|
+
}
|
|
30087
|
+
}
|
|
30088
|
+
visitElement(element) {
|
|
30089
|
+
this.visitAllTemplateNodes(element.attributes);
|
|
30090
|
+
this.visitAllTemplateNodes(element.inputs);
|
|
30091
|
+
this.visitAllTemplateNodes(element.outputs);
|
|
30092
|
+
this.visitAllTemplateNodes(element.directives);
|
|
30093
|
+
this.visitAllTemplateNodes(element.references);
|
|
30094
|
+
this.visitAllTemplateNodes(element.children);
|
|
30095
|
+
}
|
|
30096
|
+
visitTemplate(template) {
|
|
30097
|
+
this.visitAllTemplateNodes(template.attributes);
|
|
30098
|
+
this.visitAllTemplateNodes(template.inputs);
|
|
30099
|
+
this.visitAllTemplateNodes(template.outputs);
|
|
30100
|
+
this.visitAllTemplateNodes(template.directives);
|
|
30101
|
+
this.visitAllTemplateNodes(template.templateAttrs);
|
|
30102
|
+
this.visitAllTemplateNodes(template.variables);
|
|
30103
|
+
this.visitAllTemplateNodes(template.references);
|
|
30104
|
+
this.visitAllTemplateNodes(template.children);
|
|
30105
|
+
}
|
|
30106
|
+
visitContent(content) {
|
|
30107
|
+
this.visitAllTemplateNodes(content.children);
|
|
30108
|
+
}
|
|
30109
|
+
visitBoundAttribute(attribute) {
|
|
30110
|
+
this.visit(attribute.value);
|
|
30111
|
+
}
|
|
30112
|
+
visitBoundEvent(attribute) {
|
|
30113
|
+
this.visit(attribute.handler);
|
|
30114
|
+
}
|
|
30115
|
+
visitBoundText(text) {
|
|
30116
|
+
this.visit(text.value);
|
|
30117
|
+
}
|
|
30118
|
+
visitIcu(icu) {
|
|
30119
|
+
Object.keys(icu.vars).forEach((key) => this.visit(icu.vars[key]));
|
|
30120
|
+
Object.keys(icu.placeholders).forEach((key) => this.visit(icu.placeholders[key]));
|
|
30121
|
+
}
|
|
30122
|
+
visitDeferredBlock(deferred) {
|
|
30123
|
+
deferred.visitAll(this);
|
|
30124
|
+
}
|
|
30125
|
+
visitDeferredTrigger(trigger) {
|
|
30126
|
+
if (trigger instanceof BoundDeferredTrigger) {
|
|
30127
|
+
this.visit(trigger.value);
|
|
30128
|
+
}
|
|
30129
|
+
}
|
|
30130
|
+
visitDeferredBlockPlaceholder(block) {
|
|
30131
|
+
this.visitAllTemplateNodes(block.children);
|
|
30132
|
+
}
|
|
30133
|
+
visitDeferredBlockError(block) {
|
|
30134
|
+
this.visitAllTemplateNodes(block.children);
|
|
30135
|
+
}
|
|
30136
|
+
visitDeferredBlockLoading(block) {
|
|
30137
|
+
this.visitAllTemplateNodes(block.children);
|
|
30138
|
+
}
|
|
30139
|
+
visitSwitchBlock(block) {
|
|
30140
|
+
this.visit(block.expression);
|
|
30141
|
+
this.visitAllTemplateNodes(block.cases);
|
|
30142
|
+
}
|
|
30143
|
+
visitSwitchBlockCase(block) {
|
|
30144
|
+
block.expression && this.visit(block.expression);
|
|
30145
|
+
this.visitAllTemplateNodes(block.children);
|
|
30146
|
+
}
|
|
30147
|
+
visitForLoopBlock(block) {
|
|
30148
|
+
block.item.visit(this);
|
|
30149
|
+
this.visitAllTemplateNodes(block.contextVariables);
|
|
30150
|
+
this.visit(block.expression);
|
|
30151
|
+
this.visitAllTemplateNodes(block.children);
|
|
30152
|
+
block.empty?.visit(this);
|
|
30153
|
+
}
|
|
30154
|
+
visitForLoopBlockEmpty(block) {
|
|
30155
|
+
this.visitAllTemplateNodes(block.children);
|
|
30156
|
+
}
|
|
30157
|
+
visitIfBlock(block) {
|
|
30158
|
+
this.visitAllTemplateNodes(block.branches);
|
|
30159
|
+
}
|
|
30160
|
+
visitIfBlockBranch(block) {
|
|
30161
|
+
block.expression && this.visit(block.expression);
|
|
30162
|
+
block.expressionAlias?.visit(this);
|
|
30163
|
+
this.visitAllTemplateNodes(block.children);
|
|
30164
|
+
}
|
|
30165
|
+
visitLetDeclaration(decl) {
|
|
30166
|
+
this.visit(decl.value);
|
|
30167
|
+
}
|
|
30168
|
+
visitComponent(component) {
|
|
30169
|
+
this.visitAllTemplateNodes(component.attributes);
|
|
30170
|
+
this.visitAllTemplateNodes(component.inputs);
|
|
30171
|
+
this.visitAllTemplateNodes(component.outputs);
|
|
30172
|
+
this.visitAllTemplateNodes(component.directives);
|
|
30173
|
+
this.visitAllTemplateNodes(component.references);
|
|
30174
|
+
this.visitAllTemplateNodes(component.children);
|
|
30175
|
+
}
|
|
30176
|
+
visitDirective(directive) {
|
|
30177
|
+
this.visitAllTemplateNodes(directive.attributes);
|
|
30178
|
+
this.visitAllTemplateNodes(directive.inputs);
|
|
30179
|
+
this.visitAllTemplateNodes(directive.outputs);
|
|
30180
|
+
this.visitAllTemplateNodes(directive.references);
|
|
30181
|
+
}
|
|
30182
|
+
visitVariable(variable) { }
|
|
30183
|
+
visitReference(reference) { }
|
|
30184
|
+
visitTextAttribute(attribute) { }
|
|
30185
|
+
visitText(text) { }
|
|
30186
|
+
visitUnknownBlock(block) { }
|
|
30187
|
+
visitAllTemplateNodes(nodes) {
|
|
30188
|
+
for (const node of nodes) {
|
|
30189
|
+
this.visit(node);
|
|
30190
|
+
}
|
|
30191
|
+
}
|
|
30192
|
+
}
|
|
30193
|
+
|
|
30217
30194
|
/**
|
|
30218
30195
|
* Computes a difference between full list (first argument) and
|
|
30219
30196
|
* list of items that should be excluded from the full list (second
|
|
@@ -30317,9 +30294,7 @@ class R3TargetBinder {
|
|
|
30317
30294
|
// - bindings: Map of inputs, outputs, and attributes to the directive/element that claims
|
|
30318
30295
|
// them. TODO(alxhub): handle multiple directives claiming an input/output/etc.
|
|
30319
30296
|
// - references: Map of #references to their targets.
|
|
30320
|
-
|
|
30321
|
-
DirectiveBinder.apply(target.template, this.directiveMatcher, directives, eagerDirectives, missingDirectives, bindings, references);
|
|
30322
|
-
}
|
|
30297
|
+
DirectiveBinder.apply(target.template, this.directiveMatcher, directives, eagerDirectives, missingDirectives, bindings, references);
|
|
30323
30298
|
// Finally, run the TemplateBinder to bind references, variables, and other entities within the
|
|
30324
30299
|
// template. This extracts all the metadata that doesn't depend on directive matching.
|
|
30325
30300
|
TemplateBinder.applyWithScope(target.template, scope, expressions, symbols, nestingLevel, usedPipes, eagerPipes, deferBlocks);
|
|
@@ -30653,6 +30628,13 @@ class DirectiveBinder {
|
|
|
30653
30628
|
this.directiveMatcher.match(cssSelector, (_, results) => directives.push(...results));
|
|
30654
30629
|
this.trackSelectorBasedBindingsAndDirectives(node, directives);
|
|
30655
30630
|
}
|
|
30631
|
+
else {
|
|
30632
|
+
node.references.forEach((ref) => {
|
|
30633
|
+
if (ref.value.trim() === '') {
|
|
30634
|
+
this.references.set(ref, node);
|
|
30635
|
+
}
|
|
30636
|
+
});
|
|
30637
|
+
}
|
|
30656
30638
|
node.directives.forEach((directive) => directive.visit(this));
|
|
30657
30639
|
node.children.forEach((child) => child.visit(this));
|
|
30658
30640
|
}
|
|
@@ -30755,7 +30737,7 @@ class DirectiveBinder {
|
|
|
30755
30737
|
* Expressions are visited by the superclass `RecursiveAstVisitor`, with custom logic provided
|
|
30756
30738
|
* by overridden methods from that visitor.
|
|
30757
30739
|
*/
|
|
30758
|
-
class TemplateBinder extends
|
|
30740
|
+
class TemplateBinder extends CombinedRecursiveAstVisitor {
|
|
30759
30741
|
bindings;
|
|
30760
30742
|
symbols;
|
|
30761
30743
|
usedPipes;
|
|
@@ -30765,7 +30747,7 @@ class TemplateBinder extends RecursiveAstVisitor {
|
|
|
30765
30747
|
scope;
|
|
30766
30748
|
rootNode;
|
|
30767
30749
|
level;
|
|
30768
|
-
visitNode;
|
|
30750
|
+
visitNode = (node) => node.visit(this);
|
|
30769
30751
|
constructor(bindings, symbols, usedPipes, eagerPipes, deferBlocks, nestingLevel, scope, rootNode, level) {
|
|
30770
30752
|
super();
|
|
30771
30753
|
this.bindings = bindings;
|
|
@@ -30777,19 +30759,6 @@ class TemplateBinder extends RecursiveAstVisitor {
|
|
|
30777
30759
|
this.scope = scope;
|
|
30778
30760
|
this.rootNode = rootNode;
|
|
30779
30761
|
this.level = level;
|
|
30780
|
-
// Save a bit of processing time by constructing this closure in advance.
|
|
30781
|
-
this.visitNode = (node) => node.visit(this);
|
|
30782
|
-
}
|
|
30783
|
-
// This method is defined to reconcile the type of TemplateBinder since both
|
|
30784
|
-
// RecursiveAstVisitor and Visitor define the visit() method in their
|
|
30785
|
-
// interfaces.
|
|
30786
|
-
visit(node, context) {
|
|
30787
|
-
if (node instanceof AST) {
|
|
30788
|
-
node.visit(this, context);
|
|
30789
|
-
}
|
|
30790
|
-
else {
|
|
30791
|
-
node.visit(this);
|
|
30792
|
-
}
|
|
30793
30762
|
}
|
|
30794
30763
|
/**
|
|
30795
30764
|
* Process a template and extract metadata about expressions and symbols within.
|
|
@@ -30858,14 +30827,6 @@ class TemplateBinder extends RecursiveAstVisitor {
|
|
|
30858
30827
|
nodeOrNodes.forEach(this.visitNode);
|
|
30859
30828
|
}
|
|
30860
30829
|
}
|
|
30861
|
-
visitElement(element) {
|
|
30862
|
-
// Visit the inputs, outputs, and children of the element.
|
|
30863
|
-
element.inputs.forEach(this.visitNode);
|
|
30864
|
-
element.outputs.forEach(this.visitNode);
|
|
30865
|
-
element.directives.forEach(this.visitNode);
|
|
30866
|
-
element.children.forEach(this.visitNode);
|
|
30867
|
-
element.references.forEach(this.visitNode);
|
|
30868
|
-
}
|
|
30869
30830
|
visitTemplate(template) {
|
|
30870
30831
|
// First, visit inputs, outputs and template attributes of the template node.
|
|
30871
30832
|
template.inputs.forEach(this.visitNode);
|
|
@@ -30888,34 +30849,6 @@ class TemplateBinder extends RecursiveAstVisitor {
|
|
|
30888
30849
|
this.symbols.set(reference, this.rootNode);
|
|
30889
30850
|
}
|
|
30890
30851
|
}
|
|
30891
|
-
visitComponent(component) {
|
|
30892
|
-
component.inputs.forEach(this.visitNode);
|
|
30893
|
-
component.outputs.forEach(this.visitNode);
|
|
30894
|
-
component.directives.forEach(this.visitNode);
|
|
30895
|
-
component.children.forEach(this.visitNode);
|
|
30896
|
-
component.references.forEach(this.visitNode);
|
|
30897
|
-
}
|
|
30898
|
-
visitDirective(directive) {
|
|
30899
|
-
directive.inputs.forEach(this.visitNode);
|
|
30900
|
-
directive.outputs.forEach(this.visitNode);
|
|
30901
|
-
directive.references.forEach(this.visitNode);
|
|
30902
|
-
}
|
|
30903
|
-
// Unused template visitors
|
|
30904
|
-
visitText(text) { }
|
|
30905
|
-
visitTextAttribute(attribute) { }
|
|
30906
|
-
visitUnknownBlock(block) { }
|
|
30907
|
-
visitDeferredTrigger() { }
|
|
30908
|
-
visitIcu(icu) {
|
|
30909
|
-
Object.keys(icu.vars).forEach((key) => icu.vars[key].visit(this));
|
|
30910
|
-
Object.keys(icu.placeholders).forEach((key) => icu.placeholders[key].visit(this));
|
|
30911
|
-
}
|
|
30912
|
-
// The remaining visitors are concerned with processing AST expressions within template bindings
|
|
30913
|
-
visitBoundAttribute(attribute) {
|
|
30914
|
-
attribute.value.visit(this);
|
|
30915
|
-
}
|
|
30916
|
-
visitBoundEvent(event) {
|
|
30917
|
-
event.handler.visit(this);
|
|
30918
|
-
}
|
|
30919
30852
|
visitDeferredBlock(deferred) {
|
|
30920
30853
|
this.ingestScopedNode(deferred);
|
|
30921
30854
|
deferred.triggers.when?.value.visit(this);
|
|
@@ -30935,10 +30868,6 @@ class TemplateBinder extends RecursiveAstVisitor {
|
|
|
30935
30868
|
visitDeferredBlockLoading(block) {
|
|
30936
30869
|
this.ingestScopedNode(block);
|
|
30937
30870
|
}
|
|
30938
|
-
visitSwitchBlock(block) {
|
|
30939
|
-
block.expression.visit(this);
|
|
30940
|
-
block.cases.forEach(this.visitNode);
|
|
30941
|
-
}
|
|
30942
30871
|
visitSwitchBlockCase(block) {
|
|
30943
30872
|
block.expression?.visit(this);
|
|
30944
30873
|
this.ingestScopedNode(block);
|
|
@@ -30951,9 +30880,6 @@ class TemplateBinder extends RecursiveAstVisitor {
|
|
|
30951
30880
|
visitForLoopBlockEmpty(block) {
|
|
30952
30881
|
this.ingestScopedNode(block);
|
|
30953
30882
|
}
|
|
30954
|
-
visitIfBlock(block) {
|
|
30955
|
-
block.branches.forEach((node) => node.visit(this));
|
|
30956
|
-
}
|
|
30957
30883
|
visitIfBlockBranch(block) {
|
|
30958
30884
|
block.expression?.visit(this);
|
|
30959
30885
|
this.ingestScopedNode(block);
|
|
@@ -30961,11 +30887,8 @@ class TemplateBinder extends RecursiveAstVisitor {
|
|
|
30961
30887
|
visitContent(content) {
|
|
30962
30888
|
this.ingestScopedNode(content);
|
|
30963
30889
|
}
|
|
30964
|
-
visitBoundText(text) {
|
|
30965
|
-
text.value.visit(this);
|
|
30966
|
-
}
|
|
30967
30890
|
visitLetDeclaration(decl) {
|
|
30968
|
-
|
|
30891
|
+
super.visitLetDeclaration(decl);
|
|
30969
30892
|
if (this.rootNode !== null) {
|
|
30970
30893
|
this.symbols.set(decl, this.rootNode);
|
|
30971
30894
|
}
|
|
@@ -30987,10 +30910,6 @@ class TemplateBinder extends RecursiveAstVisitor {
|
|
|
30987
30910
|
this.maybeMap(ast, ast.name);
|
|
30988
30911
|
return super.visitSafePropertyRead(ast, context);
|
|
30989
30912
|
}
|
|
30990
|
-
visitPropertyWrite(ast, context) {
|
|
30991
|
-
this.maybeMap(ast, ast.name);
|
|
30992
|
-
return super.visitPropertyWrite(ast, context);
|
|
30993
|
-
}
|
|
30994
30913
|
ingestScopedNode(node) {
|
|
30995
30914
|
const childScope = this.scope.getChildScope(node);
|
|
30996
30915
|
const binder = new TemplateBinder(this.bindings, this.symbols, this.usedPipes, this.eagerPipes, this.deferBlocks, this.nestingLevel, childScope, node, this.level + 1);
|
|
@@ -31232,8 +31151,10 @@ class CompilerFacadeImpl {
|
|
|
31232
31151
|
}
|
|
31233
31152
|
compilePipe(angularCoreEnv, sourceMapUrl, facade) {
|
|
31234
31153
|
const metadata = {
|
|
31154
|
+
name: facade.name,
|
|
31235
31155
|
type: wrapReference(facade.type),
|
|
31236
31156
|
typeArgumentCount: 0,
|
|
31157
|
+
deps: null,
|
|
31237
31158
|
pipeName: facade.pipeName,
|
|
31238
31159
|
pure: facade.pure,
|
|
31239
31160
|
isStandalone: facade.isStandalone,
|
|
@@ -31278,6 +31199,7 @@ class CompilerFacadeImpl {
|
|
|
31278
31199
|
}
|
|
31279
31200
|
compileInjector(angularCoreEnv, sourceMapUrl, facade) {
|
|
31280
31201
|
const meta = {
|
|
31202
|
+
name: facade.name,
|
|
31281
31203
|
type: wrapReference(facade.type),
|
|
31282
31204
|
providers: facade.providers && facade.providers.length > 0
|
|
31283
31205
|
? new WrappedNodeExpr(facade.providers)
|
|
@@ -31975,7 +31897,7 @@ class _Visitor {
|
|
|
31975
31897
|
this._init(_VisitorMode.Merge, interpolationConfig);
|
|
31976
31898
|
this._translations = translations;
|
|
31977
31899
|
// Construct a single fake root element
|
|
31978
|
-
const wrapper = new Element('wrapper', [], [], nodes, undefined, undefined, undefined);
|
|
31900
|
+
const wrapper = new Element('wrapper', [], [], nodes, false, undefined, undefined, undefined);
|
|
31979
31901
|
const translatedNode = wrapper.visit(this, null);
|
|
31980
31902
|
if (this._inI18nBlock) {
|
|
31981
31903
|
this._reportError(nodes[nodes.length - 1], 'Unclosed block');
|
|
@@ -32153,10 +32075,10 @@ class _Visitor {
|
|
|
32153
32075
|
this._inImplicitNode = wasInImplicitNode;
|
|
32154
32076
|
if (this._mode === _VisitorMode.Merge) {
|
|
32155
32077
|
if (node instanceof Element) {
|
|
32156
|
-
return new Element(node.name, this._translateAttributes(node), this._translateDirectives(node), childNodes, node.sourceSpan, node.startSourceSpan, node.endSourceSpan);
|
|
32078
|
+
return new Element(node.name, this._translateAttributes(node), this._translateDirectives(node), childNodes, node.isSelfClosing, node.sourceSpan, node.startSourceSpan, node.endSourceSpan);
|
|
32157
32079
|
}
|
|
32158
32080
|
else {
|
|
32159
|
-
return new Component(node.componentName, node.tagName, node.fullName, this._translateAttributes(node), this._translateDirectives(node), childNodes, node.sourceSpan, node.startSourceSpan, node.endSourceSpan);
|
|
32081
|
+
return new Component(node.componentName, node.tagName, node.fullName, this._translateAttributes(node), this._translateDirectives(node), childNodes, node.isSelfClosing, node.sourceSpan, node.startSourceSpan, node.endSourceSpan);
|
|
32160
32082
|
}
|
|
32161
32083
|
}
|
|
32162
32084
|
return null;
|
|
@@ -33647,7 +33569,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
|
|
|
33647
33569
|
function compileDeclareClassMetadata(metadata) {
|
|
33648
33570
|
const definitionMap = new DefinitionMap();
|
|
33649
33571
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
|
|
33650
|
-
definitionMap.set('version', literal('20.0.
|
|
33572
|
+
definitionMap.set('version', literal('20.1.0-next.0'));
|
|
33651
33573
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
33652
33574
|
definitionMap.set('type', metadata.type);
|
|
33653
33575
|
definitionMap.set('decorators', metadata.decorators);
|
|
@@ -33665,7 +33587,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
|
|
|
33665
33587
|
callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? literal(null));
|
|
33666
33588
|
callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? literal(null));
|
|
33667
33589
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
|
|
33668
|
-
definitionMap.set('version', literal('20.0.
|
|
33590
|
+
definitionMap.set('version', literal('20.1.0-next.0'));
|
|
33669
33591
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
33670
33592
|
definitionMap.set('type', metadata.type);
|
|
33671
33593
|
definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
|
|
@@ -33760,7 +33682,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
33760
33682
|
const definitionMap = new DefinitionMap();
|
|
33761
33683
|
const minVersion = getMinimumVersionForPartialOutput(meta);
|
|
33762
33684
|
definitionMap.set('minVersion', literal(minVersion));
|
|
33763
|
-
definitionMap.set('version', literal('20.0.
|
|
33685
|
+
definitionMap.set('version', literal('20.1.0-next.0'));
|
|
33764
33686
|
// e.g. `type: MyDirective`
|
|
33765
33687
|
definitionMap.set('type', meta.type.value);
|
|
33766
33688
|
if (meta.isStandalone !== undefined) {
|
|
@@ -34176,7 +34098,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
|
|
|
34176
34098
|
function compileDeclareFactoryFunction(meta) {
|
|
34177
34099
|
const definitionMap = new DefinitionMap();
|
|
34178
34100
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
|
|
34179
|
-
definitionMap.set('version', literal('20.0.
|
|
34101
|
+
definitionMap.set('version', literal('20.1.0-next.0'));
|
|
34180
34102
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
34181
34103
|
definitionMap.set('type', meta.type.value);
|
|
34182
34104
|
definitionMap.set('deps', compileDependencies(meta.deps));
|
|
@@ -34211,7 +34133,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
34211
34133
|
function createInjectableDefinitionMap(meta) {
|
|
34212
34134
|
const definitionMap = new DefinitionMap();
|
|
34213
34135
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
|
|
34214
|
-
definitionMap.set('version', literal('20.0.
|
|
34136
|
+
definitionMap.set('version', literal('20.1.0-next.0'));
|
|
34215
34137
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
34216
34138
|
definitionMap.set('type', meta.type.value);
|
|
34217
34139
|
// Only generate providedIn property if it has a non-null value
|
|
@@ -34262,7 +34184,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
34262
34184
|
function createInjectorDefinitionMap(meta) {
|
|
34263
34185
|
const definitionMap = new DefinitionMap();
|
|
34264
34186
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
|
|
34265
|
-
definitionMap.set('version', literal('20.0.
|
|
34187
|
+
definitionMap.set('version', literal('20.1.0-next.0'));
|
|
34266
34188
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
34267
34189
|
definitionMap.set('type', meta.type.value);
|
|
34268
34190
|
definitionMap.set('providers', meta.providers);
|
|
@@ -34295,7 +34217,7 @@ function createNgModuleDefinitionMap(meta) {
|
|
|
34295
34217
|
throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
|
|
34296
34218
|
}
|
|
34297
34219
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
|
|
34298
|
-
definitionMap.set('version', literal('20.0.
|
|
34220
|
+
definitionMap.set('version', literal('20.1.0-next.0'));
|
|
34299
34221
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
34300
34222
|
definitionMap.set('type', meta.type.value);
|
|
34301
34223
|
// We only generate the keys in the metadata if the arrays contain values.
|
|
@@ -34346,7 +34268,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
34346
34268
|
function createPipeDefinitionMap(meta) {
|
|
34347
34269
|
const definitionMap = new DefinitionMap();
|
|
34348
34270
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
34349
|
-
definitionMap.set('version', literal('20.0.
|
|
34271
|
+
definitionMap.set('version', literal('20.1.0-next.0'));
|
|
34350
34272
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
34351
34273
|
// e.g. `type: MyPipe`
|
|
34352
34274
|
definitionMap.set('type', meta.type.value);
|
|
@@ -34354,7 +34276,7 @@ function createPipeDefinitionMap(meta) {
|
|
|
34354
34276
|
definitionMap.set('isStandalone', literal(meta.isStandalone));
|
|
34355
34277
|
}
|
|
34356
34278
|
// e.g. `name: "myPipe"`
|
|
34357
|
-
definitionMap.set('name', literal(meta.pipeName));
|
|
34279
|
+
definitionMap.set('name', literal(meta.pipeName ?? meta.name));
|
|
34358
34280
|
if (meta.pure === false) {
|
|
34359
34281
|
// e.g. `pure: false`
|
|
34360
34282
|
definitionMap.set('pure', literal(meta.pure));
|
|
@@ -34502,7 +34424,7 @@ function compileHmrUpdateCallback(definitions, constantStatements, meta) {
|
|
|
34502
34424
|
* @description
|
|
34503
34425
|
* Entry point for all public APIs of the compiler package.
|
|
34504
34426
|
*/
|
|
34505
|
-
const VERSION = new Version('20.0.
|
|
34427
|
+
const VERSION = new Version('20.1.0-next.0');
|
|
34506
34428
|
|
|
34507
34429
|
//////////////////////////////////////
|
|
34508
34430
|
// THIS FILE HAS GLOBAL SIDE EFFECT //
|
|
@@ -34528,5 +34450,5 @@ const VERSION = new Version('20.0.1');
|
|
|
34528
34450
|
// the late binding of the Compiler to the @angular/core for jit compilation.
|
|
34529
34451
|
publishFacade(_global);
|
|
34530
34452
|
|
|
34531
|
-
export { AST, ASTWithName, ASTWithSource, AbsoluteSourceSpan, ArrayType, ArrowFunctionExpr, Attribute, Binary, BinaryOperator, BinaryOperatorExpr, BindingPipe, BindingType, Block, BlockParameter, BoundElementProperty, BuiltinType, BuiltinTypeName, CUSTOM_ELEMENTS_SCHEMA, Call, Chain, ChangeDetectionStrategy, CommaExpr, Comment, CompilerConfig, CompilerFacadeImpl, Component, Conditional, ConditionalExpr, ConstantPool, CssSelector, DEFAULT_INTERPOLATION_CONFIG, 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, InterpolationConfig, InvokeFunctionExpr, JSDocComment, JitEvaluator, KeyedRead,
|
|
34453
|
+
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, DEFAULT_INTERPOLATION_CONFIG, 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, InterpolationConfig, InvokeFunctionExpr, JSDocComment, JitEvaluator, KeyedRead, LeadingComment, LetDeclaration, Lexer, LiteralArray, LiteralArrayExpr, LiteralExpr, LiteralMap, LiteralMapExpr, 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, ParserError, PrefixNot, PropertyRead, Identifiers as R3Identifiers, R3NgModuleMetadataKind, R3SelectorScopeMode, R3TargetBinder, R3TemplateDependencyKind, ReadKeyExpr, ReadPropExpr, ReadVarExpr, RecursiveAstVisitor, RecursiveVisitor, ResourceLoader, ReturnStatement, SECURITY_SCHEMA, STRING_TYPE, SafeCall, SafeKeyedRead, SafePropertyRead, SelectorContext, SelectorListContext, SelectorMatcher, SelectorlessMatcher, Serializer, SplitInterpolation, 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, 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, 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 };
|
|
34532
34454
|
//# sourceMappingURL=compiler.mjs.map
|