@angular-eslint/bundled-angular-compiler 21.1.1-alpha.9 → 21.2.1-alpha.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/dist/index.js +347 -164
- 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.
|
|
289
|
+
// ../../node_modules/.pnpm/@angular+compiler@21.1.1/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
|
}
|
|
@@ -2757,9 +2782,6 @@ var Identifiers = class {
|
|
|
2757
2782
|
static {
|
|
2758
2783
|
__name(this, "Identifiers");
|
|
2759
2784
|
}
|
|
2760
|
-
static NEW_METHOD = "factory";
|
|
2761
|
-
static TRANSFORM_METHOD = "transform";
|
|
2762
|
-
static PATCH_DEPS = "patchedDeps";
|
|
2763
2785
|
static core = {
|
|
2764
2786
|
name: null,
|
|
2765
2787
|
moduleName: CORE
|
|
@@ -4194,8 +4216,13 @@ var AbstractEmitterVisitor = class {
|
|
|
4194
4216
|
visitLiteralMapExpr(ast, ctx) {
|
|
4195
4217
|
ctx.print(ast, `{`);
|
|
4196
4218
|
this.visitAllObjects((entry) => {
|
|
4197
|
-
|
|
4198
|
-
|
|
4219
|
+
if (entry instanceof LiteralMapSpreadAssignment) {
|
|
4220
|
+
ctx.print(ast, "...");
|
|
4221
|
+
entry.expression.visitExpression(this, ctx);
|
|
4222
|
+
} else {
|
|
4223
|
+
ctx.print(ast, `${escapeIdentifier(entry.key, this._escapeDollarInStrings, entry.quoted)}:`);
|
|
4224
|
+
entry.value.visitExpression(this, ctx);
|
|
4225
|
+
}
|
|
4199
4226
|
}, ast.entries, ctx, ",");
|
|
4200
4227
|
ctx.print(ast, `}`);
|
|
4201
4228
|
return null;
|
|
@@ -4209,6 +4236,10 @@ var AbstractEmitterVisitor = class {
|
|
|
4209
4236
|
visitParenthesizedExpr(ast, ctx) {
|
|
4210
4237
|
ast.expr.visitExpression(this, ctx);
|
|
4211
4238
|
}
|
|
4239
|
+
visitSpreadElementExpr(ast, ctx) {
|
|
4240
|
+
ctx.print(ast, "...");
|
|
4241
|
+
ast.expression.visitExpression(this, ctx);
|
|
4242
|
+
}
|
|
4212
4243
|
visitAllExpressions(expressions, ctx, separator) {
|
|
4213
4244
|
this.visitAllObjects((expr) => expr.visitExpression(this, ctx), expressions, ctx, separator);
|
|
4214
4245
|
}
|
|
@@ -4551,7 +4582,7 @@ var ImplicitReceiver = class extends AST {
|
|
|
4551
4582
|
return visitor.visitImplicitReceiver(this, context);
|
|
4552
4583
|
}
|
|
4553
4584
|
};
|
|
4554
|
-
var ThisReceiver = class extends
|
|
4585
|
+
var ThisReceiver = class extends AST {
|
|
4555
4586
|
static {
|
|
4556
4587
|
__name(this, "ThisReceiver");
|
|
4557
4588
|
}
|
|
@@ -4699,6 +4730,19 @@ var LiteralArray = class extends AST {
|
|
|
4699
4730
|
return visitor.visitLiteralArray(this, context);
|
|
4700
4731
|
}
|
|
4701
4732
|
};
|
|
4733
|
+
var SpreadElement = class extends AST {
|
|
4734
|
+
static {
|
|
4735
|
+
__name(this, "SpreadElement");
|
|
4736
|
+
}
|
|
4737
|
+
expression;
|
|
4738
|
+
constructor(span, sourceSpan, expression) {
|
|
4739
|
+
super(span, sourceSpan);
|
|
4740
|
+
this.expression = expression;
|
|
4741
|
+
}
|
|
4742
|
+
visit(visitor, context = null) {
|
|
4743
|
+
return visitor.visitSpreadElement(this, context);
|
|
4744
|
+
}
|
|
4745
|
+
};
|
|
4702
4746
|
var LiteralMap = class extends AST {
|
|
4703
4747
|
static {
|
|
4704
4748
|
__name(this, "LiteralMap");
|
|
@@ -5090,6 +5134,9 @@ var RecursiveAstVisitor2 = class {
|
|
|
5090
5134
|
}
|
|
5091
5135
|
visitRegularExpressionLiteral(ast, context) {
|
|
5092
5136
|
}
|
|
5137
|
+
visitSpreadElement(ast, context) {
|
|
5138
|
+
this.visit(ast.expression, context);
|
|
5139
|
+
}
|
|
5093
5140
|
visitAll(asts, context) {
|
|
5094
5141
|
for (const ast of asts) {
|
|
5095
5142
|
this.visit(ast, context);
|
|
@@ -5622,12 +5669,12 @@ var SwitchBlock = class extends BlockNode {
|
|
|
5622
5669
|
__name(this, "SwitchBlock");
|
|
5623
5670
|
}
|
|
5624
5671
|
expression;
|
|
5625
|
-
|
|
5672
|
+
groups;
|
|
5626
5673
|
unknownBlocks;
|
|
5627
|
-
constructor(expression,
|
|
5674
|
+
constructor(expression, groups, unknownBlocks, sourceSpan, startSourceSpan, endSourceSpan, nameSpan) {
|
|
5628
5675
|
super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
|
|
5629
5676
|
this.expression = expression;
|
|
5630
|
-
this.
|
|
5677
|
+
this.groups = groups;
|
|
5631
5678
|
this.unknownBlocks = unknownBlocks;
|
|
5632
5679
|
}
|
|
5633
5680
|
visit(visitor) {
|
|
@@ -5639,16 +5686,29 @@ var SwitchBlockCase = class extends BlockNode {
|
|
|
5639
5686
|
__name(this, "SwitchBlockCase");
|
|
5640
5687
|
}
|
|
5641
5688
|
expression;
|
|
5689
|
+
constructor(expression, sourceSpan, startSourceSpan, endSourceSpan, nameSpan) {
|
|
5690
|
+
super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
|
|
5691
|
+
this.expression = expression;
|
|
5692
|
+
}
|
|
5693
|
+
visit(visitor) {
|
|
5694
|
+
return visitor.visitSwitchBlockCase(this);
|
|
5695
|
+
}
|
|
5696
|
+
};
|
|
5697
|
+
var SwitchBlockCaseGroup = class extends BlockNode {
|
|
5698
|
+
static {
|
|
5699
|
+
__name(this, "SwitchBlockCaseGroup");
|
|
5700
|
+
}
|
|
5701
|
+
cases;
|
|
5642
5702
|
children;
|
|
5643
5703
|
i18n;
|
|
5644
|
-
constructor(
|
|
5704
|
+
constructor(cases, children, sourceSpan, startSourceSpan, endSourceSpan, nameSpan, i18n2) {
|
|
5645
5705
|
super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
|
|
5646
|
-
this.
|
|
5706
|
+
this.cases = cases;
|
|
5647
5707
|
this.children = children;
|
|
5648
5708
|
this.i18n = i18n2;
|
|
5649
5709
|
}
|
|
5650
5710
|
visit(visitor) {
|
|
5651
|
-
return visitor.
|
|
5711
|
+
return visitor.visitSwitchBlockCaseGroup(this);
|
|
5652
5712
|
}
|
|
5653
5713
|
};
|
|
5654
5714
|
var ForLoopBlock = class extends BlockNode {
|
|
@@ -6007,9 +6067,12 @@ var RecursiveVisitor$1 = class RecursiveVisitor {
|
|
|
6007
6067
|
visitAll$1(this, block.children);
|
|
6008
6068
|
}
|
|
6009
6069
|
visitSwitchBlock(block) {
|
|
6010
|
-
visitAll$1(this, block.
|
|
6070
|
+
visitAll$1(this, block.groups);
|
|
6011
6071
|
}
|
|
6012
6072
|
visitSwitchBlockCase(block) {
|
|
6073
|
+
}
|
|
6074
|
+
visitSwitchBlockCaseGroup(block) {
|
|
6075
|
+
visitAll$1(this, block.cases);
|
|
6013
6076
|
visitAll$1(this, block.children);
|
|
6014
6077
|
}
|
|
6015
6078
|
visitForLoopBlock(block) {
|
|
@@ -7419,7 +7482,7 @@ var JitEmitterVisitor = class extends AbstractJsEmitterVisitor {
|
|
|
7419
7482
|
this.refResolver = refResolver;
|
|
7420
7483
|
}
|
|
7421
7484
|
createReturnStmt(ctx) {
|
|
7422
|
-
const stmt = new ReturnStatement(new LiteralMapExpr(this._evalExportedVars.map((resultVar) => new
|
|
7485
|
+
const stmt = new ReturnStatement(new LiteralMapExpr(this._evalExportedVars.map((resultVar) => new LiteralMapPropertyAssignment(resultVar, variable(resultVar), false))));
|
|
7423
7486
|
stmt.visitStatement(this, ctx);
|
|
7424
7487
|
}
|
|
7425
7488
|
getArgs() {
|
|
@@ -8767,6 +8830,7 @@ function createControlOp(op) {
|
|
|
8767
8830
|
return {
|
|
8768
8831
|
kind: OpKind.Control,
|
|
8769
8832
|
target: op.target,
|
|
8833
|
+
name: op.name,
|
|
8770
8834
|
expression: op.expression,
|
|
8771
8835
|
bindingKind: op.bindingKind,
|
|
8772
8836
|
securityContext: op.securityContext,
|
|
@@ -9746,8 +9810,12 @@ function transformExpressionsInExpression(expr, transform2, flags) {
|
|
|
9746
9810
|
expr.entries[i] = transformExpressionsInExpression(expr.entries[i], transform2, flags);
|
|
9747
9811
|
}
|
|
9748
9812
|
} else if (expr instanceof LiteralMapExpr) {
|
|
9749
|
-
for (
|
|
9750
|
-
|
|
9813
|
+
for (const entry of expr.entries) {
|
|
9814
|
+
if (entry instanceof LiteralMapSpreadAssignment) {
|
|
9815
|
+
entry.expression = transformExpressionsInExpression(entry.expression, transform2, flags);
|
|
9816
|
+
} else {
|
|
9817
|
+
entry.value = transformExpressionsInExpression(entry.value, transform2, flags);
|
|
9818
|
+
}
|
|
9751
9819
|
}
|
|
9752
9820
|
} else if (expr instanceof ConditionalExpr) {
|
|
9753
9821
|
expr.condition = transformExpressionsInExpression(expr.condition, transform2, flags);
|
|
@@ -9783,6 +9851,8 @@ function transformExpressionsInExpression(expr, transform2, flags) {
|
|
|
9783
9851
|
}
|
|
9784
9852
|
} else if (expr instanceof ParenthesizedExpr) {
|
|
9785
9853
|
expr.expr = transformExpressionsInExpression(expr.expr, transform2, flags);
|
|
9854
|
+
} else if (expr instanceof SpreadElementExpr) {
|
|
9855
|
+
expr.expression = transformExpressionsInExpression(expr.expression, transform2, flags);
|
|
9786
9856
|
} else if (expr instanceof ReadVarExpr || expr instanceof ExternalExpr || expr instanceof LiteralExpr || expr instanceof RegularExpressionLiteralExpr) ;
|
|
9787
9857
|
else {
|
|
9788
9858
|
throw new Error(`Unhandled expression kind: ${expr.constructor.name}`);
|
|
@@ -10834,7 +10904,7 @@ function extractAttributes(job) {
|
|
|
10834
10904
|
}
|
|
10835
10905
|
break;
|
|
10836
10906
|
case OpKind.Control:
|
|
10837
|
-
OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.Property, null,
|
|
10907
|
+
OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.Property, null, op.name, null, null, null, op.securityContext), lookupElement$3(elements, op.target));
|
|
10838
10908
|
break;
|
|
10839
10909
|
case OpKind.TwoWayProperty:
|
|
10840
10910
|
OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.TwoWayProperty, null, op.name, null, null, null, op.securityContext), lookupElement$3(elements, op.target));
|
|
@@ -10947,7 +11017,7 @@ function specializeBindings(job) {
|
|
|
10947
11017
|
OpList.replace(op, createAttributeOp(op.target, null, op.name, op.expression, op.securityContext, false, op.isStructuralTemplateAttribute, op.templateKind, op.i18nMessage, op.sourceSpan));
|
|
10948
11018
|
} else if (job.kind === CompilationJobKind.Host) {
|
|
10949
11019
|
OpList.replace(op, createDomPropertyOp(op.name, op.expression, op.bindingKind, op.i18nContext, op.securityContext, op.sourceSpan));
|
|
10950
|
-
} else if (op.name === "
|
|
11020
|
+
} else if (op.name === "formField") {
|
|
10951
11021
|
OpList.replace(op, createControlOp(op));
|
|
10952
11022
|
} else {
|
|
10953
11023
|
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 +14869,11 @@ var _Tokenizer = class {
|
|
|
14799
14869
|
if (this._attemptCharCode($LBRACE)) {
|
|
14800
14870
|
this._beginToken(25);
|
|
14801
14871
|
this._endToken([]);
|
|
14872
|
+
} else if (this._isBlockStart() && (startToken.parts[0] === "case" || startToken.parts[0] === "default")) {
|
|
14873
|
+
this._beginToken(25);
|
|
14874
|
+
this._endToken([]);
|
|
14875
|
+
this._beginToken(26);
|
|
14876
|
+
this._endToken([]);
|
|
14802
14877
|
} else {
|
|
14803
14878
|
startToken.type = 28;
|
|
14804
14879
|
}
|
|
@@ -16816,7 +16891,18 @@ var _Scanner = class {
|
|
|
16816
16891
|
switch (peek) {
|
|
16817
16892
|
case $PERIOD:
|
|
16818
16893
|
this.advance();
|
|
16819
|
-
|
|
16894
|
+
if (isDigit(this.peek)) {
|
|
16895
|
+
return this.scanNumber(start);
|
|
16896
|
+
}
|
|
16897
|
+
if (this.peek !== $PERIOD) {
|
|
16898
|
+
return newCharacterToken(start, this.index, $PERIOD);
|
|
16899
|
+
}
|
|
16900
|
+
this.advance();
|
|
16901
|
+
if (this.peek === $PERIOD) {
|
|
16902
|
+
this.advance();
|
|
16903
|
+
return newOperatorToken(start, this.index, "...");
|
|
16904
|
+
}
|
|
16905
|
+
return this.error(`Unexpected character [${String.fromCharCode(peek)}]`, 0);
|
|
16820
16906
|
case $LPAREN:
|
|
16821
16907
|
case $RPAREN:
|
|
16822
16908
|
case $LBRACKET:
|
|
@@ -17791,14 +17877,14 @@ var _ParseAST = class {
|
|
|
17791
17877
|
return new PrefixNot(this.span(start), this.sourceSpan(start), result);
|
|
17792
17878
|
}
|
|
17793
17879
|
} else if (this.next.isKeywordTypeof()) {
|
|
17794
|
-
this.advance();
|
|
17795
17880
|
const start = this.inputIndex;
|
|
17796
|
-
|
|
17881
|
+
this.advance();
|
|
17882
|
+
const result = this.parsePrefix();
|
|
17797
17883
|
return new TypeofExpression(this.span(start), this.sourceSpan(start), result);
|
|
17798
17884
|
} else if (this.next.isKeywordVoid()) {
|
|
17799
|
-
this.advance();
|
|
17800
17885
|
const start = this.inputIndex;
|
|
17801
|
-
|
|
17886
|
+
this.advance();
|
|
17887
|
+
const result = this.parsePrefix();
|
|
17802
17888
|
return new VoidExpression(this.span(start), this.sourceSpan(start), result);
|
|
17803
17889
|
}
|
|
17804
17890
|
return this.parseCallChain();
|
|
@@ -17860,11 +17946,7 @@ var _ParseAST = class {
|
|
|
17860
17946
|
this.advance();
|
|
17861
17947
|
return new ThisReceiver(this.span(start), this.sourceSpan(start));
|
|
17862
17948
|
} 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);
|
|
17949
|
+
return this.parseLiteralArray(start);
|
|
17868
17950
|
} else if (this.next.isCharacter($LBRACE)) {
|
|
17869
17951
|
return this.parseLiteralMap();
|
|
17870
17952
|
} else if (this.next.isIdentifier()) {
|
|
@@ -17894,16 +17976,21 @@ var _ParseAST = class {
|
|
|
17894
17976
|
return new EmptyExpr$1(this.span(start), this.sourceSpan(start));
|
|
17895
17977
|
}
|
|
17896
17978
|
}
|
|
17897
|
-
|
|
17898
|
-
|
|
17979
|
+
parseLiteralArray(arrayStart) {
|
|
17980
|
+
this.rbracketsExpected++;
|
|
17981
|
+
const elements = [];
|
|
17899
17982
|
do {
|
|
17900
|
-
if (
|
|
17901
|
-
|
|
17983
|
+
if (this.next.isOperator("...")) {
|
|
17984
|
+
elements.push(this.parseSpreadElement());
|
|
17985
|
+
} else if (!this.next.isCharacter($RBRACKET)) {
|
|
17986
|
+
elements.push(this.parsePipe());
|
|
17902
17987
|
} else {
|
|
17903
17988
|
break;
|
|
17904
17989
|
}
|
|
17905
17990
|
} while (this.consumeOptionalCharacter($COMMA));
|
|
17906
|
-
|
|
17991
|
+
this.rbracketsExpected--;
|
|
17992
|
+
this.expectCharacter($RBRACKET);
|
|
17993
|
+
return new LiteralArray(this.span(arrayStart), this.sourceSpan(arrayStart), elements);
|
|
17907
17994
|
}
|
|
17908
17995
|
parseLiteralMap() {
|
|
17909
17996
|
const keys = [];
|
|
@@ -17914,11 +18001,26 @@ var _ParseAST = class {
|
|
|
17914
18001
|
this.rbracesExpected++;
|
|
17915
18002
|
do {
|
|
17916
18003
|
const keyStart = this.inputIndex;
|
|
18004
|
+
if (this.next.isOperator("...")) {
|
|
18005
|
+
this.advance();
|
|
18006
|
+
keys.push({
|
|
18007
|
+
kind: "spread",
|
|
18008
|
+
span: this.span(keyStart),
|
|
18009
|
+
sourceSpan: this.sourceSpan(keyStart)
|
|
18010
|
+
});
|
|
18011
|
+
values.push(this.parsePipe());
|
|
18012
|
+
continue;
|
|
18013
|
+
}
|
|
17917
18014
|
const quoted = this.next.isString();
|
|
17918
18015
|
const key = this.expectIdentifierOrKeywordOrString();
|
|
18016
|
+
const keySpan = this.span(keyStart);
|
|
18017
|
+
const keySourceSpan = this.sourceSpan(keyStart);
|
|
17919
18018
|
const literalMapKey = {
|
|
18019
|
+
kind: "property",
|
|
17920
18020
|
key,
|
|
17921
|
-
quoted
|
|
18021
|
+
quoted,
|
|
18022
|
+
span: keySpan,
|
|
18023
|
+
sourceSpan: keySourceSpan
|
|
17922
18024
|
};
|
|
17923
18025
|
keys.push(literalMapKey);
|
|
17924
18026
|
if (quoted) {
|
|
@@ -17928,9 +18030,7 @@ var _ParseAST = class {
|
|
|
17928
18030
|
values.push(this.parsePipe());
|
|
17929
18031
|
} else {
|
|
17930
18032
|
literalMapKey.isShorthandInitialized = true;
|
|
17931
|
-
|
|
17932
|
-
const sourceSpan = this.sourceSpan(keyStart);
|
|
17933
|
-
values.push(new PropertyRead(span, sourceSpan, sourceSpan, new ImplicitReceiver(span, sourceSpan), key));
|
|
18033
|
+
values.push(new PropertyRead(keySpan, keySourceSpan, keySourceSpan, new ImplicitReceiver(keySpan, keySourceSpan), key));
|
|
17934
18034
|
}
|
|
17935
18035
|
} while (this.consumeOptionalCharacter($COMMA) && !this.next.isCharacter($RBRACE));
|
|
17936
18036
|
this.rbracesExpected--;
|
|
@@ -17985,13 +18085,26 @@ var _ParseAST = class {
|
|
|
17985
18085
|
return isSafe ? new SafeCall(span, sourceSpan, receiver, args, argumentSpan) : new Call(span, sourceSpan, receiver, args, argumentSpan);
|
|
17986
18086
|
}
|
|
17987
18087
|
parseCallArguments() {
|
|
17988
|
-
if (this.next.isCharacter($RPAREN))
|
|
18088
|
+
if (this.next.isCharacter($RPAREN)) {
|
|
18089
|
+
return [];
|
|
18090
|
+
}
|
|
17989
18091
|
const positionals = [];
|
|
17990
18092
|
do {
|
|
17991
|
-
positionals.push(this.parsePipe());
|
|
18093
|
+
positionals.push(this.next.isOperator("...") ? this.parseSpreadElement() : this.parsePipe());
|
|
17992
18094
|
} while (this.consumeOptionalCharacter($COMMA));
|
|
17993
18095
|
return positionals;
|
|
17994
18096
|
}
|
|
18097
|
+
parseSpreadElement() {
|
|
18098
|
+
if (!this.next.isOperator("...")) {
|
|
18099
|
+
this.error("Spread element must start with '...' operator");
|
|
18100
|
+
}
|
|
18101
|
+
const spreadStart = this.inputIndex;
|
|
18102
|
+
this.advance();
|
|
18103
|
+
const expression = this.parsePipe();
|
|
18104
|
+
const span = this.span(spreadStart);
|
|
18105
|
+
const sourceSpan = this.sourceSpan(spreadStart);
|
|
18106
|
+
return new SpreadElement(span, sourceSpan, expression);
|
|
18107
|
+
}
|
|
17995
18108
|
expectTemplateBindingKey() {
|
|
17996
18109
|
let result = "";
|
|
17997
18110
|
let operatorFound = false;
|
|
@@ -18284,7 +18397,12 @@ var SerializeExpressionVisitor = class {
|
|
|
18284
18397
|
return `[${ast.expressions.map((e) => e.visit(this, context)).join(", ")}]`;
|
|
18285
18398
|
}
|
|
18286
18399
|
visitLiteralMap(ast, context) {
|
|
18287
|
-
return `{${zip(ast.keys.map((literal2) =>
|
|
18400
|
+
return `{${zip(ast.keys.map((literal2) => {
|
|
18401
|
+
if (literal2.kind === "spread") {
|
|
18402
|
+
return "...";
|
|
18403
|
+
}
|
|
18404
|
+
return literal2.quoted ? `'${literal2.key}'` : literal2.key;
|
|
18405
|
+
}), ast.values.map((value) => value.visit(this, context))).map(([key, value]) => `${key}: ${value}`).join(", ")}}`;
|
|
18288
18406
|
}
|
|
18289
18407
|
visitLiteralPrimitive(ast) {
|
|
18290
18408
|
if (ast.value === null) return "null";
|
|
@@ -18310,7 +18428,7 @@ var SerializeExpressionVisitor = class {
|
|
|
18310
18428
|
return `${ast.expression.visit(this, context)}!`;
|
|
18311
18429
|
}
|
|
18312
18430
|
visitPropertyRead(ast, context) {
|
|
18313
|
-
if (ast.receiver instanceof ImplicitReceiver) {
|
|
18431
|
+
if (ast.receiver instanceof ImplicitReceiver || ast.receiver instanceof ThisReceiver) {
|
|
18314
18432
|
return ast.name;
|
|
18315
18433
|
} else {
|
|
18316
18434
|
return `${ast.receiver.visit(this, context)}.${ast.name}`;
|
|
@@ -18357,6 +18475,9 @@ var SerializeExpressionVisitor = class {
|
|
|
18357
18475
|
visitTaggedTemplateLiteral(ast, context) {
|
|
18358
18476
|
return ast.tag.visit(this, context) + ast.template.visit(this, context);
|
|
18359
18477
|
}
|
|
18478
|
+
visitSpreadElement(ast, context) {
|
|
18479
|
+
return `...${ast.expression.visit(this, context)}`;
|
|
18480
|
+
}
|
|
18360
18481
|
visitParenthesizedExpression(ast, context) {
|
|
18361
18482
|
return "(" + ast.expression.visit(this, context) + ")";
|
|
18362
18483
|
}
|
|
@@ -18382,7 +18503,7 @@ function SECURITY_SCHEMA() {
|
|
|
18382
18503
|
registerContext(SecurityContext.HTML, ["iframe|srcdoc", "*|innerHTML", "*|outerHTML"]);
|
|
18383
18504
|
registerContext(SecurityContext.STYLE, ["*|style"]);
|
|
18384
18505
|
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"]);
|
|
18506
|
+
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
18507
|
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
18508
|
}
|
|
18388
18509
|
return _SECURITY_SCHEMA;
|
|
@@ -20270,6 +20391,8 @@ var UPDATE_ORDERING = [{
|
|
|
20270
20391
|
test: nonInterpolationPropertyKindTest
|
|
20271
20392
|
}, {
|
|
20272
20393
|
test: kindWithInterpolationTest(OpKind.Attribute, false)
|
|
20394
|
+
}, {
|
|
20395
|
+
test: kindTest(OpKind.Control)
|
|
20273
20396
|
}];
|
|
20274
20397
|
var UPDATE_HOST_ORDERING = [{
|
|
20275
20398
|
test: kindWithInterpolationTest(OpKind.DomProperty, true)
|
|
@@ -20288,7 +20411,7 @@ var UPDATE_HOST_ORDERING = [{
|
|
|
20288
20411
|
}, {
|
|
20289
20412
|
test: kindTest(OpKind.ClassProp)
|
|
20290
20413
|
}];
|
|
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]);
|
|
20414
|
+
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
20415
|
function orderOps(job) {
|
|
20293
20416
|
for (const unit of job.units) {
|
|
20294
20417
|
orderWithin(unit.create, CREATE_ORDERING);
|
|
@@ -20551,6 +20674,16 @@ function transformLiteralArray(expr) {
|
|
|
20551
20674
|
const derivedEntries = [];
|
|
20552
20675
|
const nonConstantArgs = [];
|
|
20553
20676
|
for (const entry of expr.entries) {
|
|
20677
|
+
if (entry instanceof SpreadElementExpr) {
|
|
20678
|
+
if (entry.expression.isConstant()) {
|
|
20679
|
+
derivedEntries.push(entry);
|
|
20680
|
+
} else {
|
|
20681
|
+
const idx = nonConstantArgs.length;
|
|
20682
|
+
nonConstantArgs.push(entry.expression);
|
|
20683
|
+
derivedEntries.push(new SpreadElementExpr(new PureFunctionParameterExpr(idx)));
|
|
20684
|
+
}
|
|
20685
|
+
continue;
|
|
20686
|
+
}
|
|
20554
20687
|
if (entry.isConstant()) {
|
|
20555
20688
|
derivedEntries.push(entry);
|
|
20556
20689
|
} else {
|
|
@@ -20566,15 +20699,25 @@ function transformLiteralMap(expr) {
|
|
|
20566
20699
|
let derivedEntries = [];
|
|
20567
20700
|
const nonConstantArgs = [];
|
|
20568
20701
|
for (const entry of expr.entries) {
|
|
20702
|
+
if (entry instanceof LiteralMapSpreadAssignment) {
|
|
20703
|
+
if (entry.expression.isConstant()) {
|
|
20704
|
+
derivedEntries.push(entry);
|
|
20705
|
+
} else {
|
|
20706
|
+
const idx = nonConstantArgs.length;
|
|
20707
|
+
nonConstantArgs.push(entry.expression);
|
|
20708
|
+
derivedEntries.push(new LiteralMapSpreadAssignment(new PureFunctionParameterExpr(idx)));
|
|
20709
|
+
}
|
|
20710
|
+
continue;
|
|
20711
|
+
}
|
|
20569
20712
|
if (entry.value.isConstant()) {
|
|
20570
20713
|
derivedEntries.push(entry);
|
|
20571
20714
|
} else {
|
|
20572
20715
|
const idx = nonConstantArgs.length;
|
|
20573
20716
|
nonConstantArgs.push(entry.value);
|
|
20574
|
-
derivedEntries.push(new
|
|
20717
|
+
derivedEntries.push(new LiteralMapPropertyAssignment(entry.key, new PureFunctionParameterExpr(idx), entry.quoted));
|
|
20575
20718
|
}
|
|
20576
20719
|
}
|
|
20577
|
-
return new PureFunctionExpr(
|
|
20720
|
+
return new PureFunctionExpr(new LiteralMapExpr(derivedEntries), nonConstantArgs);
|
|
20578
20721
|
}
|
|
20579
20722
|
__name(transformLiteralMap, "transformLiteralMap");
|
|
20580
20723
|
function optimizeRegularExpressions(job) {
|
|
@@ -20902,13 +21045,14 @@ function property(name, expression, sanitizer, sourceSpan) {
|
|
|
20902
21045
|
return propertyBase(Identifiers.property, name, expression, sanitizer, sourceSpan);
|
|
20903
21046
|
}
|
|
20904
21047
|
__name(property, "property");
|
|
20905
|
-
function control(expression, sanitizer, sourceSpan) {
|
|
21048
|
+
function control(name, expression, sanitizer, sourceSpan) {
|
|
20906
21049
|
const args = [];
|
|
20907
21050
|
if (expression instanceof Interpolation2) {
|
|
20908
21051
|
args.push(interpolationToExpression(expression, sourceSpan));
|
|
20909
21052
|
} else {
|
|
20910
21053
|
args.push(expression);
|
|
20911
21054
|
}
|
|
21055
|
+
args.push(literal(name));
|
|
20912
21056
|
if (sanitizer !== null) {
|
|
20913
21057
|
args.push(sanitizer);
|
|
20914
21058
|
}
|
|
@@ -21021,7 +21165,7 @@ function pipeBindV(slot, varOffset, args) {
|
|
|
21021
21165
|
__name(pipeBindV, "pipeBindV");
|
|
21022
21166
|
function textInterpolate(strings, expressions, sourceSpan) {
|
|
21023
21167
|
const interpolationArgs = collateInterpolationArgs(strings, expressions);
|
|
21024
|
-
return callVariadicInstruction(TEXT_INTERPOLATE_CONFIG, [], interpolationArgs,
|
|
21168
|
+
return callVariadicInstruction(TEXT_INTERPOLATE_CONFIG, [], interpolationArgs, sourceSpan);
|
|
21025
21169
|
}
|
|
21026
21170
|
__name(textInterpolate, "textInterpolate");
|
|
21027
21171
|
function i18nExp(expr, sourceSpan) {
|
|
@@ -21066,7 +21210,7 @@ function syntheticHostProperty(name, expression, sourceSpan) {
|
|
|
21066
21210
|
}
|
|
21067
21211
|
__name(syntheticHostProperty, "syntheticHostProperty");
|
|
21068
21212
|
function pureFunction(varOffset, fn2, args) {
|
|
21069
|
-
return callVariadicInstructionExpr(PURE_FUNCTION_CONFIG, [literal(varOffset), fn2], args,
|
|
21213
|
+
return callVariadicInstructionExpr(PURE_FUNCTION_CONFIG, [literal(varOffset), fn2], args, null);
|
|
21070
21214
|
}
|
|
21071
21215
|
__name(pureFunction, "pureFunction");
|
|
21072
21216
|
function attachSourceLocation(templatePath, locations) {
|
|
@@ -21092,7 +21236,7 @@ function collateInterpolationArgs(strings, expressions) {
|
|
|
21092
21236
|
__name(collateInterpolationArgs, "collateInterpolationArgs");
|
|
21093
21237
|
function interpolationToExpression(interpolation, sourceSpan) {
|
|
21094
21238
|
const interpolationArgs = collateInterpolationArgs(interpolation.strings, interpolation.expressions);
|
|
21095
|
-
return callVariadicInstructionExpr(VALUE_INTERPOLATE_CONFIG, [], interpolationArgs,
|
|
21239
|
+
return callVariadicInstructionExpr(VALUE_INTERPOLATE_CONFIG, [], interpolationArgs, sourceSpan);
|
|
21096
21240
|
}
|
|
21097
21241
|
__name(interpolationToExpression, "interpolationToExpression");
|
|
21098
21242
|
function call(instruction, args, sourceSpan) {
|
|
@@ -21133,23 +21277,23 @@ var PURE_FUNCTION_CONFIG = {
|
|
|
21133
21277
|
variable: Identifiers.pureFunctionV,
|
|
21134
21278
|
mapping: /* @__PURE__ */ __name((n) => n, "mapping")
|
|
21135
21279
|
};
|
|
21136
|
-
function callVariadicInstructionExpr(config, baseArgs, interpolationArgs,
|
|
21280
|
+
function callVariadicInstructionExpr(config, baseArgs, interpolationArgs, sourceSpan) {
|
|
21137
21281
|
const n = config.mapping(interpolationArgs.length);
|
|
21138
21282
|
const lastInterpolationArg = interpolationArgs.at(-1);
|
|
21139
|
-
if (
|
|
21283
|
+
if (interpolationArgs.length > 1 && lastInterpolationArg instanceof LiteralExpr && lastInterpolationArg.value === "") {
|
|
21140
21284
|
interpolationArgs.pop();
|
|
21141
21285
|
}
|
|
21142
21286
|
if (n < config.constant.length) {
|
|
21143
|
-
return importExpr(config.constant[n]).callFn([...baseArgs, ...interpolationArgs
|
|
21287
|
+
return importExpr(config.constant[n]).callFn([...baseArgs, ...interpolationArgs], sourceSpan);
|
|
21144
21288
|
} else if (config.variable !== null) {
|
|
21145
|
-
return importExpr(config.variable).callFn([...baseArgs, literalArr(interpolationArgs)
|
|
21289
|
+
return importExpr(config.variable).callFn([...baseArgs, literalArr(interpolationArgs)], sourceSpan);
|
|
21146
21290
|
} else {
|
|
21147
21291
|
throw new Error(`AssertionError: unable to call variadic function`);
|
|
21148
21292
|
}
|
|
21149
21293
|
}
|
|
21150
21294
|
__name(callVariadicInstructionExpr, "callVariadicInstructionExpr");
|
|
21151
|
-
function callVariadicInstruction(config, baseArgs, interpolationArgs,
|
|
21152
|
-
return createStatementOp(callVariadicInstructionExpr(config, baseArgs, interpolationArgs,
|
|
21295
|
+
function callVariadicInstruction(config, baseArgs, interpolationArgs, sourceSpan) {
|
|
21296
|
+
return createStatementOp(callVariadicInstructionExpr(config, baseArgs, interpolationArgs, sourceSpan).toStmt());
|
|
21153
21297
|
}
|
|
21154
21298
|
__name(callVariadicInstruction, "callVariadicInstruction");
|
|
21155
21299
|
var GLOBAL_TARGET_RESOLVERS = /* @__PURE__ */ new Map([["window", Identifiers.resolveWindow], ["document", Identifiers.resolveDocument], ["body", Identifiers.resolveBody]]);
|
|
@@ -21497,7 +21641,7 @@ function reifyProperty(op) {
|
|
|
21497
21641
|
}
|
|
21498
21642
|
__name(reifyProperty, "reifyProperty");
|
|
21499
21643
|
function reifyControl(op) {
|
|
21500
|
-
return control(op.expression, op.sanitizer, op.sourceSpan);
|
|
21644
|
+
return control(op.name, op.expression, op.sanitizer, op.sourceSpan);
|
|
21501
21645
|
}
|
|
21502
21646
|
__name(reifyControl, "reifyControl");
|
|
21503
21647
|
function reifyIrExpression(expr) {
|
|
@@ -23336,7 +23480,7 @@ function ingestElement(unit, element2) {
|
|
|
23336
23480
|
ingestNodes(unit, element2.children);
|
|
23337
23481
|
const endOp = createElementEndOp(id, element2.endSourceSpan ?? element2.startSourceSpan);
|
|
23338
23482
|
unit.create.push(endOp);
|
|
23339
|
-
const fieldInput = element2.inputs.find((input) => input.name === "
|
|
23483
|
+
const fieldInput = element2.inputs.find((input) => input.name === "formField" && input.type === BindingType.Property);
|
|
23340
23484
|
if (fieldInput) {
|
|
23341
23485
|
unit.create.push(createControlCreateOp(fieldInput.sourceSpan));
|
|
23342
23486
|
}
|
|
@@ -23452,32 +23596,34 @@ function ingestIfBlock(unit, ifBlock) {
|
|
|
23452
23596
|
}
|
|
23453
23597
|
__name(ingestIfBlock, "ingestIfBlock");
|
|
23454
23598
|
function ingestSwitchBlock(unit, switchBlock) {
|
|
23455
|
-
if (switchBlock.
|
|
23599
|
+
if (switchBlock.groups.length === 0) {
|
|
23456
23600
|
return;
|
|
23457
23601
|
}
|
|
23458
23602
|
let firstXref = null;
|
|
23459
23603
|
let conditions = [];
|
|
23460
|
-
for (let i = 0; i < switchBlock.
|
|
23461
|
-
const
|
|
23604
|
+
for (let i = 0; i < switchBlock.groups.length; i++) {
|
|
23605
|
+
const switchCaseGroup = switchBlock.groups[i];
|
|
23462
23606
|
const cView = unit.job.allocateView(unit.xref);
|
|
23463
|
-
const tagName = ingestControlFlowInsertionPoint(unit, cView.xref,
|
|
23607
|
+
const tagName = ingestControlFlowInsertionPoint(unit, cView.xref, switchCaseGroup);
|
|
23464
23608
|
let switchCaseI18nMeta = void 0;
|
|
23465
|
-
if (
|
|
23466
|
-
if (!(
|
|
23467
|
-
throw Error(`Unhandled i18n metadata type for switch block: ${
|
|
23609
|
+
if (switchCaseGroup.i18n !== void 0) {
|
|
23610
|
+
if (!(switchCaseGroup.i18n instanceof BlockPlaceholder)) {
|
|
23611
|
+
throw Error(`Unhandled i18n metadata type for switch block: ${switchCaseGroup.i18n?.constructor.name}`);
|
|
23468
23612
|
}
|
|
23469
|
-
switchCaseI18nMeta =
|
|
23613
|
+
switchCaseI18nMeta = switchCaseGroup.i18n;
|
|
23470
23614
|
}
|
|
23471
23615
|
const createOp = i === 0 ? createConditionalCreateOp : createConditionalBranchCreateOp;
|
|
23472
|
-
const conditionalCreateOp = createOp(cView.xref, TemplateKind.Block, tagName, "Case", Namespace.HTML, switchCaseI18nMeta,
|
|
23616
|
+
const conditionalCreateOp = createOp(cView.xref, TemplateKind.Block, tagName, "Case", Namespace.HTML, switchCaseI18nMeta, switchCaseGroup.startSourceSpan, switchCaseGroup.sourceSpan);
|
|
23473
23617
|
unit.create.push(conditionalCreateOp);
|
|
23474
23618
|
if (firstXref === null) {
|
|
23475
23619
|
firstXref = cView.xref;
|
|
23476
23620
|
}
|
|
23477
|
-
const
|
|
23478
|
-
|
|
23479
|
-
|
|
23480
|
-
|
|
23621
|
+
for (const switchCase of switchCaseGroup.cases) {
|
|
23622
|
+
const caseExpr = switchCase.expression ? convertAst(switchCase.expression, unit.job, switchBlock.startSourceSpan) : null;
|
|
23623
|
+
const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr, conditionalCreateOp.xref, conditionalCreateOp.handle);
|
|
23624
|
+
conditions.push(conditionalCaseExpr);
|
|
23625
|
+
}
|
|
23626
|
+
ingestNodes(cView, switchCaseGroup.children);
|
|
23481
23627
|
}
|
|
23482
23628
|
unit.update.push(createConditionalOp(firstXref, convertAst(switchBlock.expression, unit.job, null), conditions, switchBlock.sourceSpan));
|
|
23483
23629
|
}
|
|
@@ -23712,8 +23858,7 @@ function convertAst(ast, job, baseSourceSpan) {
|
|
|
23712
23858
|
if (ast instanceof ASTWithSource) {
|
|
23713
23859
|
return convertAst(ast.ast, job, baseSourceSpan);
|
|
23714
23860
|
} else if (ast instanceof PropertyRead) {
|
|
23715
|
-
|
|
23716
|
-
if (isImplicitReceiver) {
|
|
23861
|
+
if (ast.receiver instanceof ImplicitReceiver) {
|
|
23717
23862
|
return new LexicalReadExpr(ast.name);
|
|
23718
23863
|
} else {
|
|
23719
23864
|
return new ReadPropExpr(convertAst(ast.receiver, job, baseSourceSpan), ast.name, null, convertSourceSpan(ast.span, baseSourceSpan));
|
|
@@ -23749,8 +23894,8 @@ function convertAst(ast, job, baseSourceSpan) {
|
|
|
23749
23894
|
throw new Error(`AssertionError: Chain in unknown context`);
|
|
23750
23895
|
} else if (ast instanceof LiteralMap) {
|
|
23751
23896
|
const entries = ast.keys.map((key, idx) => {
|
|
23752
|
-
const value = ast.values[idx];
|
|
23753
|
-
return new
|
|
23897
|
+
const value = convertAst(ast.values[idx], job, baseSourceSpan);
|
|
23898
|
+
return key.kind === "spread" ? new LiteralMapSpreadAssignment(value) : new LiteralMapPropertyAssignment(key.key, value, key.quoted);
|
|
23754
23899
|
});
|
|
23755
23900
|
return new LiteralMapExpr(entries, void 0, convertSourceSpan(ast.span, baseSourceSpan));
|
|
23756
23901
|
} else if (ast instanceof LiteralArray) {
|
|
@@ -23783,6 +23928,8 @@ function convertAst(ast, job, baseSourceSpan) {
|
|
|
23783
23928
|
return new ParenthesizedExpr(convertAst(ast.expression, job, baseSourceSpan), void 0, convertSourceSpan(ast.span, baseSourceSpan));
|
|
23784
23929
|
} else if (ast instanceof RegularExpressionLiteral) {
|
|
23785
23930
|
return new RegularExpressionLiteralExpr(ast.body, ast.flags, baseSourceSpan);
|
|
23931
|
+
} else if (ast instanceof SpreadElement) {
|
|
23932
|
+
return new SpreadElementExpr(convertAst(ast.expression, job, baseSourceSpan));
|
|
23786
23933
|
} else {
|
|
23787
23934
|
throw new Error(`Unhandled expression type "${ast.constructor.name}" in file "${baseSourceSpan?.start.file.url}"`);
|
|
23788
23935
|
}
|
|
@@ -24508,7 +24655,7 @@ var BindingParser = class {
|
|
|
24508
24655
|
if (ast instanceof NonNullAssert) {
|
|
24509
24656
|
return this._isAllowedAssignmentEvent(ast.expression);
|
|
24510
24657
|
}
|
|
24511
|
-
if (ast instanceof Call && ast.args.length === 1 && ast.receiver instanceof PropertyRead && ast.receiver.name === "$any" && ast.receiver.receiver instanceof ImplicitReceiver
|
|
24658
|
+
if (ast instanceof Call && ast.args.length === 1 && ast.receiver instanceof PropertyRead && ast.receiver.name === "$any" && ast.receiver.receiver instanceof ImplicitReceiver) {
|
|
24512
24659
|
return this._isAllowedAssignmentEvent(ast.args[0]);
|
|
24513
24660
|
}
|
|
24514
24661
|
if (ast instanceof PropertyRead || ast instanceof KeyedRead) {
|
|
@@ -24729,30 +24876,46 @@ __name(createForLoop, "createForLoop");
|
|
|
24729
24876
|
function createSwitchBlock(ast, visitor, bindingParser) {
|
|
24730
24877
|
const errors = validateSwitchBlock(ast);
|
|
24731
24878
|
const primaryExpression = ast.parameters.length > 0 ? parseBlockParameterToBinding(ast.parameters[0], bindingParser) : bindingParser.parseBinding("", false, ast.sourceSpan, 0);
|
|
24732
|
-
const
|
|
24879
|
+
const groups = [];
|
|
24733
24880
|
const unknownBlocks = [];
|
|
24734
|
-
let
|
|
24735
|
-
|
|
24736
|
-
|
|
24881
|
+
let collectedCases = [];
|
|
24882
|
+
let firstCaseStart = null;
|
|
24883
|
+
for (const node2 of ast.children) {
|
|
24884
|
+
if (!(node2 instanceof Block)) {
|
|
24737
24885
|
continue;
|
|
24738
24886
|
}
|
|
24739
|
-
if ((
|
|
24740
|
-
unknownBlocks.push(new UnknownBlock(
|
|
24887
|
+
if ((node2.name !== "case" || node2.parameters.length === 0) && node2.name !== "default") {
|
|
24888
|
+
unknownBlocks.push(new UnknownBlock(node2.name, node2.sourceSpan, node2.nameSpan));
|
|
24741
24889
|
continue;
|
|
24742
24890
|
}
|
|
24743
|
-
const
|
|
24744
|
-
|
|
24745
|
-
if (
|
|
24746
|
-
|
|
24747
|
-
} else {
|
|
24748
|
-
cases.push(ast2);
|
|
24891
|
+
const isCase = node2.name === "case";
|
|
24892
|
+
let expression = null;
|
|
24893
|
+
if (isCase) {
|
|
24894
|
+
expression = parseBlockParameterToBinding(node2.parameters[0], bindingParser);
|
|
24749
24895
|
}
|
|
24896
|
+
const switchCase = new SwitchBlockCase(expression, node2.sourceSpan, node2.startSourceSpan, node2.endSourceSpan, node2.nameSpan);
|
|
24897
|
+
collectedCases.push(switchCase);
|
|
24898
|
+
const caseWithoutBody = node2.children.length === 0 && node2.endSourceSpan !== null && node2.endSourceSpan.start.offset === node2.endSourceSpan.end.offset;
|
|
24899
|
+
if (caseWithoutBody) {
|
|
24900
|
+
if (firstCaseStart === null) {
|
|
24901
|
+
firstCaseStart = node2.sourceSpan;
|
|
24902
|
+
}
|
|
24903
|
+
continue;
|
|
24904
|
+
}
|
|
24905
|
+
let sourceSpan = node2.sourceSpan;
|
|
24906
|
+
let startSourceSpan = node2.startSourceSpan;
|
|
24907
|
+
if (firstCaseStart !== null) {
|
|
24908
|
+
sourceSpan = new ParseSourceSpan(firstCaseStart.start, node2.sourceSpan.end);
|
|
24909
|
+
startSourceSpan = new ParseSourceSpan(firstCaseStart.start, node2.startSourceSpan.end);
|
|
24910
|
+
firstCaseStart = null;
|
|
24911
|
+
}
|
|
24912
|
+
const group = new SwitchBlockCaseGroup(collectedCases, visitAll(visitor, node2.children, node2.children), sourceSpan, startSourceSpan, node2.endSourceSpan, node2.nameSpan, node2.i18n);
|
|
24913
|
+
groups.push(group);
|
|
24914
|
+
collectedCases = [];
|
|
24750
24915
|
}
|
|
24751
|
-
|
|
24752
|
-
cases.push(defaultCase);
|
|
24753
|
-
}
|
|
24916
|
+
const node = new SwitchBlock(primaryExpression, groups, unknownBlocks, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan, ast.nameSpan);
|
|
24754
24917
|
return {
|
|
24755
|
-
node
|
|
24918
|
+
node,
|
|
24756
24919
|
errors
|
|
24757
24920
|
};
|
|
24758
24921
|
}
|
|
@@ -25297,17 +25460,19 @@ function createViewportTrigger(start, isHydrationTrigger, bindingParser, paramet
|
|
|
25297
25460
|
const parsed = bindingParser.parseBinding(parameters[0].expression, false, sourceSpan, sourceSpan.start.offset + start + parameters[0].start);
|
|
25298
25461
|
if (!(parsed.ast instanceof LiteralMap)) {
|
|
25299
25462
|
throw new Error('Options parameter of the "viewport" trigger must be an object literal');
|
|
25300
|
-
} else if (parsed.ast.keys.some((key) => key.
|
|
25463
|
+
} else if (parsed.ast.keys.some((key) => key.kind === "spread")) {
|
|
25464
|
+
throw new Error("Spread operator are not allowed in this context");
|
|
25465
|
+
} else if (parsed.ast.keys.some((key) => key.kind === "property" && key.key === "root")) {
|
|
25301
25466
|
throw new Error('The "root" option is not supported in the options parameter of the "viewport" trigger');
|
|
25302
25467
|
}
|
|
25303
|
-
const triggerIndex = parsed.ast.keys.findIndex((key) => key.key === "trigger");
|
|
25468
|
+
const triggerIndex = parsed.ast.keys.findIndex((key) => key.kind === "property" && key.key === "trigger");
|
|
25304
25469
|
if (triggerIndex === -1) {
|
|
25305
25470
|
reference2 = null;
|
|
25306
25471
|
options = parsed.ast;
|
|
25307
25472
|
} else {
|
|
25308
25473
|
const value = parsed.ast.values[triggerIndex];
|
|
25309
25474
|
const triggerFilter = /* @__PURE__ */ __name((_, index) => index !== triggerIndex, "triggerFilter");
|
|
25310
|
-
if (!(value instanceof PropertyRead) || !(value.receiver instanceof ImplicitReceiver)
|
|
25475
|
+
if (!(value instanceof PropertyRead) || !(value.receiver instanceof ImplicitReceiver)) {
|
|
25311
25476
|
throw new Error(`"trigger" option of the "viewport" trigger must be an identifier`);
|
|
25312
25477
|
}
|
|
25313
25478
|
reference2 = value.name;
|
|
@@ -26759,10 +26924,13 @@ var CombinedRecursiveAstVisitor = class extends RecursiveAstVisitor2 {
|
|
|
26759
26924
|
}
|
|
26760
26925
|
visitSwitchBlock(block) {
|
|
26761
26926
|
this.visit(block.expression);
|
|
26762
|
-
this.visitAllTemplateNodes(block.
|
|
26927
|
+
this.visitAllTemplateNodes(block.groups);
|
|
26763
26928
|
}
|
|
26764
26929
|
visitSwitchBlockCase(block) {
|
|
26765
26930
|
block.expression && this.visit(block.expression);
|
|
26931
|
+
}
|
|
26932
|
+
visitSwitchBlockCaseGroup(block) {
|
|
26933
|
+
this.visitAllTemplateNodes(block.cases);
|
|
26766
26934
|
this.visitAllTemplateNodes(block.children);
|
|
26767
26935
|
}
|
|
26768
26936
|
visitForLoopBlock(block) {
|
|
@@ -26933,7 +27101,7 @@ var Scope2 = class _Scope {
|
|
|
26933
27101
|
this.visitVariable(nodeOrNodes.item);
|
|
26934
27102
|
nodeOrNodes.contextVariables.forEach((v) => this.visitVariable(v));
|
|
26935
27103
|
nodeOrNodes.children.forEach((node) => node.visit(this));
|
|
26936
|
-
} else if (nodeOrNodes instanceof
|
|
27104
|
+
} else if (nodeOrNodes instanceof SwitchBlockCaseGroup || nodeOrNodes instanceof ForLoopBlockEmpty || nodeOrNodes instanceof DeferredBlock || nodeOrNodes instanceof DeferredBlockError || nodeOrNodes instanceof DeferredBlockPlaceholder || nodeOrNodes instanceof DeferredBlockLoading || nodeOrNodes instanceof Content) {
|
|
26937
27105
|
nodeOrNodes.children.forEach((node) => node.visit(this));
|
|
26938
27106
|
} else if (!(nodeOrNodes instanceof HostElement)) {
|
|
26939
27107
|
nodeOrNodes.forEach((node) => node.visit(this));
|
|
@@ -26969,9 +27137,11 @@ var Scope2 = class _Scope {
|
|
|
26969
27137
|
this.ingestScopedNode(block);
|
|
26970
27138
|
}
|
|
26971
27139
|
visitSwitchBlock(block) {
|
|
26972
|
-
block.
|
|
27140
|
+
block.groups.forEach((node) => node.visit(this));
|
|
26973
27141
|
}
|
|
26974
27142
|
visitSwitchBlockCase(block) {
|
|
27143
|
+
}
|
|
27144
|
+
visitSwitchBlockCaseGroup(block) {
|
|
26975
27145
|
this.ingestScopedNode(block);
|
|
26976
27146
|
}
|
|
26977
27147
|
visitForLoopBlock(block) {
|
|
@@ -27099,9 +27269,11 @@ var DirectiveBinder = class _DirectiveBinder {
|
|
|
27099
27269
|
block.children.forEach((child) => child.visit(this));
|
|
27100
27270
|
}
|
|
27101
27271
|
visitSwitchBlock(block) {
|
|
27102
|
-
block.
|
|
27272
|
+
block.groups.forEach((node) => node.visit(this));
|
|
27103
27273
|
}
|
|
27104
27274
|
visitSwitchBlockCase(block) {
|
|
27275
|
+
}
|
|
27276
|
+
visitSwitchBlockCaseGroup(block) {
|
|
27105
27277
|
block.children.forEach((node) => node.visit(this));
|
|
27106
27278
|
}
|
|
27107
27279
|
visitForLoopBlock(block) {
|
|
@@ -27302,7 +27474,7 @@ var TemplateBinder = class _TemplateBinder extends CombinedRecursiveAstVisitor {
|
|
|
27302
27474
|
this.deferBlocks.push([nodeOrNodes, this.scope]);
|
|
27303
27475
|
nodeOrNodes.children.forEach((node) => node.visit(this));
|
|
27304
27476
|
this.nestingLevel.set(nodeOrNodes, this.level);
|
|
27305
|
-
} else if (nodeOrNodes instanceof
|
|
27477
|
+
} else if (nodeOrNodes instanceof SwitchBlockCaseGroup || nodeOrNodes instanceof ForLoopBlockEmpty || nodeOrNodes instanceof DeferredBlockError || nodeOrNodes instanceof DeferredBlockPlaceholder || nodeOrNodes instanceof DeferredBlockLoading || nodeOrNodes instanceof Content) {
|
|
27306
27478
|
nodeOrNodes.children.forEach((node) => node.visit(this));
|
|
27307
27479
|
this.nestingLevel.set(nodeOrNodes, this.level);
|
|
27308
27480
|
} else if (nodeOrNodes instanceof HostElement) {
|
|
@@ -27350,6 +27522,9 @@ var TemplateBinder = class _TemplateBinder extends CombinedRecursiveAstVisitor {
|
|
|
27350
27522
|
}
|
|
27351
27523
|
visitSwitchBlockCase(block) {
|
|
27352
27524
|
block.expression?.visit(this);
|
|
27525
|
+
}
|
|
27526
|
+
visitSwitchBlockCaseGroup(block) {
|
|
27527
|
+
block.cases.forEach((caseNode) => caseNode.visit(this));
|
|
27353
27528
|
this.ingestScopedNode(block);
|
|
27354
27529
|
}
|
|
27355
27530
|
visitForLoopBlock(block) {
|
|
@@ -27394,7 +27569,7 @@ var TemplateBinder = class _TemplateBinder extends CombinedRecursiveAstVisitor {
|
|
|
27394
27569
|
binder.ingest(node);
|
|
27395
27570
|
}
|
|
27396
27571
|
maybeMap(ast, name) {
|
|
27397
|
-
if (!(ast.receiver instanceof ImplicitReceiver)
|
|
27572
|
+
if (!(ast.receiver instanceof ImplicitReceiver)) {
|
|
27398
27573
|
return;
|
|
27399
27574
|
}
|
|
27400
27575
|
const target = this.scope.lookup(name);
|
|
@@ -29909,7 +30084,7 @@ var MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = "18.0.0";
|
|
|
29909
30084
|
function compileDeclareClassMetadata(metadata) {
|
|
29910
30085
|
const definitionMap = new DefinitionMap();
|
|
29911
30086
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
|
|
29912
|
-
definitionMap.set("version", literal("21.
|
|
30087
|
+
definitionMap.set("version", literal("21.1.1"));
|
|
29913
30088
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
29914
30089
|
definitionMap.set("type", metadata.type);
|
|
29915
30090
|
definitionMap.set("decorators", metadata.decorators);
|
|
@@ -29928,7 +30103,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
|
|
|
29928
30103
|
callbackReturnDefinitionMap.set("ctorParameters", metadata.ctorParameters ?? literal(null));
|
|
29929
30104
|
callbackReturnDefinitionMap.set("propDecorators", metadata.propDecorators ?? literal(null));
|
|
29930
30105
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
|
|
29931
|
-
definitionMap.set("version", literal("21.
|
|
30106
|
+
definitionMap.set("version", literal("21.1.1"));
|
|
29932
30107
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
29933
30108
|
definitionMap.set("type", metadata.type);
|
|
29934
30109
|
definitionMap.set("resolveDeferredDeps", compileComponentMetadataAsyncResolver(dependencies));
|
|
@@ -30005,7 +30180,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
30005
30180
|
const definitionMap = new DefinitionMap();
|
|
30006
30181
|
const minVersion = getMinimumVersionForPartialOutput(meta);
|
|
30007
30182
|
definitionMap.set("minVersion", literal(minVersion));
|
|
30008
|
-
definitionMap.set("version", literal("21.
|
|
30183
|
+
definitionMap.set("version", literal("21.1.1"));
|
|
30009
30184
|
definitionMap.set("type", meta.type.value);
|
|
30010
30185
|
if (meta.isStandalone !== void 0) {
|
|
30011
30186
|
definitionMap.set("isStandalone", literal(meta.isStandalone));
|
|
@@ -30346,12 +30521,15 @@ var BlockPresenceVisitor = class extends RecursiveVisitor$1 {
|
|
|
30346
30521
|
visitSwitchBlockCase() {
|
|
30347
30522
|
this.hasBlocks = true;
|
|
30348
30523
|
}
|
|
30524
|
+
visitSwitchBlockCaseGroup() {
|
|
30525
|
+
this.hasBlocks = true;
|
|
30526
|
+
}
|
|
30349
30527
|
};
|
|
30350
30528
|
var MINIMUM_PARTIAL_LINKER_VERSION$4 = "12.0.0";
|
|
30351
30529
|
function compileDeclareFactoryFunction(meta) {
|
|
30352
30530
|
const definitionMap = new DefinitionMap();
|
|
30353
30531
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
|
|
30354
|
-
definitionMap.set("version", literal("21.
|
|
30532
|
+
definitionMap.set("version", literal("21.1.1"));
|
|
30355
30533
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
30356
30534
|
definitionMap.set("type", meta.type.value);
|
|
30357
30535
|
definitionMap.set("deps", compileDependencies(meta.deps));
|
|
@@ -30378,7 +30556,7 @@ __name(compileDeclareInjectableFromMetadata, "compileDeclareInjectableFromMetada
|
|
|
30378
30556
|
function createInjectableDefinitionMap(meta) {
|
|
30379
30557
|
const definitionMap = new DefinitionMap();
|
|
30380
30558
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
|
|
30381
|
-
definitionMap.set("version", literal("21.
|
|
30559
|
+
definitionMap.set("version", literal("21.1.1"));
|
|
30382
30560
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
30383
30561
|
definitionMap.set("type", meta.type.value);
|
|
30384
30562
|
if (meta.providedIn !== void 0) {
|
|
@@ -30420,7 +30598,7 @@ __name(compileDeclareInjectorFromMetadata, "compileDeclareInjectorFromMetadata")
|
|
|
30420
30598
|
function createInjectorDefinitionMap(meta) {
|
|
30421
30599
|
const definitionMap = new DefinitionMap();
|
|
30422
30600
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
|
|
30423
|
-
definitionMap.set("version", literal("21.
|
|
30601
|
+
definitionMap.set("version", literal("21.1.1"));
|
|
30424
30602
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
30425
30603
|
definitionMap.set("type", meta.type.value);
|
|
30426
30604
|
definitionMap.set("providers", meta.providers);
|
|
@@ -30448,7 +30626,7 @@ function createNgModuleDefinitionMap(meta) {
|
|
|
30448
30626
|
throw new Error("Invalid path! Local compilation mode should not get into the partial compilation path");
|
|
30449
30627
|
}
|
|
30450
30628
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
|
|
30451
|
-
definitionMap.set("version", literal("21.
|
|
30629
|
+
definitionMap.set("version", literal("21.1.1"));
|
|
30452
30630
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
30453
30631
|
definitionMap.set("type", meta.type.value);
|
|
30454
30632
|
if (meta.bootstrap.length > 0) {
|
|
@@ -30487,7 +30665,7 @@ __name(compileDeclarePipeFromMetadata, "compileDeclarePipeFromMetadata");
|
|
|
30487
30665
|
function createPipeDefinitionMap(meta) {
|
|
30488
30666
|
const definitionMap = new DefinitionMap();
|
|
30489
30667
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
30490
|
-
definitionMap.set("version", literal("21.
|
|
30668
|
+
definitionMap.set("version", literal("21.1.1"));
|
|
30491
30669
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
30492
30670
|
definitionMap.set("type", meta.type.value);
|
|
30493
30671
|
if (meta.isStandalone !== void 0) {
|
|
@@ -30562,7 +30740,7 @@ function compileHmrUpdateCallback(definitions, constantStatements, meta) {
|
|
|
30562
30740
|
return new DeclareFunctionStmt(`${meta.className}_UpdateMetadata`, params, body, null, StmtModifier.Final);
|
|
30563
30741
|
}
|
|
30564
30742
|
__name(compileHmrUpdateCallback, "compileHmrUpdateCallback");
|
|
30565
|
-
var VERSION = new Version("21.
|
|
30743
|
+
var VERSION = new Version("21.1.1");
|
|
30566
30744
|
publishFacade(_global);
|
|
30567
30745
|
// Annotate the CommonJS export names for ESM import in node:
|
|
30568
30746
|
0 && (module.exports = {
|
|
@@ -30638,6 +30816,8 @@ publishFacade(_global);
|
|
|
30638
30816
|
LiteralExpr,
|
|
30639
30817
|
LiteralMap,
|
|
30640
30818
|
LiteralMapExpr,
|
|
30819
|
+
LiteralMapPropertyAssignment,
|
|
30820
|
+
LiteralMapSpreadAssignment,
|
|
30641
30821
|
LiteralPrimitive,
|
|
30642
30822
|
LocalizedString,
|
|
30643
30823
|
MapType,
|
|
@@ -30690,6 +30870,8 @@ publishFacade(_global);
|
|
|
30690
30870
|
SelectorlessMatcher,
|
|
30691
30871
|
Serializer,
|
|
30692
30872
|
SplitInterpolation,
|
|
30873
|
+
SpreadElement,
|
|
30874
|
+
SpreadElementExpr,
|
|
30693
30875
|
Statement,
|
|
30694
30876
|
StmtModifier,
|
|
30695
30877
|
StringToken,
|
|
@@ -30734,6 +30916,7 @@ publishFacade(_global);
|
|
|
30734
30916
|
TmplAstReference,
|
|
30735
30917
|
TmplAstSwitchBlock,
|
|
30736
30918
|
TmplAstSwitchBlockCase,
|
|
30919
|
+
TmplAstSwitchBlockCaseGroup,
|
|
30737
30920
|
TmplAstTemplate,
|
|
30738
30921
|
TmplAstText,
|
|
30739
30922
|
TmplAstTextAttribute,
|
|
@@ -30828,8 +31011,8 @@ publishFacade(_global);
|
|
|
30828
31011
|
|
|
30829
31012
|
@angular/compiler/fesm2022/compiler.mjs:
|
|
30830
31013
|
(**
|
|
30831
|
-
* @license Angular v21.
|
|
30832
|
-
* (c) 2010-
|
|
31014
|
+
* @license Angular v21.1.1
|
|
31015
|
+
* (c) 2010-2026 Google LLC. https://angular.dev/
|
|
30833
31016
|
* License: MIT
|
|
30834
31017
|
*)
|
|
30835
31018
|
(**
|