@angular-eslint/bundled-angular-compiler 21.1.1-alpha.10 → 21.1.1-alpha.11
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/dist/index.js +347 -161
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -93,6 +93,8 @@ __export(index_exports, {
|
|
|
93
93
|
LiteralExpr: () => LiteralExpr,
|
|
94
94
|
LiteralMap: () => LiteralMap,
|
|
95
95
|
LiteralMapExpr: () => LiteralMapExpr,
|
|
96
|
+
LiteralMapPropertyAssignment: () => LiteralMapPropertyAssignment,
|
|
97
|
+
LiteralMapSpreadAssignment: () => LiteralMapSpreadAssignment,
|
|
96
98
|
LiteralPrimitive: () => LiteralPrimitive,
|
|
97
99
|
LocalizedString: () => LocalizedString,
|
|
98
100
|
MapType: () => MapType,
|
|
@@ -145,6 +147,8 @@ __export(index_exports, {
|
|
|
145
147
|
SelectorlessMatcher: () => SelectorlessMatcher,
|
|
146
148
|
Serializer: () => Serializer,
|
|
147
149
|
SplitInterpolation: () => SplitInterpolation,
|
|
150
|
+
SpreadElement: () => SpreadElement,
|
|
151
|
+
SpreadElementExpr: () => SpreadElementExpr,
|
|
148
152
|
Statement: () => Statement,
|
|
149
153
|
StmtModifier: () => StmtModifier,
|
|
150
154
|
StringToken: () => StringToken,
|
|
@@ -189,6 +193,7 @@ __export(index_exports, {
|
|
|
189
193
|
TmplAstReference: () => Reference,
|
|
190
194
|
TmplAstSwitchBlock: () => SwitchBlock,
|
|
191
195
|
TmplAstSwitchBlockCase: () => SwitchBlockCase,
|
|
196
|
+
TmplAstSwitchBlockCaseGroup: () => SwitchBlockCaseGroup,
|
|
192
197
|
TmplAstTemplate: () => Template,
|
|
193
198
|
TmplAstText: () => Text$3,
|
|
194
199
|
TmplAstTextAttribute: () => TextAttribute,
|
|
@@ -281,7 +286,7 @@ __export(index_exports, {
|
|
|
281
286
|
});
|
|
282
287
|
module.exports = __toCommonJS(index_exports);
|
|
283
288
|
|
|
284
|
-
// ../../node_modules/.pnpm/@angular+compiler@21.0
|
|
289
|
+
// ../../node_modules/.pnpm/@angular+compiler@21.1.0/node_modules/@angular/compiler/fesm2022/compiler.mjs
|
|
285
290
|
var _SELECTOR_REGEXP = new RegExp(`(\\:not\\()|(([\\.\\#]?)[-\\w]+)|(?:\\[([-.\\w*\\\\$]+)(?:=(["']?)([^\\]"']*)\\5)?\\])|(\\))|(\\s*,\\s*)`, "g");
|
|
286
291
|
var CssSelector = class _CssSelector {
|
|
287
292
|
static {
|
|
@@ -1955,9 +1960,9 @@ var LiteralArrayExpr = class _LiteralArrayExpr extends Expression {
|
|
|
1955
1960
|
return new _LiteralArrayExpr(this.entries.map((e) => e.clone()), this.type, this.sourceSpan);
|
|
1956
1961
|
}
|
|
1957
1962
|
};
|
|
1958
|
-
var
|
|
1963
|
+
var LiteralMapPropertyAssignment = class _LiteralMapPropertyAssignment {
|
|
1959
1964
|
static {
|
|
1960
|
-
__name(this, "
|
|
1965
|
+
__name(this, "LiteralMapPropertyAssignment");
|
|
1961
1966
|
}
|
|
1962
1967
|
key;
|
|
1963
1968
|
value;
|
|
@@ -1971,7 +1976,28 @@ var LiteralMapEntry = class _LiteralMapEntry {
|
|
|
1971
1976
|
return this.key === e.key && this.value.isEquivalent(e.value);
|
|
1972
1977
|
}
|
|
1973
1978
|
clone() {
|
|
1974
|
-
return new
|
|
1979
|
+
return new _LiteralMapPropertyAssignment(this.key, this.value.clone(), this.quoted);
|
|
1980
|
+
}
|
|
1981
|
+
isConstant() {
|
|
1982
|
+
return this.value.isConstant();
|
|
1983
|
+
}
|
|
1984
|
+
};
|
|
1985
|
+
var LiteralMapSpreadAssignment = class _LiteralMapSpreadAssignment {
|
|
1986
|
+
static {
|
|
1987
|
+
__name(this, "LiteralMapSpreadAssignment");
|
|
1988
|
+
}
|
|
1989
|
+
expression;
|
|
1990
|
+
constructor(expression) {
|
|
1991
|
+
this.expression = expression;
|
|
1992
|
+
}
|
|
1993
|
+
isEquivalent(e) {
|
|
1994
|
+
return e instanceof _LiteralMapSpreadAssignment && this.expression.isEquivalent(e.expression);
|
|
1995
|
+
}
|
|
1996
|
+
clone() {
|
|
1997
|
+
return new _LiteralMapSpreadAssignment(this.expression.clone());
|
|
1998
|
+
}
|
|
1999
|
+
isConstant() {
|
|
2000
|
+
return this.expression.isConstant();
|
|
1975
2001
|
}
|
|
1976
2002
|
};
|
|
1977
2003
|
var LiteralMapExpr = class _LiteralMapExpr extends Expression {
|
|
@@ -1991,7 +2017,7 @@ var LiteralMapExpr = class _LiteralMapExpr extends Expression {
|
|
|
1991
2017
|
return e instanceof _LiteralMapExpr && areAllEquivalent(this.entries, e.entries);
|
|
1992
2018
|
}
|
|
1993
2019
|
isConstant() {
|
|
1994
|
-
return this.entries.every((e) => e.
|
|
2020
|
+
return this.entries.every((e) => e.isConstant());
|
|
1995
2021
|
}
|
|
1996
2022
|
visitExpression(visitor, context) {
|
|
1997
2023
|
return visitor.visitLiteralMapExpr(this, context);
|
|
@@ -2023,6 +2049,28 @@ var CommaExpr = class _CommaExpr extends Expression {
|
|
|
2023
2049
|
return new _CommaExpr(this.parts.map((p) => p.clone()));
|
|
2024
2050
|
}
|
|
2025
2051
|
};
|
|
2052
|
+
var SpreadElementExpr = class _SpreadElementExpr extends Expression {
|
|
2053
|
+
static {
|
|
2054
|
+
__name(this, "SpreadElementExpr");
|
|
2055
|
+
}
|
|
2056
|
+
expression;
|
|
2057
|
+
constructor(expression, sourceSpan) {
|
|
2058
|
+
super(null, sourceSpan);
|
|
2059
|
+
this.expression = expression;
|
|
2060
|
+
}
|
|
2061
|
+
isEquivalent(e) {
|
|
2062
|
+
return e instanceof _SpreadElementExpr && this.expression.isEquivalent(e.expression);
|
|
2063
|
+
}
|
|
2064
|
+
isConstant() {
|
|
2065
|
+
return this.expression.isConstant();
|
|
2066
|
+
}
|
|
2067
|
+
visitExpression(visitor, context) {
|
|
2068
|
+
return visitor.visitSpreadElementExpr(this, context);
|
|
2069
|
+
}
|
|
2070
|
+
clone() {
|
|
2071
|
+
return new _SpreadElementExpr(this.expression.clone(), this.sourceSpan);
|
|
2072
|
+
}
|
|
2073
|
+
};
|
|
2026
2074
|
var NULL_EXPR = new LiteralExpr(null, null, null);
|
|
2027
2075
|
var TYPED_NULL_EXPR = new LiteralExpr(null, INFERRED_TYPE, null);
|
|
2028
2076
|
var StmtModifier;
|
|
@@ -2300,7 +2348,13 @@ var RecursiveAstVisitor$1 = class RecursiveAstVisitor {
|
|
|
2300
2348
|
return this.visitExpression(ast, context);
|
|
2301
2349
|
}
|
|
2302
2350
|
visitLiteralMapExpr(ast, context) {
|
|
2303
|
-
ast.entries.forEach((entry) =>
|
|
2351
|
+
ast.entries.forEach((entry) => {
|
|
2352
|
+
if (entry instanceof LiteralMapSpreadAssignment) {
|
|
2353
|
+
entry.expression.visitExpression(this, context);
|
|
2354
|
+
} else {
|
|
2355
|
+
entry.value.visitExpression(this, context);
|
|
2356
|
+
}
|
|
2357
|
+
});
|
|
2304
2358
|
return this.visitExpression(ast, context);
|
|
2305
2359
|
}
|
|
2306
2360
|
visitCommaExpr(ast, context) {
|
|
@@ -2319,6 +2373,10 @@ var RecursiveAstVisitor$1 = class RecursiveAstVisitor {
|
|
|
2319
2373
|
ast.expr.visitExpression(this, context);
|
|
2320
2374
|
return this.visitExpression(ast, context);
|
|
2321
2375
|
}
|
|
2376
|
+
visitSpreadElementExpr(ast, context) {
|
|
2377
|
+
ast.expression.visitExpression(this, context);
|
|
2378
|
+
return this.visitExpression(ast, context);
|
|
2379
|
+
}
|
|
2322
2380
|
visitAllExpressions(exprs, context) {
|
|
2323
2381
|
exprs.forEach((expr) => expr.visitExpression(this, context));
|
|
2324
2382
|
}
|
|
@@ -2393,7 +2451,7 @@ function literalArr(values, type, sourceSpan) {
|
|
|
2393
2451
|
}
|
|
2394
2452
|
__name(literalArr, "literalArr");
|
|
2395
2453
|
function literalMap(values, type = null) {
|
|
2396
|
-
return new LiteralMapExpr(values.map((e) => new
|
|
2454
|
+
return new LiteralMapExpr(values.map((e) => new LiteralMapPropertyAssignment(e.key, e.value, e.quoted)), type, null);
|
|
2397
2455
|
}
|
|
2398
2456
|
__name(literalMap, "literalMap");
|
|
2399
2457
|
function unary(operator, expr, type, sourceSpan) {
|
|
@@ -2497,8 +2555,9 @@ var output_ast = /* @__PURE__ */ Object.freeze({
|
|
|
2497
2555
|
LeadingComment,
|
|
2498
2556
|
LiteralArrayExpr,
|
|
2499
2557
|
LiteralExpr,
|
|
2500
|
-
LiteralMapEntry,
|
|
2501
2558
|
LiteralMapExpr,
|
|
2559
|
+
LiteralMapPropertyAssignment,
|
|
2560
|
+
LiteralMapSpreadAssignment,
|
|
2502
2561
|
LiteralPiece,
|
|
2503
2562
|
LocalizedString,
|
|
2504
2563
|
MapType,
|
|
@@ -2515,6 +2574,7 @@ var output_ast = /* @__PURE__ */ Object.freeze({
|
|
|
2515
2574
|
RegularExpressionLiteralExpr,
|
|
2516
2575
|
ReturnStatement,
|
|
2517
2576
|
STRING_TYPE,
|
|
2577
|
+
SpreadElementExpr,
|
|
2518
2578
|
Statement,
|
|
2519
2579
|
get StmtModifier() {
|
|
2520
2580
|
return StmtModifier;
|
|
@@ -2558,7 +2618,6 @@ var output_ast = /* @__PURE__ */ Object.freeze({
|
|
|
2558
2618
|
variable
|
|
2559
2619
|
});
|
|
2560
2620
|
var CONSTANT_PREFIX = "_c";
|
|
2561
|
-
var UNKNOWN_VALUE_KEY = variable("<unknown>");
|
|
2562
2621
|
var KEY_CONTEXT = {};
|
|
2563
2622
|
var POOL_INCLUSION_LENGTH_THRESHOLD_FOR_STRINGS = 50;
|
|
2564
2623
|
var FixupExpression = class _FixupExpression extends Expression {
|
|
@@ -2645,25 +2704,6 @@ var ConstantPool = class {
|
|
|
2645
2704
|
}
|
|
2646
2705
|
return this.sharedConstants.get(key);
|
|
2647
2706
|
}
|
|
2648
|
-
getLiteralFactory(literal2) {
|
|
2649
|
-
if (literal2 instanceof LiteralArrayExpr) {
|
|
2650
|
-
const argumentsForKey = literal2.entries.map((e) => e.isConstant() ? e : UNKNOWN_VALUE_KEY);
|
|
2651
|
-
const key = GenericKeyFn.INSTANCE.keyOf(literalArr(argumentsForKey));
|
|
2652
|
-
return this._getLiteralFactory(key, literal2.entries, (entries) => literalArr(entries));
|
|
2653
|
-
} else {
|
|
2654
|
-
const expressionForKey = literalMap(literal2.entries.map((e) => ({
|
|
2655
|
-
key: e.key,
|
|
2656
|
-
value: e.value.isConstant() ? e.value : UNKNOWN_VALUE_KEY,
|
|
2657
|
-
quoted: e.quoted
|
|
2658
|
-
})));
|
|
2659
|
-
const key = GenericKeyFn.INSTANCE.keyOf(expressionForKey);
|
|
2660
|
-
return this._getLiteralFactory(key, literal2.entries.map((e) => e.value), (entries) => literalMap(entries.map((value, index) => ({
|
|
2661
|
-
key: literal2.entries[index].key,
|
|
2662
|
-
value,
|
|
2663
|
-
quoted: literal2.entries[index].quoted
|
|
2664
|
-
}))));
|
|
2665
|
-
}
|
|
2666
|
-
}
|
|
2667
2707
|
getSharedFunctionReference(fn2, prefix, useUniqueName = true) {
|
|
2668
2708
|
const isArrow = fn2 instanceof ArrowFunctionExpr;
|
|
2669
2709
|
for (const current of this.statements) {
|
|
@@ -2678,23 +2718,6 @@ var ConstantPool = class {
|
|
|
2678
2718
|
this.statements.push(fn2 instanceof FunctionExpr ? fn2.toDeclStmt(name, StmtModifier.Final) : new DeclareVarStmt(name, fn2, INFERRED_TYPE, StmtModifier.Final, fn2.sourceSpan));
|
|
2679
2719
|
return variable(name);
|
|
2680
2720
|
}
|
|
2681
|
-
_getLiteralFactory(key, values, resultMap) {
|
|
2682
|
-
let literalFactory = this.literalFactories.get(key);
|
|
2683
|
-
const literalFactoryArguments = values.filter((e) => !e.isConstant());
|
|
2684
|
-
if (!literalFactory) {
|
|
2685
|
-
const resultExpressions = values.map((e, index) => e.isConstant() ? this.getConstLiteral(e, true) : variable(`a${index}`));
|
|
2686
|
-
const parameters = resultExpressions.filter(isVariable).map((e) => new FnParam(e.name, DYNAMIC_TYPE));
|
|
2687
|
-
const pureFunctionDeclaration = arrowFn(parameters, resultMap(resultExpressions), INFERRED_TYPE);
|
|
2688
|
-
const name = this.freshName();
|
|
2689
|
-
this.statements.push(new DeclareVarStmt(name, pureFunctionDeclaration, INFERRED_TYPE, StmtModifier.Final));
|
|
2690
|
-
literalFactory = variable(name);
|
|
2691
|
-
this.literalFactories.set(key, literalFactory);
|
|
2692
|
-
}
|
|
2693
|
-
return {
|
|
2694
|
-
literalFactory,
|
|
2695
|
-
literalFactoryArguments
|
|
2696
|
-
};
|
|
2697
|
-
}
|
|
2698
2721
|
uniqueName(name, alwaysIncludeSuffix = true) {
|
|
2699
2722
|
const count = this._claimedNames.get(name) ?? 0;
|
|
2700
2723
|
const result = count === 0 && !alwaysIncludeSuffix ? `${name}` : `${name}${count}`;
|
|
@@ -2726,11 +2749,15 @@ var GenericKeyFn = class _GenericKeyFn {
|
|
|
2726
2749
|
} else if (expr instanceof LiteralMapExpr) {
|
|
2727
2750
|
const entries = [];
|
|
2728
2751
|
for (const entry of expr.entries) {
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2752
|
+
if (entry instanceof LiteralMapSpreadAssignment) {
|
|
2753
|
+
entries.push("..." + this.keyOf(entry.expression));
|
|
2754
|
+
} else {
|
|
2755
|
+
let key = entry.key;
|
|
2756
|
+
if (entry.quoted) {
|
|
2757
|
+
key = `"${key}"`;
|
|
2758
|
+
}
|
|
2759
|
+
entries.push(key + ":" + this.keyOf(entry.value));
|
|
2732
2760
|
}
|
|
2733
|
-
entries.push(key + ":" + this.keyOf(entry.value));
|
|
2734
2761
|
}
|
|
2735
2762
|
return `{${entries.join(",")}}`;
|
|
2736
2763
|
} else if (expr instanceof ExternalExpr) {
|
|
@@ -2739,15 +2766,13 @@ var GenericKeyFn = class _GenericKeyFn {
|
|
|
2739
2766
|
return `read(${expr.name})`;
|
|
2740
2767
|
} else if (expr instanceof TypeofExpr) {
|
|
2741
2768
|
return `typeof(${this.keyOf(expr.expr)})`;
|
|
2769
|
+
} else if (expr instanceof SpreadElementExpr) {
|
|
2770
|
+
return `...${this.keyOf(expr.expression)}`;
|
|
2742
2771
|
} else {
|
|
2743
2772
|
throw new Error(`${this.constructor.name} does not handle expressions of type ${expr.constructor.name}`);
|
|
2744
2773
|
}
|
|
2745
2774
|
}
|
|
2746
2775
|
};
|
|
2747
|
-
function isVariable(e) {
|
|
2748
|
-
return e instanceof ReadVarExpr;
|
|
2749
|
-
}
|
|
2750
|
-
__name(isVariable, "isVariable");
|
|
2751
2776
|
function isLongStringLiteral(expr) {
|
|
2752
2777
|
return expr instanceof LiteralExpr && typeof expr.value === "string" && expr.value.length >= POOL_INCLUSION_LENGTH_THRESHOLD_FOR_STRINGS;
|
|
2753
2778
|
}
|
|
@@ -4194,8 +4219,13 @@ var AbstractEmitterVisitor = class {
|
|
|
4194
4219
|
visitLiteralMapExpr(ast, ctx) {
|
|
4195
4220
|
ctx.print(ast, `{`);
|
|
4196
4221
|
this.visitAllObjects((entry) => {
|
|
4197
|
-
|
|
4198
|
-
|
|
4222
|
+
if (entry instanceof LiteralMapSpreadAssignment) {
|
|
4223
|
+
ctx.print(ast, "...");
|
|
4224
|
+
entry.expression.visitExpression(this, ctx);
|
|
4225
|
+
} else {
|
|
4226
|
+
ctx.print(ast, `${escapeIdentifier(entry.key, this._escapeDollarInStrings, entry.quoted)}:`);
|
|
4227
|
+
entry.value.visitExpression(this, ctx);
|
|
4228
|
+
}
|
|
4199
4229
|
}, ast.entries, ctx, ",");
|
|
4200
4230
|
ctx.print(ast, `}`);
|
|
4201
4231
|
return null;
|
|
@@ -4209,6 +4239,10 @@ var AbstractEmitterVisitor = class {
|
|
|
4209
4239
|
visitParenthesizedExpr(ast, ctx) {
|
|
4210
4240
|
ast.expr.visitExpression(this, ctx);
|
|
4211
4241
|
}
|
|
4242
|
+
visitSpreadElementExpr(ast, ctx) {
|
|
4243
|
+
ctx.print(ast, "...");
|
|
4244
|
+
ast.expression.visitExpression(this, ctx);
|
|
4245
|
+
}
|
|
4212
4246
|
visitAllExpressions(expressions, ctx, separator) {
|
|
4213
4247
|
this.visitAllObjects((expr) => expr.visitExpression(this, ctx), expressions, ctx, separator);
|
|
4214
4248
|
}
|
|
@@ -4551,7 +4585,7 @@ var ImplicitReceiver = class extends AST {
|
|
|
4551
4585
|
return visitor.visitImplicitReceiver(this, context);
|
|
4552
4586
|
}
|
|
4553
4587
|
};
|
|
4554
|
-
var ThisReceiver = class extends
|
|
4588
|
+
var ThisReceiver = class extends AST {
|
|
4555
4589
|
static {
|
|
4556
4590
|
__name(this, "ThisReceiver");
|
|
4557
4591
|
}
|
|
@@ -4699,6 +4733,19 @@ var LiteralArray = class extends AST {
|
|
|
4699
4733
|
return visitor.visitLiteralArray(this, context);
|
|
4700
4734
|
}
|
|
4701
4735
|
};
|
|
4736
|
+
var SpreadElement = class extends AST {
|
|
4737
|
+
static {
|
|
4738
|
+
__name(this, "SpreadElement");
|
|
4739
|
+
}
|
|
4740
|
+
expression;
|
|
4741
|
+
constructor(span, sourceSpan, expression) {
|
|
4742
|
+
super(span, sourceSpan);
|
|
4743
|
+
this.expression = expression;
|
|
4744
|
+
}
|
|
4745
|
+
visit(visitor, context = null) {
|
|
4746
|
+
return visitor.visitSpreadElement(this, context);
|
|
4747
|
+
}
|
|
4748
|
+
};
|
|
4702
4749
|
var LiteralMap = class extends AST {
|
|
4703
4750
|
static {
|
|
4704
4751
|
__name(this, "LiteralMap");
|
|
@@ -5090,6 +5137,9 @@ var RecursiveAstVisitor2 = class {
|
|
|
5090
5137
|
}
|
|
5091
5138
|
visitRegularExpressionLiteral(ast, context) {
|
|
5092
5139
|
}
|
|
5140
|
+
visitSpreadElement(ast, context) {
|
|
5141
|
+
this.visit(ast.expression, context);
|
|
5142
|
+
}
|
|
5093
5143
|
visitAll(asts, context) {
|
|
5094
5144
|
for (const ast of asts) {
|
|
5095
5145
|
this.visit(ast, context);
|
|
@@ -5622,12 +5672,12 @@ var SwitchBlock = class extends BlockNode {
|
|
|
5622
5672
|
__name(this, "SwitchBlock");
|
|
5623
5673
|
}
|
|
5624
5674
|
expression;
|
|
5625
|
-
|
|
5675
|
+
groups;
|
|
5626
5676
|
unknownBlocks;
|
|
5627
|
-
constructor(expression,
|
|
5677
|
+
constructor(expression, groups, unknownBlocks, sourceSpan, startSourceSpan, endSourceSpan, nameSpan) {
|
|
5628
5678
|
super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
|
|
5629
5679
|
this.expression = expression;
|
|
5630
|
-
this.
|
|
5680
|
+
this.groups = groups;
|
|
5631
5681
|
this.unknownBlocks = unknownBlocks;
|
|
5632
5682
|
}
|
|
5633
5683
|
visit(visitor) {
|
|
@@ -5639,16 +5689,29 @@ var SwitchBlockCase = class extends BlockNode {
|
|
|
5639
5689
|
__name(this, "SwitchBlockCase");
|
|
5640
5690
|
}
|
|
5641
5691
|
expression;
|
|
5692
|
+
constructor(expression, sourceSpan, startSourceSpan, endSourceSpan, nameSpan) {
|
|
5693
|
+
super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
|
|
5694
|
+
this.expression = expression;
|
|
5695
|
+
}
|
|
5696
|
+
visit(visitor) {
|
|
5697
|
+
return visitor.visitSwitchBlockCase(this);
|
|
5698
|
+
}
|
|
5699
|
+
};
|
|
5700
|
+
var SwitchBlockCaseGroup = class extends BlockNode {
|
|
5701
|
+
static {
|
|
5702
|
+
__name(this, "SwitchBlockCaseGroup");
|
|
5703
|
+
}
|
|
5704
|
+
cases;
|
|
5642
5705
|
children;
|
|
5643
5706
|
i18n;
|
|
5644
|
-
constructor(
|
|
5707
|
+
constructor(cases, children, sourceSpan, startSourceSpan, endSourceSpan, nameSpan, i18n2) {
|
|
5645
5708
|
super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
|
|
5646
|
-
this.
|
|
5709
|
+
this.cases = cases;
|
|
5647
5710
|
this.children = children;
|
|
5648
5711
|
this.i18n = i18n2;
|
|
5649
5712
|
}
|
|
5650
5713
|
visit(visitor) {
|
|
5651
|
-
return visitor.
|
|
5714
|
+
return visitor.visitSwitchBlockCaseGroup(this);
|
|
5652
5715
|
}
|
|
5653
5716
|
};
|
|
5654
5717
|
var ForLoopBlock = class extends BlockNode {
|
|
@@ -6007,9 +6070,12 @@ var RecursiveVisitor$1 = class RecursiveVisitor {
|
|
|
6007
6070
|
visitAll$1(this, block.children);
|
|
6008
6071
|
}
|
|
6009
6072
|
visitSwitchBlock(block) {
|
|
6010
|
-
visitAll$1(this, block.
|
|
6073
|
+
visitAll$1(this, block.groups);
|
|
6011
6074
|
}
|
|
6012
6075
|
visitSwitchBlockCase(block) {
|
|
6076
|
+
}
|
|
6077
|
+
visitSwitchBlockCaseGroup(block) {
|
|
6078
|
+
visitAll$1(this, block.cases);
|
|
6013
6079
|
visitAll$1(this, block.children);
|
|
6014
6080
|
}
|
|
6015
6081
|
visitForLoopBlock(block) {
|
|
@@ -7419,7 +7485,7 @@ var JitEmitterVisitor = class extends AbstractJsEmitterVisitor {
|
|
|
7419
7485
|
this.refResolver = refResolver;
|
|
7420
7486
|
}
|
|
7421
7487
|
createReturnStmt(ctx) {
|
|
7422
|
-
const stmt = new ReturnStatement(new LiteralMapExpr(this._evalExportedVars.map((resultVar) => new
|
|
7488
|
+
const stmt = new ReturnStatement(new LiteralMapExpr(this._evalExportedVars.map((resultVar) => new LiteralMapPropertyAssignment(resultVar, variable(resultVar), false))));
|
|
7423
7489
|
stmt.visitStatement(this, ctx);
|
|
7424
7490
|
}
|
|
7425
7491
|
getArgs() {
|
|
@@ -8767,6 +8833,7 @@ function createControlOp(op) {
|
|
|
8767
8833
|
return {
|
|
8768
8834
|
kind: OpKind.Control,
|
|
8769
8835
|
target: op.target,
|
|
8836
|
+
name: op.name,
|
|
8770
8837
|
expression: op.expression,
|
|
8771
8838
|
bindingKind: op.bindingKind,
|
|
8772
8839
|
securityContext: op.securityContext,
|
|
@@ -9746,8 +9813,12 @@ function transformExpressionsInExpression(expr, transform2, flags) {
|
|
|
9746
9813
|
expr.entries[i] = transformExpressionsInExpression(expr.entries[i], transform2, flags);
|
|
9747
9814
|
}
|
|
9748
9815
|
} else if (expr instanceof LiteralMapExpr) {
|
|
9749
|
-
for (
|
|
9750
|
-
|
|
9816
|
+
for (const entry of expr.entries) {
|
|
9817
|
+
if (entry instanceof LiteralMapSpreadAssignment) {
|
|
9818
|
+
entry.expression = transformExpressionsInExpression(entry.expression, transform2, flags);
|
|
9819
|
+
} else {
|
|
9820
|
+
entry.value = transformExpressionsInExpression(entry.value, transform2, flags);
|
|
9821
|
+
}
|
|
9751
9822
|
}
|
|
9752
9823
|
} else if (expr instanceof ConditionalExpr) {
|
|
9753
9824
|
expr.condition = transformExpressionsInExpression(expr.condition, transform2, flags);
|
|
@@ -9783,6 +9854,8 @@ function transformExpressionsInExpression(expr, transform2, flags) {
|
|
|
9783
9854
|
}
|
|
9784
9855
|
} else if (expr instanceof ParenthesizedExpr) {
|
|
9785
9856
|
expr.expr = transformExpressionsInExpression(expr.expr, transform2, flags);
|
|
9857
|
+
} else if (expr instanceof SpreadElementExpr) {
|
|
9858
|
+
expr.expression = transformExpressionsInExpression(expr.expression, transform2, flags);
|
|
9786
9859
|
} else if (expr instanceof ReadVarExpr || expr instanceof ExternalExpr || expr instanceof LiteralExpr || expr instanceof RegularExpressionLiteralExpr) ;
|
|
9787
9860
|
else {
|
|
9788
9861
|
throw new Error(`Unhandled expression kind: ${expr.constructor.name}`);
|
|
@@ -10834,7 +10907,7 @@ function extractAttributes(job) {
|
|
|
10834
10907
|
}
|
|
10835
10908
|
break;
|
|
10836
10909
|
case OpKind.Control:
|
|
10837
|
-
OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.Property, null,
|
|
10910
|
+
OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.Property, null, op.name, null, null, null, op.securityContext), lookupElement$3(elements, op.target));
|
|
10838
10911
|
break;
|
|
10839
10912
|
case OpKind.TwoWayProperty:
|
|
10840
10913
|
OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.TwoWayProperty, null, op.name, null, null, null, op.securityContext), lookupElement$3(elements, op.target));
|
|
@@ -10947,7 +11020,7 @@ function specializeBindings(job) {
|
|
|
10947
11020
|
OpList.replace(op, createAttributeOp(op.target, null, op.name, op.expression, op.securityContext, false, op.isStructuralTemplateAttribute, op.templateKind, op.i18nMessage, op.sourceSpan));
|
|
10948
11021
|
} else if (job.kind === CompilationJobKind.Host) {
|
|
10949
11022
|
OpList.replace(op, createDomPropertyOp(op.name, op.expression, op.bindingKind, op.i18nContext, op.securityContext, op.sourceSpan));
|
|
10950
|
-
} else if (op.name === "
|
|
11023
|
+
} else if (op.name === "formField") {
|
|
10951
11024
|
OpList.replace(op, createControlOp(op));
|
|
10952
11025
|
} else {
|
|
10953
11026
|
OpList.replace(op, createPropertyOp(op.target, op.name, op.expression, op.bindingKind, op.securityContext, op.isStructuralTemplateAttribute, op.templateKind, op.i18nContext, op.i18nMessage, op.sourceSpan));
|
|
@@ -14799,6 +14872,11 @@ var _Tokenizer = class {
|
|
|
14799
14872
|
if (this._attemptCharCode($LBRACE)) {
|
|
14800
14873
|
this._beginToken(25);
|
|
14801
14874
|
this._endToken([]);
|
|
14875
|
+
} else if (this._isBlockStart() && (startToken.parts[0] === "case" || startToken.parts[0] === "default")) {
|
|
14876
|
+
this._beginToken(25);
|
|
14877
|
+
this._endToken([]);
|
|
14878
|
+
this._beginToken(26);
|
|
14879
|
+
this._endToken([]);
|
|
14802
14880
|
} else {
|
|
14803
14881
|
startToken.type = 28;
|
|
14804
14882
|
}
|
|
@@ -16816,7 +16894,18 @@ var _Scanner = class {
|
|
|
16816
16894
|
switch (peek) {
|
|
16817
16895
|
case $PERIOD:
|
|
16818
16896
|
this.advance();
|
|
16819
|
-
|
|
16897
|
+
if (isDigit(this.peek)) {
|
|
16898
|
+
return this.scanNumber(start);
|
|
16899
|
+
}
|
|
16900
|
+
if (this.peek !== $PERIOD) {
|
|
16901
|
+
return newCharacterToken(start, this.index, $PERIOD);
|
|
16902
|
+
}
|
|
16903
|
+
this.advance();
|
|
16904
|
+
if (this.peek === $PERIOD) {
|
|
16905
|
+
this.advance();
|
|
16906
|
+
return newOperatorToken(start, this.index, "...");
|
|
16907
|
+
}
|
|
16908
|
+
return this.error(`Unexpected character [${String.fromCharCode(peek)}]`, 0);
|
|
16820
16909
|
case $LPAREN:
|
|
16821
16910
|
case $RPAREN:
|
|
16822
16911
|
case $LBRACKET:
|
|
@@ -17791,14 +17880,14 @@ var _ParseAST = class {
|
|
|
17791
17880
|
return new PrefixNot(this.span(start), this.sourceSpan(start), result);
|
|
17792
17881
|
}
|
|
17793
17882
|
} else if (this.next.isKeywordTypeof()) {
|
|
17794
|
-
this.advance();
|
|
17795
17883
|
const start = this.inputIndex;
|
|
17796
|
-
|
|
17884
|
+
this.advance();
|
|
17885
|
+
const result = this.parsePrefix();
|
|
17797
17886
|
return new TypeofExpression(this.span(start), this.sourceSpan(start), result);
|
|
17798
17887
|
} else if (this.next.isKeywordVoid()) {
|
|
17799
|
-
this.advance();
|
|
17800
17888
|
const start = this.inputIndex;
|
|
17801
|
-
|
|
17889
|
+
this.advance();
|
|
17890
|
+
const result = this.parsePrefix();
|
|
17802
17891
|
return new VoidExpression(this.span(start), this.sourceSpan(start), result);
|
|
17803
17892
|
}
|
|
17804
17893
|
return this.parseCallChain();
|
|
@@ -17860,11 +17949,7 @@ var _ParseAST = class {
|
|
|
17860
17949
|
this.advance();
|
|
17861
17950
|
return new ThisReceiver(this.span(start), this.sourceSpan(start));
|
|
17862
17951
|
} else if (this.consumeOptionalCharacter($LBRACKET)) {
|
|
17863
|
-
this.
|
|
17864
|
-
const elements = this.parseExpressionList($RBRACKET);
|
|
17865
|
-
this.rbracketsExpected--;
|
|
17866
|
-
this.expectCharacter($RBRACKET);
|
|
17867
|
-
return new LiteralArray(this.span(start), this.sourceSpan(start), elements);
|
|
17952
|
+
return this.parseLiteralArray(start);
|
|
17868
17953
|
} else if (this.next.isCharacter($LBRACE)) {
|
|
17869
17954
|
return this.parseLiteralMap();
|
|
17870
17955
|
} else if (this.next.isIdentifier()) {
|
|
@@ -17894,16 +17979,21 @@ var _ParseAST = class {
|
|
|
17894
17979
|
return new EmptyExpr$1(this.span(start), this.sourceSpan(start));
|
|
17895
17980
|
}
|
|
17896
17981
|
}
|
|
17897
|
-
|
|
17898
|
-
|
|
17982
|
+
parseLiteralArray(arrayStart) {
|
|
17983
|
+
this.rbracketsExpected++;
|
|
17984
|
+
const elements = [];
|
|
17899
17985
|
do {
|
|
17900
|
-
if (
|
|
17901
|
-
|
|
17986
|
+
if (this.next.isOperator("...")) {
|
|
17987
|
+
elements.push(this.parseSpreadElement());
|
|
17988
|
+
} else if (!this.next.isCharacter($RBRACKET)) {
|
|
17989
|
+
elements.push(this.parsePipe());
|
|
17902
17990
|
} else {
|
|
17903
17991
|
break;
|
|
17904
17992
|
}
|
|
17905
17993
|
} while (this.consumeOptionalCharacter($COMMA));
|
|
17906
|
-
|
|
17994
|
+
this.rbracketsExpected--;
|
|
17995
|
+
this.expectCharacter($RBRACKET);
|
|
17996
|
+
return new LiteralArray(this.span(arrayStart), this.sourceSpan(arrayStart), elements);
|
|
17907
17997
|
}
|
|
17908
17998
|
parseLiteralMap() {
|
|
17909
17999
|
const keys = [];
|
|
@@ -17914,11 +18004,26 @@ var _ParseAST = class {
|
|
|
17914
18004
|
this.rbracesExpected++;
|
|
17915
18005
|
do {
|
|
17916
18006
|
const keyStart = this.inputIndex;
|
|
18007
|
+
if (this.next.isOperator("...")) {
|
|
18008
|
+
this.advance();
|
|
18009
|
+
keys.push({
|
|
18010
|
+
kind: "spread",
|
|
18011
|
+
span: this.span(keyStart),
|
|
18012
|
+
sourceSpan: this.sourceSpan(keyStart)
|
|
18013
|
+
});
|
|
18014
|
+
values.push(this.parsePipe());
|
|
18015
|
+
continue;
|
|
18016
|
+
}
|
|
17917
18017
|
const quoted = this.next.isString();
|
|
17918
18018
|
const key = this.expectIdentifierOrKeywordOrString();
|
|
18019
|
+
const keySpan = this.span(keyStart);
|
|
18020
|
+
const keySourceSpan = this.sourceSpan(keyStart);
|
|
17919
18021
|
const literalMapKey = {
|
|
18022
|
+
kind: "property",
|
|
17920
18023
|
key,
|
|
17921
|
-
quoted
|
|
18024
|
+
quoted,
|
|
18025
|
+
span: keySpan,
|
|
18026
|
+
sourceSpan: keySourceSpan
|
|
17922
18027
|
};
|
|
17923
18028
|
keys.push(literalMapKey);
|
|
17924
18029
|
if (quoted) {
|
|
@@ -17928,9 +18033,7 @@ var _ParseAST = class {
|
|
|
17928
18033
|
values.push(this.parsePipe());
|
|
17929
18034
|
} else {
|
|
17930
18035
|
literalMapKey.isShorthandInitialized = true;
|
|
17931
|
-
|
|
17932
|
-
const sourceSpan = this.sourceSpan(keyStart);
|
|
17933
|
-
values.push(new PropertyRead(span, sourceSpan, sourceSpan, new ImplicitReceiver(span, sourceSpan), key));
|
|
18036
|
+
values.push(new PropertyRead(keySpan, keySourceSpan, keySourceSpan, new ImplicitReceiver(keySpan, keySourceSpan), key));
|
|
17934
18037
|
}
|
|
17935
18038
|
} while (this.consumeOptionalCharacter($COMMA) && !this.next.isCharacter($RBRACE));
|
|
17936
18039
|
this.rbracesExpected--;
|
|
@@ -17985,13 +18088,26 @@ var _ParseAST = class {
|
|
|
17985
18088
|
return isSafe ? new SafeCall(span, sourceSpan, receiver, args, argumentSpan) : new Call(span, sourceSpan, receiver, args, argumentSpan);
|
|
17986
18089
|
}
|
|
17987
18090
|
parseCallArguments() {
|
|
17988
|
-
if (this.next.isCharacter($RPAREN))
|
|
18091
|
+
if (this.next.isCharacter($RPAREN)) {
|
|
18092
|
+
return [];
|
|
18093
|
+
}
|
|
17989
18094
|
const positionals = [];
|
|
17990
18095
|
do {
|
|
17991
|
-
positionals.push(this.parsePipe());
|
|
18096
|
+
positionals.push(this.next.isOperator("...") ? this.parseSpreadElement() : this.parsePipe());
|
|
17992
18097
|
} while (this.consumeOptionalCharacter($COMMA));
|
|
17993
18098
|
return positionals;
|
|
17994
18099
|
}
|
|
18100
|
+
parseSpreadElement() {
|
|
18101
|
+
if (!this.next.isOperator("...")) {
|
|
18102
|
+
this.error("Spread element must start with '...' operator");
|
|
18103
|
+
}
|
|
18104
|
+
const spreadStart = this.inputIndex;
|
|
18105
|
+
this.advance();
|
|
18106
|
+
const expression = this.parsePipe();
|
|
18107
|
+
const span = this.span(spreadStart);
|
|
18108
|
+
const sourceSpan = this.sourceSpan(spreadStart);
|
|
18109
|
+
return new SpreadElement(span, sourceSpan, expression);
|
|
18110
|
+
}
|
|
17995
18111
|
expectTemplateBindingKey() {
|
|
17996
18112
|
let result = "";
|
|
17997
18113
|
let operatorFound = false;
|
|
@@ -18284,7 +18400,12 @@ var SerializeExpressionVisitor = class {
|
|
|
18284
18400
|
return `[${ast.expressions.map((e) => e.visit(this, context)).join(", ")}]`;
|
|
18285
18401
|
}
|
|
18286
18402
|
visitLiteralMap(ast, context) {
|
|
18287
|
-
return `{${zip(ast.keys.map((literal2) =>
|
|
18403
|
+
return `{${zip(ast.keys.map((literal2) => {
|
|
18404
|
+
if (literal2.kind === "spread") {
|
|
18405
|
+
return "...";
|
|
18406
|
+
}
|
|
18407
|
+
return literal2.quoted ? `'${literal2.key}'` : literal2.key;
|
|
18408
|
+
}), ast.values.map((value) => value.visit(this, context))).map(([key, value]) => `${key}: ${value}`).join(", ")}}`;
|
|
18288
18409
|
}
|
|
18289
18410
|
visitLiteralPrimitive(ast) {
|
|
18290
18411
|
if (ast.value === null) return "null";
|
|
@@ -18310,7 +18431,7 @@ var SerializeExpressionVisitor = class {
|
|
|
18310
18431
|
return `${ast.expression.visit(this, context)}!`;
|
|
18311
18432
|
}
|
|
18312
18433
|
visitPropertyRead(ast, context) {
|
|
18313
|
-
if (ast.receiver instanceof ImplicitReceiver) {
|
|
18434
|
+
if (ast.receiver instanceof ImplicitReceiver || ast.receiver instanceof ThisReceiver) {
|
|
18314
18435
|
return ast.name;
|
|
18315
18436
|
} else {
|
|
18316
18437
|
return `${ast.receiver.visit(this, context)}.${ast.name}`;
|
|
@@ -18357,6 +18478,9 @@ var SerializeExpressionVisitor = class {
|
|
|
18357
18478
|
visitTaggedTemplateLiteral(ast, context) {
|
|
18358
18479
|
return ast.tag.visit(this, context) + ast.template.visit(this, context);
|
|
18359
18480
|
}
|
|
18481
|
+
visitSpreadElement(ast, context) {
|
|
18482
|
+
return `...${ast.expression.visit(this, context)}`;
|
|
18483
|
+
}
|
|
18360
18484
|
visitParenthesizedExpression(ast, context) {
|
|
18361
18485
|
return "(" + ast.expression.visit(this, context) + ")";
|
|
18362
18486
|
}
|
|
@@ -18382,7 +18506,7 @@ function SECURITY_SCHEMA() {
|
|
|
18382
18506
|
registerContext(SecurityContext.HTML, ["iframe|srcdoc", "*|innerHTML", "*|outerHTML"]);
|
|
18383
18507
|
registerContext(SecurityContext.STYLE, ["*|style"]);
|
|
18384
18508
|
registerContext(SecurityContext.URL, ["*|formAction", "area|href", "a|href", "a|xlink:href", "form|action", "annotation|href", "annotation|xlink:href", "annotation-xml|href", "annotation-xml|xlink:href", "maction|href", "maction|xlink:href", "malignmark|href", "malignmark|xlink:href", "math|href", "math|xlink:href", "mroot|href", "mroot|xlink:href", "msqrt|href", "msqrt|xlink:href", "merror|href", "merror|xlink:href", "mfrac|href", "mfrac|xlink:href", "mglyph|href", "mglyph|xlink:href", "msub|href", "msub|xlink:href", "msup|href", "msup|xlink:href", "msubsup|href", "msubsup|xlink:href", "mmultiscripts|href", "mmultiscripts|xlink:href", "mprescripts|href", "mprescripts|xlink:href", "mi|href", "mi|xlink:href", "mn|href", "mn|xlink:href", "mo|href", "mo|xlink:href", "mpadded|href", "mpadded|xlink:href", "mphantom|href", "mphantom|xlink:href", "mrow|href", "mrow|xlink:href", "ms|href", "ms|xlink:href", "mspace|href", "mspace|xlink:href", "mstyle|href", "mstyle|xlink:href", "mtable|href", "mtable|xlink:href", "mtd|href", "mtd|xlink:href", "mtr|href", "mtr|xlink:href", "mtext|href", "mtext|xlink:href", "mover|href", "mover|xlink:href", "munder|href", "munder|xlink:href", "munderover|href", "munderover|xlink:href", "semantics|href", "semantics|xlink:href", "none|href", "none|xlink:href", "img|src", "video|src"]);
|
|
18385
|
-
registerContext(SecurityContext.RESOURCE_URL, ["base|href", "embed|src", "frame|src", "iframe|src", "link|href", "object|codebase", "object|data", "script|src"]);
|
|
18509
|
+
registerContext(SecurityContext.RESOURCE_URL, ["base|href", "embed|src", "frame|src", "iframe|src", "link|href", "object|codebase", "object|data", "script|src", "script|href", "script|xlink:href"]);
|
|
18386
18510
|
registerContext(SecurityContext.ATTRIBUTE_NO_BINDING, ["animate|attributeName", "set|attributeName", "animateMotion|attributeName", "animateTransform|attributeName", "unknown|attributeName", "iframe|sandbox", "iframe|allow", "iframe|allowFullscreen", "iframe|referrerPolicy", "iframe|csp", "iframe|fetchPriority", "unknown|sandbox", "unknown|allow", "unknown|allowFullscreen", "unknown|referrerPolicy", "unknown|csp", "unknown|fetchPriority"]);
|
|
18387
18511
|
}
|
|
18388
18512
|
return _SECURITY_SCHEMA;
|
|
@@ -20270,6 +20394,8 @@ var UPDATE_ORDERING = [{
|
|
|
20270
20394
|
test: nonInterpolationPropertyKindTest
|
|
20271
20395
|
}, {
|
|
20272
20396
|
test: kindWithInterpolationTest(OpKind.Attribute, false)
|
|
20397
|
+
}, {
|
|
20398
|
+
test: kindTest(OpKind.Control)
|
|
20273
20399
|
}];
|
|
20274
20400
|
var UPDATE_HOST_ORDERING = [{
|
|
20275
20401
|
test: kindWithInterpolationTest(OpKind.DomProperty, true)
|
|
@@ -20288,7 +20414,7 @@ var UPDATE_HOST_ORDERING = [{
|
|
|
20288
20414
|
}, {
|
|
20289
20415
|
test: kindTest(OpKind.ClassProp)
|
|
20290
20416
|
}];
|
|
20291
|
-
var handledOpKinds = /* @__PURE__ */ new Set([OpKind.Listener, OpKind.TwoWayListener, OpKind.AnimationListener, OpKind.StyleMap, OpKind.ClassMap, OpKind.StyleProp, OpKind.ClassProp, OpKind.Property, OpKind.TwoWayProperty, OpKind.DomProperty, OpKind.Attribute, OpKind.Animation]);
|
|
20417
|
+
var handledOpKinds = /* @__PURE__ */ new Set([OpKind.Listener, OpKind.TwoWayListener, OpKind.AnimationListener, OpKind.StyleMap, OpKind.ClassMap, OpKind.StyleProp, OpKind.ClassProp, OpKind.Property, OpKind.TwoWayProperty, OpKind.DomProperty, OpKind.Attribute, OpKind.Animation, OpKind.Control]);
|
|
20292
20418
|
function orderOps(job) {
|
|
20293
20419
|
for (const unit of job.units) {
|
|
20294
20420
|
orderWithin(unit.create, CREATE_ORDERING);
|
|
@@ -20551,6 +20677,16 @@ function transformLiteralArray(expr) {
|
|
|
20551
20677
|
const derivedEntries = [];
|
|
20552
20678
|
const nonConstantArgs = [];
|
|
20553
20679
|
for (const entry of expr.entries) {
|
|
20680
|
+
if (entry instanceof SpreadElementExpr) {
|
|
20681
|
+
if (entry.expression.isConstant()) {
|
|
20682
|
+
derivedEntries.push(entry);
|
|
20683
|
+
} else {
|
|
20684
|
+
const idx = nonConstantArgs.length;
|
|
20685
|
+
nonConstantArgs.push(entry.expression);
|
|
20686
|
+
derivedEntries.push(new SpreadElementExpr(new PureFunctionParameterExpr(idx)));
|
|
20687
|
+
}
|
|
20688
|
+
continue;
|
|
20689
|
+
}
|
|
20554
20690
|
if (entry.isConstant()) {
|
|
20555
20691
|
derivedEntries.push(entry);
|
|
20556
20692
|
} else {
|
|
@@ -20566,15 +20702,25 @@ function transformLiteralMap(expr) {
|
|
|
20566
20702
|
let derivedEntries = [];
|
|
20567
20703
|
const nonConstantArgs = [];
|
|
20568
20704
|
for (const entry of expr.entries) {
|
|
20705
|
+
if (entry instanceof LiteralMapSpreadAssignment) {
|
|
20706
|
+
if (entry.expression.isConstant()) {
|
|
20707
|
+
derivedEntries.push(entry);
|
|
20708
|
+
} else {
|
|
20709
|
+
const idx = nonConstantArgs.length;
|
|
20710
|
+
nonConstantArgs.push(entry.expression);
|
|
20711
|
+
derivedEntries.push(new LiteralMapSpreadAssignment(new PureFunctionParameterExpr(idx)));
|
|
20712
|
+
}
|
|
20713
|
+
continue;
|
|
20714
|
+
}
|
|
20569
20715
|
if (entry.value.isConstant()) {
|
|
20570
20716
|
derivedEntries.push(entry);
|
|
20571
20717
|
} else {
|
|
20572
20718
|
const idx = nonConstantArgs.length;
|
|
20573
20719
|
nonConstantArgs.push(entry.value);
|
|
20574
|
-
derivedEntries.push(new
|
|
20720
|
+
derivedEntries.push(new LiteralMapPropertyAssignment(entry.key, new PureFunctionParameterExpr(idx), entry.quoted));
|
|
20575
20721
|
}
|
|
20576
20722
|
}
|
|
20577
|
-
return new PureFunctionExpr(
|
|
20723
|
+
return new PureFunctionExpr(new LiteralMapExpr(derivedEntries), nonConstantArgs);
|
|
20578
20724
|
}
|
|
20579
20725
|
__name(transformLiteralMap, "transformLiteralMap");
|
|
20580
20726
|
function optimizeRegularExpressions(job) {
|
|
@@ -20902,13 +21048,14 @@ function property(name, expression, sanitizer, sourceSpan) {
|
|
|
20902
21048
|
return propertyBase(Identifiers.property, name, expression, sanitizer, sourceSpan);
|
|
20903
21049
|
}
|
|
20904
21050
|
__name(property, "property");
|
|
20905
|
-
function control(expression, sanitizer, sourceSpan) {
|
|
21051
|
+
function control(name, expression, sanitizer, sourceSpan) {
|
|
20906
21052
|
const args = [];
|
|
20907
21053
|
if (expression instanceof Interpolation2) {
|
|
20908
21054
|
args.push(interpolationToExpression(expression, sourceSpan));
|
|
20909
21055
|
} else {
|
|
20910
21056
|
args.push(expression);
|
|
20911
21057
|
}
|
|
21058
|
+
args.push(literal(name));
|
|
20912
21059
|
if (sanitizer !== null) {
|
|
20913
21060
|
args.push(sanitizer);
|
|
20914
21061
|
}
|
|
@@ -21021,7 +21168,7 @@ function pipeBindV(slot, varOffset, args) {
|
|
|
21021
21168
|
__name(pipeBindV, "pipeBindV");
|
|
21022
21169
|
function textInterpolate(strings, expressions, sourceSpan) {
|
|
21023
21170
|
const interpolationArgs = collateInterpolationArgs(strings, expressions);
|
|
21024
|
-
return callVariadicInstruction(TEXT_INTERPOLATE_CONFIG, [], interpolationArgs,
|
|
21171
|
+
return callVariadicInstruction(TEXT_INTERPOLATE_CONFIG, [], interpolationArgs, sourceSpan);
|
|
21025
21172
|
}
|
|
21026
21173
|
__name(textInterpolate, "textInterpolate");
|
|
21027
21174
|
function i18nExp(expr, sourceSpan) {
|
|
@@ -21066,7 +21213,7 @@ function syntheticHostProperty(name, expression, sourceSpan) {
|
|
|
21066
21213
|
}
|
|
21067
21214
|
__name(syntheticHostProperty, "syntheticHostProperty");
|
|
21068
21215
|
function pureFunction(varOffset, fn2, args) {
|
|
21069
|
-
return callVariadicInstructionExpr(PURE_FUNCTION_CONFIG, [literal(varOffset), fn2], args,
|
|
21216
|
+
return callVariadicInstructionExpr(PURE_FUNCTION_CONFIG, [literal(varOffset), fn2], args, null);
|
|
21070
21217
|
}
|
|
21071
21218
|
__name(pureFunction, "pureFunction");
|
|
21072
21219
|
function attachSourceLocation(templatePath, locations) {
|
|
@@ -21092,7 +21239,7 @@ function collateInterpolationArgs(strings, expressions) {
|
|
|
21092
21239
|
__name(collateInterpolationArgs, "collateInterpolationArgs");
|
|
21093
21240
|
function interpolationToExpression(interpolation, sourceSpan) {
|
|
21094
21241
|
const interpolationArgs = collateInterpolationArgs(interpolation.strings, interpolation.expressions);
|
|
21095
|
-
return callVariadicInstructionExpr(VALUE_INTERPOLATE_CONFIG, [], interpolationArgs,
|
|
21242
|
+
return callVariadicInstructionExpr(VALUE_INTERPOLATE_CONFIG, [], interpolationArgs, sourceSpan);
|
|
21096
21243
|
}
|
|
21097
21244
|
__name(interpolationToExpression, "interpolationToExpression");
|
|
21098
21245
|
function call(instruction, args, sourceSpan) {
|
|
@@ -21133,23 +21280,23 @@ var PURE_FUNCTION_CONFIG = {
|
|
|
21133
21280
|
variable: Identifiers.pureFunctionV,
|
|
21134
21281
|
mapping: /* @__PURE__ */ __name((n) => n, "mapping")
|
|
21135
21282
|
};
|
|
21136
|
-
function callVariadicInstructionExpr(config, baseArgs, interpolationArgs,
|
|
21283
|
+
function callVariadicInstructionExpr(config, baseArgs, interpolationArgs, sourceSpan) {
|
|
21137
21284
|
const n = config.mapping(interpolationArgs.length);
|
|
21138
21285
|
const lastInterpolationArg = interpolationArgs.at(-1);
|
|
21139
|
-
if (
|
|
21286
|
+
if (interpolationArgs.length > 1 && lastInterpolationArg instanceof LiteralExpr && lastInterpolationArg.value === "") {
|
|
21140
21287
|
interpolationArgs.pop();
|
|
21141
21288
|
}
|
|
21142
21289
|
if (n < config.constant.length) {
|
|
21143
|
-
return importExpr(config.constant[n]).callFn([...baseArgs, ...interpolationArgs
|
|
21290
|
+
return importExpr(config.constant[n]).callFn([...baseArgs, ...interpolationArgs], sourceSpan);
|
|
21144
21291
|
} else if (config.variable !== null) {
|
|
21145
|
-
return importExpr(config.variable).callFn([...baseArgs, literalArr(interpolationArgs)
|
|
21292
|
+
return importExpr(config.variable).callFn([...baseArgs, literalArr(interpolationArgs)], sourceSpan);
|
|
21146
21293
|
} else {
|
|
21147
21294
|
throw new Error(`AssertionError: unable to call variadic function`);
|
|
21148
21295
|
}
|
|
21149
21296
|
}
|
|
21150
21297
|
__name(callVariadicInstructionExpr, "callVariadicInstructionExpr");
|
|
21151
|
-
function callVariadicInstruction(config, baseArgs, interpolationArgs,
|
|
21152
|
-
return createStatementOp(callVariadicInstructionExpr(config, baseArgs, interpolationArgs,
|
|
21298
|
+
function callVariadicInstruction(config, baseArgs, interpolationArgs, sourceSpan) {
|
|
21299
|
+
return createStatementOp(callVariadicInstructionExpr(config, baseArgs, interpolationArgs, sourceSpan).toStmt());
|
|
21153
21300
|
}
|
|
21154
21301
|
__name(callVariadicInstruction, "callVariadicInstruction");
|
|
21155
21302
|
var GLOBAL_TARGET_RESOLVERS = /* @__PURE__ */ new Map([["window", Identifiers.resolveWindow], ["document", Identifiers.resolveDocument], ["body", Identifiers.resolveBody]]);
|
|
@@ -21497,7 +21644,7 @@ function reifyProperty(op) {
|
|
|
21497
21644
|
}
|
|
21498
21645
|
__name(reifyProperty, "reifyProperty");
|
|
21499
21646
|
function reifyControl(op) {
|
|
21500
|
-
return control(op.expression, op.sanitizer, op.sourceSpan);
|
|
21647
|
+
return control(op.name, op.expression, op.sanitizer, op.sourceSpan);
|
|
21501
21648
|
}
|
|
21502
21649
|
__name(reifyControl, "reifyControl");
|
|
21503
21650
|
function reifyIrExpression(expr) {
|
|
@@ -23336,7 +23483,7 @@ function ingestElement(unit, element2) {
|
|
|
23336
23483
|
ingestNodes(unit, element2.children);
|
|
23337
23484
|
const endOp = createElementEndOp(id, element2.endSourceSpan ?? element2.startSourceSpan);
|
|
23338
23485
|
unit.create.push(endOp);
|
|
23339
|
-
const fieldInput = element2.inputs.find((input) => input.name === "
|
|
23486
|
+
const fieldInput = element2.inputs.find((input) => input.name === "formField" && input.type === BindingType.Property);
|
|
23340
23487
|
if (fieldInput) {
|
|
23341
23488
|
unit.create.push(createControlCreateOp(fieldInput.sourceSpan));
|
|
23342
23489
|
}
|
|
@@ -23452,32 +23599,34 @@ function ingestIfBlock(unit, ifBlock) {
|
|
|
23452
23599
|
}
|
|
23453
23600
|
__name(ingestIfBlock, "ingestIfBlock");
|
|
23454
23601
|
function ingestSwitchBlock(unit, switchBlock) {
|
|
23455
|
-
if (switchBlock.
|
|
23602
|
+
if (switchBlock.groups.length === 0) {
|
|
23456
23603
|
return;
|
|
23457
23604
|
}
|
|
23458
23605
|
let firstXref = null;
|
|
23459
23606
|
let conditions = [];
|
|
23460
|
-
for (let i = 0; i < switchBlock.
|
|
23461
|
-
const
|
|
23607
|
+
for (let i = 0; i < switchBlock.groups.length; i++) {
|
|
23608
|
+
const switchCaseGroup = switchBlock.groups[i];
|
|
23462
23609
|
const cView = unit.job.allocateView(unit.xref);
|
|
23463
|
-
const tagName = ingestControlFlowInsertionPoint(unit, cView.xref,
|
|
23610
|
+
const tagName = ingestControlFlowInsertionPoint(unit, cView.xref, switchCaseGroup);
|
|
23464
23611
|
let switchCaseI18nMeta = void 0;
|
|
23465
|
-
if (
|
|
23466
|
-
if (!(
|
|
23467
|
-
throw Error(`Unhandled i18n metadata type for switch block: ${
|
|
23612
|
+
if (switchCaseGroup.i18n !== void 0) {
|
|
23613
|
+
if (!(switchCaseGroup.i18n instanceof BlockPlaceholder)) {
|
|
23614
|
+
throw Error(`Unhandled i18n metadata type for switch block: ${switchCaseGroup.i18n?.constructor.name}`);
|
|
23468
23615
|
}
|
|
23469
|
-
switchCaseI18nMeta =
|
|
23616
|
+
switchCaseI18nMeta = switchCaseGroup.i18n;
|
|
23470
23617
|
}
|
|
23471
23618
|
const createOp = i === 0 ? createConditionalCreateOp : createConditionalBranchCreateOp;
|
|
23472
|
-
const conditionalCreateOp = createOp(cView.xref, TemplateKind.Block, tagName, "Case", Namespace.HTML, switchCaseI18nMeta,
|
|
23619
|
+
const conditionalCreateOp = createOp(cView.xref, TemplateKind.Block, tagName, "Case", Namespace.HTML, switchCaseI18nMeta, switchCaseGroup.startSourceSpan, switchCaseGroup.sourceSpan);
|
|
23473
23620
|
unit.create.push(conditionalCreateOp);
|
|
23474
23621
|
if (firstXref === null) {
|
|
23475
23622
|
firstXref = cView.xref;
|
|
23476
23623
|
}
|
|
23477
|
-
const
|
|
23478
|
-
|
|
23479
|
-
|
|
23480
|
-
|
|
23624
|
+
for (const switchCase of switchCaseGroup.cases) {
|
|
23625
|
+
const caseExpr = switchCase.expression ? convertAst(switchCase.expression, unit.job, switchBlock.startSourceSpan) : null;
|
|
23626
|
+
const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr, conditionalCreateOp.xref, conditionalCreateOp.handle);
|
|
23627
|
+
conditions.push(conditionalCaseExpr);
|
|
23628
|
+
}
|
|
23629
|
+
ingestNodes(cView, switchCaseGroup.children);
|
|
23481
23630
|
}
|
|
23482
23631
|
unit.update.push(createConditionalOp(firstXref, convertAst(switchBlock.expression, unit.job, null), conditions, switchBlock.sourceSpan));
|
|
23483
23632
|
}
|
|
@@ -23712,8 +23861,7 @@ function convertAst(ast, job, baseSourceSpan) {
|
|
|
23712
23861
|
if (ast instanceof ASTWithSource) {
|
|
23713
23862
|
return convertAst(ast.ast, job, baseSourceSpan);
|
|
23714
23863
|
} else if (ast instanceof PropertyRead) {
|
|
23715
|
-
|
|
23716
|
-
if (isImplicitReceiver) {
|
|
23864
|
+
if (ast.receiver instanceof ImplicitReceiver) {
|
|
23717
23865
|
return new LexicalReadExpr(ast.name);
|
|
23718
23866
|
} else {
|
|
23719
23867
|
return new ReadPropExpr(convertAst(ast.receiver, job, baseSourceSpan), ast.name, null, convertSourceSpan(ast.span, baseSourceSpan));
|
|
@@ -23749,8 +23897,8 @@ function convertAst(ast, job, baseSourceSpan) {
|
|
|
23749
23897
|
throw new Error(`AssertionError: Chain in unknown context`);
|
|
23750
23898
|
} else if (ast instanceof LiteralMap) {
|
|
23751
23899
|
const entries = ast.keys.map((key, idx) => {
|
|
23752
|
-
const value = ast.values[idx];
|
|
23753
|
-
return new
|
|
23900
|
+
const value = convertAst(ast.values[idx], job, baseSourceSpan);
|
|
23901
|
+
return key.kind === "spread" ? new LiteralMapSpreadAssignment(value) : new LiteralMapPropertyAssignment(key.key, value, key.quoted);
|
|
23754
23902
|
});
|
|
23755
23903
|
return new LiteralMapExpr(entries, void 0, convertSourceSpan(ast.span, baseSourceSpan));
|
|
23756
23904
|
} else if (ast instanceof LiteralArray) {
|
|
@@ -23783,6 +23931,8 @@ function convertAst(ast, job, baseSourceSpan) {
|
|
|
23783
23931
|
return new ParenthesizedExpr(convertAst(ast.expression, job, baseSourceSpan), void 0, convertSourceSpan(ast.span, baseSourceSpan));
|
|
23784
23932
|
} else if (ast instanceof RegularExpressionLiteral) {
|
|
23785
23933
|
return new RegularExpressionLiteralExpr(ast.body, ast.flags, baseSourceSpan);
|
|
23934
|
+
} else if (ast instanceof SpreadElement) {
|
|
23935
|
+
return new SpreadElementExpr(convertAst(ast.expression, job, baseSourceSpan));
|
|
23786
23936
|
} else {
|
|
23787
23937
|
throw new Error(`Unhandled expression type "${ast.constructor.name}" in file "${baseSourceSpan?.start.file.url}"`);
|
|
23788
23938
|
}
|
|
@@ -24508,7 +24658,7 @@ var BindingParser = class {
|
|
|
24508
24658
|
if (ast instanceof NonNullAssert) {
|
|
24509
24659
|
return this._isAllowedAssignmentEvent(ast.expression);
|
|
24510
24660
|
}
|
|
24511
|
-
if (ast instanceof Call && ast.args.length === 1 && ast.receiver instanceof PropertyRead && ast.receiver.name === "$any" && ast.receiver.receiver instanceof ImplicitReceiver
|
|
24661
|
+
if (ast instanceof Call && ast.args.length === 1 && ast.receiver instanceof PropertyRead && ast.receiver.name === "$any" && ast.receiver.receiver instanceof ImplicitReceiver) {
|
|
24512
24662
|
return this._isAllowedAssignmentEvent(ast.args[0]);
|
|
24513
24663
|
}
|
|
24514
24664
|
if (ast instanceof PropertyRead || ast instanceof KeyedRead) {
|
|
@@ -24729,30 +24879,46 @@ __name(createForLoop, "createForLoop");
|
|
|
24729
24879
|
function createSwitchBlock(ast, visitor, bindingParser) {
|
|
24730
24880
|
const errors = validateSwitchBlock(ast);
|
|
24731
24881
|
const primaryExpression = ast.parameters.length > 0 ? parseBlockParameterToBinding(ast.parameters[0], bindingParser) : bindingParser.parseBinding("", false, ast.sourceSpan, 0);
|
|
24732
|
-
const
|
|
24882
|
+
const groups = [];
|
|
24733
24883
|
const unknownBlocks = [];
|
|
24734
|
-
let
|
|
24735
|
-
|
|
24736
|
-
|
|
24884
|
+
let collectedCases = [];
|
|
24885
|
+
let firstCaseStart = null;
|
|
24886
|
+
for (const node2 of ast.children) {
|
|
24887
|
+
if (!(node2 instanceof Block)) {
|
|
24737
24888
|
continue;
|
|
24738
24889
|
}
|
|
24739
|
-
if ((
|
|
24740
|
-
unknownBlocks.push(new UnknownBlock(
|
|
24890
|
+
if ((node2.name !== "case" || node2.parameters.length === 0) && node2.name !== "default") {
|
|
24891
|
+
unknownBlocks.push(new UnknownBlock(node2.name, node2.sourceSpan, node2.nameSpan));
|
|
24741
24892
|
continue;
|
|
24742
24893
|
}
|
|
24743
|
-
const
|
|
24744
|
-
|
|
24745
|
-
if (
|
|
24746
|
-
|
|
24747
|
-
} else {
|
|
24748
|
-
cases.push(ast2);
|
|
24894
|
+
const isCase = node2.name === "case";
|
|
24895
|
+
let expression = null;
|
|
24896
|
+
if (isCase) {
|
|
24897
|
+
expression = parseBlockParameterToBinding(node2.parameters[0], bindingParser);
|
|
24749
24898
|
}
|
|
24899
|
+
const switchCase = new SwitchBlockCase(expression, node2.sourceSpan, node2.startSourceSpan, node2.endSourceSpan, node2.nameSpan);
|
|
24900
|
+
collectedCases.push(switchCase);
|
|
24901
|
+
const caseWithoutBody = node2.children.length === 0 && node2.endSourceSpan !== null && node2.endSourceSpan.start.offset === node2.endSourceSpan.end.offset;
|
|
24902
|
+
if (caseWithoutBody) {
|
|
24903
|
+
if (firstCaseStart === null) {
|
|
24904
|
+
firstCaseStart = node2.sourceSpan;
|
|
24905
|
+
}
|
|
24906
|
+
continue;
|
|
24907
|
+
}
|
|
24908
|
+
let sourceSpan = node2.sourceSpan;
|
|
24909
|
+
let startSourceSpan = node2.startSourceSpan;
|
|
24910
|
+
if (firstCaseStart !== null) {
|
|
24911
|
+
sourceSpan = new ParseSourceSpan(firstCaseStart.start, node2.sourceSpan.end);
|
|
24912
|
+
startSourceSpan = new ParseSourceSpan(firstCaseStart.start, node2.startSourceSpan.end);
|
|
24913
|
+
firstCaseStart = null;
|
|
24914
|
+
}
|
|
24915
|
+
const group = new SwitchBlockCaseGroup(collectedCases, visitAll(visitor, node2.children, node2.children), sourceSpan, startSourceSpan, node2.endSourceSpan, node2.nameSpan, node2.i18n);
|
|
24916
|
+
groups.push(group);
|
|
24917
|
+
collectedCases = [];
|
|
24750
24918
|
}
|
|
24751
|
-
|
|
24752
|
-
cases.push(defaultCase);
|
|
24753
|
-
}
|
|
24919
|
+
const node = new SwitchBlock(primaryExpression, groups, unknownBlocks, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan, ast.nameSpan);
|
|
24754
24920
|
return {
|
|
24755
|
-
node
|
|
24921
|
+
node,
|
|
24756
24922
|
errors
|
|
24757
24923
|
};
|
|
24758
24924
|
}
|
|
@@ -25297,17 +25463,19 @@ function createViewportTrigger(start, isHydrationTrigger, bindingParser, paramet
|
|
|
25297
25463
|
const parsed = bindingParser.parseBinding(parameters[0].expression, false, sourceSpan, sourceSpan.start.offset + start + parameters[0].start);
|
|
25298
25464
|
if (!(parsed.ast instanceof LiteralMap)) {
|
|
25299
25465
|
throw new Error('Options parameter of the "viewport" trigger must be an object literal');
|
|
25300
|
-
} else if (parsed.ast.keys.some((key) => key.
|
|
25466
|
+
} else if (parsed.ast.keys.some((key) => key.kind === "spread")) {
|
|
25467
|
+
throw new Error("Spread operator are not allowed in this context");
|
|
25468
|
+
} else if (parsed.ast.keys.some((key) => key.kind === "property" && key.key === "root")) {
|
|
25301
25469
|
throw new Error('The "root" option is not supported in the options parameter of the "viewport" trigger');
|
|
25302
25470
|
}
|
|
25303
|
-
const triggerIndex = parsed.ast.keys.findIndex((key) => key.key === "trigger");
|
|
25471
|
+
const triggerIndex = parsed.ast.keys.findIndex((key) => key.kind === "property" && key.key === "trigger");
|
|
25304
25472
|
if (triggerIndex === -1) {
|
|
25305
25473
|
reference2 = null;
|
|
25306
25474
|
options = parsed.ast;
|
|
25307
25475
|
} else {
|
|
25308
25476
|
const value = parsed.ast.values[triggerIndex];
|
|
25309
25477
|
const triggerFilter = /* @__PURE__ */ __name((_, index) => index !== triggerIndex, "triggerFilter");
|
|
25310
|
-
if (!(value instanceof PropertyRead) || !(value.receiver instanceof ImplicitReceiver)
|
|
25478
|
+
if (!(value instanceof PropertyRead) || !(value.receiver instanceof ImplicitReceiver)) {
|
|
25311
25479
|
throw new Error(`"trigger" option of the "viewport" trigger must be an identifier`);
|
|
25312
25480
|
}
|
|
25313
25481
|
reference2 = value.name;
|
|
@@ -26759,10 +26927,13 @@ var CombinedRecursiveAstVisitor = class extends RecursiveAstVisitor2 {
|
|
|
26759
26927
|
}
|
|
26760
26928
|
visitSwitchBlock(block) {
|
|
26761
26929
|
this.visit(block.expression);
|
|
26762
|
-
this.visitAllTemplateNodes(block.
|
|
26930
|
+
this.visitAllTemplateNodes(block.groups);
|
|
26763
26931
|
}
|
|
26764
26932
|
visitSwitchBlockCase(block) {
|
|
26765
26933
|
block.expression && this.visit(block.expression);
|
|
26934
|
+
}
|
|
26935
|
+
visitSwitchBlockCaseGroup(block) {
|
|
26936
|
+
this.visitAllTemplateNodes(block.cases);
|
|
26766
26937
|
this.visitAllTemplateNodes(block.children);
|
|
26767
26938
|
}
|
|
26768
26939
|
visitForLoopBlock(block) {
|
|
@@ -26933,7 +27104,7 @@ var Scope2 = class _Scope {
|
|
|
26933
27104
|
this.visitVariable(nodeOrNodes.item);
|
|
26934
27105
|
nodeOrNodes.contextVariables.forEach((v) => this.visitVariable(v));
|
|
26935
27106
|
nodeOrNodes.children.forEach((node) => node.visit(this));
|
|
26936
|
-
} else if (nodeOrNodes instanceof
|
|
27107
|
+
} else if (nodeOrNodes instanceof SwitchBlockCaseGroup || nodeOrNodes instanceof ForLoopBlockEmpty || nodeOrNodes instanceof DeferredBlock || nodeOrNodes instanceof DeferredBlockError || nodeOrNodes instanceof DeferredBlockPlaceholder || nodeOrNodes instanceof DeferredBlockLoading || nodeOrNodes instanceof Content) {
|
|
26937
27108
|
nodeOrNodes.children.forEach((node) => node.visit(this));
|
|
26938
27109
|
} else if (!(nodeOrNodes instanceof HostElement)) {
|
|
26939
27110
|
nodeOrNodes.forEach((node) => node.visit(this));
|
|
@@ -26969,9 +27140,11 @@ var Scope2 = class _Scope {
|
|
|
26969
27140
|
this.ingestScopedNode(block);
|
|
26970
27141
|
}
|
|
26971
27142
|
visitSwitchBlock(block) {
|
|
26972
|
-
block.
|
|
27143
|
+
block.groups.forEach((node) => node.visit(this));
|
|
26973
27144
|
}
|
|
26974
27145
|
visitSwitchBlockCase(block) {
|
|
27146
|
+
}
|
|
27147
|
+
visitSwitchBlockCaseGroup(block) {
|
|
26975
27148
|
this.ingestScopedNode(block);
|
|
26976
27149
|
}
|
|
26977
27150
|
visitForLoopBlock(block) {
|
|
@@ -27099,9 +27272,11 @@ var DirectiveBinder = class _DirectiveBinder {
|
|
|
27099
27272
|
block.children.forEach((child) => child.visit(this));
|
|
27100
27273
|
}
|
|
27101
27274
|
visitSwitchBlock(block) {
|
|
27102
|
-
block.
|
|
27275
|
+
block.groups.forEach((node) => node.visit(this));
|
|
27103
27276
|
}
|
|
27104
27277
|
visitSwitchBlockCase(block) {
|
|
27278
|
+
}
|
|
27279
|
+
visitSwitchBlockCaseGroup(block) {
|
|
27105
27280
|
block.children.forEach((node) => node.visit(this));
|
|
27106
27281
|
}
|
|
27107
27282
|
visitForLoopBlock(block) {
|
|
@@ -27302,7 +27477,7 @@ var TemplateBinder = class _TemplateBinder extends CombinedRecursiveAstVisitor {
|
|
|
27302
27477
|
this.deferBlocks.push([nodeOrNodes, this.scope]);
|
|
27303
27478
|
nodeOrNodes.children.forEach((node) => node.visit(this));
|
|
27304
27479
|
this.nestingLevel.set(nodeOrNodes, this.level);
|
|
27305
|
-
} else if (nodeOrNodes instanceof
|
|
27480
|
+
} else if (nodeOrNodes instanceof SwitchBlockCaseGroup || nodeOrNodes instanceof ForLoopBlockEmpty || nodeOrNodes instanceof DeferredBlockError || nodeOrNodes instanceof DeferredBlockPlaceholder || nodeOrNodes instanceof DeferredBlockLoading || nodeOrNodes instanceof Content) {
|
|
27306
27481
|
nodeOrNodes.children.forEach((node) => node.visit(this));
|
|
27307
27482
|
this.nestingLevel.set(nodeOrNodes, this.level);
|
|
27308
27483
|
} else if (nodeOrNodes instanceof HostElement) {
|
|
@@ -27350,6 +27525,9 @@ var TemplateBinder = class _TemplateBinder extends CombinedRecursiveAstVisitor {
|
|
|
27350
27525
|
}
|
|
27351
27526
|
visitSwitchBlockCase(block) {
|
|
27352
27527
|
block.expression?.visit(this);
|
|
27528
|
+
}
|
|
27529
|
+
visitSwitchBlockCaseGroup(block) {
|
|
27530
|
+
block.cases.forEach((caseNode) => caseNode.visit(this));
|
|
27353
27531
|
this.ingestScopedNode(block);
|
|
27354
27532
|
}
|
|
27355
27533
|
visitForLoopBlock(block) {
|
|
@@ -27394,7 +27572,7 @@ var TemplateBinder = class _TemplateBinder extends CombinedRecursiveAstVisitor {
|
|
|
27394
27572
|
binder.ingest(node);
|
|
27395
27573
|
}
|
|
27396
27574
|
maybeMap(ast, name) {
|
|
27397
|
-
if (!(ast.receiver instanceof ImplicitReceiver)
|
|
27575
|
+
if (!(ast.receiver instanceof ImplicitReceiver)) {
|
|
27398
27576
|
return;
|
|
27399
27577
|
}
|
|
27400
27578
|
const target = this.scope.lookup(name);
|
|
@@ -29909,7 +30087,7 @@ var MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = "18.0.0";
|
|
|
29909
30087
|
function compileDeclareClassMetadata(metadata) {
|
|
29910
30088
|
const definitionMap = new DefinitionMap();
|
|
29911
30089
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
|
|
29912
|
-
definitionMap.set("version", literal("21.0
|
|
30090
|
+
definitionMap.set("version", literal("21.1.0"));
|
|
29913
30091
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
29914
30092
|
definitionMap.set("type", metadata.type);
|
|
29915
30093
|
definitionMap.set("decorators", metadata.decorators);
|
|
@@ -29928,7 +30106,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
|
|
|
29928
30106
|
callbackReturnDefinitionMap.set("ctorParameters", metadata.ctorParameters ?? literal(null));
|
|
29929
30107
|
callbackReturnDefinitionMap.set("propDecorators", metadata.propDecorators ?? literal(null));
|
|
29930
30108
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
|
|
29931
|
-
definitionMap.set("version", literal("21.0
|
|
30109
|
+
definitionMap.set("version", literal("21.1.0"));
|
|
29932
30110
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
29933
30111
|
definitionMap.set("type", metadata.type);
|
|
29934
30112
|
definitionMap.set("resolveDeferredDeps", compileComponentMetadataAsyncResolver(dependencies));
|
|
@@ -30005,7 +30183,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
30005
30183
|
const definitionMap = new DefinitionMap();
|
|
30006
30184
|
const minVersion = getMinimumVersionForPartialOutput(meta);
|
|
30007
30185
|
definitionMap.set("minVersion", literal(minVersion));
|
|
30008
|
-
definitionMap.set("version", literal("21.0
|
|
30186
|
+
definitionMap.set("version", literal("21.1.0"));
|
|
30009
30187
|
definitionMap.set("type", meta.type.value);
|
|
30010
30188
|
if (meta.isStandalone !== void 0) {
|
|
30011
30189
|
definitionMap.set("isStandalone", literal(meta.isStandalone));
|
|
@@ -30346,12 +30524,15 @@ var BlockPresenceVisitor = class extends RecursiveVisitor$1 {
|
|
|
30346
30524
|
visitSwitchBlockCase() {
|
|
30347
30525
|
this.hasBlocks = true;
|
|
30348
30526
|
}
|
|
30527
|
+
visitSwitchBlockCaseGroup() {
|
|
30528
|
+
this.hasBlocks = true;
|
|
30529
|
+
}
|
|
30349
30530
|
};
|
|
30350
30531
|
var MINIMUM_PARTIAL_LINKER_VERSION$4 = "12.0.0";
|
|
30351
30532
|
function compileDeclareFactoryFunction(meta) {
|
|
30352
30533
|
const definitionMap = new DefinitionMap();
|
|
30353
30534
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
|
|
30354
|
-
definitionMap.set("version", literal("21.0
|
|
30535
|
+
definitionMap.set("version", literal("21.1.0"));
|
|
30355
30536
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
30356
30537
|
definitionMap.set("type", meta.type.value);
|
|
30357
30538
|
definitionMap.set("deps", compileDependencies(meta.deps));
|
|
@@ -30378,7 +30559,7 @@ __name(compileDeclareInjectableFromMetadata, "compileDeclareInjectableFromMetada
|
|
|
30378
30559
|
function createInjectableDefinitionMap(meta) {
|
|
30379
30560
|
const definitionMap = new DefinitionMap();
|
|
30380
30561
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
|
|
30381
|
-
definitionMap.set("version", literal("21.0
|
|
30562
|
+
definitionMap.set("version", literal("21.1.0"));
|
|
30382
30563
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
30383
30564
|
definitionMap.set("type", meta.type.value);
|
|
30384
30565
|
if (meta.providedIn !== void 0) {
|
|
@@ -30420,7 +30601,7 @@ __name(compileDeclareInjectorFromMetadata, "compileDeclareInjectorFromMetadata")
|
|
|
30420
30601
|
function createInjectorDefinitionMap(meta) {
|
|
30421
30602
|
const definitionMap = new DefinitionMap();
|
|
30422
30603
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
|
|
30423
|
-
definitionMap.set("version", literal("21.0
|
|
30604
|
+
definitionMap.set("version", literal("21.1.0"));
|
|
30424
30605
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
30425
30606
|
definitionMap.set("type", meta.type.value);
|
|
30426
30607
|
definitionMap.set("providers", meta.providers);
|
|
@@ -30448,7 +30629,7 @@ function createNgModuleDefinitionMap(meta) {
|
|
|
30448
30629
|
throw new Error("Invalid path! Local compilation mode should not get into the partial compilation path");
|
|
30449
30630
|
}
|
|
30450
30631
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
|
|
30451
|
-
definitionMap.set("version", literal("21.0
|
|
30632
|
+
definitionMap.set("version", literal("21.1.0"));
|
|
30452
30633
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
30453
30634
|
definitionMap.set("type", meta.type.value);
|
|
30454
30635
|
if (meta.bootstrap.length > 0) {
|
|
@@ -30487,7 +30668,7 @@ __name(compileDeclarePipeFromMetadata, "compileDeclarePipeFromMetadata");
|
|
|
30487
30668
|
function createPipeDefinitionMap(meta) {
|
|
30488
30669
|
const definitionMap = new DefinitionMap();
|
|
30489
30670
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
30490
|
-
definitionMap.set("version", literal("21.0
|
|
30671
|
+
definitionMap.set("version", literal("21.1.0"));
|
|
30491
30672
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
30492
30673
|
definitionMap.set("type", meta.type.value);
|
|
30493
30674
|
if (meta.isStandalone !== void 0) {
|
|
@@ -30562,7 +30743,7 @@ function compileHmrUpdateCallback(definitions, constantStatements, meta) {
|
|
|
30562
30743
|
return new DeclareFunctionStmt(`${meta.className}_UpdateMetadata`, params, body, null, StmtModifier.Final);
|
|
30563
30744
|
}
|
|
30564
30745
|
__name(compileHmrUpdateCallback, "compileHmrUpdateCallback");
|
|
30565
|
-
var VERSION = new Version("21.0
|
|
30746
|
+
var VERSION = new Version("21.1.0");
|
|
30566
30747
|
publishFacade(_global);
|
|
30567
30748
|
// Annotate the CommonJS export names for ESM import in node:
|
|
30568
30749
|
0 && (module.exports = {
|
|
@@ -30638,6 +30819,8 @@ publishFacade(_global);
|
|
|
30638
30819
|
LiteralExpr,
|
|
30639
30820
|
LiteralMap,
|
|
30640
30821
|
LiteralMapExpr,
|
|
30822
|
+
LiteralMapPropertyAssignment,
|
|
30823
|
+
LiteralMapSpreadAssignment,
|
|
30641
30824
|
LiteralPrimitive,
|
|
30642
30825
|
LocalizedString,
|
|
30643
30826
|
MapType,
|
|
@@ -30690,6 +30873,8 @@ publishFacade(_global);
|
|
|
30690
30873
|
SelectorlessMatcher,
|
|
30691
30874
|
Serializer,
|
|
30692
30875
|
SplitInterpolation,
|
|
30876
|
+
SpreadElement,
|
|
30877
|
+
SpreadElementExpr,
|
|
30693
30878
|
Statement,
|
|
30694
30879
|
StmtModifier,
|
|
30695
30880
|
StringToken,
|
|
@@ -30734,6 +30919,7 @@ publishFacade(_global);
|
|
|
30734
30919
|
TmplAstReference,
|
|
30735
30920
|
TmplAstSwitchBlock,
|
|
30736
30921
|
TmplAstSwitchBlockCase,
|
|
30922
|
+
TmplAstSwitchBlockCaseGroup,
|
|
30737
30923
|
TmplAstTemplate,
|
|
30738
30924
|
TmplAstText,
|
|
30739
30925
|
TmplAstTextAttribute,
|
|
@@ -30828,8 +31014,8 @@ publishFacade(_global);
|
|
|
30828
31014
|
|
|
30829
31015
|
@angular/compiler/fesm2022/compiler.mjs:
|
|
30830
31016
|
(**
|
|
30831
|
-
* @license Angular v21.0
|
|
30832
|
-
* (c) 2010-
|
|
31017
|
+
* @license Angular v21.1.0
|
|
31018
|
+
* (c) 2010-2026 Google LLC. https://angular.dev/
|
|
30833
31019
|
* License: MIT
|
|
30834
31020
|
*)
|
|
30835
31021
|
(**
|