@angular-eslint/bundled-angular-compiler 19.8.1-alpha.1 → 19.8.1
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 +1052 -2002
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -46,7 +46,6 @@ __export(index_exports, {
|
|
|
46
46
|
Comment: () => Comment2,
|
|
47
47
|
CompilerConfig: () => CompilerConfig,
|
|
48
48
|
CompilerFacadeImpl: () => CompilerFacadeImpl,
|
|
49
|
-
Component: () => Component2,
|
|
50
49
|
Conditional: () => Conditional,
|
|
51
50
|
ConditionalExpr: () => ConditionalExpr,
|
|
52
51
|
ConstantPool: () => ConstantPool,
|
|
@@ -55,7 +54,6 @@ __export(index_exports, {
|
|
|
55
54
|
DYNAMIC_TYPE: () => DYNAMIC_TYPE,
|
|
56
55
|
DeclareFunctionStmt: () => DeclareFunctionStmt,
|
|
57
56
|
DeclareVarStmt: () => DeclareVarStmt,
|
|
58
|
-
Directive: () => Directive2,
|
|
59
57
|
DomElementSchemaRegistry: () => DomElementSchemaRegistry,
|
|
60
58
|
DynamicImportExpr: () => DynamicImportExpr,
|
|
61
59
|
EOF: () => EOF,
|
|
@@ -103,8 +101,6 @@ __export(index_exports, {
|
|
|
103
101
|
NodeWithI18n: () => NodeWithI18n,
|
|
104
102
|
NonNullAssert: () => NonNullAssert,
|
|
105
103
|
NotExpr: () => NotExpr,
|
|
106
|
-
ParenthesizedExpr: () => ParenthesizedExpr,
|
|
107
|
-
ParenthesizedExpression: () => ParenthesizedExpression,
|
|
108
104
|
ParseError: () => ParseError,
|
|
109
105
|
ParseErrorLevel: () => ParseErrorLevel,
|
|
110
106
|
ParseLocation: () => ParseLocation,
|
|
@@ -122,6 +118,7 @@ __export(index_exports, {
|
|
|
122
118
|
PrefixNot: () => PrefixNot,
|
|
123
119
|
PropertyRead: () => PropertyRead,
|
|
124
120
|
PropertyWrite: () => PropertyWrite,
|
|
121
|
+
R3BoundTarget: () => R3BoundTarget,
|
|
125
122
|
R3Identifiers: () => Identifiers,
|
|
126
123
|
R3NgModuleMetadataKind: () => R3NgModuleMetadataKind,
|
|
127
124
|
R3SelectorScopeMode: () => R3SelectorScopeMode,
|
|
@@ -142,7 +139,6 @@ __export(index_exports, {
|
|
|
142
139
|
SelectorContext: () => SelectorContext,
|
|
143
140
|
SelectorListContext: () => SelectorListContext,
|
|
144
141
|
SelectorMatcher: () => SelectorMatcher,
|
|
145
|
-
SelectorlessMatcher: () => SelectorlessMatcher,
|
|
146
142
|
Serializer: () => Serializer,
|
|
147
143
|
SplitInterpolation: () => SplitInterpolation,
|
|
148
144
|
Statement: () => Statement,
|
|
@@ -150,7 +146,6 @@ __export(index_exports, {
|
|
|
150
146
|
StringToken: () => StringToken,
|
|
151
147
|
StringTokenKind: () => StringTokenKind,
|
|
152
148
|
TagContentType: () => TagContentType,
|
|
153
|
-
TaggedTemplateLiteral: () => TaggedTemplateLiteral,
|
|
154
149
|
TaggedTemplateLiteralExpr: () => TaggedTemplateLiteralExpr,
|
|
155
150
|
TemplateBindingParseResult: () => TemplateBindingParseResult,
|
|
156
151
|
TemplateLiteral: () => TemplateLiteral,
|
|
@@ -164,18 +159,15 @@ __export(index_exports, {
|
|
|
164
159
|
TmplAstBoundDeferredTrigger: () => BoundDeferredTrigger,
|
|
165
160
|
TmplAstBoundEvent: () => BoundEvent,
|
|
166
161
|
TmplAstBoundText: () => BoundText,
|
|
167
|
-
TmplAstComponent: () => Component$1,
|
|
168
162
|
TmplAstContent: () => Content,
|
|
169
163
|
TmplAstDeferredBlock: () => DeferredBlock,
|
|
170
164
|
TmplAstDeferredBlockError: () => DeferredBlockError,
|
|
171
165
|
TmplAstDeferredBlockLoading: () => DeferredBlockLoading,
|
|
172
166
|
TmplAstDeferredBlockPlaceholder: () => DeferredBlockPlaceholder,
|
|
173
167
|
TmplAstDeferredTrigger: () => DeferredTrigger,
|
|
174
|
-
TmplAstDirective: () => Directive$1,
|
|
175
168
|
TmplAstElement: () => Element$1,
|
|
176
169
|
TmplAstForLoopBlock: () => ForLoopBlock,
|
|
177
170
|
TmplAstForLoopBlockEmpty: () => ForLoopBlockEmpty,
|
|
178
|
-
TmplAstHostElement: () => HostElement,
|
|
179
171
|
TmplAstHoverDeferredTrigger: () => HoverDeferredTrigger,
|
|
180
172
|
TmplAstIcu: () => Icu$1,
|
|
181
173
|
TmplAstIdleDeferredTrigger: () => IdleDeferredTrigger,
|
|
@@ -211,8 +203,6 @@ __export(index_exports, {
|
|
|
211
203
|
VariableBinding: () => VariableBinding,
|
|
212
204
|
Version: () => Version,
|
|
213
205
|
ViewEncapsulation: () => ViewEncapsulation$1,
|
|
214
|
-
VoidExpr: () => VoidExpr,
|
|
215
|
-
VoidExpression: () => VoidExpression,
|
|
216
206
|
WrappedNodeExpr: () => WrappedNodeExpr,
|
|
217
207
|
WriteKeyExpr: () => WriteKeyExpr,
|
|
218
208
|
WritePropExpr: () => WritePropExpr,
|
|
@@ -275,6 +265,7 @@ __export(index_exports, {
|
|
|
275
265
|
publishFacade: () => publishFacade,
|
|
276
266
|
r3JitTypeSourceSpan: () => r3JitTypeSourceSpan,
|
|
277
267
|
sanitizeIdentifier: () => sanitizeIdentifier,
|
|
268
|
+
setEnableTemplateSourceLocations: () => setEnableTemplateSourceLocations,
|
|
278
269
|
splitNsName: () => splitNsName,
|
|
279
270
|
tmplAstVisitAll: () => visitAll$1,
|
|
280
271
|
verifyHostBindings: () => verifyHostBindings,
|
|
@@ -282,7 +273,7 @@ __export(index_exports, {
|
|
|
282
273
|
});
|
|
283
274
|
module.exports = __toCommonJS(index_exports);
|
|
284
275
|
|
|
285
|
-
// ../../node_modules/.pnpm/@angular+compiler@
|
|
276
|
+
// ../../node_modules/.pnpm/@angular+compiler@19.2.14/node_modules/@angular/compiler/fesm2022/compiler.mjs
|
|
286
277
|
var _SELECTOR_REGEXP = new RegExp(
|
|
287
278
|
`(\\:not\\()|(([\\.\\#]?)[-\\w]+)|(?:\\[([-.\\w*\\\\$]+)(?:=(["']?)([^\\]"']*)\\5)?\\])|(\\))|(\\s*,\\s*)`,
|
|
288
279
|
// 8: ","
|
|
@@ -669,18 +660,6 @@ var SelectorContext = class {
|
|
|
669
660
|
return result;
|
|
670
661
|
}
|
|
671
662
|
};
|
|
672
|
-
var SelectorlessMatcher = class {
|
|
673
|
-
static {
|
|
674
|
-
__name(this, "SelectorlessMatcher");
|
|
675
|
-
}
|
|
676
|
-
registry;
|
|
677
|
-
constructor(registry) {
|
|
678
|
-
this.registry = registry;
|
|
679
|
-
}
|
|
680
|
-
match(name) {
|
|
681
|
-
return this.registry.has(name) ? this.registry.get(name) : [];
|
|
682
|
-
}
|
|
683
|
-
};
|
|
684
663
|
var emitDistinctChangesOnlyDefaultValue = true;
|
|
685
664
|
var ViewEncapsulation$1;
|
|
686
665
|
(function(ViewEncapsulation2) {
|
|
@@ -1189,8 +1168,6 @@ var BinaryOperator;
|
|
|
1189
1168
|
BinaryOperator2[BinaryOperator2["Bigger"] = 15] = "Bigger";
|
|
1190
1169
|
BinaryOperator2[BinaryOperator2["BiggerEquals"] = 16] = "BiggerEquals";
|
|
1191
1170
|
BinaryOperator2[BinaryOperator2["NullishCoalesce"] = 17] = "NullishCoalesce";
|
|
1192
|
-
BinaryOperator2[BinaryOperator2["Exponentiation"] = 18] = "Exponentiation";
|
|
1193
|
-
BinaryOperator2[BinaryOperator2["In"] = 19] = "In";
|
|
1194
1171
|
})(BinaryOperator || (BinaryOperator = {}));
|
|
1195
1172
|
function nullSafeIsEquivalent(base, other) {
|
|
1196
1173
|
if (base == null || other == null) {
|
|
@@ -1268,17 +1245,14 @@ var Expression = class {
|
|
|
1268
1245
|
modulo(rhs, sourceSpan) {
|
|
1269
1246
|
return new BinaryOperatorExpr(BinaryOperator.Modulo, this, rhs, null, sourceSpan);
|
|
1270
1247
|
}
|
|
1271
|
-
power(rhs, sourceSpan) {
|
|
1272
|
-
return new BinaryOperatorExpr(BinaryOperator.Exponentiation, this, rhs, null, sourceSpan);
|
|
1273
|
-
}
|
|
1274
1248
|
and(rhs, sourceSpan) {
|
|
1275
1249
|
return new BinaryOperatorExpr(BinaryOperator.And, this, rhs, null, sourceSpan);
|
|
1276
1250
|
}
|
|
1277
|
-
bitwiseOr(rhs, sourceSpan) {
|
|
1278
|
-
return new BinaryOperatorExpr(BinaryOperator.BitwiseOr, this, rhs, null, sourceSpan);
|
|
1251
|
+
bitwiseOr(rhs, sourceSpan, parens = true) {
|
|
1252
|
+
return new BinaryOperatorExpr(BinaryOperator.BitwiseOr, this, rhs, null, sourceSpan, parens);
|
|
1279
1253
|
}
|
|
1280
|
-
bitwiseAnd(rhs, sourceSpan) {
|
|
1281
|
-
return new BinaryOperatorExpr(BinaryOperator.BitwiseAnd, this, rhs, null, sourceSpan);
|
|
1254
|
+
bitwiseAnd(rhs, sourceSpan, parens = true) {
|
|
1255
|
+
return new BinaryOperatorExpr(BinaryOperator.BitwiseAnd, this, rhs, null, sourceSpan, parens);
|
|
1282
1256
|
}
|
|
1283
1257
|
or(rhs, sourceSpan) {
|
|
1284
1258
|
return new BinaryOperatorExpr(BinaryOperator.Or, this, rhs, null, sourceSpan);
|
|
@@ -1352,28 +1326,6 @@ var TypeofExpr = class _TypeofExpr extends Expression {
|
|
|
1352
1326
|
return new _TypeofExpr(this.expr.clone());
|
|
1353
1327
|
}
|
|
1354
1328
|
};
|
|
1355
|
-
var VoidExpr = class _VoidExpr extends Expression {
|
|
1356
|
-
static {
|
|
1357
|
-
__name(this, "VoidExpr");
|
|
1358
|
-
}
|
|
1359
|
-
expr;
|
|
1360
|
-
constructor(expr, type, sourceSpan) {
|
|
1361
|
-
super(type, sourceSpan);
|
|
1362
|
-
this.expr = expr;
|
|
1363
|
-
}
|
|
1364
|
-
visitExpression(visitor, context) {
|
|
1365
|
-
return visitor.visitVoidExpr(this, context);
|
|
1366
|
-
}
|
|
1367
|
-
isEquivalent(e) {
|
|
1368
|
-
return e instanceof _VoidExpr && e.expr.isEquivalent(this.expr);
|
|
1369
|
-
}
|
|
1370
|
-
isConstant() {
|
|
1371
|
-
return this.expr.isConstant();
|
|
1372
|
-
}
|
|
1373
|
-
clone() {
|
|
1374
|
-
return new _VoidExpr(this.expr.clone());
|
|
1375
|
-
}
|
|
1376
|
-
};
|
|
1377
1329
|
var WrappedNodeExpr = class _WrappedNodeExpr extends Expression {
|
|
1378
1330
|
static {
|
|
1379
1331
|
__name(this, "WrappedNodeExpr");
|
|
@@ -1976,39 +1928,19 @@ var UnaryOperatorExpr = class _UnaryOperatorExpr extends Expression {
|
|
|
1976
1928
|
return new _UnaryOperatorExpr(this.operator, this.expr.clone(), this.type, this.sourceSpan, this.parens);
|
|
1977
1929
|
}
|
|
1978
1930
|
};
|
|
1979
|
-
var ParenthesizedExpr = class _ParenthesizedExpr extends Expression {
|
|
1980
|
-
static {
|
|
1981
|
-
__name(this, "ParenthesizedExpr");
|
|
1982
|
-
}
|
|
1983
|
-
expr;
|
|
1984
|
-
constructor(expr, type, sourceSpan) {
|
|
1985
|
-
super(type, sourceSpan);
|
|
1986
|
-
this.expr = expr;
|
|
1987
|
-
}
|
|
1988
|
-
visitExpression(visitor, context) {
|
|
1989
|
-
return visitor.visitParenthesizedExpr(this, context);
|
|
1990
|
-
}
|
|
1991
|
-
isEquivalent(e) {
|
|
1992
|
-
return e instanceof _ParenthesizedExpr && e.expr.isEquivalent(this.expr);
|
|
1993
|
-
}
|
|
1994
|
-
isConstant() {
|
|
1995
|
-
return this.expr.isConstant();
|
|
1996
|
-
}
|
|
1997
|
-
clone() {
|
|
1998
|
-
return new _ParenthesizedExpr(this.expr.clone());
|
|
1999
|
-
}
|
|
2000
|
-
};
|
|
2001
1931
|
var BinaryOperatorExpr = class _BinaryOperatorExpr extends Expression {
|
|
2002
1932
|
static {
|
|
2003
1933
|
__name(this, "BinaryOperatorExpr");
|
|
2004
1934
|
}
|
|
2005
1935
|
operator;
|
|
2006
1936
|
rhs;
|
|
1937
|
+
parens;
|
|
2007
1938
|
lhs;
|
|
2008
|
-
constructor(operator, lhs, rhs, type, sourceSpan) {
|
|
1939
|
+
constructor(operator, lhs, rhs, type, sourceSpan, parens = true) {
|
|
2009
1940
|
super(type || lhs.type, sourceSpan);
|
|
2010
1941
|
this.operator = operator;
|
|
2011
1942
|
this.rhs = rhs;
|
|
1943
|
+
this.parens = parens;
|
|
2012
1944
|
this.lhs = lhs;
|
|
2013
1945
|
}
|
|
2014
1946
|
isEquivalent(e) {
|
|
@@ -2021,7 +1953,7 @@ var BinaryOperatorExpr = class _BinaryOperatorExpr extends Expression {
|
|
|
2021
1953
|
return visitor.visitBinaryOperatorExpr(this, context);
|
|
2022
1954
|
}
|
|
2023
1955
|
clone() {
|
|
2024
|
-
return new _BinaryOperatorExpr(this.operator, this.lhs.clone(), this.rhs.clone(), this.type, this.sourceSpan);
|
|
1956
|
+
return new _BinaryOperatorExpr(this.operator, this.lhs.clone(), this.rhs.clone(), this.type, this.sourceSpan, this.parens);
|
|
2025
1957
|
}
|
|
2026
1958
|
};
|
|
2027
1959
|
var ReadPropExpr = class _ReadPropExpr extends Expression {
|
|
@@ -2366,6 +2298,9 @@ var RecursiveAstVisitor$1 = class RecursiveAstVisitor {
|
|
|
2366
2298
|
visitWrappedNodeExpr(ast, context) {
|
|
2367
2299
|
return ast;
|
|
2368
2300
|
}
|
|
2301
|
+
visitTypeofExpr(ast, context) {
|
|
2302
|
+
return this.visitExpression(ast, context);
|
|
2303
|
+
}
|
|
2369
2304
|
visitReadVarExpr(ast, context) {
|
|
2370
2305
|
return this.visitExpression(ast, context);
|
|
2371
2306
|
}
|
|
@@ -2440,14 +2375,6 @@ var RecursiveAstVisitor$1 = class RecursiveAstVisitor {
|
|
|
2440
2375
|
ast.expr.visitExpression(this, context);
|
|
2441
2376
|
return this.visitExpression(ast, context);
|
|
2442
2377
|
}
|
|
2443
|
-
visitTypeofExpr(ast, context) {
|
|
2444
|
-
ast.expr.visitExpression(this, context);
|
|
2445
|
-
return this.visitExpression(ast, context);
|
|
2446
|
-
}
|
|
2447
|
-
visitVoidExpr(ast, context) {
|
|
2448
|
-
ast.expr.visitExpression(this, context);
|
|
2449
|
-
return this.visitExpression(ast, context);
|
|
2450
|
-
}
|
|
2451
2378
|
visitBinaryOperatorExpr(ast, context) {
|
|
2452
2379
|
ast.lhs.visitExpression(this, context);
|
|
2453
2380
|
ast.rhs.visitExpression(this, context);
|
|
@@ -2482,10 +2409,6 @@ var RecursiveAstVisitor$1 = class RecursiveAstVisitor {
|
|
|
2482
2409
|
visitTemplateLiteralElementExpr(ast, context) {
|
|
2483
2410
|
return this.visitExpression(ast, context);
|
|
2484
2411
|
}
|
|
2485
|
-
visitParenthesizedExpr(ast, context) {
|
|
2486
|
-
ast.expr.visitExpression(this, context);
|
|
2487
|
-
return this.visitExpression(ast, context);
|
|
2488
|
-
}
|
|
2489
2412
|
visitAllExpressions(exprs, context) {
|
|
2490
2413
|
exprs.forEach((expr) => expr.visitExpression(this, context));
|
|
2491
2414
|
}
|
|
@@ -2674,7 +2597,6 @@ var output_ast = /* @__PURE__ */ Object.freeze({
|
|
|
2674
2597
|
NULL_EXPR,
|
|
2675
2598
|
NUMBER_TYPE,
|
|
2676
2599
|
NotExpr,
|
|
2677
|
-
ParenthesizedExpr,
|
|
2678
2600
|
PlaceholderPiece,
|
|
2679
2601
|
ReadKeyExpr,
|
|
2680
2602
|
ReadPropExpr,
|
|
@@ -2700,7 +2622,6 @@ var output_ast = /* @__PURE__ */ Object.freeze({
|
|
|
2700
2622
|
return UnaryOperator;
|
|
2701
2623
|
},
|
|
2702
2624
|
UnaryOperatorExpr,
|
|
2703
|
-
VoidExpr,
|
|
2704
2625
|
WrappedNodeExpr,
|
|
2705
2626
|
WriteKeyExpr,
|
|
2706
2627
|
WritePropExpr,
|
|
@@ -2966,6 +2887,42 @@ var Identifiers = class {
|
|
|
2966
2887
|
moduleName: CORE
|
|
2967
2888
|
};
|
|
2968
2889
|
static attribute = { name: "\u0275\u0275attribute", moduleName: CORE };
|
|
2890
|
+
static attributeInterpolate1 = {
|
|
2891
|
+
name: "\u0275\u0275attributeInterpolate1",
|
|
2892
|
+
moduleName: CORE
|
|
2893
|
+
};
|
|
2894
|
+
static attributeInterpolate2 = {
|
|
2895
|
+
name: "\u0275\u0275attributeInterpolate2",
|
|
2896
|
+
moduleName: CORE
|
|
2897
|
+
};
|
|
2898
|
+
static attributeInterpolate3 = {
|
|
2899
|
+
name: "\u0275\u0275attributeInterpolate3",
|
|
2900
|
+
moduleName: CORE
|
|
2901
|
+
};
|
|
2902
|
+
static attributeInterpolate4 = {
|
|
2903
|
+
name: "\u0275\u0275attributeInterpolate4",
|
|
2904
|
+
moduleName: CORE
|
|
2905
|
+
};
|
|
2906
|
+
static attributeInterpolate5 = {
|
|
2907
|
+
name: "\u0275\u0275attributeInterpolate5",
|
|
2908
|
+
moduleName: CORE
|
|
2909
|
+
};
|
|
2910
|
+
static attributeInterpolate6 = {
|
|
2911
|
+
name: "\u0275\u0275attributeInterpolate6",
|
|
2912
|
+
moduleName: CORE
|
|
2913
|
+
};
|
|
2914
|
+
static attributeInterpolate7 = {
|
|
2915
|
+
name: "\u0275\u0275attributeInterpolate7",
|
|
2916
|
+
moduleName: CORE
|
|
2917
|
+
};
|
|
2918
|
+
static attributeInterpolate8 = {
|
|
2919
|
+
name: "\u0275\u0275attributeInterpolate8",
|
|
2920
|
+
moduleName: CORE
|
|
2921
|
+
};
|
|
2922
|
+
static attributeInterpolateV = {
|
|
2923
|
+
name: "\u0275\u0275attributeInterpolateV",
|
|
2924
|
+
moduleName: CORE
|
|
2925
|
+
};
|
|
2969
2926
|
static classProp = { name: "\u0275\u0275classProp", moduleName: CORE };
|
|
2970
2927
|
static elementContainerStart = {
|
|
2971
2928
|
name: "\u0275\u0275elementContainerStart",
|
|
@@ -2977,46 +2934,114 @@ var Identifiers = class {
|
|
|
2977
2934
|
};
|
|
2978
2935
|
static elementContainer = { name: "\u0275\u0275elementContainer", moduleName: CORE };
|
|
2979
2936
|
static styleMap = { name: "\u0275\u0275styleMap", moduleName: CORE };
|
|
2937
|
+
static styleMapInterpolate1 = {
|
|
2938
|
+
name: "\u0275\u0275styleMapInterpolate1",
|
|
2939
|
+
moduleName: CORE
|
|
2940
|
+
};
|
|
2941
|
+
static styleMapInterpolate2 = {
|
|
2942
|
+
name: "\u0275\u0275styleMapInterpolate2",
|
|
2943
|
+
moduleName: CORE
|
|
2944
|
+
};
|
|
2945
|
+
static styleMapInterpolate3 = {
|
|
2946
|
+
name: "\u0275\u0275styleMapInterpolate3",
|
|
2947
|
+
moduleName: CORE
|
|
2948
|
+
};
|
|
2949
|
+
static styleMapInterpolate4 = {
|
|
2950
|
+
name: "\u0275\u0275styleMapInterpolate4",
|
|
2951
|
+
moduleName: CORE
|
|
2952
|
+
};
|
|
2953
|
+
static styleMapInterpolate5 = {
|
|
2954
|
+
name: "\u0275\u0275styleMapInterpolate5",
|
|
2955
|
+
moduleName: CORE
|
|
2956
|
+
};
|
|
2957
|
+
static styleMapInterpolate6 = {
|
|
2958
|
+
name: "\u0275\u0275styleMapInterpolate6",
|
|
2959
|
+
moduleName: CORE
|
|
2960
|
+
};
|
|
2961
|
+
static styleMapInterpolate7 = {
|
|
2962
|
+
name: "\u0275\u0275styleMapInterpolate7",
|
|
2963
|
+
moduleName: CORE
|
|
2964
|
+
};
|
|
2965
|
+
static styleMapInterpolate8 = {
|
|
2966
|
+
name: "\u0275\u0275styleMapInterpolate8",
|
|
2967
|
+
moduleName: CORE
|
|
2968
|
+
};
|
|
2969
|
+
static styleMapInterpolateV = {
|
|
2970
|
+
name: "\u0275\u0275styleMapInterpolateV",
|
|
2971
|
+
moduleName: CORE
|
|
2972
|
+
};
|
|
2980
2973
|
static classMap = { name: "\u0275\u0275classMap", moduleName: CORE };
|
|
2981
|
-
static
|
|
2982
|
-
|
|
2983
|
-
|
|
2974
|
+
static classMapInterpolate1 = {
|
|
2975
|
+
name: "\u0275\u0275classMapInterpolate1",
|
|
2976
|
+
moduleName: CORE
|
|
2977
|
+
};
|
|
2978
|
+
static classMapInterpolate2 = {
|
|
2979
|
+
name: "\u0275\u0275classMapInterpolate2",
|
|
2980
|
+
moduleName: CORE
|
|
2981
|
+
};
|
|
2982
|
+
static classMapInterpolate3 = {
|
|
2983
|
+
name: "\u0275\u0275classMapInterpolate3",
|
|
2984
2984
|
moduleName: CORE
|
|
2985
2985
|
};
|
|
2986
|
-
static
|
|
2987
|
-
name: "\u0275\
|
|
2986
|
+
static classMapInterpolate4 = {
|
|
2987
|
+
name: "\u0275\u0275classMapInterpolate4",
|
|
2988
2988
|
moduleName: CORE
|
|
2989
2989
|
};
|
|
2990
|
-
static
|
|
2991
|
-
name: "\u0275\
|
|
2990
|
+
static classMapInterpolate5 = {
|
|
2991
|
+
name: "\u0275\u0275classMapInterpolate5",
|
|
2992
2992
|
moduleName: CORE
|
|
2993
2993
|
};
|
|
2994
|
-
static
|
|
2995
|
-
name: "\u0275\
|
|
2994
|
+
static classMapInterpolate6 = {
|
|
2995
|
+
name: "\u0275\u0275classMapInterpolate6",
|
|
2996
2996
|
moduleName: CORE
|
|
2997
2997
|
};
|
|
2998
|
-
static
|
|
2999
|
-
name: "\u0275\
|
|
2998
|
+
static classMapInterpolate7 = {
|
|
2999
|
+
name: "\u0275\u0275classMapInterpolate7",
|
|
3000
3000
|
moduleName: CORE
|
|
3001
3001
|
};
|
|
3002
|
-
static
|
|
3003
|
-
name: "\u0275\
|
|
3002
|
+
static classMapInterpolate8 = {
|
|
3003
|
+
name: "\u0275\u0275classMapInterpolate8",
|
|
3004
3004
|
moduleName: CORE
|
|
3005
3005
|
};
|
|
3006
|
-
static
|
|
3007
|
-
name: "\u0275\
|
|
3006
|
+
static classMapInterpolateV = {
|
|
3007
|
+
name: "\u0275\u0275classMapInterpolateV",
|
|
3008
3008
|
moduleName: CORE
|
|
3009
3009
|
};
|
|
3010
|
-
static
|
|
3011
|
-
|
|
3010
|
+
static styleProp = { name: "\u0275\u0275styleProp", moduleName: CORE };
|
|
3011
|
+
static stylePropInterpolate1 = {
|
|
3012
|
+
name: "\u0275\u0275stylePropInterpolate1",
|
|
3013
|
+
moduleName: CORE
|
|
3014
|
+
};
|
|
3015
|
+
static stylePropInterpolate2 = {
|
|
3016
|
+
name: "\u0275\u0275stylePropInterpolate2",
|
|
3017
|
+
moduleName: CORE
|
|
3018
|
+
};
|
|
3019
|
+
static stylePropInterpolate3 = {
|
|
3020
|
+
name: "\u0275\u0275stylePropInterpolate3",
|
|
3021
|
+
moduleName: CORE
|
|
3022
|
+
};
|
|
3023
|
+
static stylePropInterpolate4 = {
|
|
3024
|
+
name: "\u0275\u0275stylePropInterpolate4",
|
|
3025
|
+
moduleName: CORE
|
|
3026
|
+
};
|
|
3027
|
+
static stylePropInterpolate5 = {
|
|
3028
|
+
name: "\u0275\u0275stylePropInterpolate5",
|
|
3029
|
+
moduleName: CORE
|
|
3030
|
+
};
|
|
3031
|
+
static stylePropInterpolate6 = {
|
|
3032
|
+
name: "\u0275\u0275stylePropInterpolate6",
|
|
3033
|
+
moduleName: CORE
|
|
3034
|
+
};
|
|
3035
|
+
static stylePropInterpolate7 = {
|
|
3036
|
+
name: "\u0275\u0275stylePropInterpolate7",
|
|
3012
3037
|
moduleName: CORE
|
|
3013
3038
|
};
|
|
3014
|
-
static
|
|
3015
|
-
name: "\u0275\
|
|
3039
|
+
static stylePropInterpolate8 = {
|
|
3040
|
+
name: "\u0275\u0275stylePropInterpolate8",
|
|
3016
3041
|
moduleName: CORE
|
|
3017
3042
|
};
|
|
3018
|
-
static
|
|
3019
|
-
name: "\u0275\
|
|
3043
|
+
static stylePropInterpolateV = {
|
|
3044
|
+
name: "\u0275\u0275stylePropInterpolateV",
|
|
3020
3045
|
moduleName: CORE
|
|
3021
3046
|
};
|
|
3022
3047
|
static nextContext = { name: "\u0275\u0275nextContext", moduleName: CORE };
|
|
@@ -3085,11 +3110,6 @@ var Identifiers = class {
|
|
|
3085
3110
|
name: "\u0275\u0275deferEnableTimerScheduling",
|
|
3086
3111
|
moduleName: CORE
|
|
3087
3112
|
};
|
|
3088
|
-
static conditionalCreate = { name: "\u0275\u0275conditionalCreate", moduleName: CORE };
|
|
3089
|
-
static conditionalBranchCreate = {
|
|
3090
|
-
name: "\u0275\u0275conditionalBranchCreate",
|
|
3091
|
-
moduleName: CORE
|
|
3092
|
-
};
|
|
3093
3113
|
static conditional = { name: "\u0275\u0275conditional", moduleName: CORE };
|
|
3094
3114
|
static repeater = { name: "\u0275\u0275repeater", moduleName: CORE };
|
|
3095
3115
|
static repeaterCreate = { name: "\u0275\u0275repeaterCreate", moduleName: CORE };
|
|
@@ -3132,8 +3152,48 @@ var Identifiers = class {
|
|
|
3132
3152
|
static pipeBind3 = { name: "\u0275\u0275pipeBind3", moduleName: CORE };
|
|
3133
3153
|
static pipeBind4 = { name: "\u0275\u0275pipeBind4", moduleName: CORE };
|
|
3134
3154
|
static pipeBindV = { name: "\u0275\u0275pipeBindV", moduleName: CORE };
|
|
3135
|
-
static
|
|
3155
|
+
static hostProperty = { name: "\u0275\u0275hostProperty", moduleName: CORE };
|
|
3136
3156
|
static property = { name: "\u0275\u0275property", moduleName: CORE };
|
|
3157
|
+
static propertyInterpolate = {
|
|
3158
|
+
name: "\u0275\u0275propertyInterpolate",
|
|
3159
|
+
moduleName: CORE
|
|
3160
|
+
};
|
|
3161
|
+
static propertyInterpolate1 = {
|
|
3162
|
+
name: "\u0275\u0275propertyInterpolate1",
|
|
3163
|
+
moduleName: CORE
|
|
3164
|
+
};
|
|
3165
|
+
static propertyInterpolate2 = {
|
|
3166
|
+
name: "\u0275\u0275propertyInterpolate2",
|
|
3167
|
+
moduleName: CORE
|
|
3168
|
+
};
|
|
3169
|
+
static propertyInterpolate3 = {
|
|
3170
|
+
name: "\u0275\u0275propertyInterpolate3",
|
|
3171
|
+
moduleName: CORE
|
|
3172
|
+
};
|
|
3173
|
+
static propertyInterpolate4 = {
|
|
3174
|
+
name: "\u0275\u0275propertyInterpolate4",
|
|
3175
|
+
moduleName: CORE
|
|
3176
|
+
};
|
|
3177
|
+
static propertyInterpolate5 = {
|
|
3178
|
+
name: "\u0275\u0275propertyInterpolate5",
|
|
3179
|
+
moduleName: CORE
|
|
3180
|
+
};
|
|
3181
|
+
static propertyInterpolate6 = {
|
|
3182
|
+
name: "\u0275\u0275propertyInterpolate6",
|
|
3183
|
+
moduleName: CORE
|
|
3184
|
+
};
|
|
3185
|
+
static propertyInterpolate7 = {
|
|
3186
|
+
name: "\u0275\u0275propertyInterpolate7",
|
|
3187
|
+
moduleName: CORE
|
|
3188
|
+
};
|
|
3189
|
+
static propertyInterpolate8 = {
|
|
3190
|
+
name: "\u0275\u0275propertyInterpolate8",
|
|
3191
|
+
moduleName: CORE
|
|
3192
|
+
};
|
|
3193
|
+
static propertyInterpolateV = {
|
|
3194
|
+
name: "\u0275\u0275propertyInterpolateV",
|
|
3195
|
+
moduleName: CORE
|
|
3196
|
+
};
|
|
3137
3197
|
static i18n = { name: "\u0275\u0275i18n", moduleName: CORE };
|
|
3138
3198
|
static i18nAttributes = { name: "\u0275\u0275i18nAttributes", moduleName: CORE };
|
|
3139
3199
|
static i18nExp = { name: "\u0275\u0275i18nExp", moduleName: CORE };
|
|
@@ -3701,7 +3761,6 @@ var AbstractEmitterVisitor = class {
|
|
|
3701
3761
|
__name(this, "AbstractEmitterVisitor");
|
|
3702
3762
|
}
|
|
3703
3763
|
_escapeDollarInStrings;
|
|
3704
|
-
lastIfCondition = null;
|
|
3705
3764
|
constructor(_escapeDollarInStrings) {
|
|
3706
3765
|
this._escapeDollarInStrings = _escapeDollarInStrings;
|
|
3707
3766
|
}
|
|
@@ -3739,9 +3798,7 @@ var AbstractEmitterVisitor = class {
|
|
|
3739
3798
|
visitIfStmt(stmt, ctx) {
|
|
3740
3799
|
this.printLeadingComments(stmt, ctx);
|
|
3741
3800
|
ctx.print(stmt, `if (`);
|
|
3742
|
-
this.lastIfCondition = stmt.condition;
|
|
3743
3801
|
stmt.condition.visitExpression(this, ctx);
|
|
3744
|
-
this.lastIfCondition = null;
|
|
3745
3802
|
ctx.print(stmt, `) {`);
|
|
3746
3803
|
const hasElseCase = stmt.falseCase != null && stmt.falseCase.length > 0;
|
|
3747
3804
|
if (stmt.trueCase.length <= 1 && !hasElseCase) {
|
|
@@ -3846,10 +3903,6 @@ var AbstractEmitterVisitor = class {
|
|
|
3846
3903
|
ctx.print(expr, "typeof ");
|
|
3847
3904
|
expr.expr.visitExpression(this, ctx);
|
|
3848
3905
|
}
|
|
3849
|
-
visitVoidExpr(expr, ctx) {
|
|
3850
|
-
ctx.print(expr, "void ");
|
|
3851
|
-
expr.expr.visitExpression(this, ctx);
|
|
3852
|
-
}
|
|
3853
3906
|
visitReadVarExpr(ast, ctx) {
|
|
3854
3907
|
ctx.print(ast, ast.name);
|
|
3855
3908
|
return null;
|
|
@@ -3912,12 +3965,11 @@ var AbstractEmitterVisitor = class {
|
|
|
3912
3965
|
default:
|
|
3913
3966
|
throw new Error(`Unknown operator ${ast.operator}`);
|
|
3914
3967
|
}
|
|
3915
|
-
|
|
3916
|
-
if (parens)
|
|
3968
|
+
if (ast.parens)
|
|
3917
3969
|
ctx.print(ast, `(`);
|
|
3918
3970
|
ctx.print(ast, opStr);
|
|
3919
3971
|
ast.expr.visitExpression(this, ctx);
|
|
3920
|
-
if (parens)
|
|
3972
|
+
if (ast.parens)
|
|
3921
3973
|
ctx.print(ast, `)`);
|
|
3922
3974
|
return null;
|
|
3923
3975
|
}
|
|
@@ -3963,9 +4015,6 @@ var AbstractEmitterVisitor = class {
|
|
|
3963
4015
|
case BinaryOperator.Modulo:
|
|
3964
4016
|
opStr = "%";
|
|
3965
4017
|
break;
|
|
3966
|
-
case BinaryOperator.Exponentiation:
|
|
3967
|
-
opStr = "**";
|
|
3968
|
-
break;
|
|
3969
4018
|
case BinaryOperator.Lower:
|
|
3970
4019
|
opStr = "<";
|
|
3971
4020
|
break;
|
|
@@ -3981,19 +4030,15 @@ var AbstractEmitterVisitor = class {
|
|
|
3981
4030
|
case BinaryOperator.NullishCoalesce:
|
|
3982
4031
|
opStr = "??";
|
|
3983
4032
|
break;
|
|
3984
|
-
case BinaryOperator.In:
|
|
3985
|
-
opStr = "in";
|
|
3986
|
-
break;
|
|
3987
4033
|
default:
|
|
3988
4034
|
throw new Error(`Unknown operator ${ast.operator}`);
|
|
3989
4035
|
}
|
|
3990
|
-
|
|
3991
|
-
if (parens)
|
|
4036
|
+
if (ast.parens)
|
|
3992
4037
|
ctx.print(ast, `(`);
|
|
3993
4038
|
ast.lhs.visitExpression(this, ctx);
|
|
3994
4039
|
ctx.print(ast, ` ${opStr} `);
|
|
3995
4040
|
ast.rhs.visitExpression(this, ctx);
|
|
3996
|
-
if (parens)
|
|
4041
|
+
if (ast.parens)
|
|
3997
4042
|
ctx.print(ast, `)`);
|
|
3998
4043
|
return null;
|
|
3999
4044
|
}
|
|
@@ -4031,9 +4076,6 @@ var AbstractEmitterVisitor = class {
|
|
|
4031
4076
|
ctx.print(ast, ")");
|
|
4032
4077
|
return null;
|
|
4033
4078
|
}
|
|
4034
|
-
visitParenthesizedExpr(ast, ctx) {
|
|
4035
|
-
ast.expr.visitExpression(this, ctx);
|
|
4036
|
-
}
|
|
4037
4079
|
visitAllExpressions(expressions, ctx, separator) {
|
|
4038
4080
|
this.visitAllObjects((expr) => expr.visitExpression(this, ctx), expressions, ctx, separator);
|
|
4039
4081
|
}
|
|
@@ -4124,7 +4166,8 @@ function guardedExpression(guard, expr) {
|
|
|
4124
4166
|
/* type */
|
|
4125
4167
|
void 0,
|
|
4126
4168
|
/* sourceSpan */
|
|
4127
|
-
void 0
|
|
4169
|
+
void 0,
|
|
4170
|
+
true
|
|
4128
4171
|
);
|
|
4129
4172
|
return new BinaryOperatorExpr(BinaryOperator.And, guardUndefinedOrTrue, expr);
|
|
4130
4173
|
}
|
|
@@ -4663,19 +4706,6 @@ var TypeofExpression = class extends AST {
|
|
|
4663
4706
|
return visitor.visitTypeofExpression(this, context);
|
|
4664
4707
|
}
|
|
4665
4708
|
};
|
|
4666
|
-
var VoidExpression = class extends AST {
|
|
4667
|
-
static {
|
|
4668
|
-
__name(this, "VoidExpression");
|
|
4669
|
-
}
|
|
4670
|
-
expression;
|
|
4671
|
-
constructor(span, sourceSpan, expression) {
|
|
4672
|
-
super(span, sourceSpan);
|
|
4673
|
-
this.expression = expression;
|
|
4674
|
-
}
|
|
4675
|
-
visit(visitor, context = null) {
|
|
4676
|
-
return visitor.visitVoidExpression(this, context);
|
|
4677
|
-
}
|
|
4678
|
-
};
|
|
4679
4709
|
var NonNullAssert = class extends AST {
|
|
4680
4710
|
static {
|
|
4681
4711
|
__name(this, "NonNullAssert");
|
|
@@ -4723,21 +4753,6 @@ var SafeCall = class extends AST {
|
|
|
4723
4753
|
return visitor.visitSafeCall(this, context);
|
|
4724
4754
|
}
|
|
4725
4755
|
};
|
|
4726
|
-
var TaggedTemplateLiteral = class extends AST {
|
|
4727
|
-
static {
|
|
4728
|
-
__name(this, "TaggedTemplateLiteral");
|
|
4729
|
-
}
|
|
4730
|
-
tag;
|
|
4731
|
-
template;
|
|
4732
|
-
constructor(span, sourceSpan, tag, template2) {
|
|
4733
|
-
super(span, sourceSpan);
|
|
4734
|
-
this.tag = tag;
|
|
4735
|
-
this.template = template2;
|
|
4736
|
-
}
|
|
4737
|
-
visit(visitor, context) {
|
|
4738
|
-
return visitor.visitTaggedTemplateLiteral(this, context);
|
|
4739
|
-
}
|
|
4740
|
-
};
|
|
4741
4756
|
var TemplateLiteral = class extends AST {
|
|
4742
4757
|
static {
|
|
4743
4758
|
__name(this, "TemplateLiteral");
|
|
@@ -4766,19 +4781,6 @@ var TemplateLiteralElement = class extends AST {
|
|
|
4766
4781
|
return visitor.visitTemplateLiteralElement(this, context);
|
|
4767
4782
|
}
|
|
4768
4783
|
};
|
|
4769
|
-
var ParenthesizedExpression = class extends AST {
|
|
4770
|
-
static {
|
|
4771
|
-
__name(this, "ParenthesizedExpression");
|
|
4772
|
-
}
|
|
4773
|
-
expression;
|
|
4774
|
-
constructor(span, sourceSpan, expression) {
|
|
4775
|
-
super(span, sourceSpan);
|
|
4776
|
-
this.expression = expression;
|
|
4777
|
-
}
|
|
4778
|
-
visit(visitor, context) {
|
|
4779
|
-
return visitor.visitParenthesizedExpression(this, context);
|
|
4780
|
-
}
|
|
4781
|
-
};
|
|
4782
4784
|
var AbsoluteSourceSpan = class {
|
|
4783
4785
|
static {
|
|
4784
4786
|
__name(this, "AbsoluteSourceSpan");
|
|
@@ -4912,9 +4914,6 @@ var RecursiveAstVisitor2 = class {
|
|
|
4912
4914
|
visitTypeofExpression(ast, context) {
|
|
4913
4915
|
this.visit(ast.expression, context);
|
|
4914
4916
|
}
|
|
4915
|
-
visitVoidExpression(ast, context) {
|
|
4916
|
-
this.visit(ast.expression, context);
|
|
4917
|
-
}
|
|
4918
4917
|
visitNonNullAssert(ast, context) {
|
|
4919
4918
|
this.visit(ast.expression, context);
|
|
4920
4919
|
}
|
|
@@ -4951,13 +4950,6 @@ var RecursiveAstVisitor2 = class {
|
|
|
4951
4950
|
}
|
|
4952
4951
|
visitTemplateLiteralElement(ast, context) {
|
|
4953
4952
|
}
|
|
4954
|
-
visitTaggedTemplateLiteral(ast, context) {
|
|
4955
|
-
this.visit(ast.tag, context);
|
|
4956
|
-
this.visit(ast.template, context);
|
|
4957
|
-
}
|
|
4958
|
-
visitParenthesizedExpression(ast, context) {
|
|
4959
|
-
this.visit(ast.expression, context);
|
|
4960
|
-
}
|
|
4961
4953
|
// This is not part of the AstVisitor interface, just a helper method
|
|
4962
4954
|
visitAll(asts, context) {
|
|
4963
4955
|
for (const ast of asts) {
|
|
@@ -5254,19 +5246,17 @@ var Element$1 = class Element {
|
|
|
5254
5246
|
attributes;
|
|
5255
5247
|
inputs;
|
|
5256
5248
|
outputs;
|
|
5257
|
-
directives;
|
|
5258
5249
|
children;
|
|
5259
5250
|
references;
|
|
5260
5251
|
sourceSpan;
|
|
5261
5252
|
startSourceSpan;
|
|
5262
5253
|
endSourceSpan;
|
|
5263
5254
|
i18n;
|
|
5264
|
-
constructor(name, attributes, inputs, outputs,
|
|
5255
|
+
constructor(name, attributes, inputs, outputs, children, references, sourceSpan, startSourceSpan, endSourceSpan, i18n2) {
|
|
5265
5256
|
this.name = name;
|
|
5266
5257
|
this.attributes = attributes;
|
|
5267
5258
|
this.inputs = inputs;
|
|
5268
5259
|
this.outputs = outputs;
|
|
5269
|
-
this.directives = directives;
|
|
5270
5260
|
this.children = children;
|
|
5271
5261
|
this.references = references;
|
|
5272
5262
|
this.sourceSpan = sourceSpan;
|
|
@@ -5628,70 +5618,6 @@ var LetDeclaration$1 = class LetDeclaration {
|
|
|
5628
5618
|
return visitor.visitLetDeclaration(this);
|
|
5629
5619
|
}
|
|
5630
5620
|
};
|
|
5631
|
-
var Component$1 = class Component {
|
|
5632
|
-
static {
|
|
5633
|
-
__name(this, "Component");
|
|
5634
|
-
}
|
|
5635
|
-
componentName;
|
|
5636
|
-
tagName;
|
|
5637
|
-
fullName;
|
|
5638
|
-
attributes;
|
|
5639
|
-
inputs;
|
|
5640
|
-
outputs;
|
|
5641
|
-
directives;
|
|
5642
|
-
children;
|
|
5643
|
-
references;
|
|
5644
|
-
sourceSpan;
|
|
5645
|
-
startSourceSpan;
|
|
5646
|
-
endSourceSpan;
|
|
5647
|
-
i18n;
|
|
5648
|
-
constructor(componentName, tagName, fullName, attributes, inputs, outputs, directives, children, references, sourceSpan, startSourceSpan, endSourceSpan, i18n2) {
|
|
5649
|
-
this.componentName = componentName;
|
|
5650
|
-
this.tagName = tagName;
|
|
5651
|
-
this.fullName = fullName;
|
|
5652
|
-
this.attributes = attributes;
|
|
5653
|
-
this.inputs = inputs;
|
|
5654
|
-
this.outputs = outputs;
|
|
5655
|
-
this.directives = directives;
|
|
5656
|
-
this.children = children;
|
|
5657
|
-
this.references = references;
|
|
5658
|
-
this.sourceSpan = sourceSpan;
|
|
5659
|
-
this.startSourceSpan = startSourceSpan;
|
|
5660
|
-
this.endSourceSpan = endSourceSpan;
|
|
5661
|
-
this.i18n = i18n2;
|
|
5662
|
-
}
|
|
5663
|
-
visit(visitor) {
|
|
5664
|
-
return visitor.visitComponent(this);
|
|
5665
|
-
}
|
|
5666
|
-
};
|
|
5667
|
-
var Directive$1 = class Directive {
|
|
5668
|
-
static {
|
|
5669
|
-
__name(this, "Directive");
|
|
5670
|
-
}
|
|
5671
|
-
name;
|
|
5672
|
-
attributes;
|
|
5673
|
-
inputs;
|
|
5674
|
-
outputs;
|
|
5675
|
-
references;
|
|
5676
|
-
sourceSpan;
|
|
5677
|
-
startSourceSpan;
|
|
5678
|
-
endSourceSpan;
|
|
5679
|
-
i18n;
|
|
5680
|
-
constructor(name, attributes, inputs, outputs, references, sourceSpan, startSourceSpan, endSourceSpan, i18n2) {
|
|
5681
|
-
this.name = name;
|
|
5682
|
-
this.attributes = attributes;
|
|
5683
|
-
this.inputs = inputs;
|
|
5684
|
-
this.outputs = outputs;
|
|
5685
|
-
this.references = references;
|
|
5686
|
-
this.sourceSpan = sourceSpan;
|
|
5687
|
-
this.startSourceSpan = startSourceSpan;
|
|
5688
|
-
this.endSourceSpan = endSourceSpan;
|
|
5689
|
-
this.i18n = i18n2;
|
|
5690
|
-
}
|
|
5691
|
-
visit(visitor) {
|
|
5692
|
-
return visitor.visitDirective(this);
|
|
5693
|
-
}
|
|
5694
|
-
};
|
|
5695
5621
|
var Template = class {
|
|
5696
5622
|
static {
|
|
5697
5623
|
__name(this, "Template");
|
|
@@ -5700,7 +5626,6 @@ var Template = class {
|
|
|
5700
5626
|
attributes;
|
|
5701
5627
|
inputs;
|
|
5702
5628
|
outputs;
|
|
5703
|
-
directives;
|
|
5704
5629
|
templateAttrs;
|
|
5705
5630
|
children;
|
|
5706
5631
|
references;
|
|
@@ -5709,12 +5634,11 @@ var Template = class {
|
|
|
5709
5634
|
startSourceSpan;
|
|
5710
5635
|
endSourceSpan;
|
|
5711
5636
|
i18n;
|
|
5712
|
-
constructor(tagName, attributes, inputs, outputs,
|
|
5637
|
+
constructor(tagName, attributes, inputs, outputs, templateAttrs, children, references, variables, sourceSpan, startSourceSpan, endSourceSpan, i18n2) {
|
|
5713
5638
|
this.tagName = tagName;
|
|
5714
5639
|
this.attributes = attributes;
|
|
5715
5640
|
this.inputs = inputs;
|
|
5716
5641
|
this.outputs = outputs;
|
|
5717
|
-
this.directives = directives;
|
|
5718
5642
|
this.templateAttrs = templateAttrs;
|
|
5719
5643
|
this.children = children;
|
|
5720
5644
|
this.references = references;
|
|
@@ -5736,17 +5660,13 @@ var Content = class {
|
|
|
5736
5660
|
attributes;
|
|
5737
5661
|
children;
|
|
5738
5662
|
sourceSpan;
|
|
5739
|
-
startSourceSpan;
|
|
5740
|
-
endSourceSpan;
|
|
5741
5663
|
i18n;
|
|
5742
5664
|
name = "ng-content";
|
|
5743
|
-
constructor(selector, attributes, children, sourceSpan,
|
|
5665
|
+
constructor(selector, attributes, children, sourceSpan, i18n2) {
|
|
5744
5666
|
this.selector = selector;
|
|
5745
5667
|
this.attributes = attributes;
|
|
5746
5668
|
this.children = children;
|
|
5747
5669
|
this.sourceSpan = sourceSpan;
|
|
5748
|
-
this.startSourceSpan = startSourceSpan;
|
|
5749
|
-
this.endSourceSpan = endSourceSpan;
|
|
5750
5670
|
this.i18n = i18n2;
|
|
5751
5671
|
}
|
|
5752
5672
|
visit(visitor) {
|
|
@@ -5811,27 +5731,6 @@ var Icu$1 = class Icu {
|
|
|
5811
5731
|
return visitor.visitIcu(this);
|
|
5812
5732
|
}
|
|
5813
5733
|
};
|
|
5814
|
-
var HostElement = class {
|
|
5815
|
-
static {
|
|
5816
|
-
__name(this, "HostElement");
|
|
5817
|
-
}
|
|
5818
|
-
tagNames;
|
|
5819
|
-
bindings;
|
|
5820
|
-
listeners;
|
|
5821
|
-
sourceSpan;
|
|
5822
|
-
constructor(tagNames, bindings, listeners, sourceSpan) {
|
|
5823
|
-
this.tagNames = tagNames;
|
|
5824
|
-
this.bindings = bindings;
|
|
5825
|
-
this.listeners = listeners;
|
|
5826
|
-
this.sourceSpan = sourceSpan;
|
|
5827
|
-
if (tagNames.length === 0) {
|
|
5828
|
-
throw new Error("HostElement must have at least one tag name.");
|
|
5829
|
-
}
|
|
5830
|
-
}
|
|
5831
|
-
visit() {
|
|
5832
|
-
throw new Error(`HostElement cannot be visited`);
|
|
5833
|
-
}
|
|
5834
|
-
};
|
|
5835
5734
|
var RecursiveVisitor$1 = class RecursiveVisitor {
|
|
5836
5735
|
static {
|
|
5837
5736
|
__name(this, "RecursiveVisitor");
|
|
@@ -5840,7 +5739,6 @@ var RecursiveVisitor$1 = class RecursiveVisitor {
|
|
|
5840
5739
|
visitAll$1(this, element2.attributes);
|
|
5841
5740
|
visitAll$1(this, element2.inputs);
|
|
5842
5741
|
visitAll$1(this, element2.outputs);
|
|
5843
|
-
visitAll$1(this, element2.directives);
|
|
5844
5742
|
visitAll$1(this, element2.children);
|
|
5845
5743
|
visitAll$1(this, element2.references);
|
|
5846
5744
|
}
|
|
@@ -5848,7 +5746,6 @@ var RecursiveVisitor$1 = class RecursiveVisitor {
|
|
|
5848
5746
|
visitAll$1(this, template2.attributes);
|
|
5849
5747
|
visitAll$1(this, template2.inputs);
|
|
5850
5748
|
visitAll$1(this, template2.outputs);
|
|
5851
|
-
visitAll$1(this, template2.directives);
|
|
5852
5749
|
visitAll$1(this, template2.children);
|
|
5853
5750
|
visitAll$1(this, template2.references);
|
|
5854
5751
|
visitAll$1(this, template2.variables);
|
|
@@ -5890,20 +5787,6 @@ var RecursiveVisitor$1 = class RecursiveVisitor {
|
|
|
5890
5787
|
visitContent(content) {
|
|
5891
5788
|
visitAll$1(this, content.children);
|
|
5892
5789
|
}
|
|
5893
|
-
visitComponent(component) {
|
|
5894
|
-
visitAll$1(this, component.attributes);
|
|
5895
|
-
visitAll$1(this, component.inputs);
|
|
5896
|
-
visitAll$1(this, component.outputs);
|
|
5897
|
-
visitAll$1(this, component.directives);
|
|
5898
|
-
visitAll$1(this, component.children);
|
|
5899
|
-
visitAll$1(this, component.references);
|
|
5900
|
-
}
|
|
5901
|
-
visitDirective(directive) {
|
|
5902
|
-
visitAll$1(this, directive.attributes);
|
|
5903
|
-
visitAll$1(this, directive.inputs);
|
|
5904
|
-
visitAll$1(this, directive.outputs);
|
|
5905
|
-
visitAll$1(this, directive.references);
|
|
5906
|
-
}
|
|
5907
5790
|
visitVariable(variable2) {
|
|
5908
5791
|
}
|
|
5909
5792
|
visitReference(reference2) {
|
|
@@ -6576,8 +6459,8 @@ function isI18nAttribute(name) {
|
|
|
6576
6459
|
return name === I18N_ATTR || name.startsWith(I18N_ATTR_PREFIX);
|
|
6577
6460
|
}
|
|
6578
6461
|
__name(isI18nAttribute, "isI18nAttribute");
|
|
6579
|
-
function hasI18nAttrs(
|
|
6580
|
-
return
|
|
6462
|
+
function hasI18nAttrs(element2) {
|
|
6463
|
+
return element2.attrs.some((attr) => isI18nAttribute(attr.name));
|
|
6581
6464
|
}
|
|
6582
6465
|
__name(hasI18nAttrs, "hasI18nAttrs");
|
|
6583
6466
|
function icuFromI18nMessage(message) {
|
|
@@ -8502,48 +8385,46 @@ var OpKind;
|
|
|
8502
8385
|
OpKind2[OpKind2["Container"] = 8] = "Container";
|
|
8503
8386
|
OpKind2[OpKind2["ContainerEnd"] = 9] = "ContainerEnd";
|
|
8504
8387
|
OpKind2[OpKind2["DisableBindings"] = 10] = "DisableBindings";
|
|
8505
|
-
OpKind2[OpKind2["
|
|
8506
|
-
OpKind2[OpKind2["
|
|
8507
|
-
OpKind2[OpKind2["
|
|
8508
|
-
OpKind2[OpKind2["
|
|
8509
|
-
OpKind2[OpKind2["
|
|
8510
|
-
OpKind2[OpKind2["
|
|
8511
|
-
OpKind2[OpKind2["
|
|
8512
|
-
OpKind2[OpKind2["
|
|
8513
|
-
OpKind2[OpKind2["
|
|
8514
|
-
OpKind2[OpKind2["
|
|
8515
|
-
OpKind2[OpKind2["
|
|
8516
|
-
OpKind2[OpKind2["
|
|
8517
|
-
OpKind2[OpKind2["
|
|
8518
|
-
OpKind2[OpKind2["
|
|
8519
|
-
OpKind2[OpKind2["
|
|
8520
|
-
OpKind2[OpKind2["
|
|
8521
|
-
OpKind2[OpKind2["
|
|
8522
|
-
OpKind2[OpKind2["
|
|
8523
|
-
OpKind2[OpKind2["
|
|
8524
|
-
OpKind2[OpKind2["
|
|
8525
|
-
OpKind2[OpKind2["
|
|
8526
|
-
OpKind2[OpKind2["
|
|
8527
|
-
OpKind2[OpKind2["
|
|
8528
|
-
OpKind2[OpKind2["
|
|
8529
|
-
OpKind2[OpKind2["
|
|
8530
|
-
OpKind2[OpKind2["
|
|
8531
|
-
OpKind2[OpKind2["
|
|
8532
|
-
OpKind2[OpKind2["
|
|
8533
|
-
OpKind2[OpKind2["
|
|
8534
|
-
OpKind2[OpKind2["
|
|
8535
|
-
OpKind2[OpKind2["
|
|
8536
|
-
OpKind2[OpKind2["
|
|
8537
|
-
OpKind2[OpKind2["
|
|
8538
|
-
OpKind2[OpKind2["
|
|
8539
|
-
OpKind2[OpKind2["
|
|
8540
|
-
OpKind2[OpKind2["
|
|
8541
|
-
OpKind2[OpKind2["
|
|
8542
|
-
OpKind2[OpKind2["
|
|
8543
|
-
OpKind2[OpKind2["
|
|
8544
|
-
OpKind2[OpKind2["
|
|
8545
|
-
OpKind2[OpKind2["I18nAttributes"] = 51] = "I18nAttributes";
|
|
8546
|
-
OpKind2[OpKind2["SourceLocation"] = 52] = "SourceLocation";
|
|
8388
|
+
OpKind2[OpKind2["Conditional"] = 11] = "Conditional";
|
|
8389
|
+
OpKind2[OpKind2["EnableBindings"] = 12] = "EnableBindings";
|
|
8390
|
+
OpKind2[OpKind2["Text"] = 13] = "Text";
|
|
8391
|
+
OpKind2[OpKind2["Listener"] = 14] = "Listener";
|
|
8392
|
+
OpKind2[OpKind2["InterpolateText"] = 15] = "InterpolateText";
|
|
8393
|
+
OpKind2[OpKind2["Binding"] = 16] = "Binding";
|
|
8394
|
+
OpKind2[OpKind2["Property"] = 17] = "Property";
|
|
8395
|
+
OpKind2[OpKind2["StyleProp"] = 18] = "StyleProp";
|
|
8396
|
+
OpKind2[OpKind2["ClassProp"] = 19] = "ClassProp";
|
|
8397
|
+
OpKind2[OpKind2["StyleMap"] = 20] = "StyleMap";
|
|
8398
|
+
OpKind2[OpKind2["ClassMap"] = 21] = "ClassMap";
|
|
8399
|
+
OpKind2[OpKind2["Advance"] = 22] = "Advance";
|
|
8400
|
+
OpKind2[OpKind2["Pipe"] = 23] = "Pipe";
|
|
8401
|
+
OpKind2[OpKind2["Attribute"] = 24] = "Attribute";
|
|
8402
|
+
OpKind2[OpKind2["ExtractedAttribute"] = 25] = "ExtractedAttribute";
|
|
8403
|
+
OpKind2[OpKind2["Defer"] = 26] = "Defer";
|
|
8404
|
+
OpKind2[OpKind2["DeferOn"] = 27] = "DeferOn";
|
|
8405
|
+
OpKind2[OpKind2["DeferWhen"] = 28] = "DeferWhen";
|
|
8406
|
+
OpKind2[OpKind2["I18nMessage"] = 29] = "I18nMessage";
|
|
8407
|
+
OpKind2[OpKind2["HostProperty"] = 30] = "HostProperty";
|
|
8408
|
+
OpKind2[OpKind2["Namespace"] = 31] = "Namespace";
|
|
8409
|
+
OpKind2[OpKind2["ProjectionDef"] = 32] = "ProjectionDef";
|
|
8410
|
+
OpKind2[OpKind2["Projection"] = 33] = "Projection";
|
|
8411
|
+
OpKind2[OpKind2["RepeaterCreate"] = 34] = "RepeaterCreate";
|
|
8412
|
+
OpKind2[OpKind2["Repeater"] = 35] = "Repeater";
|
|
8413
|
+
OpKind2[OpKind2["TwoWayProperty"] = 36] = "TwoWayProperty";
|
|
8414
|
+
OpKind2[OpKind2["TwoWayListener"] = 37] = "TwoWayListener";
|
|
8415
|
+
OpKind2[OpKind2["DeclareLet"] = 38] = "DeclareLet";
|
|
8416
|
+
OpKind2[OpKind2["StoreLet"] = 39] = "StoreLet";
|
|
8417
|
+
OpKind2[OpKind2["I18nStart"] = 40] = "I18nStart";
|
|
8418
|
+
OpKind2[OpKind2["I18n"] = 41] = "I18n";
|
|
8419
|
+
OpKind2[OpKind2["I18nEnd"] = 42] = "I18nEnd";
|
|
8420
|
+
OpKind2[OpKind2["I18nExpression"] = 43] = "I18nExpression";
|
|
8421
|
+
OpKind2[OpKind2["I18nApply"] = 44] = "I18nApply";
|
|
8422
|
+
OpKind2[OpKind2["IcuStart"] = 45] = "IcuStart";
|
|
8423
|
+
OpKind2[OpKind2["IcuEnd"] = 46] = "IcuEnd";
|
|
8424
|
+
OpKind2[OpKind2["IcuPlaceholder"] = 47] = "IcuPlaceholder";
|
|
8425
|
+
OpKind2[OpKind2["I18nContext"] = 48] = "I18nContext";
|
|
8426
|
+
OpKind2[OpKind2["I18nAttributes"] = 49] = "I18nAttributes";
|
|
8427
|
+
OpKind2[OpKind2["SourceLocation"] = 50] = "SourceLocation";
|
|
8547
8428
|
})(OpKind || (OpKind = {}));
|
|
8548
8429
|
var ExpressionKind;
|
|
8549
8430
|
(function(ExpressionKind2) {
|
|
@@ -9784,7 +9665,7 @@ function transformExpressionsInOp(op, transform2, flags) {
|
|
|
9784
9665
|
}
|
|
9785
9666
|
break;
|
|
9786
9667
|
case OpKind.Property:
|
|
9787
|
-
case OpKind.
|
|
9668
|
+
case OpKind.HostProperty:
|
|
9788
9669
|
case OpKind.Attribute:
|
|
9789
9670
|
if (op.expression instanceof Interpolation2) {
|
|
9790
9671
|
transformExpressionsInInterpolation(op.expression, transform2, flags);
|
|
@@ -9900,8 +9781,6 @@ function transformExpressionsInOp(op, transform2, flags) {
|
|
|
9900
9781
|
case OpKind.IcuPlaceholder:
|
|
9901
9782
|
case OpKind.DeclareLet:
|
|
9902
9783
|
case OpKind.SourceLocation:
|
|
9903
|
-
case OpKind.ConditionalCreate:
|
|
9904
|
-
case OpKind.ConditionalBranchCreate:
|
|
9905
9784
|
break;
|
|
9906
9785
|
default:
|
|
9907
9786
|
throw new Error(`AssertionError: transformExpressionsInOp doesn't handle ${OpKind[op.kind]}`);
|
|
@@ -9949,8 +9828,6 @@ function transformExpressionsInExpression(expr, transform2, flags) {
|
|
|
9949
9828
|
}
|
|
9950
9829
|
} else if (expr instanceof TypeofExpr) {
|
|
9951
9830
|
expr.expr = transformExpressionsInExpression(expr.expr, transform2, flags);
|
|
9952
|
-
} else if (expr instanceof VoidExpr) {
|
|
9953
|
-
expr.expr = transformExpressionsInExpression(expr.expr, transform2, flags);
|
|
9954
9831
|
} else if (expr instanceof WriteVarExpr) {
|
|
9955
9832
|
expr.value = transformExpressionsInExpression(expr.value, transform2, flags);
|
|
9956
9833
|
} else if (expr instanceof LocalizedString) {
|
|
@@ -9975,8 +9852,6 @@ function transformExpressionsInExpression(expr, transform2, flags) {
|
|
|
9975
9852
|
for (let i = 0; i < expr.expressions.length; i++) {
|
|
9976
9853
|
expr.expressions[i] = transformExpressionsInExpression(expr.expressions[i], transform2, flags);
|
|
9977
9854
|
}
|
|
9978
|
-
} else if (expr instanceof ParenthesizedExpr) {
|
|
9979
|
-
expr.expr = transformExpressionsInExpression(expr.expr, transform2, flags);
|
|
9980
9855
|
} else if (expr instanceof ReadVarExpr || expr instanceof ExternalExpr || expr instanceof LiteralExpr) ;
|
|
9981
9856
|
else {
|
|
9982
9857
|
throw new Error(`Unhandled expression kind: ${expr.constructor.name}`);
|
|
@@ -10255,9 +10130,7 @@ var elementContainerOpKinds = /* @__PURE__ */ new Set([
|
|
|
10255
10130
|
OpKind.Container,
|
|
10256
10131
|
OpKind.ContainerStart,
|
|
10257
10132
|
OpKind.Template,
|
|
10258
|
-
OpKind.RepeaterCreate
|
|
10259
|
-
OpKind.ConditionalCreate,
|
|
10260
|
-
OpKind.ConditionalBranchCreate
|
|
10133
|
+
OpKind.RepeaterCreate
|
|
10261
10134
|
]);
|
|
10262
10135
|
function isElementOrContainerOp(op) {
|
|
10263
10136
|
return elementContainerOpKinds.has(op.kind);
|
|
@@ -10303,55 +10176,11 @@ function createTemplateOp(xref, templateKind, tag, functionNameSuffix, namespace
|
|
|
10303
10176
|
};
|
|
10304
10177
|
}
|
|
10305
10178
|
__name(createTemplateOp, "createTemplateOp");
|
|
10306
|
-
function
|
|
10179
|
+
function createRepeaterCreateOp(primaryView, emptyView, tag, track, varNames, emptyTag, i18nPlaceholder, emptyI18nPlaceholder, startSourceSpan, wholeSourceSpan) {
|
|
10307
10180
|
return {
|
|
10308
|
-
kind: OpKind.
|
|
10309
|
-
xref,
|
|
10310
|
-
templateKind,
|
|
10181
|
+
kind: OpKind.RepeaterCreate,
|
|
10311
10182
|
attributes: null,
|
|
10312
|
-
|
|
10313
|
-
handle: new SlotHandle(),
|
|
10314
|
-
functionNameSuffix,
|
|
10315
|
-
decls: null,
|
|
10316
|
-
vars: null,
|
|
10317
|
-
localRefs: [],
|
|
10318
|
-
nonBindable: false,
|
|
10319
|
-
namespace,
|
|
10320
|
-
i18nPlaceholder,
|
|
10321
|
-
startSourceSpan,
|
|
10322
|
-
wholeSourceSpan,
|
|
10323
|
-
...TRAIT_CONSUMES_SLOT,
|
|
10324
|
-
...NEW_OP
|
|
10325
|
-
};
|
|
10326
|
-
}
|
|
10327
|
-
__name(createConditionalCreateOp, "createConditionalCreateOp");
|
|
10328
|
-
function createConditionalBranchCreateOp(xref, templateKind, tag, functionNameSuffix, namespace, i18nPlaceholder, startSourceSpan, wholeSourceSpan) {
|
|
10329
|
-
return {
|
|
10330
|
-
kind: OpKind.ConditionalBranchCreate,
|
|
10331
|
-
xref,
|
|
10332
|
-
templateKind,
|
|
10333
|
-
attributes: null,
|
|
10334
|
-
tag,
|
|
10335
|
-
handle: new SlotHandle(),
|
|
10336
|
-
functionNameSuffix,
|
|
10337
|
-
decls: null,
|
|
10338
|
-
vars: null,
|
|
10339
|
-
localRefs: [],
|
|
10340
|
-
nonBindable: false,
|
|
10341
|
-
namespace,
|
|
10342
|
-
i18nPlaceholder,
|
|
10343
|
-
startSourceSpan,
|
|
10344
|
-
wholeSourceSpan,
|
|
10345
|
-
...TRAIT_CONSUMES_SLOT,
|
|
10346
|
-
...NEW_OP
|
|
10347
|
-
};
|
|
10348
|
-
}
|
|
10349
|
-
__name(createConditionalBranchCreateOp, "createConditionalBranchCreateOp");
|
|
10350
|
-
function createRepeaterCreateOp(primaryView, emptyView, tag, track, varNames, emptyTag, i18nPlaceholder, emptyI18nPlaceholder, startSourceSpan, wholeSourceSpan) {
|
|
10351
|
-
return {
|
|
10352
|
-
kind: OpKind.RepeaterCreate,
|
|
10353
|
-
attributes: null,
|
|
10354
|
-
xref: primaryView,
|
|
10183
|
+
xref: primaryView,
|
|
10355
10184
|
handle: new SlotHandle(),
|
|
10356
10185
|
emptyView,
|
|
10357
10186
|
track,
|
|
@@ -10676,9 +10505,9 @@ function createSourceLocationOp(templatePath, locations) {
|
|
|
10676
10505
|
};
|
|
10677
10506
|
}
|
|
10678
10507
|
__name(createSourceLocationOp, "createSourceLocationOp");
|
|
10679
|
-
function
|
|
10508
|
+
function createHostPropertyOp(name, expression, isAnimationTrigger, i18nContext, securityContext, sourceSpan) {
|
|
10680
10509
|
return {
|
|
10681
|
-
kind: OpKind.
|
|
10510
|
+
kind: OpKind.HostProperty,
|
|
10682
10511
|
name,
|
|
10683
10512
|
expression,
|
|
10684
10513
|
isAnimationTrigger,
|
|
@@ -10690,7 +10519,7 @@ function createDomPropertyOp(name, expression, isAnimationTrigger, i18nContext,
|
|
|
10690
10519
|
...NEW_OP
|
|
10691
10520
|
};
|
|
10692
10521
|
}
|
|
10693
|
-
__name(
|
|
10522
|
+
__name(createHostPropertyOp, "createHostPropertyOp");
|
|
10694
10523
|
var CTX_REF = "CTX_REF_MARKER";
|
|
10695
10524
|
var CompilationJobKind;
|
|
10696
10525
|
(function(CompilationJobKind2) {
|
|
@@ -10995,20 +10824,7 @@ function assignI18nSlotDependencies(job) {
|
|
|
10995
10824
|
i18nExpressionsInProgress.push(opToRemove);
|
|
10996
10825
|
continue;
|
|
10997
10826
|
}
|
|
10998
|
-
let hasDifferentTarget = false;
|
|
10999
10827
|
if (hasDependsOnSlotContextTrait(updateOp) && updateOp.target !== createOp.xref) {
|
|
11000
|
-
hasDifferentTarget = true;
|
|
11001
|
-
} else if (
|
|
11002
|
-
// Some expressions may consume slots as well (e.g. `storeLet`).
|
|
11003
|
-
updateOp.kind === OpKind.Statement || updateOp.kind === OpKind.Variable
|
|
11004
|
-
) {
|
|
11005
|
-
visitExpressionsInOp(updateOp, (expr) => {
|
|
11006
|
-
if (!hasDifferentTarget && hasDependsOnSlotContextTrait(expr) && expr.target !== createOp.xref) {
|
|
11007
|
-
hasDifferentTarget = true;
|
|
11008
|
-
}
|
|
11009
|
-
});
|
|
11010
|
-
}
|
|
11011
|
-
if (hasDifferentTarget) {
|
|
11012
10828
|
break;
|
|
11013
10829
|
}
|
|
11014
10830
|
updateOp = updateOp.next;
|
|
@@ -11018,29 +10834,6 @@ function assignI18nSlotDependencies(job) {
|
|
|
11018
10834
|
}
|
|
11019
10835
|
}
|
|
11020
10836
|
__name(assignI18nSlotDependencies, "assignI18nSlotDependencies");
|
|
11021
|
-
function attachSourceLocations(job) {
|
|
11022
|
-
if (!job.enableDebugLocations || job.relativeTemplatePath === null) {
|
|
11023
|
-
return;
|
|
11024
|
-
}
|
|
11025
|
-
for (const unit of job.units) {
|
|
11026
|
-
const locations = [];
|
|
11027
|
-
for (const op of unit.create) {
|
|
11028
|
-
if (op.kind === OpKind.ElementStart || op.kind === OpKind.Element) {
|
|
11029
|
-
const start = op.startSourceSpan.start;
|
|
11030
|
-
locations.push({
|
|
11031
|
-
targetSlot: op.handle,
|
|
11032
|
-
offset: start.offset,
|
|
11033
|
-
line: start.line,
|
|
11034
|
-
column: start.col
|
|
11035
|
-
});
|
|
11036
|
-
}
|
|
11037
|
-
}
|
|
11038
|
-
if (locations.length > 0) {
|
|
11039
|
-
unit.create.push(createSourceLocationOp(job.relativeTemplatePath, locations));
|
|
11040
|
-
}
|
|
11041
|
-
}
|
|
11042
|
-
}
|
|
11043
|
-
__name(attachSourceLocations, "attachSourceLocations");
|
|
11044
10837
|
function createOpXrefMap(unit) {
|
|
11045
10838
|
const map = /* @__PURE__ */ new Map();
|
|
11046
10839
|
for (const op of unit.create) {
|
|
@@ -11238,7 +11031,7 @@ function specializeBindings(job) {
|
|
|
11238
11031
|
case BindingKind.Property:
|
|
11239
11032
|
case BindingKind.Animation:
|
|
11240
11033
|
if (job.kind === CompilationJobKind.Host) {
|
|
11241
|
-
OpList.replace(op,
|
|
11034
|
+
OpList.replace(op, createHostPropertyOp(op.name, op.expression, op.bindingKind === BindingKind.Animation, op.i18nContext, op.securityContext, op.sourceSpan));
|
|
11242
11035
|
} else {
|
|
11243
11036
|
OpList.replace(op, createPropertyOp(op.target, op.name, op.expression, op.bindingKind === BindingKind.Animation, op.securityContext, op.isStructuralTemplateAttribute, op.templateKind, op.i18nContext, op.i18nMessage, op.sourceSpan));
|
|
11244
11037
|
}
|
|
@@ -11258,29 +11051,36 @@ function specializeBindings(job) {
|
|
|
11258
11051
|
}
|
|
11259
11052
|
}
|
|
11260
11053
|
__name(specializeBindings, "specializeBindings");
|
|
11261
|
-
var
|
|
11262
|
-
|
|
11263
|
-
|
|
11264
|
-
|
|
11265
|
-
|
|
11266
|
-
|
|
11267
|
-
|
|
11268
|
-
|
|
11269
|
-
|
|
11270
|
-
|
|
11271
|
-
|
|
11272
|
-
|
|
11273
|
-
|
|
11274
|
-
|
|
11275
|
-
|
|
11276
|
-
|
|
11277
|
-
|
|
11278
|
-
|
|
11279
|
-
|
|
11280
|
-
|
|
11281
|
-
|
|
11282
|
-
|
|
11283
|
-
|
|
11054
|
+
var CHAINABLE = /* @__PURE__ */ new Set([
|
|
11055
|
+
Identifiers.attribute,
|
|
11056
|
+
Identifiers.classProp,
|
|
11057
|
+
Identifiers.element,
|
|
11058
|
+
Identifiers.elementContainer,
|
|
11059
|
+
Identifiers.elementContainerEnd,
|
|
11060
|
+
Identifiers.elementContainerStart,
|
|
11061
|
+
Identifiers.elementEnd,
|
|
11062
|
+
Identifiers.elementStart,
|
|
11063
|
+
Identifiers.hostProperty,
|
|
11064
|
+
Identifiers.i18nExp,
|
|
11065
|
+
Identifiers.listener,
|
|
11066
|
+
Identifiers.listener,
|
|
11067
|
+
Identifiers.property,
|
|
11068
|
+
Identifiers.styleProp,
|
|
11069
|
+
Identifiers.stylePropInterpolate1,
|
|
11070
|
+
Identifiers.stylePropInterpolate2,
|
|
11071
|
+
Identifiers.stylePropInterpolate3,
|
|
11072
|
+
Identifiers.stylePropInterpolate4,
|
|
11073
|
+
Identifiers.stylePropInterpolate5,
|
|
11074
|
+
Identifiers.stylePropInterpolate6,
|
|
11075
|
+
Identifiers.stylePropInterpolate7,
|
|
11076
|
+
Identifiers.stylePropInterpolate8,
|
|
11077
|
+
Identifiers.stylePropInterpolateV,
|
|
11078
|
+
Identifiers.syntheticHostListener,
|
|
11079
|
+
Identifiers.syntheticHostProperty,
|
|
11080
|
+
Identifiers.templateCreate,
|
|
11081
|
+
Identifiers.twoWayProperty,
|
|
11082
|
+
Identifiers.twoWayListener,
|
|
11083
|
+
Identifiers.declareLet
|
|
11284
11084
|
]);
|
|
11285
11085
|
var MAX_CHAIN_LENGTH = 256;
|
|
11286
11086
|
function chain(job) {
|
|
@@ -11302,11 +11102,11 @@ function chainOperationsInList(opList) {
|
|
|
11302
11102
|
continue;
|
|
11303
11103
|
}
|
|
11304
11104
|
const instruction = op.statement.expr.fn.value;
|
|
11305
|
-
if (!
|
|
11105
|
+
if (!CHAINABLE.has(instruction)) {
|
|
11306
11106
|
chain2 = null;
|
|
11307
11107
|
continue;
|
|
11308
11108
|
}
|
|
11309
|
-
if (chain2 !== null &&
|
|
11109
|
+
if (chain2 !== null && chain2.instruction === instruction && chain2.length < MAX_CHAIN_LENGTH) {
|
|
11310
11110
|
const expression = chain2.expression.callFn(op.statement.expr.args, op.statement.expr.sourceSpan, op.statement.expr.pure);
|
|
11311
11111
|
chain2.expression = expression;
|
|
11312
11112
|
chain2.op.statement = expression.toStmt();
|
|
@@ -11326,7 +11126,7 @@ __name(chainOperationsInList, "chainOperationsInList");
|
|
|
11326
11126
|
function collapseSingletonInterpolations(job) {
|
|
11327
11127
|
for (const unit of job.units) {
|
|
11328
11128
|
for (const op of unit.update) {
|
|
11329
|
-
const eligibleOpKind = op.kind === OpKind.Attribute
|
|
11129
|
+
const eligibleOpKind = op.kind === OpKind.Attribute;
|
|
11330
11130
|
if (eligibleOpKind && op.expression instanceof Interpolation2 && op.expression.strings.length === 2 && op.expression.strings.every((s) => s === "")) {
|
|
11331
11131
|
op.expression = op.expression.expressions[0];
|
|
11332
11132
|
}
|
|
@@ -11383,14 +11183,12 @@ var BINARY_OPERATORS = /* @__PURE__ */ new Map([
|
|
|
11383
11183
|
["<=", BinaryOperator.LowerEquals],
|
|
11384
11184
|
["-", BinaryOperator.Minus],
|
|
11385
11185
|
["%", BinaryOperator.Modulo],
|
|
11386
|
-
["**", BinaryOperator.Exponentiation],
|
|
11387
11186
|
["*", BinaryOperator.Multiply],
|
|
11388
11187
|
["!=", BinaryOperator.NotEquals],
|
|
11389
11188
|
["!==", BinaryOperator.NotIdentical],
|
|
11390
11189
|
["??", BinaryOperator.NullishCoalesce],
|
|
11391
11190
|
["||", BinaryOperator.Or],
|
|
11392
|
-
["+", BinaryOperator.Plus]
|
|
11393
|
-
["in", BinaryOperator.In]
|
|
11191
|
+
["+", BinaryOperator.Plus]
|
|
11394
11192
|
]);
|
|
11395
11193
|
function namespaceForKey(namespacePrefixKey) {
|
|
11396
11194
|
const NAMESPACES = /* @__PURE__ */ new Map([
|
|
@@ -11657,6 +11455,30 @@ function convertI18nBindings(job) {
|
|
|
11657
11455
|
}
|
|
11658
11456
|
}
|
|
11659
11457
|
__name(convertI18nBindings, "convertI18nBindings");
|
|
11458
|
+
function resolveDeferDepsFns(job) {
|
|
11459
|
+
for (const unit of job.units) {
|
|
11460
|
+
for (const op of unit.create) {
|
|
11461
|
+
if (op.kind === OpKind.Defer) {
|
|
11462
|
+
if (op.resolverFn !== null) {
|
|
11463
|
+
continue;
|
|
11464
|
+
}
|
|
11465
|
+
if (op.ownResolverFn !== null) {
|
|
11466
|
+
if (op.handle.slot === null) {
|
|
11467
|
+
throw new Error("AssertionError: slot must be assigned before extracting defer deps functions");
|
|
11468
|
+
}
|
|
11469
|
+
const fullPathName = unit.fnName?.replace("_Template", "");
|
|
11470
|
+
op.resolverFn = job.pool.getSharedFunctionReference(
|
|
11471
|
+
op.ownResolverFn,
|
|
11472
|
+
`${fullPathName}_Defer_${op.handle.slot}_DepsFn`,
|
|
11473
|
+
/* Don't use unique names for TDB compatibility */
|
|
11474
|
+
false
|
|
11475
|
+
);
|
|
11476
|
+
}
|
|
11477
|
+
}
|
|
11478
|
+
}
|
|
11479
|
+
}
|
|
11480
|
+
}
|
|
11481
|
+
__name(resolveDeferDepsFns, "resolveDeferDepsFns");
|
|
11660
11482
|
function createI18nContexts(job) {
|
|
11661
11483
|
const attrContextByMessage = /* @__PURE__ */ new Map();
|
|
11662
11484
|
for (const unit of job.units) {
|
|
@@ -11919,8 +11741,6 @@ function needsTemporaryInSafeAccess(e) {
|
|
|
11919
11741
|
return needsTemporaryInSafeAccess(e.receiver);
|
|
11920
11742
|
} else if (e instanceof ReadKeyExpr) {
|
|
11921
11743
|
return needsTemporaryInSafeAccess(e.receiver) || needsTemporaryInSafeAccess(e.index);
|
|
11922
|
-
} else if (e instanceof ParenthesizedExpr) {
|
|
11923
|
-
return needsTemporaryInSafeAccess(e.expr);
|
|
11924
11744
|
}
|
|
11925
11745
|
return e instanceof InvokeFunctionExpr || e instanceof LiteralArrayExpr || e instanceof LiteralMapExpr || e instanceof SafeInvokeFunctionExpr || e instanceof PipeBindingExpr;
|
|
11926
11746
|
}
|
|
@@ -12030,7 +11850,7 @@ function ternaryTransform(e) {
|
|
|
12030
11850
|
if (!(e instanceof SafeTernaryExpr)) {
|
|
12031
11851
|
return e;
|
|
12032
11852
|
}
|
|
12033
|
-
return new
|
|
11853
|
+
return new ConditionalExpr(new BinaryOperatorExpr(BinaryOperator.Equals, e.guard, NULL_EXPR), NULL_EXPR, e.expr);
|
|
12034
11854
|
}
|
|
12035
11855
|
__name(ternaryTransform, "ternaryTransform");
|
|
12036
11856
|
var ESCAPE$1 = "\uFFFD";
|
|
@@ -12220,23 +12040,6 @@ function generateAdvance(job) {
|
|
|
12220
12040
|
}
|
|
12221
12041
|
}
|
|
12222
12042
|
__name(generateAdvance, "generateAdvance");
|
|
12223
|
-
function generateLocalLetReferences(job) {
|
|
12224
|
-
for (const unit of job.units) {
|
|
12225
|
-
for (const op of unit.update) {
|
|
12226
|
-
if (op.kind !== OpKind.StoreLet) {
|
|
12227
|
-
continue;
|
|
12228
|
-
}
|
|
12229
|
-
const variable2 = {
|
|
12230
|
-
kind: SemanticVariableKind.Identifier,
|
|
12231
|
-
name: null,
|
|
12232
|
-
identifier: op.declaredName,
|
|
12233
|
-
local: true
|
|
12234
|
-
};
|
|
12235
|
-
OpList.replace(op, createVariableOp(job.allocateXrefId(), variable2, new StoreLetExpr(op.target, op.value, op.sourceSpan), VariableFlags.None));
|
|
12236
|
-
}
|
|
12237
|
-
}
|
|
12238
|
-
}
|
|
12239
|
-
__name(generateLocalLetReferences, "generateLocalLetReferences");
|
|
12240
12043
|
function generateProjectionDefs(job) {
|
|
12241
12044
|
const share = job.compatibility === CompatibilityMode.TemplateDefinitionBuilder;
|
|
12242
12045
|
const selectors = [];
|
|
@@ -12272,8 +12075,6 @@ function recursivelyProcessView(view, parentScope) {
|
|
|
12272
12075
|
const scope = getScopeForView(view, parentScope);
|
|
12273
12076
|
for (const op of view.create) {
|
|
12274
12077
|
switch (op.kind) {
|
|
12275
|
-
case OpKind.ConditionalCreate:
|
|
12276
|
-
case OpKind.ConditionalBranchCreate:
|
|
12277
12078
|
case OpKind.Template:
|
|
12278
12079
|
recursivelyProcessView(view.job.views.get(op.xref), scope);
|
|
12279
12080
|
break;
|
|
@@ -12325,8 +12126,6 @@ function getScopeForView(view, parent) {
|
|
|
12325
12126
|
for (const op of view.create) {
|
|
12326
12127
|
switch (op.kind) {
|
|
12327
12128
|
case OpKind.ElementStart:
|
|
12328
|
-
case OpKind.ConditionalCreate:
|
|
12329
|
-
case OpKind.ConditionalBranchCreate:
|
|
12330
12129
|
case OpKind.Template:
|
|
12331
12130
|
if (!Array.isArray(op.localRefs)) {
|
|
12332
12131
|
throw new Error(`AssertionError: expected localRefs to be an array`);
|
|
@@ -12604,15 +12403,13 @@ var Element2 = class extends NodeWithI18n {
|
|
|
12604
12403
|
}
|
|
12605
12404
|
name;
|
|
12606
12405
|
attrs;
|
|
12607
|
-
directives;
|
|
12608
12406
|
children;
|
|
12609
12407
|
startSourceSpan;
|
|
12610
12408
|
endSourceSpan;
|
|
12611
|
-
constructor(name, attrs,
|
|
12409
|
+
constructor(name, attrs, children, sourceSpan, startSourceSpan, endSourceSpan = null, i18n2) {
|
|
12612
12410
|
super(sourceSpan, i18n2);
|
|
12613
12411
|
this.name = name;
|
|
12614
12412
|
this.attrs = attrs;
|
|
12615
|
-
this.directives = directives;
|
|
12616
12413
|
this.children = children;
|
|
12617
12414
|
this.startSourceSpan = startSourceSpan;
|
|
12618
12415
|
this.endSourceSpan = endSourceSpan;
|
|
@@ -12658,53 +12455,6 @@ var Block = class extends NodeWithI18n {
|
|
|
12658
12455
|
return visitor.visitBlock(this, context);
|
|
12659
12456
|
}
|
|
12660
12457
|
};
|
|
12661
|
-
var Component2 = class extends NodeWithI18n {
|
|
12662
|
-
static {
|
|
12663
|
-
__name(this, "Component");
|
|
12664
|
-
}
|
|
12665
|
-
componentName;
|
|
12666
|
-
tagName;
|
|
12667
|
-
fullName;
|
|
12668
|
-
attrs;
|
|
12669
|
-
directives;
|
|
12670
|
-
children;
|
|
12671
|
-
startSourceSpan;
|
|
12672
|
-
endSourceSpan;
|
|
12673
|
-
constructor(componentName, tagName, fullName, attrs, directives, children, sourceSpan, startSourceSpan, endSourceSpan = null, i18n2) {
|
|
12674
|
-
super(sourceSpan, i18n2);
|
|
12675
|
-
this.componentName = componentName;
|
|
12676
|
-
this.tagName = tagName;
|
|
12677
|
-
this.fullName = fullName;
|
|
12678
|
-
this.attrs = attrs;
|
|
12679
|
-
this.directives = directives;
|
|
12680
|
-
this.children = children;
|
|
12681
|
-
this.startSourceSpan = startSourceSpan;
|
|
12682
|
-
this.endSourceSpan = endSourceSpan;
|
|
12683
|
-
}
|
|
12684
|
-
visit(visitor, context) {
|
|
12685
|
-
return visitor.visitComponent(this, context);
|
|
12686
|
-
}
|
|
12687
|
-
};
|
|
12688
|
-
var Directive2 = class {
|
|
12689
|
-
static {
|
|
12690
|
-
__name(this, "Directive");
|
|
12691
|
-
}
|
|
12692
|
-
name;
|
|
12693
|
-
attrs;
|
|
12694
|
-
sourceSpan;
|
|
12695
|
-
startSourceSpan;
|
|
12696
|
-
endSourceSpan;
|
|
12697
|
-
constructor(name, attrs, sourceSpan, startSourceSpan, endSourceSpan = null) {
|
|
12698
|
-
this.name = name;
|
|
12699
|
-
this.attrs = attrs;
|
|
12700
|
-
this.sourceSpan = sourceSpan;
|
|
12701
|
-
this.startSourceSpan = startSourceSpan;
|
|
12702
|
-
this.endSourceSpan = endSourceSpan;
|
|
12703
|
-
}
|
|
12704
|
-
visit(visitor, context) {
|
|
12705
|
-
return visitor.visitDirective(this, context);
|
|
12706
|
-
}
|
|
12707
|
-
};
|
|
12708
12458
|
var BlockParameter = class {
|
|
12709
12459
|
static {
|
|
12710
12460
|
__name(this, "BlockParameter");
|
|
@@ -12760,7 +12510,6 @@ var RecursiveVisitor2 = class {
|
|
|
12760
12510
|
visitElement(ast, context) {
|
|
12761
12511
|
this.visitChildren(context, (visit) => {
|
|
12762
12512
|
visit(ast.attrs);
|
|
12763
|
-
visit(ast.directives);
|
|
12764
12513
|
visit(ast.children);
|
|
12765
12514
|
});
|
|
12766
12515
|
}
|
|
@@ -12787,17 +12536,6 @@ var RecursiveVisitor2 = class {
|
|
|
12787
12536
|
}
|
|
12788
12537
|
visitLetDeclaration(decl, context) {
|
|
12789
12538
|
}
|
|
12790
|
-
visitComponent(component, context) {
|
|
12791
|
-
this.visitChildren(context, (visit) => {
|
|
12792
|
-
visit(component.attrs);
|
|
12793
|
-
visit(component.children);
|
|
12794
|
-
});
|
|
12795
|
-
}
|
|
12796
|
-
visitDirective(directive, context) {
|
|
12797
|
-
this.visitChildren(context, (visit) => {
|
|
12798
|
-
visit(directive.attrs);
|
|
12799
|
-
});
|
|
12800
|
-
}
|
|
12801
12539
|
visitChildren(context, cb) {
|
|
12802
12540
|
let results = [];
|
|
12803
12541
|
let t = this;
|
|
@@ -15008,13 +14746,11 @@ var _Tokenizer = class {
|
|
|
15008
14746
|
_currentTokenStart = null;
|
|
15009
14747
|
_currentTokenType = null;
|
|
15010
14748
|
_expansionCaseStack = [];
|
|
15011
|
-
_openDirectiveCount = 0;
|
|
15012
14749
|
_inInterpolation = false;
|
|
15013
14750
|
_preserveLineEndings;
|
|
15014
14751
|
_i18nNormalizeLineEndingsInICUs;
|
|
15015
14752
|
_tokenizeBlocks;
|
|
15016
14753
|
_tokenizeLet;
|
|
15017
|
-
_selectorlessEnabled;
|
|
15018
14754
|
tokens = [];
|
|
15019
14755
|
errors = [];
|
|
15020
14756
|
nonNormalizedIcuExpressions = [];
|
|
@@ -15039,7 +14775,6 @@ var _Tokenizer = class {
|
|
|
15039
14775
|
this._i18nNormalizeLineEndingsInICUs = options.i18nNormalizeLineEndingsInICUs || false;
|
|
15040
14776
|
this._tokenizeBlocks = options.tokenizeBlocks ?? true;
|
|
15041
14777
|
this._tokenizeLet = options.tokenizeLet ?? true;
|
|
15042
|
-
this._selectorlessEnabled = options.selectorlessEnabled ?? false;
|
|
15043
14778
|
try {
|
|
15044
14779
|
this._cursor.init();
|
|
15045
14780
|
} catch (e) {
|
|
@@ -15086,7 +14821,7 @@ var _Tokenizer = class {
|
|
|
15086
14821
|
}
|
|
15087
14822
|
}
|
|
15088
14823
|
this._beginToken(
|
|
15089
|
-
|
|
14824
|
+
33
|
|
15090
14825
|
/* TokenType.EOF */
|
|
15091
14826
|
);
|
|
15092
14827
|
this._endToken([]);
|
|
@@ -15471,7 +15206,7 @@ var _Tokenizer = class {
|
|
|
15471
15206
|
this._cursor.advance();
|
|
15472
15207
|
this._endToken([content]);
|
|
15473
15208
|
}
|
|
15474
|
-
_consumePrefixAndName(
|
|
15209
|
+
_consumePrefixAndName() {
|
|
15475
15210
|
const nameOrPrefixStart = this._cursor.clone();
|
|
15476
15211
|
let prefix = "";
|
|
15477
15212
|
while (this._cursor.peek() !== $COLON && !isPrefixEnd(this._cursor.peek())) {
|
|
@@ -15485,56 +15220,36 @@ var _Tokenizer = class {
|
|
|
15485
15220
|
} else {
|
|
15486
15221
|
nameStart = nameOrPrefixStart;
|
|
15487
15222
|
}
|
|
15488
|
-
this._requireCharCodeUntilFn(
|
|
15223
|
+
this._requireCharCodeUntilFn(isNameEnd, prefix === "" ? 0 : 1);
|
|
15489
15224
|
const name = this._cursor.getChars(nameStart);
|
|
15490
15225
|
return [prefix, name];
|
|
15491
15226
|
}
|
|
15492
15227
|
_consumeTagOpen(start) {
|
|
15493
15228
|
let tagName;
|
|
15494
15229
|
let prefix;
|
|
15495
|
-
let
|
|
15496
|
-
let openToken;
|
|
15230
|
+
let openTagToken;
|
|
15497
15231
|
try {
|
|
15498
|
-
if (
|
|
15499
|
-
|
|
15500
|
-
|
|
15501
|
-
|
|
15502
|
-
|
|
15503
|
-
|
|
15504
|
-
|
|
15505
|
-
|
|
15506
|
-
|
|
15232
|
+
if (!isAsciiLetter(this._cursor.peek())) {
|
|
15233
|
+
throw this._createError(_unexpectedCharacterErrorMsg(this._cursor.peek()), this._cursor.getSpan(start));
|
|
15234
|
+
}
|
|
15235
|
+
openTagToken = this._consumeTagOpenStart(start);
|
|
15236
|
+
prefix = openTagToken.parts[0];
|
|
15237
|
+
tagName = openTagToken.parts[1];
|
|
15238
|
+
this._attemptCharCodeUntilFn(isNotWhitespace);
|
|
15239
|
+
while (this._cursor.peek() !== $SLASH && this._cursor.peek() !== $GT && this._cursor.peek() !== $LT && this._cursor.peek() !== $EOF) {
|
|
15240
|
+
this._consumeAttributeName();
|
|
15507
15241
|
this._attemptCharCodeUntilFn(isNotWhitespace);
|
|
15508
|
-
|
|
15509
|
-
|
|
15510
|
-
|
|
15242
|
+
if (this._attemptCharCode($EQ)) {
|
|
15243
|
+
this._attemptCharCodeUntilFn(isNotWhitespace);
|
|
15244
|
+
this._consumeAttributeValue();
|
|
15511
15245
|
}
|
|
15512
|
-
openToken = this._consumeTagOpenStart(start);
|
|
15513
|
-
prefix = openToken.parts[0];
|
|
15514
|
-
tagName = closingTagName = openToken.parts[1];
|
|
15515
15246
|
this._attemptCharCodeUntilFn(isNotWhitespace);
|
|
15516
15247
|
}
|
|
15517
|
-
|
|
15518
|
-
if (this._selectorlessEnabled && this._cursor.peek() === $AT) {
|
|
15519
|
-
const start2 = this._cursor.clone();
|
|
15520
|
-
const nameStart = start2.clone();
|
|
15521
|
-
nameStart.advance();
|
|
15522
|
-
if (isSelectorlessNameStart(nameStart.peek())) {
|
|
15523
|
-
this._consumeDirective(start2, nameStart);
|
|
15524
|
-
}
|
|
15525
|
-
} else {
|
|
15526
|
-
this._consumeAttribute();
|
|
15527
|
-
}
|
|
15528
|
-
}
|
|
15529
|
-
if (openToken.type === 33) {
|
|
15530
|
-
this._consumeComponentOpenEnd();
|
|
15531
|
-
} else {
|
|
15532
|
-
this._consumeTagOpenEnd();
|
|
15533
|
-
}
|
|
15248
|
+
this._consumeTagOpenEnd();
|
|
15534
15249
|
} catch (e) {
|
|
15535
15250
|
if (e instanceof _ControlFlowError) {
|
|
15536
|
-
if (
|
|
15537
|
-
|
|
15251
|
+
if (openTagToken) {
|
|
15252
|
+
openTagToken.type = 4;
|
|
15538
15253
|
} else {
|
|
15539
15254
|
this._beginToken(5, start);
|
|
15540
15255
|
this._endToken(["<"]);
|
|
@@ -15545,12 +15260,12 @@ var _Tokenizer = class {
|
|
|
15545
15260
|
}
|
|
15546
15261
|
const contentTokenType = this._getTagDefinition(tagName).getContentType(prefix);
|
|
15547
15262
|
if (contentTokenType === TagContentType.RAW_TEXT) {
|
|
15548
|
-
this._consumeRawTextWithTagClose(
|
|
15263
|
+
this._consumeRawTextWithTagClose(prefix, tagName, false);
|
|
15549
15264
|
} else if (contentTokenType === TagContentType.ESCAPABLE_RAW_TEXT) {
|
|
15550
|
-
this._consumeRawTextWithTagClose(
|
|
15265
|
+
this._consumeRawTextWithTagClose(prefix, tagName, true);
|
|
15551
15266
|
}
|
|
15552
15267
|
}
|
|
15553
|
-
_consumeRawTextWithTagClose(
|
|
15268
|
+
_consumeRawTextWithTagClose(prefix, tagName, consumeEntities) {
|
|
15554
15269
|
this._consumeRawText(consumeEntities, () => {
|
|
15555
15270
|
if (!this._attemptCharCode($LT))
|
|
15556
15271
|
return false;
|
|
@@ -15563,46 +15278,18 @@ var _Tokenizer = class {
|
|
|
15563
15278
|
return this._attemptCharCode($GT);
|
|
15564
15279
|
});
|
|
15565
15280
|
this._beginToken(
|
|
15566
|
-
|
|
15281
|
+
3
|
|
15567
15282
|
/* TokenType.TAG_CLOSE */
|
|
15568
15283
|
);
|
|
15569
15284
|
this._requireCharCodeUntilFn((code) => code === $GT, 3);
|
|
15570
15285
|
this._cursor.advance();
|
|
15571
|
-
this._endToken(
|
|
15286
|
+
this._endToken([prefix, tagName]);
|
|
15572
15287
|
}
|
|
15573
15288
|
_consumeTagOpenStart(start) {
|
|
15574
15289
|
this._beginToken(0, start);
|
|
15575
|
-
const parts = this._consumePrefixAndName(
|
|
15576
|
-
return this._endToken(parts);
|
|
15577
|
-
}
|
|
15578
|
-
_consumeComponentOpenStart(start) {
|
|
15579
|
-
this._beginToken(33, start);
|
|
15580
|
-
const parts = this._consumeComponentName();
|
|
15290
|
+
const parts = this._consumePrefixAndName();
|
|
15581
15291
|
return this._endToken(parts);
|
|
15582
15292
|
}
|
|
15583
|
-
_consumeComponentName() {
|
|
15584
|
-
const nameStart = this._cursor.clone();
|
|
15585
|
-
while (isSelectorlessNameChar(this._cursor.peek())) {
|
|
15586
|
-
this._cursor.advance();
|
|
15587
|
-
}
|
|
15588
|
-
const name = this._cursor.getChars(nameStart);
|
|
15589
|
-
let prefix = "";
|
|
15590
|
-
let tagName = "";
|
|
15591
|
-
if (this._cursor.peek() === $COLON) {
|
|
15592
|
-
this._cursor.advance();
|
|
15593
|
-
[prefix, tagName] = this._consumePrefixAndName(isNameEnd);
|
|
15594
|
-
}
|
|
15595
|
-
return [name, prefix, tagName];
|
|
15596
|
-
}
|
|
15597
|
-
_consumeAttribute() {
|
|
15598
|
-
this._consumeAttributeName();
|
|
15599
|
-
this._attemptCharCodeUntilFn(isNotWhitespace);
|
|
15600
|
-
if (this._attemptCharCode($EQ)) {
|
|
15601
|
-
this._attemptCharCodeUntilFn(isNotWhitespace);
|
|
15602
|
-
this._consumeAttributeValue();
|
|
15603
|
-
}
|
|
15604
|
-
this._attemptCharCodeUntilFn(isNotWhitespace);
|
|
15605
|
-
}
|
|
15606
15293
|
_consumeAttributeName() {
|
|
15607
15294
|
const attrNameStart = this._cursor.peek();
|
|
15608
15295
|
if (attrNameStart === $SQ || attrNameStart === $DQ) {
|
|
@@ -15612,26 +15299,7 @@ var _Tokenizer = class {
|
|
|
15612
15299
|
14
|
|
15613
15300
|
/* TokenType.ATTR_NAME */
|
|
15614
15301
|
);
|
|
15615
|
-
|
|
15616
|
-
if (this._openDirectiveCount > 0) {
|
|
15617
|
-
let openParens = 0;
|
|
15618
|
-
nameEndPredicate = /* @__PURE__ */ __name((code) => {
|
|
15619
|
-
if (this._openDirectiveCount > 0) {
|
|
15620
|
-
if (code === $LPAREN) {
|
|
15621
|
-
openParens++;
|
|
15622
|
-
} else if (code === $RPAREN) {
|
|
15623
|
-
if (openParens === 0) {
|
|
15624
|
-
return true;
|
|
15625
|
-
}
|
|
15626
|
-
openParens--;
|
|
15627
|
-
}
|
|
15628
|
-
}
|
|
15629
|
-
return isNameEnd(code);
|
|
15630
|
-
}, "nameEndPredicate");
|
|
15631
|
-
} else {
|
|
15632
|
-
nameEndPredicate = isNameEnd;
|
|
15633
|
-
}
|
|
15634
|
-
const prefixAndName = this._consumePrefixAndName(nameEndPredicate);
|
|
15302
|
+
const prefixAndName = this._consumePrefixAndName();
|
|
15635
15303
|
this._endToken(prefixAndName);
|
|
15636
15304
|
}
|
|
15637
15305
|
_consumeAttributeValue() {
|
|
@@ -15660,30 +15328,10 @@ var _Tokenizer = class {
|
|
|
15660
15328
|
this._requireCharCode($GT);
|
|
15661
15329
|
this._endToken([]);
|
|
15662
15330
|
}
|
|
15663
|
-
_consumeComponentOpenEnd() {
|
|
15664
|
-
const tokenType = this._attemptCharCode($SLASH) ? 35 : 34;
|
|
15665
|
-
this._beginToken(tokenType);
|
|
15666
|
-
this._requireCharCode($GT);
|
|
15667
|
-
this._endToken([]);
|
|
15668
|
-
}
|
|
15669
15331
|
_consumeTagClose(start) {
|
|
15670
|
-
if (this._selectorlessEnabled) {
|
|
15671
|
-
const clone = start.clone();
|
|
15672
|
-
while (clone.peek() !== $GT && !isSelectorlessNameStart(clone.peek())) {
|
|
15673
|
-
clone.advance();
|
|
15674
|
-
}
|
|
15675
|
-
if (isSelectorlessNameStart(clone.peek())) {
|
|
15676
|
-
this._beginToken(36, start);
|
|
15677
|
-
const parts = this._consumeComponentName();
|
|
15678
|
-
this._attemptCharCodeUntilFn(isNotWhitespace);
|
|
15679
|
-
this._requireCharCode($GT);
|
|
15680
|
-
this._endToken(parts);
|
|
15681
|
-
return;
|
|
15682
|
-
}
|
|
15683
|
-
}
|
|
15684
15332
|
this._beginToken(3, start);
|
|
15685
15333
|
this._attemptCharCodeUntilFn(isNotWhitespace);
|
|
15686
|
-
const prefixAndName = this._consumePrefixAndName(
|
|
15334
|
+
const prefixAndName = this._consumePrefixAndName();
|
|
15687
15335
|
this._attemptCharCodeUntilFn(isNotWhitespace);
|
|
15688
15336
|
this._requireCharCode($GT);
|
|
15689
15337
|
this._endToken(prefixAndName);
|
|
@@ -15845,46 +15493,6 @@ var _Tokenizer = class {
|
|
|
15845
15493
|
parts.push(this._getProcessedChars(expressionStart, this._cursor));
|
|
15846
15494
|
this._endToken(parts);
|
|
15847
15495
|
}
|
|
15848
|
-
_consumeDirective(start, nameStart) {
|
|
15849
|
-
this._requireCharCode($AT);
|
|
15850
|
-
this._cursor.advance();
|
|
15851
|
-
while (isSelectorlessNameChar(this._cursor.peek())) {
|
|
15852
|
-
this._cursor.advance();
|
|
15853
|
-
}
|
|
15854
|
-
this._beginToken(38, start);
|
|
15855
|
-
const name = this._cursor.getChars(nameStart);
|
|
15856
|
-
this._endToken([name]);
|
|
15857
|
-
this._attemptCharCodeUntilFn(isNotWhitespace);
|
|
15858
|
-
if (this._cursor.peek() !== $LPAREN) {
|
|
15859
|
-
return;
|
|
15860
|
-
}
|
|
15861
|
-
this._openDirectiveCount++;
|
|
15862
|
-
this._beginToken(
|
|
15863
|
-
39
|
|
15864
|
-
/* TokenType.DIRECTIVE_OPEN */
|
|
15865
|
-
);
|
|
15866
|
-
this._cursor.advance();
|
|
15867
|
-
this._endToken([]);
|
|
15868
|
-
this._attemptCharCodeUntilFn(isNotWhitespace);
|
|
15869
|
-
while (!isAttributeTerminator(this._cursor.peek()) && this._cursor.peek() !== $RPAREN) {
|
|
15870
|
-
this._consumeAttribute();
|
|
15871
|
-
}
|
|
15872
|
-
this._attemptCharCodeUntilFn(isNotWhitespace);
|
|
15873
|
-
this._openDirectiveCount--;
|
|
15874
|
-
if (this._cursor.peek() !== $RPAREN) {
|
|
15875
|
-
if (this._cursor.peek() === $GT || this._cursor.peek() === $SLASH) {
|
|
15876
|
-
return;
|
|
15877
|
-
}
|
|
15878
|
-
throw this._createError(_unexpectedCharacterErrorMsg(this._cursor.peek()), this._cursor.getSpan(start));
|
|
15879
|
-
}
|
|
15880
|
-
this._beginToken(
|
|
15881
|
-
40
|
|
15882
|
-
/* TokenType.DIRECTIVE_CLOSE */
|
|
15883
|
-
);
|
|
15884
|
-
this._cursor.advance();
|
|
15885
|
-
this._endToken([]);
|
|
15886
|
-
this._attemptCharCodeUntilFn(isNotWhitespace);
|
|
15887
|
-
}
|
|
15888
15496
|
_getProcessedChars(start, end) {
|
|
15889
15497
|
return this._processCarriageReturns(end.getChars(start));
|
|
15890
15498
|
}
|
|
@@ -15987,18 +15595,6 @@ function isBlockParameterChar(code) {
|
|
|
15987
15595
|
return code !== $SEMICOLON && isNotWhitespace(code);
|
|
15988
15596
|
}
|
|
15989
15597
|
__name(isBlockParameterChar, "isBlockParameterChar");
|
|
15990
|
-
function isSelectorlessNameStart(code) {
|
|
15991
|
-
return code === $_ || code >= $A && code <= $Z;
|
|
15992
|
-
}
|
|
15993
|
-
__name(isSelectorlessNameStart, "isSelectorlessNameStart");
|
|
15994
|
-
function isSelectorlessNameChar(code) {
|
|
15995
|
-
return isAsciiLetter(code) || isDigit(code) || code === $_;
|
|
15996
|
-
}
|
|
15997
|
-
__name(isSelectorlessNameChar, "isSelectorlessNameChar");
|
|
15998
|
-
function isAttributeTerminator(code) {
|
|
15999
|
-
return code === $SLASH || code === $GT || code === $LT || code === $EOF;
|
|
16000
|
-
}
|
|
16001
|
-
__name(isAttributeTerminator, "isAttributeTerminator");
|
|
16002
15598
|
function mergeTextTokens(srcTokens) {
|
|
16003
15599
|
const dstTokens = [];
|
|
16004
15600
|
let lastDstToken = void 0;
|
|
@@ -16278,24 +15874,24 @@ var _TreeBuilder = class __TreeBuilder {
|
|
|
16278
15874
|
__name(this, "_TreeBuilder");
|
|
16279
15875
|
}
|
|
16280
15876
|
tokens;
|
|
16281
|
-
|
|
15877
|
+
getTagDefinition;
|
|
16282
15878
|
_index = -1;
|
|
16283
15879
|
// `_peek` will be initialized by the call to `_advance()` in the constructor.
|
|
16284
15880
|
_peek;
|
|
16285
15881
|
_containerStack = [];
|
|
16286
15882
|
rootNodes = [];
|
|
16287
15883
|
errors = [];
|
|
16288
|
-
constructor(tokens,
|
|
15884
|
+
constructor(tokens, getTagDefinition) {
|
|
16289
15885
|
this.tokens = tokens;
|
|
16290
|
-
this.
|
|
15886
|
+
this.getTagDefinition = getTagDefinition;
|
|
16291
15887
|
this._advance();
|
|
16292
15888
|
}
|
|
16293
15889
|
build() {
|
|
16294
|
-
while (this._peek.type !==
|
|
15890
|
+
while (this._peek.type !== 33) {
|
|
16295
15891
|
if (this._peek.type === 0 || this._peek.type === 4) {
|
|
16296
|
-
this.
|
|
15892
|
+
this._consumeStartTag(this._advance());
|
|
16297
15893
|
} else if (this._peek.type === 3) {
|
|
16298
|
-
this.
|
|
15894
|
+
this._consumeEndTag(this._advance());
|
|
16299
15895
|
} else if (this._peek.type === 12) {
|
|
16300
15896
|
this._closeVoidElement();
|
|
16301
15897
|
this._consumeCdata(this._advance());
|
|
@@ -16322,10 +15918,6 @@ var _TreeBuilder = class __TreeBuilder {
|
|
|
16322
15918
|
} else if (this._peek.type === 32) {
|
|
16323
15919
|
this._closeVoidElement();
|
|
16324
15920
|
this._consumeIncompleteLet(this._advance());
|
|
16325
|
-
} else if (this._peek.type === 33 || this._peek.type === 37) {
|
|
16326
|
-
this._consumeComponentStartTag(this._advance());
|
|
16327
|
-
} else if (this._peek.type === 36) {
|
|
16328
|
-
this._consumeComponentEndTag(this._advance());
|
|
16329
15921
|
} else {
|
|
16330
15922
|
this._advance();
|
|
16331
15923
|
}
|
|
@@ -16399,8 +15991,8 @@ var _TreeBuilder = class __TreeBuilder {
|
|
|
16399
15991
|
if (!exp)
|
|
16400
15992
|
return null;
|
|
16401
15993
|
const end = this._advance();
|
|
16402
|
-
exp.push({ type:
|
|
16403
|
-
const expansionCaseParser = new __TreeBuilder(exp, this.
|
|
15994
|
+
exp.push({ type: 33, parts: [], sourceSpan: end.sourceSpan });
|
|
15995
|
+
const expansionCaseParser = new __TreeBuilder(exp, this.getTagDefinition);
|
|
16404
15996
|
expansionCaseParser.build();
|
|
16405
15997
|
if (expansionCaseParser.errors.length > 0) {
|
|
16406
15998
|
this.errors = this.errors.concat(expansionCaseParser.errors);
|
|
@@ -16446,7 +16038,7 @@ var _TreeBuilder = class __TreeBuilder {
|
|
|
16446
16038
|
return null;
|
|
16447
16039
|
}
|
|
16448
16040
|
}
|
|
16449
|
-
if (this._peek.type ===
|
|
16041
|
+
if (this._peek.type === 33) {
|
|
16450
16042
|
this.errors.push(TreeError.create(null, start.sourceSpan, `Invalid ICU message. Missing '}'.`));
|
|
16451
16043
|
return null;
|
|
16452
16044
|
}
|
|
@@ -16459,7 +16051,7 @@ var _TreeBuilder = class __TreeBuilder {
|
|
|
16459
16051
|
let text2 = token.parts[0];
|
|
16460
16052
|
if (text2.length > 0 && text2[0] === "\n") {
|
|
16461
16053
|
const parent = this._getContainer();
|
|
16462
|
-
if (parent != null && parent.children.length === 0 && this.
|
|
16054
|
+
if (parent != null && parent.children.length === 0 && this.getTagDefinition(parent.name).ignoreFirstLf) {
|
|
16463
16055
|
text2 = text2.substring(1);
|
|
16464
16056
|
tokens[0] = { type: token.type, sourceSpan: token.sourceSpan, parts: [text2] };
|
|
16465
16057
|
}
|
|
@@ -16482,21 +16074,23 @@ var _TreeBuilder = class __TreeBuilder {
|
|
|
16482
16074
|
}
|
|
16483
16075
|
_closeVoidElement() {
|
|
16484
16076
|
const el = this._getContainer();
|
|
16485
|
-
if (el
|
|
16077
|
+
if (el instanceof Element2 && this.getTagDefinition(el.name).isVoid) {
|
|
16486
16078
|
this._containerStack.pop();
|
|
16487
16079
|
}
|
|
16488
16080
|
}
|
|
16489
|
-
|
|
16081
|
+
_consumeStartTag(startTagToken) {
|
|
16082
|
+
const [prefix, name] = startTagToken.parts;
|
|
16490
16083
|
const attrs = [];
|
|
16491
|
-
|
|
16492
|
-
|
|
16493
|
-
|
|
16084
|
+
while (this._peek.type === 14) {
|
|
16085
|
+
attrs.push(this._consumeAttr(this._advance()));
|
|
16086
|
+
}
|
|
16087
|
+
const fullName = this._getElementFullName(prefix, name, this._getClosestParentElement());
|
|
16494
16088
|
let selfClosing = false;
|
|
16495
16089
|
if (this._peek.type === 2) {
|
|
16496
16090
|
this._advance();
|
|
16497
16091
|
selfClosing = true;
|
|
16498
|
-
const tagDef = this.
|
|
16499
|
-
if (!(tagDef
|
|
16092
|
+
const tagDef = this.getTagDefinition(fullName);
|
|
16093
|
+
if (!(tagDef.canSelfClose || getNsPrefix(fullName) !== null || tagDef.isVoid)) {
|
|
16500
16094
|
this.errors.push(TreeError.create(fullName, startTagToken.sourceSpan, `Only void, custom and foreign elements can be self closed "${startTagToken.parts[1]}"`));
|
|
16501
16095
|
}
|
|
16502
16096
|
} else if (this._peek.type === 1) {
|
|
@@ -16506,10 +16100,9 @@ var _TreeBuilder = class __TreeBuilder {
|
|
|
16506
16100
|
const end = this._peek.sourceSpan.fullStart;
|
|
16507
16101
|
const span = new ParseSourceSpan(startTagToken.sourceSpan.start, end, startTagToken.sourceSpan.fullStart);
|
|
16508
16102
|
const startSpan = new ParseSourceSpan(startTagToken.sourceSpan.start, end, startTagToken.sourceSpan.fullStart);
|
|
16509
|
-
const el = new Element2(fullName, attrs,
|
|
16510
|
-
const
|
|
16511
|
-
|
|
16512
|
-
this._pushContainer(el, isClosedByChild);
|
|
16103
|
+
const el = new Element2(fullName, attrs, [], span, startSpan, void 0);
|
|
16104
|
+
const parentEl = this._getContainer();
|
|
16105
|
+
this._pushContainer(el, parentEl instanceof Element2 && this.getTagDefinition(parentEl.name).isClosedByChild(el.name));
|
|
16513
16106
|
if (selfClosing) {
|
|
16514
16107
|
this._popContainer(fullName, Element2, span);
|
|
16515
16108
|
} else if (startTagToken.type === 4) {
|
|
@@ -16517,64 +16110,6 @@ var _TreeBuilder = class __TreeBuilder {
|
|
|
16517
16110
|
this.errors.push(TreeError.create(fullName, span, `Opening tag "${fullName}" not terminated.`));
|
|
16518
16111
|
}
|
|
16519
16112
|
}
|
|
16520
|
-
_consumeComponentStartTag(startToken) {
|
|
16521
|
-
const componentName = startToken.parts[0];
|
|
16522
|
-
const attrs = [];
|
|
16523
|
-
const directives = [];
|
|
16524
|
-
this._consumeAttributesAndDirectives(attrs, directives);
|
|
16525
|
-
const closestElement = this._getClosestElementLikeParent();
|
|
16526
|
-
const tagName = this._getComponentTagName(startToken, closestElement);
|
|
16527
|
-
const fullName = this._getComponentFullName(startToken, closestElement);
|
|
16528
|
-
const selfClosing = this._peek.type === 35;
|
|
16529
|
-
this._advance();
|
|
16530
|
-
const end = this._peek.sourceSpan.fullStart;
|
|
16531
|
-
const span = new ParseSourceSpan(startToken.sourceSpan.start, end, startToken.sourceSpan.fullStart);
|
|
16532
|
-
const startSpan = new ParseSourceSpan(startToken.sourceSpan.start, end, startToken.sourceSpan.fullStart);
|
|
16533
|
-
const node = new Component2(componentName, tagName, fullName, attrs, directives, [], span, startSpan, void 0);
|
|
16534
|
-
const parent = this._getContainer();
|
|
16535
|
-
const isClosedByChild = parent !== null && node.tagName !== null && !!this._getTagDefinition(parent)?.isClosedByChild(node.tagName);
|
|
16536
|
-
this._pushContainer(node, isClosedByChild);
|
|
16537
|
-
if (selfClosing) {
|
|
16538
|
-
this._popContainer(fullName, Component2, span);
|
|
16539
|
-
} else if (startToken.type === 37) {
|
|
16540
|
-
this._popContainer(fullName, Component2, null);
|
|
16541
|
-
this.errors.push(TreeError.create(fullName, span, `Opening tag "${fullName}" not terminated.`));
|
|
16542
|
-
}
|
|
16543
|
-
}
|
|
16544
|
-
_consumeAttributesAndDirectives(attributesResult, directivesResult) {
|
|
16545
|
-
while (this._peek.type === 14 || this._peek.type === 38) {
|
|
16546
|
-
if (this._peek.type === 38) {
|
|
16547
|
-
directivesResult.push(this._consumeDirective(this._peek));
|
|
16548
|
-
} else {
|
|
16549
|
-
attributesResult.push(this._consumeAttr(this._advance()));
|
|
16550
|
-
}
|
|
16551
|
-
}
|
|
16552
|
-
}
|
|
16553
|
-
_consumeComponentEndTag(endToken) {
|
|
16554
|
-
const fullName = this._getComponentFullName(endToken, this._getClosestElementLikeParent());
|
|
16555
|
-
if (!this._popContainer(fullName, Component2, endToken.sourceSpan)) {
|
|
16556
|
-
const container = this._containerStack[this._containerStack.length - 1];
|
|
16557
|
-
let suffix;
|
|
16558
|
-
if (container instanceof Component2 && container.componentName === endToken.parts[0]) {
|
|
16559
|
-
suffix = `, did you mean "${container.fullName}"?`;
|
|
16560
|
-
} else {
|
|
16561
|
-
suffix = ". It may happen when the tag has already been closed by another tag.";
|
|
16562
|
-
}
|
|
16563
|
-
const errMsg = `Unexpected closing tag "${fullName}"${suffix}`;
|
|
16564
|
-
this.errors.push(TreeError.create(fullName, endToken.sourceSpan, errMsg));
|
|
16565
|
-
}
|
|
16566
|
-
}
|
|
16567
|
-
_getTagDefinition(nodeOrName) {
|
|
16568
|
-
if (typeof nodeOrName === "string") {
|
|
16569
|
-
return this.tagDefinitionResolver(nodeOrName);
|
|
16570
|
-
} else if (nodeOrName instanceof Element2) {
|
|
16571
|
-
return this.tagDefinitionResolver(nodeOrName.name);
|
|
16572
|
-
} else if (nodeOrName instanceof Component2 && nodeOrName.tagName !== null) {
|
|
16573
|
-
return this.tagDefinitionResolver(nodeOrName.tagName);
|
|
16574
|
-
} else {
|
|
16575
|
-
return null;
|
|
16576
|
-
}
|
|
16577
|
-
}
|
|
16578
16113
|
_pushContainer(node, isClosedByChild) {
|
|
16579
16114
|
if (isClosedByChild) {
|
|
16580
16115
|
this._containerStack.pop();
|
|
@@ -16582,9 +16117,9 @@ var _TreeBuilder = class __TreeBuilder {
|
|
|
16582
16117
|
this._addToParent(node);
|
|
16583
16118
|
this._containerStack.push(node);
|
|
16584
16119
|
}
|
|
16585
|
-
|
|
16586
|
-
const fullName = this._getElementFullName(endTagToken, this.
|
|
16587
|
-
if (this.
|
|
16120
|
+
_consumeEndTag(endTagToken) {
|
|
16121
|
+
const fullName = this._getElementFullName(endTagToken.parts[0], endTagToken.parts[1], this._getClosestParentElement());
|
|
16122
|
+
if (this.getTagDefinition(fullName).isVoid) {
|
|
16588
16123
|
this.errors.push(TreeError.create(fullName, endTagToken.sourceSpan, `Void elements do not have end tags "${endTagToken.parts[1]}"`));
|
|
16589
16124
|
} else if (!this._popContainer(fullName, Element2, endTagToken.sourceSpan)) {
|
|
16590
16125
|
const errMsg = `Unexpected closing tag "${fullName}". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags`;
|
|
@@ -16601,14 +16136,13 @@ var _TreeBuilder = class __TreeBuilder {
|
|
|
16601
16136
|
let unexpectedCloseTagDetected = false;
|
|
16602
16137
|
for (let stackIndex = this._containerStack.length - 1; stackIndex >= 0; stackIndex--) {
|
|
16603
16138
|
const node = this._containerStack[stackIndex];
|
|
16604
|
-
|
|
16605
|
-
if ((nodeName === expectedName || expectedName === null) && node instanceof expectedType) {
|
|
16139
|
+
if ((node.name === expectedName || expectedName === null) && node instanceof expectedType) {
|
|
16606
16140
|
node.endSourceSpan = endSourceSpan;
|
|
16607
16141
|
node.sourceSpan.end = endSourceSpan !== null ? endSourceSpan.end : node.sourceSpan.end;
|
|
16608
16142
|
this._containerStack.splice(stackIndex, this._containerStack.length - stackIndex);
|
|
16609
16143
|
return !unexpectedCloseTagDetected;
|
|
16610
16144
|
}
|
|
16611
|
-
if (node instanceof Block || !this.
|
|
16145
|
+
if (node instanceof Block || node instanceof Element2 && !this.getTagDefinition(node.name).closedByParent) {
|
|
16612
16146
|
unexpectedCloseTagDetected = true;
|
|
16613
16147
|
}
|
|
16614
16148
|
}
|
|
@@ -16648,28 +16182,6 @@ var _TreeBuilder = class __TreeBuilder {
|
|
|
16648
16182
|
const valueSpan = valueStartSpan && valueEnd && new ParseSourceSpan(valueStartSpan.start, valueEnd, valueStartSpan.fullStart);
|
|
16649
16183
|
return new Attribute(fullName, value, new ParseSourceSpan(attrName.sourceSpan.start, attrEnd, attrName.sourceSpan.fullStart), attrName.sourceSpan, valueSpan, valueTokens.length > 0 ? valueTokens : void 0, void 0);
|
|
16650
16184
|
}
|
|
16651
|
-
_consumeDirective(nameToken) {
|
|
16652
|
-
const attributes = [];
|
|
16653
|
-
let startSourceSpanEnd = nameToken.sourceSpan.end;
|
|
16654
|
-
let endSourceSpan = null;
|
|
16655
|
-
this._advance();
|
|
16656
|
-
if (this._peek.type === 39) {
|
|
16657
|
-
startSourceSpanEnd = this._peek.sourceSpan.end;
|
|
16658
|
-
this._advance();
|
|
16659
|
-
while (this._peek.type === 14) {
|
|
16660
|
-
attributes.push(this._consumeAttr(this._advance()));
|
|
16661
|
-
}
|
|
16662
|
-
if (this._peek.type === 40) {
|
|
16663
|
-
endSourceSpan = this._peek.sourceSpan;
|
|
16664
|
-
this._advance();
|
|
16665
|
-
} else {
|
|
16666
|
-
this.errors.push(TreeError.create(null, nameToken.sourceSpan, "Unterminated directive definition"));
|
|
16667
|
-
}
|
|
16668
|
-
}
|
|
16669
|
-
const startSourceSpan = new ParseSourceSpan(nameToken.sourceSpan.start, startSourceSpanEnd, nameToken.sourceSpan.fullStart);
|
|
16670
|
-
const sourceSpan = new ParseSourceSpan(startSourceSpan.start, endSourceSpan === null ? nameToken.sourceSpan.end : endSourceSpan.end, startSourceSpan.fullStart);
|
|
16671
|
-
return new Directive2(nameToken.parts[0], attributes, sourceSpan, startSourceSpan, endSourceSpan);
|
|
16672
|
-
}
|
|
16673
16185
|
_consumeBlockOpen(token) {
|
|
16674
16186
|
const parameters = [];
|
|
16675
16187
|
while (this._peek.type === 27) {
|
|
@@ -16744,11 +16256,10 @@ var _TreeBuilder = class __TreeBuilder {
|
|
|
16744
16256
|
_getContainer() {
|
|
16745
16257
|
return this._containerStack.length > 0 ? this._containerStack[this._containerStack.length - 1] : null;
|
|
16746
16258
|
}
|
|
16747
|
-
|
|
16259
|
+
_getClosestParentElement() {
|
|
16748
16260
|
for (let i = this._containerStack.length - 1; i > -1; i--) {
|
|
16749
|
-
|
|
16750
|
-
|
|
16751
|
-
return current;
|
|
16261
|
+
if (this._containerStack[i] instanceof Element2) {
|
|
16262
|
+
return this._containerStack[i];
|
|
16752
16263
|
}
|
|
16753
16264
|
}
|
|
16754
16265
|
return null;
|
|
@@ -16761,51 +16272,18 @@ var _TreeBuilder = class __TreeBuilder {
|
|
|
16761
16272
|
parent.children.push(node);
|
|
16762
16273
|
}
|
|
16763
16274
|
}
|
|
16764
|
-
_getElementFullName(
|
|
16765
|
-
|
|
16766
|
-
|
|
16767
|
-
|
|
16768
|
-
|
|
16769
|
-
|
|
16770
|
-
|
|
16771
|
-
|
|
16772
|
-
return componentName;
|
|
16773
|
-
}
|
|
16774
|
-
return tagName.startsWith(":") ? componentName + tagName : `${componentName}:${tagName}`;
|
|
16775
|
-
}
|
|
16776
|
-
_getComponentTagName(token, parent) {
|
|
16777
|
-
const prefix = this._getPrefix(token, parent);
|
|
16778
|
-
const tagName = token.parts[2];
|
|
16779
|
-
if (!prefix && !tagName) {
|
|
16780
|
-
return null;
|
|
16781
|
-
} else if (!prefix && tagName) {
|
|
16782
|
-
return tagName;
|
|
16783
|
-
} else {
|
|
16784
|
-
return mergeNsAndName(prefix, tagName || "ng-component");
|
|
16785
|
-
}
|
|
16786
|
-
}
|
|
16787
|
-
_getPrefix(token, parent) {
|
|
16788
|
-
let prefix;
|
|
16789
|
-
let tagName;
|
|
16790
|
-
if (token.type === 33 || token.type === 37 || token.type === 36) {
|
|
16791
|
-
prefix = token.parts[1];
|
|
16792
|
-
tagName = token.parts[2];
|
|
16793
|
-
} else {
|
|
16794
|
-
prefix = token.parts[0];
|
|
16795
|
-
tagName = token.parts[1];
|
|
16796
|
-
}
|
|
16797
|
-
prefix = prefix || this._getTagDefinition(tagName)?.implicitNamespacePrefix || "";
|
|
16798
|
-
if (!prefix && parent) {
|
|
16799
|
-
const parentName = parent instanceof Element2 ? parent.name : parent.tagName;
|
|
16800
|
-
if (parentName !== null) {
|
|
16801
|
-
const parentTagName = splitNsName(parentName)[1];
|
|
16802
|
-
const parentTagDefinition = this._getTagDefinition(parentTagName);
|
|
16803
|
-
if (parentTagDefinition !== null && !parentTagDefinition.preventNamespaceInheritance) {
|
|
16804
|
-
prefix = getNsPrefix(parentName);
|
|
16275
|
+
_getElementFullName(prefix, localName, parentElement) {
|
|
16276
|
+
if (prefix === "") {
|
|
16277
|
+
prefix = this.getTagDefinition(localName).implicitNamespacePrefix || "";
|
|
16278
|
+
if (prefix === "" && parentElement != null) {
|
|
16279
|
+
const parentTagName = splitNsName(parentElement.name)[1];
|
|
16280
|
+
const parentTagDefinition = this.getTagDefinition(parentTagName);
|
|
16281
|
+
if (!parentTagDefinition.preventNamespaceInheritance) {
|
|
16282
|
+
prefix = getNsPrefix(parentElement.name);
|
|
16805
16283
|
}
|
|
16806
16284
|
}
|
|
16807
16285
|
}
|
|
16808
|
-
return prefix;
|
|
16286
|
+
return mergeNsAndName(prefix, localName);
|
|
16809
16287
|
}
|
|
16810
16288
|
};
|
|
16811
16289
|
function lastOnStack(stack, element2) {
|
|
@@ -16856,11 +16334,11 @@ var WhitespaceVisitor = class {
|
|
|
16856
16334
|
}
|
|
16857
16335
|
visitElement(element2, context) {
|
|
16858
16336
|
if (SKIP_WS_TRIM_TAGS.has(element2.name) || hasPreserveWhitespacesAttr(element2.attrs)) {
|
|
16859
|
-
const newElement2 = new Element2(element2.name, visitAllWithSiblings(this, element2.attrs),
|
|
16337
|
+
const newElement2 = new Element2(element2.name, visitAllWithSiblings(this, element2.attrs), element2.children, element2.sourceSpan, element2.startSourceSpan, element2.endSourceSpan, element2.i18n);
|
|
16860
16338
|
this.originalNodeMap?.set(newElement2, element2);
|
|
16861
16339
|
return newElement2;
|
|
16862
16340
|
}
|
|
16863
|
-
const newElement = new Element2(element2.name, element2.attrs,
|
|
16341
|
+
const newElement = new Element2(element2.name, element2.attrs, visitAllWithSiblings(this, element2.children), element2.sourceSpan, element2.startSourceSpan, element2.endSourceSpan, element2.i18n);
|
|
16864
16342
|
this.originalNodeMap?.set(newElement, element2);
|
|
16865
16343
|
return newElement;
|
|
16866
16344
|
}
|
|
@@ -16919,19 +16397,6 @@ var WhitespaceVisitor = class {
|
|
|
16919
16397
|
visitLetDeclaration(decl, context) {
|
|
16920
16398
|
return decl;
|
|
16921
16399
|
}
|
|
16922
|
-
visitComponent(node, context) {
|
|
16923
|
-
if (node.tagName && SKIP_WS_TRIM_TAGS.has(node.tagName) || hasPreserveWhitespacesAttr(node.attrs)) {
|
|
16924
|
-
const newElement2 = new Component2(node.componentName, node.tagName, node.fullName, visitAllWithSiblings(this, node.attrs), visitAllWithSiblings(this, node.directives), node.children, node.sourceSpan, node.startSourceSpan, node.endSourceSpan, node.i18n);
|
|
16925
|
-
this.originalNodeMap?.set(newElement2, node);
|
|
16926
|
-
return newElement2;
|
|
16927
|
-
}
|
|
16928
|
-
const newElement = new Component2(node.componentName, node.tagName, node.fullName, node.attrs, node.directives, visitAllWithSiblings(this, node.children), node.sourceSpan, node.startSourceSpan, node.endSourceSpan, node.i18n);
|
|
16929
|
-
this.originalNodeMap?.set(newElement, node);
|
|
16930
|
-
return newElement;
|
|
16931
|
-
}
|
|
16932
|
-
visitDirective(directive, context) {
|
|
16933
|
-
return directive;
|
|
16934
|
-
}
|
|
16935
16400
|
visit(_node, context) {
|
|
16936
16401
|
if (this.requireContext && !context) {
|
|
16937
16402
|
throw new Error(`WhitespaceVisitor requires context. Visit via \`visitAllWithSiblings\` to get this context.`);
|
|
@@ -17017,9 +16482,7 @@ var KEYWORDS = [
|
|
|
17017
16482
|
"if",
|
|
17018
16483
|
"else",
|
|
17019
16484
|
"this",
|
|
17020
|
-
"typeof"
|
|
17021
|
-
"void",
|
|
17022
|
-
"in"
|
|
16485
|
+
"typeof"
|
|
17023
16486
|
];
|
|
17024
16487
|
var Lexer = class {
|
|
17025
16488
|
static {
|
|
@@ -17090,12 +16553,6 @@ var Token = class {
|
|
|
17090
16553
|
isKeywordTypeof() {
|
|
17091
16554
|
return this.type === TokenType.Keyword && this.strValue === "typeof";
|
|
17092
16555
|
}
|
|
17093
|
-
isKeywordVoid() {
|
|
17094
|
-
return this.type === TokenType.Keyword && this.strValue === "void";
|
|
17095
|
-
}
|
|
17096
|
-
isKeywordIn() {
|
|
17097
|
-
return this.type === TokenType.Keyword && this.strValue === "in";
|
|
17098
|
-
}
|
|
17099
16556
|
isError() {
|
|
17100
16557
|
return this.type === TokenType.Error;
|
|
17101
16558
|
}
|
|
@@ -17247,12 +16704,11 @@ var _Scanner = class {
|
|
|
17247
16704
|
return this.scanPrivateIdentifier();
|
|
17248
16705
|
case $PLUS:
|
|
17249
16706
|
case $MINUS:
|
|
16707
|
+
case $STAR:
|
|
17250
16708
|
case $SLASH:
|
|
17251
16709
|
case $PERCENT:
|
|
17252
16710
|
case $CARET:
|
|
17253
16711
|
return this.scanOperator(start, String.fromCharCode(peek));
|
|
17254
|
-
case $STAR:
|
|
17255
|
-
return this.scanComplexOperator(start, "*", $STAR, "*");
|
|
17256
16712
|
case $QUESTION:
|
|
17257
16713
|
return this.scanQuestion(start);
|
|
17258
16714
|
case $LT:
|
|
@@ -18086,14 +17542,13 @@ var _ParseAST = class {
|
|
|
18086
17542
|
parseRelational() {
|
|
18087
17543
|
const start = this.inputIndex;
|
|
18088
17544
|
let result = this.parseAdditive();
|
|
18089
|
-
while (this.next.type == TokenType.Operator
|
|
17545
|
+
while (this.next.type == TokenType.Operator) {
|
|
18090
17546
|
const operator = this.next.strValue;
|
|
18091
17547
|
switch (operator) {
|
|
18092
17548
|
case "<":
|
|
18093
17549
|
case ">":
|
|
18094
17550
|
case "<=":
|
|
18095
17551
|
case ">=":
|
|
18096
|
-
case "in":
|
|
18097
17552
|
this.advance();
|
|
18098
17553
|
const right = this.parseAdditive();
|
|
18099
17554
|
result = new Binary(this.span(start), this.sourceSpan(start), operator, result, right);
|
|
@@ -18122,7 +17577,7 @@ var _ParseAST = class {
|
|
|
18122
17577
|
}
|
|
18123
17578
|
parseMultiplicative() {
|
|
18124
17579
|
const start = this.inputIndex;
|
|
18125
|
-
let result = this.
|
|
17580
|
+
let result = this.parsePrefix();
|
|
18126
17581
|
while (this.next.type == TokenType.Operator) {
|
|
18127
17582
|
const operator = this.next.strValue;
|
|
18128
17583
|
switch (operator) {
|
|
@@ -18130,7 +17585,7 @@ var _ParseAST = class {
|
|
|
18130
17585
|
case "%":
|
|
18131
17586
|
case "/":
|
|
18132
17587
|
this.advance();
|
|
18133
|
-
|
|
17588
|
+
let right = this.parsePrefix();
|
|
18134
17589
|
result = new Binary(this.span(start), this.sourceSpan(start), operator, result, right);
|
|
18135
17590
|
continue;
|
|
18136
17591
|
}
|
|
@@ -18138,19 +17593,6 @@ var _ParseAST = class {
|
|
|
18138
17593
|
}
|
|
18139
17594
|
return result;
|
|
18140
17595
|
}
|
|
18141
|
-
parseExponentiation() {
|
|
18142
|
-
const start = this.inputIndex;
|
|
18143
|
-
let result = this.parsePrefix();
|
|
18144
|
-
while (this.next.type == TokenType.Operator && this.next.strValue === "**") {
|
|
18145
|
-
if (result instanceof Unary || result instanceof PrefixNot || result instanceof TypeofExpression || result instanceof VoidExpression) {
|
|
18146
|
-
this.error("Unary operator used immediately before exponentiation expression. Parenthesis must be used to disambiguate operator precedence");
|
|
18147
|
-
}
|
|
18148
|
-
this.advance();
|
|
18149
|
-
const right = this.parseExponentiation();
|
|
18150
|
-
result = new Binary(this.span(start), this.sourceSpan(start), "**", result, right);
|
|
18151
|
-
}
|
|
18152
|
-
return result;
|
|
18153
|
-
}
|
|
18154
17596
|
parsePrefix() {
|
|
18155
17597
|
if (this.next.type == TokenType.Operator) {
|
|
18156
17598
|
const start = this.inputIndex;
|
|
@@ -18175,11 +17617,6 @@ var _ParseAST = class {
|
|
|
18175
17617
|
const start = this.inputIndex;
|
|
18176
17618
|
let result = this.parsePrefix();
|
|
18177
17619
|
return new TypeofExpression(this.span(start), this.sourceSpan(start), result);
|
|
18178
|
-
} else if (this.next.isKeywordVoid()) {
|
|
18179
|
-
this.advance();
|
|
18180
|
-
const start = this.inputIndex;
|
|
18181
|
-
let result = this.parsePrefix();
|
|
18182
|
-
return new VoidExpression(this.span(start), this.sourceSpan(start), result);
|
|
18183
17620
|
}
|
|
18184
17621
|
return this.parseCallChain();
|
|
18185
17622
|
}
|
|
@@ -18201,10 +17638,6 @@ var _ParseAST = class {
|
|
|
18201
17638
|
result = this.parseCall(result, start, false);
|
|
18202
17639
|
} else if (this.consumeOptionalOperator("!")) {
|
|
18203
17640
|
result = new NonNullAssert(this.span(start), this.sourceSpan(start), result);
|
|
18204
|
-
} else if (this.next.isTemplateLiteralEnd()) {
|
|
18205
|
-
result = this.parseNoInterpolationTaggedTemplateLiteral(result, start);
|
|
18206
|
-
} else if (this.next.isTemplateLiteralPart()) {
|
|
18207
|
-
result = this.parseTaggedTemplateLiteral(result, start);
|
|
18208
17641
|
} else {
|
|
18209
17642
|
return result;
|
|
18210
17643
|
}
|
|
@@ -18217,7 +17650,7 @@ var _ParseAST = class {
|
|
|
18217
17650
|
const result = this.parsePipe();
|
|
18218
17651
|
this.rparensExpected--;
|
|
18219
17652
|
this.expectCharacter($RPAREN);
|
|
18220
|
-
return
|
|
17653
|
+
return result;
|
|
18221
17654
|
} else if (this.next.isKeywordNull()) {
|
|
18222
17655
|
this.advance();
|
|
18223
17656
|
return new LiteralPrimitive(this.span(start), this.sourceSpan(start), null);
|
|
@@ -18230,9 +17663,6 @@ var _ParseAST = class {
|
|
|
18230
17663
|
} else if (this.next.isKeywordFalse()) {
|
|
18231
17664
|
this.advance();
|
|
18232
17665
|
return new LiteralPrimitive(this.span(start), this.sourceSpan(start), false);
|
|
18233
|
-
} else if (this.next.isKeywordIn()) {
|
|
18234
|
-
this.advance();
|
|
18235
|
-
return new LiteralPrimitive(this.span(start), this.sourceSpan(start), "in");
|
|
18236
17666
|
} else if (this.next.isKeywordThis()) {
|
|
18237
17667
|
this.advance();
|
|
18238
17668
|
return new ThisReceiver(this.span(start), this.sourceSpan(start));
|
|
@@ -18543,10 +17973,6 @@ var _ParseAST = class {
|
|
|
18543
17973
|
const sourceSpan = new AbsoluteSourceSpan(spanStart, this.currentAbsoluteOffset);
|
|
18544
17974
|
return new VariableBinding(sourceSpan, key, value);
|
|
18545
17975
|
}
|
|
18546
|
-
parseNoInterpolationTaggedTemplateLiteral(tag, start) {
|
|
18547
|
-
const template2 = this.parseNoInterpolationTemplateLiteral();
|
|
18548
|
-
return new TaggedTemplateLiteral(this.span(start), this.sourceSpan(start), tag, template2);
|
|
18549
|
-
}
|
|
18550
17976
|
parseNoInterpolationTemplateLiteral() {
|
|
18551
17977
|
const text2 = this.next.strValue;
|
|
18552
17978
|
const start = this.inputIndex;
|
|
@@ -18555,14 +17981,10 @@ var _ParseAST = class {
|
|
|
18555
17981
|
const sourceSpan = this.sourceSpan(start);
|
|
18556
17982
|
return new TemplateLiteral(span, sourceSpan, [new TemplateLiteralElement(span, sourceSpan, text2)], []);
|
|
18557
17983
|
}
|
|
18558
|
-
parseTaggedTemplateLiteral(tag, start) {
|
|
18559
|
-
const template2 = this.parseTemplateLiteral();
|
|
18560
|
-
return new TaggedTemplateLiteral(this.span(start), this.sourceSpan(start), tag, template2);
|
|
18561
|
-
}
|
|
18562
17984
|
parseTemplateLiteral() {
|
|
17985
|
+
const start = this.inputIndex;
|
|
18563
17986
|
const elements = [];
|
|
18564
17987
|
const expressions = [];
|
|
18565
|
-
const start = this.inputIndex;
|
|
18566
17988
|
while (this.next !== EOF) {
|
|
18567
17989
|
const token = this.next;
|
|
18568
17990
|
if (token.isTemplateLiteralPart() || token.isTemplateLiteralEnd()) {
|
|
@@ -18777,9 +18199,6 @@ var SerializeExpressionVisitor = class {
|
|
|
18777
18199
|
visitTypeofExpression(ast, context) {
|
|
18778
18200
|
return `typeof ${ast.expression.visit(this, context)}`;
|
|
18779
18201
|
}
|
|
18780
|
-
visitVoidExpression(ast, context) {
|
|
18781
|
-
return `void ${ast.expression.visit(this, context)}`;
|
|
18782
|
-
}
|
|
18783
18202
|
visitASTWithSource(ast, context) {
|
|
18784
18203
|
return ast.ast.visit(this, context);
|
|
18785
18204
|
}
|
|
@@ -18797,12 +18216,6 @@ var SerializeExpressionVisitor = class {
|
|
|
18797
18216
|
visitTemplateLiteralElement(ast, context) {
|
|
18798
18217
|
return ast.text;
|
|
18799
18218
|
}
|
|
18800
|
-
visitTaggedTemplateLiteral(ast, context) {
|
|
18801
|
-
return ast.tag.visit(this, context) + ast.template.visit(this, context);
|
|
18802
|
-
}
|
|
18803
|
-
visitParenthesizedExpression(ast, context) {
|
|
18804
|
-
return "(" + ast.expression.visit(this, context) + ")";
|
|
18805
|
-
}
|
|
18806
18219
|
};
|
|
18807
18220
|
function zip(left, right) {
|
|
18808
18221
|
if (left.length !== right.length)
|
|
@@ -18957,7 +18370,6 @@ var SCHEMA = [
|
|
|
18957
18370
|
"q,blockquote,cite^[HTMLElement]|",
|
|
18958
18371
|
"script^[HTMLElement]|!async,charset,%crossOrigin,!defer,event,htmlFor,integrity,!noModule,%referrerPolicy,src,text,type",
|
|
18959
18372
|
"select^[HTMLElement]|autocomplete,!disabled,#length,!multiple,name,!required,#selectedIndex,#size,value",
|
|
18960
|
-
"selectedcontent^[HTMLElement]|",
|
|
18961
18373
|
"slot^[HTMLElement]|name",
|
|
18962
18374
|
"source^[HTMLElement]|#height,media,sizes,src,srcset,type,#width",
|
|
18963
18375
|
"span^[HTMLElement]|",
|
|
@@ -19597,13 +19009,27 @@ var _I18nVisitor = class {
|
|
|
19597
19009
|
return new Message(i18nodes, context.placeholderToContent, context.placeholderToMessage, meaning, description, customId);
|
|
19598
19010
|
}
|
|
19599
19011
|
visitElement(el, context) {
|
|
19600
|
-
|
|
19601
|
-
|
|
19602
|
-
|
|
19603
|
-
|
|
19604
|
-
|
|
19605
|
-
|
|
19606
|
-
|
|
19012
|
+
const children = visitAll(this, el.children, context);
|
|
19013
|
+
const attrs = {};
|
|
19014
|
+
el.attrs.forEach((attr) => {
|
|
19015
|
+
attrs[attr.name] = attr.value;
|
|
19016
|
+
});
|
|
19017
|
+
const isVoid = getHtmlTagDefinition(el.name).isVoid;
|
|
19018
|
+
const startPhName = context.placeholderRegistry.getStartTagPlaceholderName(el.name, attrs, isVoid);
|
|
19019
|
+
context.placeholderToContent[startPhName] = {
|
|
19020
|
+
text: el.startSourceSpan.toString(),
|
|
19021
|
+
sourceSpan: el.startSourceSpan
|
|
19022
|
+
};
|
|
19023
|
+
let closePhName = "";
|
|
19024
|
+
if (!isVoid) {
|
|
19025
|
+
closePhName = context.placeholderRegistry.getCloseTagPlaceholderName(el.name);
|
|
19026
|
+
context.placeholderToContent[closePhName] = {
|
|
19027
|
+
text: `</${el.name}>`,
|
|
19028
|
+
sourceSpan: el.endSourceSpan ?? el.sourceSpan
|
|
19029
|
+
};
|
|
19030
|
+
}
|
|
19031
|
+
const node = new TagPlaceholder(el.name, attrs, startPhName, closePhName, children, isVoid, el.sourceSpan, el.startSourceSpan, el.endSourceSpan);
|
|
19032
|
+
return context.visitNodeFn(el, node);
|
|
19607
19033
|
}
|
|
19608
19034
|
visitAttribute(attribute2, context) {
|
|
19609
19035
|
const node = attribute2.valueTokens === void 0 || attribute2.valueTokens.length === 1 ? new Text$2(attribute2.value, attribute2.valueSpan || attribute2.sourceSpan) : this._visitTextWithInterpolation(attribute2.valueTokens, attribute2.valueSpan || attribute2.sourceSpan, context, attribute2.i18n);
|
|
@@ -19666,39 +19092,6 @@ var _I18nVisitor = class {
|
|
|
19666
19092
|
visitLetDeclaration(decl, context) {
|
|
19667
19093
|
return null;
|
|
19668
19094
|
}
|
|
19669
|
-
_visitElementLike(node, context) {
|
|
19670
|
-
const children = visitAll(this, node.children, context);
|
|
19671
|
-
const attrs = {};
|
|
19672
|
-
const visitAttribute = /* @__PURE__ */ __name((attr) => {
|
|
19673
|
-
attrs[attr.name] = attr.value;
|
|
19674
|
-
}, "visitAttribute");
|
|
19675
|
-
let nodeName;
|
|
19676
|
-
let isVoid;
|
|
19677
|
-
if (node instanceof Element2) {
|
|
19678
|
-
nodeName = node.name;
|
|
19679
|
-
isVoid = getHtmlTagDefinition(node.name).isVoid;
|
|
19680
|
-
} else {
|
|
19681
|
-
nodeName = node.fullName;
|
|
19682
|
-
isVoid = node.tagName ? getHtmlTagDefinition(node.tagName).isVoid : false;
|
|
19683
|
-
}
|
|
19684
|
-
node.attrs.forEach(visitAttribute);
|
|
19685
|
-
node.directives.forEach((dir) => dir.attrs.forEach(visitAttribute));
|
|
19686
|
-
const startPhName = context.placeholderRegistry.getStartTagPlaceholderName(nodeName, attrs, isVoid);
|
|
19687
|
-
context.placeholderToContent[startPhName] = {
|
|
19688
|
-
text: node.startSourceSpan.toString(),
|
|
19689
|
-
sourceSpan: node.startSourceSpan
|
|
19690
|
-
};
|
|
19691
|
-
let closePhName = "";
|
|
19692
|
-
if (!isVoid) {
|
|
19693
|
-
closePhName = context.placeholderRegistry.getCloseTagPlaceholderName(nodeName);
|
|
19694
|
-
context.placeholderToContent[closePhName] = {
|
|
19695
|
-
text: `</${nodeName}>`,
|
|
19696
|
-
sourceSpan: node.endSourceSpan ?? node.sourceSpan
|
|
19697
|
-
};
|
|
19698
|
-
}
|
|
19699
|
-
const i18nNode = new TagPlaceholder(nodeName, attrs, startPhName, closePhName, children, isVoid, node.sourceSpan, node.startSourceSpan, node.endSourceSpan);
|
|
19700
|
-
return context.visitNodeFn(node, i18nNode);
|
|
19701
|
-
}
|
|
19702
19095
|
/**
|
|
19703
19096
|
* Convert, text and interpolated tokens up into text and placeholder pieces.
|
|
19704
19097
|
*
|
|
@@ -19892,13 +19285,47 @@ var I18nMetaVisitor = class {
|
|
|
19892
19285
|
return new ParseTreeResult(result, this._errors);
|
|
19893
19286
|
}
|
|
19894
19287
|
visitElement(element2) {
|
|
19895
|
-
|
|
19288
|
+
let message = void 0;
|
|
19289
|
+
if (hasI18nAttrs(element2)) {
|
|
19290
|
+
this.hasI18nMeta = true;
|
|
19291
|
+
const attrs = [];
|
|
19292
|
+
const attrsMeta = {};
|
|
19293
|
+
for (const attr of element2.attrs) {
|
|
19294
|
+
if (attr.name === I18N_ATTR) {
|
|
19295
|
+
const i18n2 = element2.i18n || attr.value;
|
|
19296
|
+
const originalNodeMap = /* @__PURE__ */ new Map();
|
|
19297
|
+
const trimmedNodes = this.preserveSignificantWhitespace ? element2.children : visitAllWithSiblings(new WhitespaceVisitor(false, originalNodeMap), element2.children);
|
|
19298
|
+
message = this._generateI18nMessage(trimmedNodes, i18n2, setI18nRefs(originalNodeMap));
|
|
19299
|
+
if (message.nodes.length === 0) {
|
|
19300
|
+
message = void 0;
|
|
19301
|
+
}
|
|
19302
|
+
element2.i18n = message;
|
|
19303
|
+
} else if (attr.name.startsWith(I18N_ATTR_PREFIX)) {
|
|
19304
|
+
const name = attr.name.slice(I18N_ATTR_PREFIX.length);
|
|
19305
|
+
if (isTrustedTypesSink(element2.name, name)) {
|
|
19306
|
+
this._reportError(attr, `Translating attribute '${name}' is disallowed for security reasons.`);
|
|
19307
|
+
} else {
|
|
19308
|
+
attrsMeta[name] = attr.value;
|
|
19309
|
+
}
|
|
19310
|
+
} else {
|
|
19311
|
+
attrs.push(attr);
|
|
19312
|
+
}
|
|
19313
|
+
}
|
|
19314
|
+
if (Object.keys(attrsMeta).length) {
|
|
19315
|
+
for (const attr of attrs) {
|
|
19316
|
+
const meta = attrsMeta[attr.name];
|
|
19317
|
+
if (meta !== void 0 && attr.value) {
|
|
19318
|
+
attr.i18n = this._generateI18nMessage([attr], attr.i18n || meta);
|
|
19319
|
+
}
|
|
19320
|
+
}
|
|
19321
|
+
}
|
|
19322
|
+
if (!this.keepI18nAttrs) {
|
|
19323
|
+
element2.attrs = attrs;
|
|
19324
|
+
}
|
|
19325
|
+
}
|
|
19326
|
+
visitAll(this, element2.children, message);
|
|
19896
19327
|
return element2;
|
|
19897
19328
|
}
|
|
19898
|
-
visitComponent(component, context) {
|
|
19899
|
-
this._visitElementLike(component);
|
|
19900
|
-
return component;
|
|
19901
|
-
}
|
|
19902
19329
|
visitExpansion(expansion, currentMessage) {
|
|
19903
19330
|
let message;
|
|
19904
19331
|
const meta = expansion.i18n;
|
|
@@ -19939,56 +19366,6 @@ var I18nMetaVisitor = class {
|
|
|
19939
19366
|
visitLetDeclaration(decl, context) {
|
|
19940
19367
|
return decl;
|
|
19941
19368
|
}
|
|
19942
|
-
visitDirective(directive, context) {
|
|
19943
|
-
return directive;
|
|
19944
|
-
}
|
|
19945
|
-
_visitElementLike(node) {
|
|
19946
|
-
let message = void 0;
|
|
19947
|
-
if (hasI18nAttrs(node)) {
|
|
19948
|
-
this.hasI18nMeta = true;
|
|
19949
|
-
const attrs = [];
|
|
19950
|
-
const attrsMeta = {};
|
|
19951
|
-
for (const attr of node.attrs) {
|
|
19952
|
-
if (attr.name === I18N_ATTR) {
|
|
19953
|
-
const i18n2 = node.i18n || attr.value;
|
|
19954
|
-
const originalNodeMap = /* @__PURE__ */ new Map();
|
|
19955
|
-
const trimmedNodes = this.preserveSignificantWhitespace ? node.children : visitAllWithSiblings(new WhitespaceVisitor(false, originalNodeMap), node.children);
|
|
19956
|
-
message = this._generateI18nMessage(trimmedNodes, i18n2, setI18nRefs(originalNodeMap));
|
|
19957
|
-
if (message.nodes.length === 0) {
|
|
19958
|
-
message = void 0;
|
|
19959
|
-
}
|
|
19960
|
-
node.i18n = message;
|
|
19961
|
-
} else if (attr.name.startsWith(I18N_ATTR_PREFIX)) {
|
|
19962
|
-
const name = attr.name.slice(I18N_ATTR_PREFIX.length);
|
|
19963
|
-
let isTrustedType;
|
|
19964
|
-
if (node instanceof Component2) {
|
|
19965
|
-
isTrustedType = node.tagName === null ? false : isTrustedTypesSink(node.tagName, name);
|
|
19966
|
-
} else {
|
|
19967
|
-
isTrustedType = isTrustedTypesSink(node.name, name);
|
|
19968
|
-
}
|
|
19969
|
-
if (isTrustedType) {
|
|
19970
|
-
this._reportError(attr, `Translating attribute '${name}' is disallowed for security reasons.`);
|
|
19971
|
-
} else {
|
|
19972
|
-
attrsMeta[name] = attr.value;
|
|
19973
|
-
}
|
|
19974
|
-
} else {
|
|
19975
|
-
attrs.push(attr);
|
|
19976
|
-
}
|
|
19977
|
-
}
|
|
19978
|
-
if (Object.keys(attrsMeta).length) {
|
|
19979
|
-
for (const attr of attrs) {
|
|
19980
|
-
const meta = attrsMeta[attr.name];
|
|
19981
|
-
if (meta !== void 0 && attr.value) {
|
|
19982
|
-
attr.i18n = this._generateI18nMessage([attr], attr.i18n || meta);
|
|
19983
|
-
}
|
|
19984
|
-
}
|
|
19985
|
-
}
|
|
19986
|
-
if (!this.keepI18nAttrs) {
|
|
19987
|
-
node.attrs = attrs;
|
|
19988
|
-
}
|
|
19989
|
-
}
|
|
19990
|
-
visitAll(this, node.children, message);
|
|
19991
|
-
}
|
|
19992
19369
|
/**
|
|
19993
19370
|
* Parse the general form `meta` passed into extract the explicit metadata needed to create a
|
|
19994
19371
|
* `Message`.
|
|
@@ -20484,8 +19861,6 @@ function liftLocalRefs(job) {
|
|
|
20484
19861
|
for (const op of unit.create) {
|
|
20485
19862
|
switch (op.kind) {
|
|
20486
19863
|
case OpKind.ElementStart:
|
|
20487
|
-
case OpKind.ConditionalCreate:
|
|
20488
|
-
case OpKind.ConditionalBranchCreate:
|
|
20489
19864
|
case OpKind.Template:
|
|
20490
19865
|
if (!Array.isArray(op.localRefs)) {
|
|
20491
19866
|
throw new Error(`AssertionError: expected localRefs to be an array still`);
|
|
@@ -20600,7 +19975,7 @@ function parseExtractedStyles(job) {
|
|
|
20600
19975
|
for (const op of unit.create) {
|
|
20601
19976
|
if (op.kind === OpKind.ExtractedAttribute && op.bindingKind === BindingKind.Attribute && isStringLiteral(op.expression)) {
|
|
20602
19977
|
const target = elements.get(op.target);
|
|
20603
|
-
if (target !== void 0 &&
|
|
19978
|
+
if (target !== void 0 && target.kind === OpKind.Template && target.templateKind === TemplateKind.Structural) {
|
|
20604
19979
|
continue;
|
|
20605
19980
|
}
|
|
20606
19981
|
if (op.name === "style") {
|
|
@@ -20637,7 +20012,7 @@ function addNamesToView(unit, baseName, state, compatibility) {
|
|
|
20637
20012
|
for (const op of unit.ops()) {
|
|
20638
20013
|
switch (op.kind) {
|
|
20639
20014
|
case OpKind.Property:
|
|
20640
|
-
case OpKind.
|
|
20015
|
+
case OpKind.HostProperty:
|
|
20641
20016
|
if (op.isAnimationTrigger) {
|
|
20642
20017
|
op.name = "@" + op.name;
|
|
20643
20018
|
}
|
|
@@ -20698,8 +20073,6 @@ function addNamesToView(unit, baseName, state, compatibility) {
|
|
|
20698
20073
|
addNamesToView(fallbackView, `${baseName}_ProjectionFallback_${op.handle.slot}`, state, compatibility);
|
|
20699
20074
|
}
|
|
20700
20075
|
break;
|
|
20701
|
-
case OpKind.ConditionalCreate:
|
|
20702
|
-
case OpKind.ConditionalBranchCreate:
|
|
20703
20076
|
case OpKind.Template:
|
|
20704
20077
|
if (!(unit instanceof ViewCompilationUnit)) {
|
|
20705
20078
|
throw new Error(`AssertionError: must be compiling a component`);
|
|
@@ -20864,6 +20237,21 @@ function disableBindings$1(job) {
|
|
|
20864
20237
|
}
|
|
20865
20238
|
}
|
|
20866
20239
|
__name(disableBindings$1, "disableBindings$1");
|
|
20240
|
+
function generateNullishCoalesceExpressions(job) {
|
|
20241
|
+
for (const unit of job.units) {
|
|
20242
|
+
for (const op of unit.ops()) {
|
|
20243
|
+
transformExpressionsInOp(op, (expr) => {
|
|
20244
|
+
if (!(expr instanceof BinaryOperatorExpr) || expr.operator !== BinaryOperator.NullishCoalesce) {
|
|
20245
|
+
return expr;
|
|
20246
|
+
}
|
|
20247
|
+
const assignment = new AssignTemporaryExpr(expr.lhs.clone(), job.allocateXrefId());
|
|
20248
|
+
const read = new ReadTemporaryExpr(assignment.xref);
|
|
20249
|
+
return new ConditionalExpr(new BinaryOperatorExpr(BinaryOperator.And, new BinaryOperatorExpr(BinaryOperator.NotIdentical, assignment, NULL_EXPR), new BinaryOperatorExpr(BinaryOperator.NotIdentical, read, new LiteralExpr(void 0))), read.clone(), expr.rhs);
|
|
20250
|
+
}, VisitorContextFlag.None);
|
|
20251
|
+
}
|
|
20252
|
+
}
|
|
20253
|
+
}
|
|
20254
|
+
__name(generateNullishCoalesceExpressions, "generateNullishCoalesceExpressions");
|
|
20867
20255
|
function kindTest(kind) {
|
|
20868
20256
|
return (op) => op.kind === kind;
|
|
20869
20257
|
}
|
|
@@ -20897,8 +20285,8 @@ var UPDATE_ORDERING = [
|
|
|
20897
20285
|
{ test: kindWithInterpolationTest(OpKind.Attribute, false) }
|
|
20898
20286
|
];
|
|
20899
20287
|
var UPDATE_HOST_ORDERING = [
|
|
20900
|
-
{ test: kindWithInterpolationTest(OpKind.
|
|
20901
|
-
{ test: kindWithInterpolationTest(OpKind.
|
|
20288
|
+
{ test: kindWithInterpolationTest(OpKind.HostProperty, true) },
|
|
20289
|
+
{ test: kindWithInterpolationTest(OpKind.HostProperty, false) },
|
|
20902
20290
|
{ test: kindTest(OpKind.Attribute) },
|
|
20903
20291
|
{ test: kindTest(OpKind.StyleMap), transform: keepLast },
|
|
20904
20292
|
{ test: kindTest(OpKind.ClassMap), transform: keepLast },
|
|
@@ -20914,7 +20302,7 @@ var handledOpKinds = /* @__PURE__ */ new Set([
|
|
|
20914
20302
|
OpKind.ClassProp,
|
|
20915
20303
|
OpKind.Property,
|
|
20916
20304
|
OpKind.TwoWayProperty,
|
|
20917
|
-
OpKind.
|
|
20305
|
+
OpKind.HostProperty,
|
|
20918
20306
|
OpKind.Attribute
|
|
20919
20307
|
]);
|
|
20920
20308
|
function orderOps(job) {
|
|
@@ -21071,8 +20459,6 @@ function propagateI18nBlocksToTemplates(unit, subTemplateIndex) {
|
|
|
21071
20459
|
}
|
|
21072
20460
|
i18nBlock = null;
|
|
21073
20461
|
break;
|
|
21074
|
-
case OpKind.ConditionalCreate:
|
|
21075
|
-
case OpKind.ConditionalBranchCreate:
|
|
21076
20462
|
case OpKind.Template:
|
|
21077
20463
|
subTemplateIndex = propagateI18nBlocksForView(unit.job.views.get(op.xref), i18nBlock, op.i18nPlaceholder, subTemplateIndex);
|
|
21078
20464
|
break;
|
|
@@ -21292,6 +20678,7 @@ __name(enableBindings, "enableBindings");
|
|
|
21292
20678
|
function listener(name, handlerFn, eventTargetResolver, syntheticHost, sourceSpan) {
|
|
21293
20679
|
const args = [literal(name), handlerFn];
|
|
21294
20680
|
if (eventTargetResolver !== null) {
|
|
20681
|
+
args.push(literal(false));
|
|
21295
20682
|
args.push(importExpr(eventTargetResolver));
|
|
21296
20683
|
}
|
|
21297
20684
|
return call(syntheticHost ? Identifiers.syntheticHostListener : Identifiers.listener, args, sourceSpan);
|
|
@@ -21531,44 +20918,6 @@ function i18nStart(slot, constIndex, subTemplateIndex, sourceSpan) {
|
|
|
21531
20918
|
return call(Identifiers.i18nStart, args, sourceSpan);
|
|
21532
20919
|
}
|
|
21533
20920
|
__name(i18nStart, "i18nStart");
|
|
21534
|
-
function conditionalCreate(slot, templateFnRef, decls, vars, tag, constIndex, localRefs, sourceSpan) {
|
|
21535
|
-
const args = [
|
|
21536
|
-
literal(slot),
|
|
21537
|
-
templateFnRef,
|
|
21538
|
-
literal(decls),
|
|
21539
|
-
literal(vars),
|
|
21540
|
-
literal(tag),
|
|
21541
|
-
literal(constIndex)
|
|
21542
|
-
];
|
|
21543
|
-
if (localRefs !== null) {
|
|
21544
|
-
args.push(literal(localRefs));
|
|
21545
|
-
args.push(importExpr(Identifiers.templateRefExtractor));
|
|
21546
|
-
}
|
|
21547
|
-
while (args[args.length - 1].isEquivalent(NULL_EXPR)) {
|
|
21548
|
-
args.pop();
|
|
21549
|
-
}
|
|
21550
|
-
return call(Identifiers.conditionalCreate, args, sourceSpan);
|
|
21551
|
-
}
|
|
21552
|
-
__name(conditionalCreate, "conditionalCreate");
|
|
21553
|
-
function conditionalBranchCreate(slot, templateFnRef, decls, vars, tag, constIndex, localRefs, sourceSpan) {
|
|
21554
|
-
const args = [
|
|
21555
|
-
literal(slot),
|
|
21556
|
-
templateFnRef,
|
|
21557
|
-
literal(decls),
|
|
21558
|
-
literal(vars),
|
|
21559
|
-
literal(tag),
|
|
21560
|
-
literal(constIndex)
|
|
21561
|
-
];
|
|
21562
|
-
if (localRefs !== null) {
|
|
21563
|
-
args.push(literal(localRefs));
|
|
21564
|
-
args.push(importExpr(Identifiers.templateRefExtractor));
|
|
21565
|
-
}
|
|
21566
|
-
while (args[args.length - 1].isEquivalent(NULL_EXPR)) {
|
|
21567
|
-
args.pop();
|
|
21568
|
-
}
|
|
21569
|
-
return call(Identifiers.conditionalBranchCreate, args, sourceSpan);
|
|
21570
|
-
}
|
|
21571
|
-
__name(conditionalBranchCreate, "conditionalBranchCreate");
|
|
21572
20921
|
function repeaterCreate(slot, viewFnName, decls, vars, tag, constIndex, trackByFn, trackByUsesComponentInstance, emptyViewFnName, emptyDecls, emptyVars, emptyTag, emptyConstIndex, sourceSpan) {
|
|
21573
20922
|
const args = [
|
|
21574
20923
|
literal(slot),
|
|
@@ -21637,12 +20986,7 @@ function i18nAttributes(slot, i18nAttributesConfig) {
|
|
|
21637
20986
|
}
|
|
21638
20987
|
__name(i18nAttributes, "i18nAttributes");
|
|
21639
20988
|
function property(name, expression, sanitizer, sourceSpan) {
|
|
21640
|
-
const args = [literal(name)];
|
|
21641
|
-
if (expression instanceof Interpolation2) {
|
|
21642
|
-
args.push(interpolationToExpression(expression, sourceSpan));
|
|
21643
|
-
} else {
|
|
21644
|
-
args.push(expression);
|
|
21645
|
-
}
|
|
20989
|
+
const args = [literal(name), expression];
|
|
21646
20990
|
if (sanitizer !== null) {
|
|
21647
20991
|
args.push(sanitizer);
|
|
21648
20992
|
}
|
|
@@ -21657,13 +21001,8 @@ function twoWayProperty(name, expression, sanitizer, sourceSpan) {
|
|
|
21657
21001
|
return call(Identifiers.twoWayProperty, args, sourceSpan);
|
|
21658
21002
|
}
|
|
21659
21003
|
__name(twoWayProperty, "twoWayProperty");
|
|
21660
|
-
function attribute(name, expression, sanitizer, namespace
|
|
21661
|
-
const args = [literal(name)];
|
|
21662
|
-
if (expression instanceof Interpolation2) {
|
|
21663
|
-
args.push(interpolationToExpression(expression, sourceSpan));
|
|
21664
|
-
} else {
|
|
21665
|
-
args.push(expression);
|
|
21666
|
-
}
|
|
21004
|
+
function attribute(name, expression, sanitizer, namespace) {
|
|
21005
|
+
const args = [literal(name), expression];
|
|
21667
21006
|
if (sanitizer !== null || namespace !== null) {
|
|
21668
21007
|
args.push(sanitizer ?? literal(null));
|
|
21669
21008
|
}
|
|
@@ -21674,12 +21013,7 @@ function attribute(name, expression, sanitizer, namespace, sourceSpan) {
|
|
|
21674
21013
|
}
|
|
21675
21014
|
__name(attribute, "attribute");
|
|
21676
21015
|
function styleProp(name, expression, unit, sourceSpan) {
|
|
21677
|
-
const args = [literal(name)];
|
|
21678
|
-
if (expression instanceof Interpolation2) {
|
|
21679
|
-
args.push(interpolationToExpression(expression, sourceSpan));
|
|
21680
|
-
} else {
|
|
21681
|
-
args.push(expression);
|
|
21682
|
-
}
|
|
21016
|
+
const args = [literal(name), expression];
|
|
21683
21017
|
if (unit !== null) {
|
|
21684
21018
|
args.push(literal(unit));
|
|
21685
21019
|
}
|
|
@@ -21691,13 +21025,11 @@ function classProp(name, expression, sourceSpan) {
|
|
|
21691
21025
|
}
|
|
21692
21026
|
__name(classProp, "classProp");
|
|
21693
21027
|
function styleMap(expression, sourceSpan) {
|
|
21694
|
-
|
|
21695
|
-
return call(Identifiers.styleMap, [value], sourceSpan);
|
|
21028
|
+
return call(Identifiers.styleMap, [expression], sourceSpan);
|
|
21696
21029
|
}
|
|
21697
21030
|
__name(styleMap, "styleMap");
|
|
21698
21031
|
function classMap(expression, sourceSpan) {
|
|
21699
|
-
|
|
21700
|
-
return call(Identifiers.classMap, [value], sourceSpan);
|
|
21032
|
+
return call(Identifiers.classMap, [expression], sourceSpan);
|
|
21701
21033
|
}
|
|
21702
21034
|
__name(classMap, "classMap");
|
|
21703
21035
|
var PIPE_BINDINGS = [
|
|
@@ -21731,14 +21063,51 @@ function i18nApply(slot, sourceSpan) {
|
|
|
21731
21063
|
return call(Identifiers.i18nApply, [literal(slot)], sourceSpan);
|
|
21732
21064
|
}
|
|
21733
21065
|
__name(i18nApply, "i18nApply");
|
|
21734
|
-
function
|
|
21066
|
+
function propertyInterpolate(name, strings, expressions, sanitizer, sourceSpan) {
|
|
21067
|
+
const interpolationArgs = collateInterpolationArgs(strings, expressions);
|
|
21068
|
+
const extraArgs = [];
|
|
21069
|
+
if (sanitizer !== null) {
|
|
21070
|
+
extraArgs.push(sanitizer);
|
|
21071
|
+
}
|
|
21072
|
+
return callVariadicInstruction(PROPERTY_INTERPOLATE_CONFIG, [literal(name)], interpolationArgs, extraArgs, sourceSpan);
|
|
21073
|
+
}
|
|
21074
|
+
__name(propertyInterpolate, "propertyInterpolate");
|
|
21075
|
+
function attributeInterpolate(name, strings, expressions, sanitizer, sourceSpan) {
|
|
21076
|
+
const interpolationArgs = collateInterpolationArgs(strings, expressions);
|
|
21077
|
+
const extraArgs = [];
|
|
21078
|
+
if (sanitizer !== null) {
|
|
21079
|
+
extraArgs.push(sanitizer);
|
|
21080
|
+
}
|
|
21081
|
+
return callVariadicInstruction(ATTRIBUTE_INTERPOLATE_CONFIG, [literal(name)], interpolationArgs, extraArgs, sourceSpan);
|
|
21082
|
+
}
|
|
21083
|
+
__name(attributeInterpolate, "attributeInterpolate");
|
|
21084
|
+
function stylePropInterpolate(name, strings, expressions, unit, sourceSpan) {
|
|
21085
|
+
const interpolationArgs = collateInterpolationArgs(strings, expressions);
|
|
21086
|
+
const extraArgs = [];
|
|
21087
|
+
if (unit !== null) {
|
|
21088
|
+
extraArgs.push(literal(unit));
|
|
21089
|
+
}
|
|
21090
|
+
return callVariadicInstruction(STYLE_PROP_INTERPOLATE_CONFIG, [literal(name)], interpolationArgs, extraArgs, sourceSpan);
|
|
21091
|
+
}
|
|
21092
|
+
__name(stylePropInterpolate, "stylePropInterpolate");
|
|
21093
|
+
function styleMapInterpolate(strings, expressions, sourceSpan) {
|
|
21094
|
+
const interpolationArgs = collateInterpolationArgs(strings, expressions);
|
|
21095
|
+
return callVariadicInstruction(STYLE_MAP_INTERPOLATE_CONFIG, [], interpolationArgs, [], sourceSpan);
|
|
21096
|
+
}
|
|
21097
|
+
__name(styleMapInterpolate, "styleMapInterpolate");
|
|
21098
|
+
function classMapInterpolate(strings, expressions, sourceSpan) {
|
|
21099
|
+
const interpolationArgs = collateInterpolationArgs(strings, expressions);
|
|
21100
|
+
return callVariadicInstruction(CLASS_MAP_INTERPOLATE_CONFIG, [], interpolationArgs, [], sourceSpan);
|
|
21101
|
+
}
|
|
21102
|
+
__name(classMapInterpolate, "classMapInterpolate");
|
|
21103
|
+
function hostProperty(name, expression, sanitizer, sourceSpan) {
|
|
21735
21104
|
const args = [literal(name), expression];
|
|
21736
21105
|
if (sanitizer !== null) {
|
|
21737
21106
|
args.push(sanitizer);
|
|
21738
21107
|
}
|
|
21739
|
-
return call(Identifiers.
|
|
21108
|
+
return call(Identifiers.hostProperty, args, sourceSpan);
|
|
21740
21109
|
}
|
|
21741
|
-
__name(
|
|
21110
|
+
__name(hostProperty, "hostProperty");
|
|
21742
21111
|
function syntheticHostProperty(name, expression, sourceSpan) {
|
|
21743
21112
|
return call(Identifiers.syntheticHostProperty, [literal(name), expression], sourceSpan);
|
|
21744
21113
|
}
|
|
@@ -21768,11 +21137,6 @@ function collateInterpolationArgs(strings, expressions) {
|
|
|
21768
21137
|
return interpolationArgs;
|
|
21769
21138
|
}
|
|
21770
21139
|
__name(collateInterpolationArgs, "collateInterpolationArgs");
|
|
21771
|
-
function interpolationToExpression(interpolation, sourceSpan) {
|
|
21772
|
-
const interpolationArgs = collateInterpolationArgs(interpolation.strings, interpolation.expressions);
|
|
21773
|
-
return callVariadicInstructionExpr(VALUE_INTERPOLATE_CONFIG, [], interpolationArgs, [], sourceSpan);
|
|
21774
|
-
}
|
|
21775
|
-
__name(interpolationToExpression, "interpolationToExpression");
|
|
21776
21140
|
function call(instruction, args, sourceSpan) {
|
|
21777
21141
|
const expr = importExpr(instruction).callFn(args, sourceSpan);
|
|
21778
21142
|
return createStatementOp(new ExpressionStatement(expr, sourceSpan));
|
|
@@ -21806,19 +21170,99 @@ var TEXT_INTERPOLATE_CONFIG = {
|
|
|
21806
21170
|
return (n - 1) / 2;
|
|
21807
21171
|
}, "mapping")
|
|
21808
21172
|
};
|
|
21809
|
-
var
|
|
21173
|
+
var PROPERTY_INTERPOLATE_CONFIG = {
|
|
21174
|
+
constant: [
|
|
21175
|
+
Identifiers.propertyInterpolate,
|
|
21176
|
+
Identifiers.propertyInterpolate1,
|
|
21177
|
+
Identifiers.propertyInterpolate2,
|
|
21178
|
+
Identifiers.propertyInterpolate3,
|
|
21179
|
+
Identifiers.propertyInterpolate4,
|
|
21180
|
+
Identifiers.propertyInterpolate5,
|
|
21181
|
+
Identifiers.propertyInterpolate6,
|
|
21182
|
+
Identifiers.propertyInterpolate7,
|
|
21183
|
+
Identifiers.propertyInterpolate8
|
|
21184
|
+
],
|
|
21185
|
+
variable: Identifiers.propertyInterpolateV,
|
|
21186
|
+
mapping: /* @__PURE__ */ __name((n) => {
|
|
21187
|
+
if (n % 2 === 0) {
|
|
21188
|
+
throw new Error(`Expected odd number of arguments`);
|
|
21189
|
+
}
|
|
21190
|
+
return (n - 1) / 2;
|
|
21191
|
+
}, "mapping")
|
|
21192
|
+
};
|
|
21193
|
+
var STYLE_PROP_INTERPOLATE_CONFIG = {
|
|
21194
|
+
constant: [
|
|
21195
|
+
Identifiers.styleProp,
|
|
21196
|
+
Identifiers.stylePropInterpolate1,
|
|
21197
|
+
Identifiers.stylePropInterpolate2,
|
|
21198
|
+
Identifiers.stylePropInterpolate3,
|
|
21199
|
+
Identifiers.stylePropInterpolate4,
|
|
21200
|
+
Identifiers.stylePropInterpolate5,
|
|
21201
|
+
Identifiers.stylePropInterpolate6,
|
|
21202
|
+
Identifiers.stylePropInterpolate7,
|
|
21203
|
+
Identifiers.stylePropInterpolate8
|
|
21204
|
+
],
|
|
21205
|
+
variable: Identifiers.stylePropInterpolateV,
|
|
21206
|
+
mapping: /* @__PURE__ */ __name((n) => {
|
|
21207
|
+
if (n % 2 === 0) {
|
|
21208
|
+
throw new Error(`Expected odd number of arguments`);
|
|
21209
|
+
}
|
|
21210
|
+
return (n - 1) / 2;
|
|
21211
|
+
}, "mapping")
|
|
21212
|
+
};
|
|
21213
|
+
var ATTRIBUTE_INTERPOLATE_CONFIG = {
|
|
21214
|
+
constant: [
|
|
21215
|
+
Identifiers.attribute,
|
|
21216
|
+
Identifiers.attributeInterpolate1,
|
|
21217
|
+
Identifiers.attributeInterpolate2,
|
|
21218
|
+
Identifiers.attributeInterpolate3,
|
|
21219
|
+
Identifiers.attributeInterpolate4,
|
|
21220
|
+
Identifiers.attributeInterpolate5,
|
|
21221
|
+
Identifiers.attributeInterpolate6,
|
|
21222
|
+
Identifiers.attributeInterpolate7,
|
|
21223
|
+
Identifiers.attributeInterpolate8
|
|
21224
|
+
],
|
|
21225
|
+
variable: Identifiers.attributeInterpolateV,
|
|
21226
|
+
mapping: /* @__PURE__ */ __name((n) => {
|
|
21227
|
+
if (n % 2 === 0) {
|
|
21228
|
+
throw new Error(`Expected odd number of arguments`);
|
|
21229
|
+
}
|
|
21230
|
+
return (n - 1) / 2;
|
|
21231
|
+
}, "mapping")
|
|
21232
|
+
};
|
|
21233
|
+
var STYLE_MAP_INTERPOLATE_CONFIG = {
|
|
21234
|
+
constant: [
|
|
21235
|
+
Identifiers.styleMap,
|
|
21236
|
+
Identifiers.styleMapInterpolate1,
|
|
21237
|
+
Identifiers.styleMapInterpolate2,
|
|
21238
|
+
Identifiers.styleMapInterpolate3,
|
|
21239
|
+
Identifiers.styleMapInterpolate4,
|
|
21240
|
+
Identifiers.styleMapInterpolate5,
|
|
21241
|
+
Identifiers.styleMapInterpolate6,
|
|
21242
|
+
Identifiers.styleMapInterpolate7,
|
|
21243
|
+
Identifiers.styleMapInterpolate8
|
|
21244
|
+
],
|
|
21245
|
+
variable: Identifiers.styleMapInterpolateV,
|
|
21246
|
+
mapping: /* @__PURE__ */ __name((n) => {
|
|
21247
|
+
if (n % 2 === 0) {
|
|
21248
|
+
throw new Error(`Expected odd number of arguments`);
|
|
21249
|
+
}
|
|
21250
|
+
return (n - 1) / 2;
|
|
21251
|
+
}, "mapping")
|
|
21252
|
+
};
|
|
21253
|
+
var CLASS_MAP_INTERPOLATE_CONFIG = {
|
|
21810
21254
|
constant: [
|
|
21811
|
-
Identifiers.
|
|
21812
|
-
Identifiers.
|
|
21813
|
-
Identifiers.
|
|
21814
|
-
Identifiers.
|
|
21815
|
-
Identifiers.
|
|
21816
|
-
Identifiers.
|
|
21817
|
-
Identifiers.
|
|
21818
|
-
Identifiers.
|
|
21819
|
-
Identifiers.
|
|
21255
|
+
Identifiers.classMap,
|
|
21256
|
+
Identifiers.classMapInterpolate1,
|
|
21257
|
+
Identifiers.classMapInterpolate2,
|
|
21258
|
+
Identifiers.classMapInterpolate3,
|
|
21259
|
+
Identifiers.classMapInterpolate4,
|
|
21260
|
+
Identifiers.classMapInterpolate5,
|
|
21261
|
+
Identifiers.classMapInterpolate6,
|
|
21262
|
+
Identifiers.classMapInterpolate7,
|
|
21263
|
+
Identifiers.classMapInterpolate8
|
|
21820
21264
|
],
|
|
21821
|
-
variable: Identifiers.
|
|
21265
|
+
variable: Identifiers.classMapInterpolateV,
|
|
21822
21266
|
mapping: /* @__PURE__ */ __name((n) => {
|
|
21823
21267
|
if (n % 2 === 0) {
|
|
21824
21268
|
throw new Error(`Expected odd number of arguments`);
|
|
@@ -21843,10 +21287,6 @@ var PURE_FUNCTION_CONFIG = {
|
|
|
21843
21287
|
};
|
|
21844
21288
|
function callVariadicInstructionExpr(config, baseArgs, interpolationArgs, extraArgs, sourceSpan) {
|
|
21845
21289
|
const n = config.mapping(interpolationArgs.length);
|
|
21846
|
-
const lastInterpolationArg = interpolationArgs.at(-1);
|
|
21847
|
-
if (extraArgs.length === 0 && interpolationArgs.length > 1 && lastInterpolationArg instanceof LiteralExpr && lastInterpolationArg.value === "") {
|
|
21848
|
-
interpolationArgs.pop();
|
|
21849
|
-
}
|
|
21850
21290
|
if (n < config.constant.length) {
|
|
21851
21291
|
return importExpr(config.constant[n]).callFn([...baseArgs, ...interpolationArgs, ...extraArgs], sourceSpan);
|
|
21852
21292
|
} else if (config.variable !== null) {
|
|
@@ -22025,26 +21465,6 @@ function reifyCreateOperations(unit, ops) {
|
|
|
22025
21465
|
}
|
|
22026
21466
|
OpList.replace(op, projection(op.handle.slot, op.projectionSlotIndex, op.attributes, fallbackViewFnName, fallbackDecls, fallbackVars, op.sourceSpan));
|
|
22027
21467
|
break;
|
|
22028
|
-
case OpKind.ConditionalCreate:
|
|
22029
|
-
if (!(unit instanceof ViewCompilationUnit)) {
|
|
22030
|
-
throw new Error(`AssertionError: must be compiling a component`);
|
|
22031
|
-
}
|
|
22032
|
-
if (Array.isArray(op.localRefs)) {
|
|
22033
|
-
throw new Error(`AssertionError: local refs array should have been extracted into a constant`);
|
|
22034
|
-
}
|
|
22035
|
-
const conditionalCreateChildView = unit.job.views.get(op.xref);
|
|
22036
|
-
OpList.replace(op, conditionalCreate(op.handle.slot, variable(conditionalCreateChildView.fnName), conditionalCreateChildView.decls, conditionalCreateChildView.vars, op.tag, op.attributes, op.localRefs, op.startSourceSpan));
|
|
22037
|
-
break;
|
|
22038
|
-
case OpKind.ConditionalBranchCreate:
|
|
22039
|
-
if (!(unit instanceof ViewCompilationUnit)) {
|
|
22040
|
-
throw new Error(`AssertionError: must be compiling a component`);
|
|
22041
|
-
}
|
|
22042
|
-
if (Array.isArray(op.localRefs)) {
|
|
22043
|
-
throw new Error(`AssertionError: local refs array should have been extracted into a constant`);
|
|
22044
|
-
}
|
|
22045
|
-
const conditionalBranchCreateChildView = unit.job.views.get(op.xref);
|
|
22046
|
-
OpList.replace(op, conditionalBranchCreate(op.handle.slot, variable(conditionalBranchCreateChildView.fnName), conditionalBranchCreateChildView.decls, conditionalBranchCreateChildView.vars, op.tag, op.attributes, op.localRefs, op.startSourceSpan));
|
|
22047
|
-
break;
|
|
22048
21468
|
case OpKind.RepeaterCreate:
|
|
22049
21469
|
if (op.handle.slot === null) {
|
|
22050
21470
|
throw new Error("No slot was assigned for repeater instruction");
|
|
@@ -22103,22 +21523,38 @@ function reifyUpdateOperations(_unit, ops) {
|
|
|
22103
21523
|
OpList.replace(op, advance(op.delta, op.sourceSpan));
|
|
22104
21524
|
break;
|
|
22105
21525
|
case OpKind.Property:
|
|
22106
|
-
|
|
21526
|
+
if (op.expression instanceof Interpolation2) {
|
|
21527
|
+
OpList.replace(op, propertyInterpolate(op.name, op.expression.strings, op.expression.expressions, op.sanitizer, op.sourceSpan));
|
|
21528
|
+
} else {
|
|
21529
|
+
OpList.replace(op, property(op.name, op.expression, op.sanitizer, op.sourceSpan));
|
|
21530
|
+
}
|
|
22107
21531
|
break;
|
|
22108
21532
|
case OpKind.TwoWayProperty:
|
|
22109
21533
|
OpList.replace(op, twoWayProperty(op.name, op.expression, op.sanitizer, op.sourceSpan));
|
|
22110
21534
|
break;
|
|
22111
21535
|
case OpKind.StyleProp:
|
|
22112
|
-
|
|
22113
|
-
|
|
21536
|
+
if (op.expression instanceof Interpolation2) {
|
|
21537
|
+
OpList.replace(op, stylePropInterpolate(op.name, op.expression.strings, op.expression.expressions, op.unit, op.sourceSpan));
|
|
21538
|
+
} else {
|
|
21539
|
+
OpList.replace(op, styleProp(op.name, op.expression, op.unit, op.sourceSpan));
|
|
21540
|
+
}
|
|
21541
|
+
break;
|
|
22114
21542
|
case OpKind.ClassProp:
|
|
22115
21543
|
OpList.replace(op, classProp(op.name, op.expression, op.sourceSpan));
|
|
22116
21544
|
break;
|
|
22117
21545
|
case OpKind.StyleMap:
|
|
22118
|
-
|
|
21546
|
+
if (op.expression instanceof Interpolation2) {
|
|
21547
|
+
OpList.replace(op, styleMapInterpolate(op.expression.strings, op.expression.expressions, op.sourceSpan));
|
|
21548
|
+
} else {
|
|
21549
|
+
OpList.replace(op, styleMap(op.expression, op.sourceSpan));
|
|
21550
|
+
}
|
|
22119
21551
|
break;
|
|
22120
21552
|
case OpKind.ClassMap:
|
|
22121
|
-
|
|
21553
|
+
if (op.expression instanceof Interpolation2) {
|
|
21554
|
+
OpList.replace(op, classMapInterpolate(op.expression.strings, op.expression.expressions, op.sourceSpan));
|
|
21555
|
+
} else {
|
|
21556
|
+
OpList.replace(op, classMap(op.expression, op.sourceSpan));
|
|
21557
|
+
}
|
|
22122
21558
|
break;
|
|
22123
21559
|
case OpKind.I18nExpression:
|
|
22124
21560
|
OpList.replace(op, i18nExp(op.expression, op.sourceSpan));
|
|
@@ -22130,16 +21566,20 @@ function reifyUpdateOperations(_unit, ops) {
|
|
|
22130
21566
|
OpList.replace(op, textInterpolate(op.interpolation.strings, op.interpolation.expressions, op.sourceSpan));
|
|
22131
21567
|
break;
|
|
22132
21568
|
case OpKind.Attribute:
|
|
22133
|
-
|
|
21569
|
+
if (op.expression instanceof Interpolation2) {
|
|
21570
|
+
OpList.replace(op, attributeInterpolate(op.name, op.expression.strings, op.expression.expressions, op.sanitizer, op.sourceSpan));
|
|
21571
|
+
} else {
|
|
21572
|
+
OpList.replace(op, attribute(op.name, op.expression, op.sanitizer, op.namespace));
|
|
21573
|
+
}
|
|
22134
21574
|
break;
|
|
22135
|
-
case OpKind.
|
|
21575
|
+
case OpKind.HostProperty:
|
|
22136
21576
|
if (op.expression instanceof Interpolation2) {
|
|
22137
21577
|
throw new Error("not yet handled");
|
|
22138
21578
|
} else {
|
|
22139
21579
|
if (op.isAnimationTrigger) {
|
|
22140
21580
|
OpList.replace(op, syntheticHostProperty(op.name, op.expression, op.sourceSpan));
|
|
22141
21581
|
} else {
|
|
22142
|
-
OpList.replace(op,
|
|
21582
|
+
OpList.replace(op, hostProperty(op.name, op.expression, op.sanitizer, op.sourceSpan));
|
|
22143
21583
|
}
|
|
22144
21584
|
}
|
|
22145
21585
|
break;
|
|
@@ -22306,22 +21746,6 @@ function removeI18nContexts(job) {
|
|
|
22306
21746
|
}
|
|
22307
21747
|
}
|
|
22308
21748
|
__name(removeI18nContexts, "removeI18nContexts");
|
|
22309
|
-
function removeIllegalLetReferences(job) {
|
|
22310
|
-
for (const unit of job.units) {
|
|
22311
|
-
for (const op of unit.update) {
|
|
22312
|
-
if (op.kind !== OpKind.Variable || op.variable.kind !== SemanticVariableKind.Identifier || !(op.initializer instanceof StoreLetExpr)) {
|
|
22313
|
-
continue;
|
|
22314
|
-
}
|
|
22315
|
-
const name = op.variable.identifier;
|
|
22316
|
-
let current = op;
|
|
22317
|
-
while (current && current.kind !== OpKind.ListEnd) {
|
|
22318
|
-
transformExpressionsInOp(current, (expr) => expr instanceof LexicalReadExpr && expr.name === name ? literal(void 0) : expr, VisitorContextFlag.None);
|
|
22319
|
-
current = current.prev;
|
|
22320
|
-
}
|
|
22321
|
-
}
|
|
22322
|
-
}
|
|
22323
|
-
}
|
|
22324
|
-
__name(removeIllegalLetReferences, "removeIllegalLetReferences");
|
|
22325
21749
|
function removeUnusedI18nAttributesOps(job) {
|
|
22326
21750
|
for (const unit of job.units) {
|
|
22327
21751
|
const ownersWithI18nExpressions = /* @__PURE__ */ new Set();
|
|
@@ -22390,30 +21814,6 @@ function processLexicalScope$1(view, ops) {
|
|
|
22390
21814
|
}
|
|
22391
21815
|
}
|
|
22392
21816
|
__name(processLexicalScope$1, "processLexicalScope$1");
|
|
22393
|
-
function resolveDeferDepsFns(job) {
|
|
22394
|
-
for (const unit of job.units) {
|
|
22395
|
-
for (const op of unit.create) {
|
|
22396
|
-
if (op.kind === OpKind.Defer) {
|
|
22397
|
-
if (op.resolverFn !== null) {
|
|
22398
|
-
continue;
|
|
22399
|
-
}
|
|
22400
|
-
if (op.ownResolverFn !== null) {
|
|
22401
|
-
if (op.handle.slot === null) {
|
|
22402
|
-
throw new Error("AssertionError: slot must be assigned before extracting defer deps functions");
|
|
22403
|
-
}
|
|
22404
|
-
const fullPathName = unit.fnName?.replace("_Template", "");
|
|
22405
|
-
op.resolverFn = job.pool.getSharedFunctionReference(
|
|
22406
|
-
op.ownResolverFn,
|
|
22407
|
-
`${fullPathName}_Defer_${op.handle.slot}_DepsFn`,
|
|
22408
|
-
/* Don't use unique names for TDB compatibility */
|
|
22409
|
-
false
|
|
22410
|
-
);
|
|
22411
|
-
}
|
|
22412
|
-
}
|
|
22413
|
-
}
|
|
22414
|
-
}
|
|
22415
|
-
}
|
|
22416
|
-
__name(resolveDeferDepsFns, "resolveDeferDepsFns");
|
|
22417
21817
|
function resolveDollarEvent(job) {
|
|
22418
21818
|
for (const unit of job.units) {
|
|
22419
21819
|
transformDollarEvent(unit.create);
|
|
@@ -22501,8 +21901,6 @@ function resolvePlaceholdersForView(job, unit, i18nContexts, elements, pendingSt
|
|
|
22501
21901
|
pendingStructuralDirective = void 0;
|
|
22502
21902
|
}
|
|
22503
21903
|
break;
|
|
22504
|
-
case OpKind.ConditionalCreate:
|
|
22505
|
-
case OpKind.ConditionalBranchCreate:
|
|
22506
21904
|
case OpKind.Template:
|
|
22507
21905
|
const view = job.views.get(op.xref);
|
|
22508
21906
|
if (op.i18nPlaceholder === void 0) {
|
|
@@ -22784,7 +22182,7 @@ function resolveSanitizers(job) {
|
|
|
22784
22182
|
switch (op.kind) {
|
|
22785
22183
|
case OpKind.Property:
|
|
22786
22184
|
case OpKind.Attribute:
|
|
22787
|
-
case OpKind.
|
|
22185
|
+
case OpKind.HostProperty:
|
|
22788
22186
|
let sanitizerFn = null;
|
|
22789
22187
|
if (Array.isArray(op.securityContext) && op.securityContext.length === 2 && op.securityContext.indexOf(SecurityContext.URL) > -1 && op.securityContext.indexOf(SecurityContext.RESOURCE_URL) > -1) {
|
|
22790
22188
|
sanitizerFn = Identifiers.sanitizeUrlOrResourceUrl;
|
|
@@ -22794,7 +22192,7 @@ function resolveSanitizers(job) {
|
|
|
22794
22192
|
op.sanitizer = sanitizerFn !== null ? importExpr(sanitizerFn) : null;
|
|
22795
22193
|
if (op.sanitizer === null) {
|
|
22796
22194
|
let isIframe = false;
|
|
22797
|
-
if (job.kind === CompilationJobKind.Host || op.kind === OpKind.
|
|
22195
|
+
if (job.kind === CompilationJobKind.Host || op.kind === OpKind.HostProperty) {
|
|
22798
22196
|
isIframe = true;
|
|
22799
22197
|
} else {
|
|
22800
22198
|
const ownerOp = elements.get(op.target);
|
|
@@ -22827,6 +22225,28 @@ function getOnlySecurityContext(securityContext) {
|
|
|
22827
22225
|
return securityContext;
|
|
22828
22226
|
}
|
|
22829
22227
|
__name(getOnlySecurityContext, "getOnlySecurityContext");
|
|
22228
|
+
function transformTwoWayBindingSet(job) {
|
|
22229
|
+
for (const unit of job.units) {
|
|
22230
|
+
for (const op of unit.create) {
|
|
22231
|
+
if (op.kind === OpKind.TwoWayListener) {
|
|
22232
|
+
transformExpressionsInOp(op, (expr) => {
|
|
22233
|
+
if (!(expr instanceof TwoWayBindingSetExpr)) {
|
|
22234
|
+
return expr;
|
|
22235
|
+
}
|
|
22236
|
+
const { target, value } = expr;
|
|
22237
|
+
if (target instanceof ReadPropExpr || target instanceof ReadKeyExpr) {
|
|
22238
|
+
return twoWayBindingSet(target, value).or(target.set(value));
|
|
22239
|
+
}
|
|
22240
|
+
if (target instanceof ReadVariableExpr) {
|
|
22241
|
+
return twoWayBindingSet(target, value);
|
|
22242
|
+
}
|
|
22243
|
+
throw new Error(`Unsupported expression in two-way action binding.`);
|
|
22244
|
+
}, VisitorContextFlag.InChildOperation);
|
|
22245
|
+
}
|
|
22246
|
+
}
|
|
22247
|
+
}
|
|
22248
|
+
}
|
|
22249
|
+
__name(transformTwoWayBindingSet, "transformTwoWayBindingSet");
|
|
22830
22250
|
function saveAndRestoreView(job) {
|
|
22831
22251
|
for (const unit of job.units) {
|
|
22832
22252
|
unit.create.prepend([
|
|
@@ -22888,7 +22308,7 @@ function allocateSlots(job) {
|
|
|
22888
22308
|
}
|
|
22889
22309
|
for (const unit of job.units) {
|
|
22890
22310
|
for (const op of unit.ops()) {
|
|
22891
|
-
if (op.kind === OpKind.Template || op.kind === OpKind.
|
|
22311
|
+
if (op.kind === OpKind.Template || op.kind === OpKind.RepeaterCreate) {
|
|
22892
22312
|
const childView = job.views.get(op.xref);
|
|
22893
22313
|
op.decls = childView.decls;
|
|
22894
22314
|
}
|
|
@@ -22896,96 +22316,6 @@ function allocateSlots(job) {
|
|
|
22896
22316
|
}
|
|
22897
22317
|
}
|
|
22898
22318
|
__name(allocateSlots, "allocateSlots");
|
|
22899
|
-
function optimizeStoreLet(job) {
|
|
22900
|
-
const letUsedExternally = /* @__PURE__ */ new Set();
|
|
22901
|
-
const declareLetOps = /* @__PURE__ */ new Map();
|
|
22902
|
-
for (const unit of job.units) {
|
|
22903
|
-
for (const op of unit.ops()) {
|
|
22904
|
-
if (op.kind === OpKind.DeclareLet) {
|
|
22905
|
-
declareLetOps.set(op.xref, op);
|
|
22906
|
-
}
|
|
22907
|
-
visitExpressionsInOp(op, (expr) => {
|
|
22908
|
-
if (expr instanceof ContextLetReferenceExpr) {
|
|
22909
|
-
letUsedExternally.add(expr.target);
|
|
22910
|
-
}
|
|
22911
|
-
});
|
|
22912
|
-
}
|
|
22913
|
-
}
|
|
22914
|
-
for (const unit of job.units) {
|
|
22915
|
-
for (const op of unit.update) {
|
|
22916
|
-
transformExpressionsInOp(op, (expr) => {
|
|
22917
|
-
if (expr instanceof StoreLetExpr && !letUsedExternally.has(expr.target)) {
|
|
22918
|
-
if (!hasPipe(expr)) {
|
|
22919
|
-
OpList.remove(declareLetOps.get(expr.target));
|
|
22920
|
-
}
|
|
22921
|
-
return expr.value;
|
|
22922
|
-
}
|
|
22923
|
-
return expr;
|
|
22924
|
-
}, VisitorContextFlag.None);
|
|
22925
|
-
}
|
|
22926
|
-
}
|
|
22927
|
-
}
|
|
22928
|
-
__name(optimizeStoreLet, "optimizeStoreLet");
|
|
22929
|
-
function hasPipe(root) {
|
|
22930
|
-
let result = false;
|
|
22931
|
-
transformExpressionsInExpression(root, (expr) => {
|
|
22932
|
-
if (expr instanceof PipeBindingExpr || expr instanceof PipeBindingVariadicExpr) {
|
|
22933
|
-
result = true;
|
|
22934
|
-
}
|
|
22935
|
-
return expr;
|
|
22936
|
-
}, VisitorContextFlag.None);
|
|
22937
|
-
return result;
|
|
22938
|
-
}
|
|
22939
|
-
__name(hasPipe, "hasPipe");
|
|
22940
|
-
function stripNonrequiredParentheses(job) {
|
|
22941
|
-
const requiredParens = /* @__PURE__ */ new Set();
|
|
22942
|
-
for (const unit of job.units) {
|
|
22943
|
-
for (const op of unit.ops()) {
|
|
22944
|
-
visitExpressionsInOp(op, (expr) => {
|
|
22945
|
-
if (expr instanceof BinaryOperatorExpr) {
|
|
22946
|
-
switch (expr.operator) {
|
|
22947
|
-
case BinaryOperator.Exponentiation:
|
|
22948
|
-
checkExponentiationParens(expr, requiredParens);
|
|
22949
|
-
break;
|
|
22950
|
-
case BinaryOperator.NullishCoalesce:
|
|
22951
|
-
checkNullishCoalescingParens(expr, requiredParens);
|
|
22952
|
-
break;
|
|
22953
|
-
}
|
|
22954
|
-
}
|
|
22955
|
-
});
|
|
22956
|
-
}
|
|
22957
|
-
}
|
|
22958
|
-
for (const unit of job.units) {
|
|
22959
|
-
for (const op of unit.ops()) {
|
|
22960
|
-
transformExpressionsInOp(op, (expr) => {
|
|
22961
|
-
if (expr instanceof ParenthesizedExpr) {
|
|
22962
|
-
return requiredParens.has(expr) ? expr : expr.expr;
|
|
22963
|
-
}
|
|
22964
|
-
return expr;
|
|
22965
|
-
}, VisitorContextFlag.None);
|
|
22966
|
-
}
|
|
22967
|
-
}
|
|
22968
|
-
}
|
|
22969
|
-
__name(stripNonrequiredParentheses, "stripNonrequiredParentheses");
|
|
22970
|
-
function checkExponentiationParens(expr, requiredParens) {
|
|
22971
|
-
if (expr.lhs instanceof ParenthesizedExpr && expr.lhs.expr instanceof UnaryOperatorExpr) {
|
|
22972
|
-
requiredParens.add(expr.lhs);
|
|
22973
|
-
}
|
|
22974
|
-
}
|
|
22975
|
-
__name(checkExponentiationParens, "checkExponentiationParens");
|
|
22976
|
-
function checkNullishCoalescingParens(expr, requiredParens) {
|
|
22977
|
-
if (expr.lhs instanceof ParenthesizedExpr && (isLogicalAndOr(expr.lhs.expr) || expr.lhs.expr instanceof ConditionalExpr)) {
|
|
22978
|
-
requiredParens.add(expr.lhs);
|
|
22979
|
-
}
|
|
22980
|
-
if (expr.rhs instanceof ParenthesizedExpr && (isLogicalAndOr(expr.rhs.expr) || expr.rhs.expr instanceof ConditionalExpr)) {
|
|
22981
|
-
requiredParens.add(expr.rhs);
|
|
22982
|
-
}
|
|
22983
|
-
}
|
|
22984
|
-
__name(checkNullishCoalescingParens, "checkNullishCoalescingParens");
|
|
22985
|
-
function isLogicalAndOr(expr) {
|
|
22986
|
-
return expr instanceof BinaryOperatorExpr && (expr.operator === BinaryOperator.And || expr.operator === BinaryOperator.Or);
|
|
22987
|
-
}
|
|
22988
|
-
__name(isLogicalAndOr, "isLogicalAndOr");
|
|
22989
22319
|
function specializeStyleBindings(job) {
|
|
22990
22320
|
for (const unit of job.units) {
|
|
22991
22321
|
for (const op of unit.update) {
|
|
@@ -23151,28 +22481,6 @@ function generateTrackVariables(job) {
|
|
|
23151
22481
|
}
|
|
23152
22482
|
}
|
|
23153
22483
|
__name(generateTrackVariables, "generateTrackVariables");
|
|
23154
|
-
function transformTwoWayBindingSet(job) {
|
|
23155
|
-
for (const unit of job.units) {
|
|
23156
|
-
for (const op of unit.create) {
|
|
23157
|
-
if (op.kind === OpKind.TwoWayListener) {
|
|
23158
|
-
transformExpressionsInOp(op, (expr) => {
|
|
23159
|
-
if (!(expr instanceof TwoWayBindingSetExpr)) {
|
|
23160
|
-
return expr;
|
|
23161
|
-
}
|
|
23162
|
-
const { target, value } = expr;
|
|
23163
|
-
if (target instanceof ReadPropExpr || target instanceof ReadKeyExpr) {
|
|
23164
|
-
return twoWayBindingSet(target, value).or(target.set(value));
|
|
23165
|
-
}
|
|
23166
|
-
if (target instanceof ReadVariableExpr) {
|
|
23167
|
-
return twoWayBindingSet(target, value);
|
|
23168
|
-
}
|
|
23169
|
-
throw new Error(`Unsupported expression in two-way action binding.`);
|
|
23170
|
-
}, VisitorContextFlag.InChildOperation);
|
|
23171
|
-
}
|
|
23172
|
-
}
|
|
23173
|
-
}
|
|
23174
|
-
}
|
|
23175
|
-
__name(transformTwoWayBindingSet, "transformTwoWayBindingSet");
|
|
23176
22484
|
function countVariables(job) {
|
|
23177
22485
|
for (const unit of job.units) {
|
|
23178
22486
|
let varCount = 0;
|
|
@@ -23217,7 +22525,7 @@ function countVariables(job) {
|
|
|
23217
22525
|
if (job instanceof ComponentCompilationJob) {
|
|
23218
22526
|
for (const unit of job.units) {
|
|
23219
22527
|
for (const op of unit.create) {
|
|
23220
|
-
if (op.kind !== OpKind.Template && op.kind !== OpKind.RepeaterCreate
|
|
22528
|
+
if (op.kind !== OpKind.Template && op.kind !== OpKind.RepeaterCreate) {
|
|
23221
22529
|
continue;
|
|
23222
22530
|
}
|
|
23223
22531
|
const childView = job.views.get(op.xref);
|
|
@@ -23230,19 +22538,14 @@ __name(countVariables, "countVariables");
|
|
|
23230
22538
|
function varsUsedByOp(op) {
|
|
23231
22539
|
let slots;
|
|
23232
22540
|
switch (op.kind) {
|
|
22541
|
+
case OpKind.Property:
|
|
22542
|
+
case OpKind.HostProperty:
|
|
23233
22543
|
case OpKind.Attribute:
|
|
23234
22544
|
slots = 1;
|
|
23235
22545
|
if (op.expression instanceof Interpolation2 && !isSingletonInterpolation(op.expression)) {
|
|
23236
22546
|
slots += op.expression.expressions.length;
|
|
23237
22547
|
}
|
|
23238
22548
|
return slots;
|
|
23239
|
-
case OpKind.Property:
|
|
23240
|
-
case OpKind.DomProperty:
|
|
23241
|
-
slots = 1;
|
|
23242
|
-
if (op.expression instanceof Interpolation2) {
|
|
23243
|
-
slots += op.expression.expressions.length;
|
|
23244
|
-
}
|
|
23245
|
-
return slots;
|
|
23246
22549
|
case OpKind.TwoWayProperty:
|
|
23247
22550
|
return 1;
|
|
23248
22551
|
case OpKind.StyleProp:
|
|
@@ -23586,6 +22889,80 @@ function wrapI18nIcus(job) {
|
|
|
23586
22889
|
}
|
|
23587
22890
|
}
|
|
23588
22891
|
__name(wrapI18nIcus, "wrapI18nIcus");
|
|
22892
|
+
function optimizeStoreLet(job) {
|
|
22893
|
+
const letUsedExternally = /* @__PURE__ */ new Set();
|
|
22894
|
+
for (const unit of job.units) {
|
|
22895
|
+
for (const op of unit.ops()) {
|
|
22896
|
+
visitExpressionsInOp(op, (expr) => {
|
|
22897
|
+
if (expr instanceof ContextLetReferenceExpr) {
|
|
22898
|
+
letUsedExternally.add(expr.target);
|
|
22899
|
+
}
|
|
22900
|
+
});
|
|
22901
|
+
}
|
|
22902
|
+
}
|
|
22903
|
+
for (const unit of job.units) {
|
|
22904
|
+
for (const op of unit.update) {
|
|
22905
|
+
transformExpressionsInOp(op, (expression) => expression instanceof StoreLetExpr && !letUsedExternally.has(expression.target) ? expression.value : expression, VisitorContextFlag.None);
|
|
22906
|
+
}
|
|
22907
|
+
}
|
|
22908
|
+
}
|
|
22909
|
+
__name(optimizeStoreLet, "optimizeStoreLet");
|
|
22910
|
+
function removeIllegalLetReferences(job) {
|
|
22911
|
+
for (const unit of job.units) {
|
|
22912
|
+
for (const op of unit.update) {
|
|
22913
|
+
if (op.kind !== OpKind.Variable || op.variable.kind !== SemanticVariableKind.Identifier || !(op.initializer instanceof StoreLetExpr)) {
|
|
22914
|
+
continue;
|
|
22915
|
+
}
|
|
22916
|
+
const name = op.variable.identifier;
|
|
22917
|
+
let current = op;
|
|
22918
|
+
while (current && current.kind !== OpKind.ListEnd) {
|
|
22919
|
+
transformExpressionsInOp(current, (expr) => expr instanceof LexicalReadExpr && expr.name === name ? literal(void 0) : expr, VisitorContextFlag.None);
|
|
22920
|
+
current = current.prev;
|
|
22921
|
+
}
|
|
22922
|
+
}
|
|
22923
|
+
}
|
|
22924
|
+
}
|
|
22925
|
+
__name(removeIllegalLetReferences, "removeIllegalLetReferences");
|
|
22926
|
+
function generateLocalLetReferences(job) {
|
|
22927
|
+
for (const unit of job.units) {
|
|
22928
|
+
for (const op of unit.update) {
|
|
22929
|
+
if (op.kind !== OpKind.StoreLet) {
|
|
22930
|
+
continue;
|
|
22931
|
+
}
|
|
22932
|
+
const variable2 = {
|
|
22933
|
+
kind: SemanticVariableKind.Identifier,
|
|
22934
|
+
name: null,
|
|
22935
|
+
identifier: op.declaredName,
|
|
22936
|
+
local: true
|
|
22937
|
+
};
|
|
22938
|
+
OpList.replace(op, createVariableOp(job.allocateXrefId(), variable2, new StoreLetExpr(op.target, op.value, op.sourceSpan), VariableFlags.None));
|
|
22939
|
+
}
|
|
22940
|
+
}
|
|
22941
|
+
}
|
|
22942
|
+
__name(generateLocalLetReferences, "generateLocalLetReferences");
|
|
22943
|
+
function attachSourceLocations(job) {
|
|
22944
|
+
if (!job.enableDebugLocations || job.relativeTemplatePath === null) {
|
|
22945
|
+
return;
|
|
22946
|
+
}
|
|
22947
|
+
for (const unit of job.units) {
|
|
22948
|
+
const locations = [];
|
|
22949
|
+
for (const op of unit.create) {
|
|
22950
|
+
if (op.kind === OpKind.ElementStart || op.kind === OpKind.Element) {
|
|
22951
|
+
const start = op.startSourceSpan.start;
|
|
22952
|
+
locations.push({
|
|
22953
|
+
targetSlot: op.handle,
|
|
22954
|
+
offset: start.offset,
|
|
22955
|
+
line: start.line,
|
|
22956
|
+
column: start.col
|
|
22957
|
+
});
|
|
22958
|
+
}
|
|
22959
|
+
}
|
|
22960
|
+
if (locations.length > 0) {
|
|
22961
|
+
unit.create.push(createSourceLocationOp(job.relativeTemplatePath, locations));
|
|
22962
|
+
}
|
|
22963
|
+
}
|
|
22964
|
+
}
|
|
22965
|
+
__name(attachSourceLocations, "attachSourceLocations");
|
|
23589
22966
|
var phases = [
|
|
23590
22967
|
{ kind: CompilationJobKind.Tmpl, fn: removeContentSelectors },
|
|
23591
22968
|
{ kind: CompilationJobKind.Host, fn: parseHostStyleProperties },
|
|
@@ -23604,6 +22981,11 @@ var phases = [
|
|
|
23604
22981
|
{ kind: CompilationJobKind.Tmpl, fn: generateConditionalExpressions },
|
|
23605
22982
|
{ kind: CompilationJobKind.Tmpl, fn: createPipes },
|
|
23606
22983
|
{ kind: CompilationJobKind.Tmpl, fn: configureDeferInstructions },
|
|
22984
|
+
{ kind: CompilationJobKind.Tmpl, fn: convertI18nText },
|
|
22985
|
+
{ kind: CompilationJobKind.Tmpl, fn: convertI18nBindings },
|
|
22986
|
+
{ kind: CompilationJobKind.Tmpl, fn: removeUnusedI18nAttributesOps },
|
|
22987
|
+
{ kind: CompilationJobKind.Tmpl, fn: assignI18nSlotDependencies },
|
|
22988
|
+
{ kind: CompilationJobKind.Tmpl, fn: applyI18nExpressions },
|
|
23607
22989
|
{ kind: CompilationJobKind.Tmpl, fn: createVariadicPipes },
|
|
23608
22990
|
{ kind: CompilationJobKind.Both, fn: generatePureLiteralStructures },
|
|
23609
22991
|
{ kind: CompilationJobKind.Tmpl, fn: generateProjectionDefs },
|
|
@@ -23621,16 +23003,11 @@ var phases = [
|
|
|
23621
23003
|
{ kind: CompilationJobKind.Both, fn: resolveContexts },
|
|
23622
23004
|
{ kind: CompilationJobKind.Both, fn: resolveSanitizers },
|
|
23623
23005
|
{ kind: CompilationJobKind.Tmpl, fn: liftLocalRefs },
|
|
23006
|
+
{ kind: CompilationJobKind.Both, fn: generateNullishCoalesceExpressions },
|
|
23624
23007
|
{ kind: CompilationJobKind.Both, fn: expandSafeReads },
|
|
23625
|
-
{ kind: CompilationJobKind.Both, fn: stripNonrequiredParentheses },
|
|
23626
23008
|
{ kind: CompilationJobKind.Both, fn: generateTemporaryVariables },
|
|
23627
23009
|
{ kind: CompilationJobKind.Both, fn: optimizeVariables },
|
|
23628
23010
|
{ kind: CompilationJobKind.Both, fn: optimizeStoreLet },
|
|
23629
|
-
{ kind: CompilationJobKind.Tmpl, fn: convertI18nText },
|
|
23630
|
-
{ kind: CompilationJobKind.Tmpl, fn: convertI18nBindings },
|
|
23631
|
-
{ kind: CompilationJobKind.Tmpl, fn: removeUnusedI18nAttributesOps },
|
|
23632
|
-
{ kind: CompilationJobKind.Tmpl, fn: assignI18nSlotDependencies },
|
|
23633
|
-
{ kind: CompilationJobKind.Tmpl, fn: applyI18nExpressions },
|
|
23634
23011
|
{ kind: CompilationJobKind.Tmpl, fn: allocateSlots },
|
|
23635
23012
|
{ kind: CompilationJobKind.Tmpl, fn: resolveI18nElementPlaceholders },
|
|
23636
23013
|
{ kind: CompilationJobKind.Tmpl, fn: resolveI18nExpressionPlaceholders },
|
|
@@ -23780,7 +23157,7 @@ function ingestHostBinding(input, bindingParser, constantPool) {
|
|
|
23780
23157
|
bindingKind = BindingKind.Animation;
|
|
23781
23158
|
}
|
|
23782
23159
|
const securityContexts = bindingParser.calcPossibleSecurityContexts(input.componentSelector, property2.name, bindingKind === BindingKind.Attribute).filter((context) => context !== SecurityContext.NONE);
|
|
23783
|
-
|
|
23160
|
+
ingestHostProperty(job, property2, bindingKind, securityContexts);
|
|
23784
23161
|
}
|
|
23785
23162
|
for (const [name, expr] of Object.entries(input.attributes) ?? []) {
|
|
23786
23163
|
const securityContexts = bindingParser.calcPossibleSecurityContexts(input.componentSelector, name, true).filter((context) => context !== SecurityContext.NONE);
|
|
@@ -23792,7 +23169,7 @@ function ingestHostBinding(input, bindingParser, constantPool) {
|
|
|
23792
23169
|
return job;
|
|
23793
23170
|
}
|
|
23794
23171
|
__name(ingestHostBinding, "ingestHostBinding");
|
|
23795
|
-
function
|
|
23172
|
+
function ingestHostProperty(job, property2, bindingKind, securityContexts) {
|
|
23796
23173
|
let expression;
|
|
23797
23174
|
const ast = property2.expression.ast;
|
|
23798
23175
|
if (ast instanceof Interpolation$1) {
|
|
@@ -23815,7 +23192,7 @@ function ingestDomProperty(job, property2, bindingKind, securityContexts) {
|
|
|
23815
23192
|
property2.sourceSpan
|
|
23816
23193
|
));
|
|
23817
23194
|
}
|
|
23818
|
-
__name(
|
|
23195
|
+
__name(ingestHostProperty, "ingestHostProperty");
|
|
23819
23196
|
function ingestHostAttribute(job, name, value, securityContexts) {
|
|
23820
23197
|
const attrBinding = createBindingOp(
|
|
23821
23198
|
job.root.xref,
|
|
@@ -23867,8 +23244,7 @@ function ingestNodes(unit, template2) {
|
|
|
23867
23244
|
ingestForBlock(unit, node);
|
|
23868
23245
|
} else if (node instanceof LetDeclaration$1) {
|
|
23869
23246
|
ingestLetDeclaration(unit, node);
|
|
23870
|
-
} else
|
|
23871
|
-
else {
|
|
23247
|
+
} else {
|
|
23872
23248
|
throw new Error(`Unsupported template node: ${node.constructor.name}`);
|
|
23873
23249
|
}
|
|
23874
23250
|
}
|
|
@@ -23986,14 +23362,13 @@ function ingestIfBlock(unit, ifBlock) {
|
|
|
23986
23362
|
}
|
|
23987
23363
|
ifCaseI18nMeta = ifCase.i18n;
|
|
23988
23364
|
}
|
|
23989
|
-
const
|
|
23990
|
-
|
|
23991
|
-
unit.create.push(conditionalCreateOp);
|
|
23365
|
+
const templateOp = createTemplateOp(cView.xref, TemplateKind.Block, tagName, "Conditional", Namespace.HTML, ifCaseI18nMeta, ifCase.startSourceSpan, ifCase.sourceSpan);
|
|
23366
|
+
unit.create.push(templateOp);
|
|
23992
23367
|
if (firstXref === null) {
|
|
23993
23368
|
firstXref = cView.xref;
|
|
23994
23369
|
}
|
|
23995
23370
|
const caseExpr = ifCase.expression ? convertAst(ifCase.expression, unit.job, null) : null;
|
|
23996
|
-
const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr,
|
|
23371
|
+
const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr, templateOp.xref, templateOp.handle, ifCase.expressionAlias);
|
|
23997
23372
|
conditions.push(conditionalCaseExpr);
|
|
23998
23373
|
ingestNodes(cView, ifCase.children);
|
|
23999
23374
|
}
|
|
@@ -24006,8 +23381,7 @@ function ingestSwitchBlock(unit, switchBlock) {
|
|
|
24006
23381
|
}
|
|
24007
23382
|
let firstXref = null;
|
|
24008
23383
|
let conditions = [];
|
|
24009
|
-
for (
|
|
24010
|
-
const switchCase = switchBlock.cases[i];
|
|
23384
|
+
for (const switchCase of switchBlock.cases) {
|
|
24011
23385
|
const cView = unit.job.allocateView(unit.xref);
|
|
24012
23386
|
const tagName = ingestControlFlowInsertionPoint(unit, cView.xref, switchCase);
|
|
24013
23387
|
let switchCaseI18nMeta = void 0;
|
|
@@ -24017,14 +23391,13 @@ function ingestSwitchBlock(unit, switchBlock) {
|
|
|
24017
23391
|
}
|
|
24018
23392
|
switchCaseI18nMeta = switchCase.i18n;
|
|
24019
23393
|
}
|
|
24020
|
-
const
|
|
24021
|
-
|
|
24022
|
-
unit.create.push(conditionalCreateOp);
|
|
23394
|
+
const templateOp = createTemplateOp(cView.xref, TemplateKind.Block, tagName, "Case", Namespace.HTML, switchCaseI18nMeta, switchCase.startSourceSpan, switchCase.sourceSpan);
|
|
23395
|
+
unit.create.push(templateOp);
|
|
24023
23396
|
if (firstXref === null) {
|
|
24024
23397
|
firstXref = cView.xref;
|
|
24025
23398
|
}
|
|
24026
23399
|
const caseExpr = switchCase.expression ? convertAst(switchCase.expression, unit.job, switchBlock.startSourceSpan) : null;
|
|
24027
|
-
const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr,
|
|
23400
|
+
const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr, templateOp.xref, templateOp.handle);
|
|
24028
23401
|
conditions.push(conditionalCaseExpr);
|
|
24029
23402
|
ingestNodes(cView, switchCase.children);
|
|
24030
23403
|
}
|
|
@@ -24330,25 +23703,15 @@ function convertAst(ast, job, baseSourceSpan) {
|
|
|
24330
23703
|
return not(convertAst(ast.expression, job, baseSourceSpan), convertSourceSpan(ast.span, baseSourceSpan));
|
|
24331
23704
|
} else if (ast instanceof TypeofExpression) {
|
|
24332
23705
|
return typeofExpr(convertAst(ast.expression, job, baseSourceSpan));
|
|
24333
|
-
} else if (ast instanceof VoidExpression) {
|
|
24334
|
-
return new VoidExpr(convertAst(ast.expression, job, baseSourceSpan), void 0, convertSourceSpan(ast.span, baseSourceSpan));
|
|
24335
23706
|
} else if (ast instanceof TemplateLiteral) {
|
|
24336
|
-
return
|
|
24337
|
-
|
|
24338
|
-
|
|
24339
|
-
} else if (ast instanceof ParenthesizedExpression) {
|
|
24340
|
-
return new ParenthesizedExpr(convertAst(ast.expression, job, baseSourceSpan), void 0, convertSourceSpan(ast.span, baseSourceSpan));
|
|
23707
|
+
return new TemplateLiteralExpr(ast.elements.map((el) => {
|
|
23708
|
+
return new TemplateLiteralElementExpr(el.text, convertSourceSpan(el.span, baseSourceSpan));
|
|
23709
|
+
}), ast.expressions.map((expr) => convertAst(expr, job, baseSourceSpan)), convertSourceSpan(ast.span, baseSourceSpan));
|
|
24341
23710
|
} else {
|
|
24342
23711
|
throw new Error(`Unhandled expression type "${ast.constructor.name}" in file "${baseSourceSpan?.start.file.url}"`);
|
|
24343
23712
|
}
|
|
24344
23713
|
}
|
|
24345
23714
|
__name(convertAst, "convertAst");
|
|
24346
|
-
function convertTemplateLiteral(ast, job, baseSourceSpan) {
|
|
24347
|
-
return new TemplateLiteralExpr(ast.elements.map((el) => {
|
|
24348
|
-
return new TemplateLiteralElementExpr(el.text, convertSourceSpan(el.span, baseSourceSpan));
|
|
24349
|
-
}), ast.expressions.map((expr) => convertAst(expr, job, baseSourceSpan)), convertSourceSpan(ast.span, baseSourceSpan));
|
|
24350
|
-
}
|
|
24351
|
-
__name(convertTemplateLiteral, "convertTemplateLiteral");
|
|
24352
23715
|
function convertAstWithInterpolation(job, value, i18nMeta, sourceSpan) {
|
|
24353
23716
|
let expression;
|
|
24354
23717
|
if (value instanceof Interpolation$1) {
|
|
@@ -24577,12 +23940,16 @@ function ingestControlFlowInsertionPoint(unit, xref, node) {
|
|
|
24577
23940
|
}
|
|
24578
23941
|
__name(ingestControlFlowInsertionPoint, "ingestControlFlowInsertionPoint");
|
|
24579
23942
|
var ENABLE_TEMPLATE_SOURCE_LOCATIONS = false;
|
|
23943
|
+
function setEnableTemplateSourceLocations(value) {
|
|
23944
|
+
ENABLE_TEMPLATE_SOURCE_LOCATIONS = value;
|
|
23945
|
+
}
|
|
23946
|
+
__name(setEnableTemplateSourceLocations, "setEnableTemplateSourceLocations");
|
|
24580
23947
|
function getTemplateSourceLocationsEnabled() {
|
|
24581
23948
|
return ENABLE_TEMPLATE_SOURCE_LOCATIONS;
|
|
24582
23949
|
}
|
|
24583
23950
|
__name(getTemplateSourceLocationsEnabled, "getTemplateSourceLocationsEnabled");
|
|
24584
23951
|
function renderFlagCheckIfStmt(flags, statements) {
|
|
24585
|
-
return ifStmt(variable(RENDER_FLAGS).bitwiseAnd(literal(flags), null), statements);
|
|
23952
|
+
return ifStmt(variable(RENDER_FLAGS).bitwiseAnd(literal(flags), null, false), statements);
|
|
24586
23953
|
}
|
|
24587
23954
|
__name(renderFlagCheckIfStmt, "renderFlagCheckIfStmt");
|
|
24588
23955
|
function toQueryFlags(query) {
|
|
@@ -25020,16 +24387,10 @@ var BindingParser = class {
|
|
|
25020
24387
|
const prop = this._schemaRegistry.getMappedPropName(propName);
|
|
25021
24388
|
return calcPossibleSecurityContexts(this._schemaRegistry, selector, prop, isAttribute);
|
|
25022
24389
|
}
|
|
25023
|
-
parseEventListenerName(rawName) {
|
|
25024
|
-
const [target, eventName] = splitAtColon(rawName, [null, rawName]);
|
|
25025
|
-
return { eventName, target };
|
|
25026
|
-
}
|
|
25027
|
-
parseAnimationEventName(rawName) {
|
|
25028
|
-
const matches = splitAtPeriod(rawName, [rawName, null]);
|
|
25029
|
-
return { eventName: matches[0], phase: matches[1] === null ? null : matches[1].toLowerCase() };
|
|
25030
|
-
}
|
|
25031
24390
|
_parseAnimationEvent(name, expression, sourceSpan, handlerSpan, targetEvents, keySpan) {
|
|
25032
|
-
const
|
|
24391
|
+
const matches = splitAtPeriod(name, [name, ""]);
|
|
24392
|
+
const eventName = matches[0];
|
|
24393
|
+
const phase = matches[1].toLowerCase();
|
|
25033
24394
|
const ast = this._parseAction(expression, handlerSpan);
|
|
25034
24395
|
targetEvents.push(new ParsedEvent(eventName, phase, ParsedEventType.Animation, ast, sourceSpan, handlerSpan, keySpan));
|
|
25035
24396
|
if (eventName.length === 0) {
|
|
@@ -25044,7 +24405,7 @@ var BindingParser = class {
|
|
|
25044
24405
|
}
|
|
25045
24406
|
}
|
|
25046
24407
|
_parseRegularEvent(name, expression, isAssignmentEvent, sourceSpan, handlerSpan, targetMatchableAttrs, targetEvents, keySpan) {
|
|
25047
|
-
const
|
|
24408
|
+
const [target, eventName] = splitAtColon(name, [null, name]);
|
|
25048
24409
|
const prevErrorCount = this.errors.length;
|
|
25049
24410
|
const ast = this._parseAction(expression, handlerSpan);
|
|
25050
24411
|
const isValid = this.errors.length === prevErrorCount;
|
|
@@ -25116,19 +24477,13 @@ function isAnimationLabel(name) {
|
|
|
25116
24477
|
}
|
|
25117
24478
|
__name(isAnimationLabel, "isAnimationLabel");
|
|
25118
24479
|
function calcPossibleSecurityContexts(registry, selector, propName, isAttribute) {
|
|
25119
|
-
|
|
25120
|
-
|
|
25121
|
-
|
|
25122
|
-
|
|
25123
|
-
|
|
25124
|
-
ctxs
|
|
25125
|
-
|
|
25126
|
-
const elementNames = selector2.element ? [selector2.element] : registry.allKnownElementNames();
|
|
25127
|
-
const notElementNames = new Set(selector2.notSelectors.filter((selector3) => selector3.isElementSelector()).map((selector3) => selector3.element));
|
|
25128
|
-
const possibleElementNames = elementNames.filter((elName) => !notElementNames.has(elName));
|
|
25129
|
-
ctxs.push(...possibleElementNames.map(nameToContext));
|
|
25130
|
-
});
|
|
25131
|
-
}
|
|
24480
|
+
const ctxs = [];
|
|
24481
|
+
CssSelector.parse(selector).forEach((selector2) => {
|
|
24482
|
+
const elementNames = selector2.element ? [selector2.element] : registry.allKnownElementNames();
|
|
24483
|
+
const notElementNames = new Set(selector2.notSelectors.filter((selector3) => selector3.isElementSelector()).map((selector3) => selector3.element));
|
|
24484
|
+
const possibleElementNames = elementNames.filter((elementName) => !notElementNames.has(elementName));
|
|
24485
|
+
ctxs.push(...possibleElementNames.map((elementName) => registry.securityContext(elementName, propName, isAttribute)));
|
|
24486
|
+
});
|
|
25132
24487
|
return ctxs.length === 0 ? [SecurityContext.NONE] : Array.from(new Set(ctxs)).sort();
|
|
25133
24488
|
}
|
|
25134
24489
|
__name(calcPossibleSecurityContexts, "calcPossibleSecurityContexts");
|
|
@@ -26051,15 +25406,6 @@ var BINDING_DELIMS = {
|
|
|
26051
25406
|
EVENT: { start: "(", end: ")" }
|
|
26052
25407
|
};
|
|
26053
25408
|
var TEMPLATE_ATTR_PREFIX = "*";
|
|
26054
|
-
var UNSUPPORTED_SELECTORLESS_TAGS = /* @__PURE__ */ new Set([
|
|
26055
|
-
"link",
|
|
26056
|
-
"style",
|
|
26057
|
-
"script",
|
|
26058
|
-
"ng-template",
|
|
26059
|
-
"ng-container",
|
|
26060
|
-
"ng-content"
|
|
26061
|
-
]);
|
|
26062
|
-
var UNSUPPORTED_SELECTORLESS_DIRECTIVE_ATTRS = /* @__PURE__ */ new Set(["ngProjectAs", "ngNonBindable"]);
|
|
26063
25409
|
function htmlAstToRender3Ast(htmlNodes, bindingParser, options) {
|
|
26064
25410
|
const transformer = new HtmlAstToIvyAst(bindingParser, options);
|
|
26065
25411
|
const ivyNodes = visitAll(transformer, htmlNodes, htmlNodes);
|
|
@@ -26122,31 +25468,92 @@ var HtmlAstToIvyAst = class {
|
|
|
26122
25468
|
return null;
|
|
26123
25469
|
}
|
|
26124
25470
|
const isTemplateElement = isNgTemplate(element2.name);
|
|
26125
|
-
const
|
|
26126
|
-
const
|
|
26127
|
-
|
|
26128
|
-
|
|
26129
|
-
|
|
26130
|
-
|
|
26131
|
-
|
|
26132
|
-
|
|
25471
|
+
const parsedProperties = [];
|
|
25472
|
+
const boundEvents = [];
|
|
25473
|
+
const variables = [];
|
|
25474
|
+
const references = [];
|
|
25475
|
+
const attributes = [];
|
|
25476
|
+
const i18nAttrsMeta = {};
|
|
25477
|
+
const templateParsedProperties = [];
|
|
25478
|
+
const templateVariables = [];
|
|
25479
|
+
let elementHasInlineTemplate = false;
|
|
25480
|
+
for (const attribute2 of element2.attrs) {
|
|
25481
|
+
let hasBinding = false;
|
|
25482
|
+
const normalizedName = normalizeAttributeName(attribute2.name);
|
|
25483
|
+
let isTemplateBinding = false;
|
|
25484
|
+
if (attribute2.i18n) {
|
|
25485
|
+
i18nAttrsMeta[attribute2.name] = attribute2.i18n;
|
|
25486
|
+
}
|
|
25487
|
+
if (normalizedName.startsWith(TEMPLATE_ATTR_PREFIX)) {
|
|
25488
|
+
if (elementHasInlineTemplate) {
|
|
25489
|
+
this.reportError(`Can't have multiple template bindings on one element. Use only one attribute prefixed with *`, attribute2.sourceSpan);
|
|
25490
|
+
}
|
|
25491
|
+
isTemplateBinding = true;
|
|
25492
|
+
elementHasInlineTemplate = true;
|
|
25493
|
+
const templateValue = attribute2.value;
|
|
25494
|
+
const templateKey = normalizedName.substring(TEMPLATE_ATTR_PREFIX.length);
|
|
25495
|
+
const parsedVariables = [];
|
|
25496
|
+
const absoluteValueOffset = attribute2.valueSpan ? attribute2.valueSpan.start.offset : (
|
|
25497
|
+
// If there is no value span the attribute does not have a value, like `attr` in
|
|
25498
|
+
//`<div attr></div>`. In this case, point to one character beyond the last character of
|
|
25499
|
+
// the attribute name.
|
|
25500
|
+
attribute2.sourceSpan.start.offset + attribute2.name.length
|
|
25501
|
+
);
|
|
25502
|
+
this.bindingParser.parseInlineTemplateBinding(
|
|
25503
|
+
templateKey,
|
|
25504
|
+
templateValue,
|
|
25505
|
+
attribute2.sourceSpan,
|
|
25506
|
+
absoluteValueOffset,
|
|
25507
|
+
[],
|
|
25508
|
+
templateParsedProperties,
|
|
25509
|
+
parsedVariables,
|
|
25510
|
+
true
|
|
25511
|
+
/* isIvyAst */
|
|
25512
|
+
);
|
|
25513
|
+
templateVariables.push(...parsedVariables.map((v) => new Variable(v.name, v.value, v.sourceSpan, v.keySpan, v.valueSpan)));
|
|
25514
|
+
} else {
|
|
25515
|
+
hasBinding = this.parseAttribute(isTemplateElement, attribute2, [], parsedProperties, boundEvents, variables, references);
|
|
25516
|
+
}
|
|
25517
|
+
if (!hasBinding && !isTemplateBinding) {
|
|
25518
|
+
attributes.push(this.visitAttribute(attribute2));
|
|
25519
|
+
}
|
|
25520
|
+
}
|
|
25521
|
+
let children;
|
|
25522
|
+
if (preparsedElement.nonBindable) {
|
|
25523
|
+
children = visitAll(NON_BINDABLE_VISITOR, element2.children).flat(Infinity);
|
|
25524
|
+
} else {
|
|
25525
|
+
children = visitAll(this, element2.children, element2.children);
|
|
25526
|
+
}
|
|
26133
25527
|
let parsedElement;
|
|
26134
25528
|
if (preparsedElement.type === PreparsedElementType.NG_CONTENT) {
|
|
26135
25529
|
const selector = preparsedElement.selectAttr;
|
|
26136
25530
|
const attrs = element2.attrs.map((attr) => this.visitAttribute(attr));
|
|
26137
|
-
parsedElement = new Content(selector, attrs, children, element2.sourceSpan, element2.
|
|
25531
|
+
parsedElement = new Content(selector, attrs, children, element2.sourceSpan, element2.i18n);
|
|
26138
25532
|
this.ngContentSelectors.push(selector);
|
|
26139
25533
|
} else if (isTemplateElement) {
|
|
26140
|
-
const attrs = this.
|
|
26141
|
-
parsedElement = new Template(element2.name, attributes, attrs.bound, boundEvents,
|
|
25534
|
+
const attrs = this.extractAttributes(element2.name, parsedProperties, i18nAttrsMeta);
|
|
25535
|
+
parsedElement = new Template(element2.name, attributes, attrs.bound, boundEvents, [
|
|
26142
25536
|
/* no template attributes */
|
|
26143
25537
|
], children, references, variables, element2.sourceSpan, element2.startSourceSpan, element2.endSourceSpan, element2.i18n);
|
|
26144
25538
|
} else {
|
|
26145
|
-
const attrs = this.
|
|
26146
|
-
parsedElement = new Element$1(element2.name, attributes, attrs.bound, boundEvents,
|
|
25539
|
+
const attrs = this.extractAttributes(element2.name, parsedProperties, i18nAttrsMeta);
|
|
25540
|
+
parsedElement = new Element$1(element2.name, attributes, attrs.bound, boundEvents, children, references, element2.sourceSpan, element2.startSourceSpan, element2.endSourceSpan, element2.i18n);
|
|
26147
25541
|
}
|
|
26148
25542
|
if (elementHasInlineTemplate) {
|
|
26149
|
-
|
|
25543
|
+
const attrs = this.extractAttributes("ng-template", templateParsedProperties, i18nAttrsMeta);
|
|
25544
|
+
const templateAttrs = [];
|
|
25545
|
+
attrs.literal.forEach((attr) => templateAttrs.push(attr));
|
|
25546
|
+
attrs.bound.forEach((attr) => templateAttrs.push(attr));
|
|
25547
|
+
const hoistedAttrs = parsedElement instanceof Element$1 ? {
|
|
25548
|
+
attributes: parsedElement.attributes,
|
|
25549
|
+
inputs: parsedElement.inputs,
|
|
25550
|
+
outputs: parsedElement.outputs
|
|
25551
|
+
} : { attributes: [], inputs: [], outputs: [] };
|
|
25552
|
+
const i18n2 = isTemplateElement && isI18nRootElement ? void 0 : element2.i18n;
|
|
25553
|
+
const name = parsedElement instanceof Template ? null : parsedElement.name;
|
|
25554
|
+
parsedElement = new Template(name, hoistedAttrs.attributes, hoistedAttrs.inputs, hoistedAttrs.outputs, templateAttrs, [parsedElement], [
|
|
25555
|
+
/* no references */
|
|
25556
|
+
], templateVariables, element2.sourceSpan, element2.startSourceSpan, element2.endSourceSpan, i18n2);
|
|
26150
25557
|
}
|
|
26151
25558
|
if (isI18nRootElement) {
|
|
26152
25559
|
this.inI18nBlock = false;
|
|
@@ -26197,40 +25604,6 @@ var HtmlAstToIvyAst = class {
|
|
|
26197
25604
|
}
|
|
26198
25605
|
return new LetDeclaration$1(decl.name, value, decl.sourceSpan, decl.nameSpan, decl.valueSpan);
|
|
26199
25606
|
}
|
|
26200
|
-
visitComponent(component) {
|
|
26201
|
-
const isI18nRootElement = isI18nRootNode(component.i18n);
|
|
26202
|
-
if (isI18nRootElement) {
|
|
26203
|
-
if (this.inI18nBlock) {
|
|
26204
|
-
this.reportError("Cannot mark a component as translatable inside of a translatable section. Please remove the nested i18n marker.", component.sourceSpan);
|
|
26205
|
-
}
|
|
26206
|
-
this.inI18nBlock = true;
|
|
26207
|
-
}
|
|
26208
|
-
if (component.tagName !== null && UNSUPPORTED_SELECTORLESS_TAGS.has(component.tagName)) {
|
|
26209
|
-
this.reportError(`Tag name "${component.tagName}" cannot be used as a component tag`, component.startSourceSpan);
|
|
26210
|
-
return null;
|
|
26211
|
-
}
|
|
26212
|
-
const { attributes, boundEvents, references, templateVariables, elementHasInlineTemplate, parsedProperties, templateParsedProperties, i18nAttrsMeta } = this.prepareAttributes(component.attrs, false);
|
|
26213
|
-
this.validateSelectorlessReferences(references);
|
|
26214
|
-
const directives = this.extractDirectives(component);
|
|
26215
|
-
let children;
|
|
26216
|
-
if (component.attrs.find((attr) => attr.name === "ngNonBindable")) {
|
|
26217
|
-
children = visitAll(NON_BINDABLE_VISITOR, component.children).flat(Infinity);
|
|
26218
|
-
} else {
|
|
26219
|
-
children = visitAll(this, component.children, component.children);
|
|
26220
|
-
}
|
|
26221
|
-
const attrs = this.categorizePropertyAttributes(component.tagName, parsedProperties, i18nAttrsMeta);
|
|
26222
|
-
let node = new Component$1(component.componentName, component.tagName, component.fullName, attributes, attrs.bound, boundEvents, directives, children, references, component.sourceSpan, component.startSourceSpan, component.endSourceSpan, component.i18n);
|
|
26223
|
-
if (elementHasInlineTemplate) {
|
|
26224
|
-
node = this.wrapInTemplate(node, templateParsedProperties, templateVariables, i18nAttrsMeta, false, isI18nRootElement);
|
|
26225
|
-
}
|
|
26226
|
-
if (isI18nRootElement) {
|
|
26227
|
-
this.inI18nBlock = false;
|
|
26228
|
-
}
|
|
26229
|
-
return node;
|
|
26230
|
-
}
|
|
26231
|
-
visitDirective() {
|
|
26232
|
-
return null;
|
|
26233
|
-
}
|
|
26234
25607
|
visitBlockParameter() {
|
|
26235
25608
|
return null;
|
|
26236
25609
|
}
|
|
@@ -26298,8 +25671,8 @@ var HtmlAstToIvyAst = class {
|
|
|
26298
25671
|
}
|
|
26299
25672
|
return relatedBlocks;
|
|
26300
25673
|
}
|
|
26301
|
-
|
|
26302
|
-
|
|
25674
|
+
// convert view engine `ParsedProperty` to a format suitable for IVY
|
|
25675
|
+
extractAttributes(elementName, properties, i18nPropsMeta) {
|
|
26303
25676
|
const bound = [];
|
|
26304
25677
|
const literal2 = [];
|
|
26305
25678
|
properties.forEach((prop) => {
|
|
@@ -26320,69 +25693,6 @@ var HtmlAstToIvyAst = class {
|
|
|
26320
25693
|
});
|
|
26321
25694
|
return { bound, literal: literal2 };
|
|
26322
25695
|
}
|
|
26323
|
-
prepareAttributes(attrs, isTemplateElement) {
|
|
26324
|
-
const parsedProperties = [];
|
|
26325
|
-
const boundEvents = [];
|
|
26326
|
-
const variables = [];
|
|
26327
|
-
const references = [];
|
|
26328
|
-
const attributes = [];
|
|
26329
|
-
const i18nAttrsMeta = {};
|
|
26330
|
-
const templateParsedProperties = [];
|
|
26331
|
-
const templateVariables = [];
|
|
26332
|
-
let elementHasInlineTemplate = false;
|
|
26333
|
-
for (const attribute2 of attrs) {
|
|
26334
|
-
let hasBinding = false;
|
|
26335
|
-
const normalizedName = normalizeAttributeName(attribute2.name);
|
|
26336
|
-
let isTemplateBinding = false;
|
|
26337
|
-
if (attribute2.i18n) {
|
|
26338
|
-
i18nAttrsMeta[attribute2.name] = attribute2.i18n;
|
|
26339
|
-
}
|
|
26340
|
-
if (normalizedName.startsWith(TEMPLATE_ATTR_PREFIX)) {
|
|
26341
|
-
if (elementHasInlineTemplate) {
|
|
26342
|
-
this.reportError(`Can't have multiple template bindings on one element. Use only one attribute prefixed with *`, attribute2.sourceSpan);
|
|
26343
|
-
}
|
|
26344
|
-
isTemplateBinding = true;
|
|
26345
|
-
elementHasInlineTemplate = true;
|
|
26346
|
-
const templateValue = attribute2.value;
|
|
26347
|
-
const templateKey = normalizedName.substring(TEMPLATE_ATTR_PREFIX.length);
|
|
26348
|
-
const parsedVariables = [];
|
|
26349
|
-
const absoluteValueOffset = attribute2.valueSpan ? attribute2.valueSpan.start.offset : (
|
|
26350
|
-
// If there is no value span the attribute does not have a value, like `attr` in
|
|
26351
|
-
//`<div attr></div>`. In this case, point to one character beyond the last character of
|
|
26352
|
-
// the attribute name.
|
|
26353
|
-
attribute2.sourceSpan.start.offset + attribute2.name.length
|
|
26354
|
-
);
|
|
26355
|
-
this.bindingParser.parseInlineTemplateBinding(
|
|
26356
|
-
templateKey,
|
|
26357
|
-
templateValue,
|
|
26358
|
-
attribute2.sourceSpan,
|
|
26359
|
-
absoluteValueOffset,
|
|
26360
|
-
[],
|
|
26361
|
-
templateParsedProperties,
|
|
26362
|
-
parsedVariables,
|
|
26363
|
-
true
|
|
26364
|
-
/* isIvyAst */
|
|
26365
|
-
);
|
|
26366
|
-
templateVariables.push(...parsedVariables.map((v) => new Variable(v.name, v.value, v.sourceSpan, v.keySpan, v.valueSpan)));
|
|
26367
|
-
} else {
|
|
26368
|
-
hasBinding = this.parseAttribute(isTemplateElement, attribute2, [], parsedProperties, boundEvents, variables, references);
|
|
26369
|
-
}
|
|
26370
|
-
if (!hasBinding && !isTemplateBinding) {
|
|
26371
|
-
attributes.push(this.visitAttribute(attribute2));
|
|
26372
|
-
}
|
|
26373
|
-
}
|
|
26374
|
-
return {
|
|
26375
|
-
attributes,
|
|
26376
|
-
boundEvents,
|
|
26377
|
-
references,
|
|
26378
|
-
variables,
|
|
26379
|
-
templateVariables,
|
|
26380
|
-
elementHasInlineTemplate,
|
|
26381
|
-
parsedProperties,
|
|
26382
|
-
templateParsedProperties,
|
|
26383
|
-
i18nAttrsMeta
|
|
26384
|
-
};
|
|
26385
|
-
}
|
|
26386
25696
|
parseAttribute(isTemplateElement, attribute2, matchableAttributes, parsedProperties, boundEvents, variables, references) {
|
|
26387
25697
|
const name = normalizeAttributeName(attribute2.name);
|
|
26388
25698
|
const value = attribute2.value;
|
|
@@ -26481,75 +25791,6 @@ var HtmlAstToIvyAst = class {
|
|
|
26481
25791
|
const hasBinding = this.bindingParser.parsePropertyInterpolation(name, value, srcSpan, attribute2.valueSpan, matchableAttributes, parsedProperties, keySpan, attribute2.valueTokens ?? null);
|
|
26482
25792
|
return hasBinding;
|
|
26483
25793
|
}
|
|
26484
|
-
extractDirectives(node) {
|
|
26485
|
-
const elementName = node instanceof Component2 ? node.tagName : node.name;
|
|
26486
|
-
const directives = [];
|
|
26487
|
-
const seenDirectives = /* @__PURE__ */ new Set();
|
|
26488
|
-
for (const directive of node.directives) {
|
|
26489
|
-
let invalid = false;
|
|
26490
|
-
for (const attr of directive.attrs) {
|
|
26491
|
-
if (attr.name.startsWith(TEMPLATE_ATTR_PREFIX)) {
|
|
26492
|
-
invalid = true;
|
|
26493
|
-
this.reportError(`Shorthand template syntax "${attr.name}" is not supported inside a directive context`, attr.sourceSpan);
|
|
26494
|
-
} else if (UNSUPPORTED_SELECTORLESS_DIRECTIVE_ATTRS.has(attr.name)) {
|
|
26495
|
-
invalid = true;
|
|
26496
|
-
this.reportError(`Attribute "${attr.name}" is not supported in a directive context`, attr.sourceSpan);
|
|
26497
|
-
}
|
|
26498
|
-
}
|
|
26499
|
-
if (!invalid && seenDirectives.has(directive.name)) {
|
|
26500
|
-
invalid = true;
|
|
26501
|
-
this.reportError(`Cannot apply directive "${directive.name}" multiple times on the same element`, directive.sourceSpan);
|
|
26502
|
-
}
|
|
26503
|
-
if (invalid) {
|
|
26504
|
-
continue;
|
|
26505
|
-
}
|
|
26506
|
-
const { attributes, parsedProperties, boundEvents, references, i18nAttrsMeta } = this.prepareAttributes(directive.attrs, false);
|
|
26507
|
-
this.validateSelectorlessReferences(references);
|
|
26508
|
-
const { bound: inputs } = this.categorizePropertyAttributes(elementName, parsedProperties, i18nAttrsMeta);
|
|
26509
|
-
for (const input of inputs) {
|
|
26510
|
-
if (input.type !== BindingType.Property && input.type !== BindingType.TwoWay) {
|
|
26511
|
-
invalid = true;
|
|
26512
|
-
this.reportError("Binding is not supported in a directive context", input.sourceSpan);
|
|
26513
|
-
}
|
|
26514
|
-
}
|
|
26515
|
-
if (invalid) {
|
|
26516
|
-
continue;
|
|
26517
|
-
}
|
|
26518
|
-
seenDirectives.add(directive.name);
|
|
26519
|
-
directives.push(new Directive$1(directive.name, attributes, inputs, boundEvents, references, directive.sourceSpan, directive.startSourceSpan, directive.endSourceSpan, void 0));
|
|
26520
|
-
}
|
|
26521
|
-
return directives;
|
|
26522
|
-
}
|
|
26523
|
-
wrapInTemplate(node, templateProperties, templateVariables, i18nAttrsMeta, isTemplateElement, isI18nRootElement) {
|
|
26524
|
-
const attrs = this.categorizePropertyAttributes("ng-template", templateProperties, i18nAttrsMeta);
|
|
26525
|
-
const templateAttrs = [];
|
|
26526
|
-
attrs.literal.forEach((attr) => templateAttrs.push(attr));
|
|
26527
|
-
attrs.bound.forEach((attr) => templateAttrs.push(attr));
|
|
26528
|
-
const hoistedAttrs = {
|
|
26529
|
-
attributes: [],
|
|
26530
|
-
inputs: [],
|
|
26531
|
-
outputs: []
|
|
26532
|
-
};
|
|
26533
|
-
if (node instanceof Element$1 || node instanceof Component$1) {
|
|
26534
|
-
hoistedAttrs.attributes.push(...node.attributes);
|
|
26535
|
-
hoistedAttrs.inputs.push(...node.inputs);
|
|
26536
|
-
hoistedAttrs.outputs.push(...node.outputs);
|
|
26537
|
-
}
|
|
26538
|
-
const i18n2 = isTemplateElement && isI18nRootElement ? void 0 : node.i18n;
|
|
26539
|
-
let name;
|
|
26540
|
-
if (node instanceof Component$1) {
|
|
26541
|
-
name = node.tagName;
|
|
26542
|
-
} else if (node instanceof Template) {
|
|
26543
|
-
name = null;
|
|
26544
|
-
} else {
|
|
26545
|
-
name = node.name;
|
|
26546
|
-
}
|
|
26547
|
-
return new Template(name, hoistedAttrs.attributes, hoistedAttrs.inputs, hoistedAttrs.outputs, [
|
|
26548
|
-
// Do not copy over the directives.
|
|
26549
|
-
], templateAttrs, [node], [
|
|
26550
|
-
// Do not copy over the references.
|
|
26551
|
-
], templateVariables, node.sourceSpan, node.startSourceSpan, node.endSourceSpan, i18n2);
|
|
26552
|
-
}
|
|
26553
25794
|
_visitTextWithInterpolation(value, sourceSpan, interpolatedTokens, i18n2) {
|
|
26554
25795
|
const valueNoNgsp = replaceNgsp(value);
|
|
26555
25796
|
const expr = this.bindingParser.parseInterpolation(valueNoNgsp, sourceSpan, interpolatedTokens);
|
|
@@ -26588,21 +25829,6 @@ var HtmlAstToIvyAst = class {
|
|
|
26588
25829
|
);
|
|
26589
25830
|
addEvents(events, boundEvents);
|
|
26590
25831
|
}
|
|
26591
|
-
validateSelectorlessReferences(references) {
|
|
26592
|
-
if (references.length === 0) {
|
|
26593
|
-
return;
|
|
26594
|
-
}
|
|
26595
|
-
const seenNames = /* @__PURE__ */ new Set();
|
|
26596
|
-
for (const ref of references) {
|
|
26597
|
-
if (ref.value.length > 0) {
|
|
26598
|
-
this.reportError("Cannot specify a value for a local reference in this context", ref.valueSpan || ref.sourceSpan);
|
|
26599
|
-
} else if (seenNames.has(ref.name)) {
|
|
26600
|
-
this.reportError("Duplicate reference names are not allowed", ref.sourceSpan);
|
|
26601
|
-
} else {
|
|
26602
|
-
seenNames.add(ref.name);
|
|
26603
|
-
}
|
|
26604
|
-
}
|
|
26605
|
-
}
|
|
26606
25832
|
reportError(message, sourceSpan, level = ParseErrorLevel.ERROR) {
|
|
26607
25833
|
this.errors.push(new ParseError(sourceSpan, message, level));
|
|
26608
25834
|
}
|
|
@@ -26624,8 +25850,6 @@ var NonBindableVisitor = class {
|
|
|
26624
25850
|
[],
|
|
26625
25851
|
/* outputs */
|
|
26626
25852
|
[],
|
|
26627
|
-
/* directives */
|
|
26628
|
-
[],
|
|
26629
25853
|
children,
|
|
26630
25854
|
/* references */
|
|
26631
25855
|
[],
|
|
@@ -26667,28 +25891,6 @@ var NonBindableVisitor = class {
|
|
|
26667
25891
|
visitLetDeclaration(decl, context) {
|
|
26668
25892
|
return new Text$3(`@let ${decl.name} = ${decl.value};`, decl.sourceSpan);
|
|
26669
25893
|
}
|
|
26670
|
-
visitComponent(ast, context) {
|
|
26671
|
-
const children = visitAll(this, ast.children, null);
|
|
26672
|
-
return new Element$1(
|
|
26673
|
-
ast.fullName,
|
|
26674
|
-
visitAll(this, ast.attrs),
|
|
26675
|
-
/* inputs */
|
|
26676
|
-
[],
|
|
26677
|
-
/* outputs */
|
|
26678
|
-
[],
|
|
26679
|
-
/* directives */
|
|
26680
|
-
[],
|
|
26681
|
-
children,
|
|
26682
|
-
/* references */
|
|
26683
|
-
[],
|
|
26684
|
-
ast.sourceSpan,
|
|
26685
|
-
ast.startSourceSpan,
|
|
26686
|
-
ast.endSourceSpan
|
|
26687
|
-
);
|
|
26688
|
-
}
|
|
26689
|
-
visitDirective(directive, context) {
|
|
26690
|
-
return null;
|
|
26691
|
-
}
|
|
26692
25894
|
};
|
|
26693
25895
|
var NON_BINDABLE_VISITOR = new NonBindableVisitor();
|
|
26694
25896
|
function normalizeAttributeName(attrName) {
|
|
@@ -26717,8 +25919,7 @@ function parseTemplate(template2, templateUrl, options = {}) {
|
|
|
26717
25919
|
...options,
|
|
26718
25920
|
tokenizeExpansionForms: true,
|
|
26719
25921
|
tokenizeBlocks: options.enableBlockSyntax ?? true,
|
|
26720
|
-
tokenizeLet: options.enableLetSyntax ?? true
|
|
26721
|
-
selectorlessEnabled: options.enableSelectorless ?? false
|
|
25922
|
+
tokenizeLet: options.enableLetSyntax ?? true
|
|
26722
25923
|
});
|
|
26723
25924
|
if (!options.alwaysAttemptHtmlToR3AstConversion && parseResult.errors && parseResult.errors.length > 0) {
|
|
26724
25925
|
const parsedTemplate2 = {
|
|
@@ -27294,12 +26495,11 @@ var R3TargetBinder = class {
|
|
|
27294
26495
|
* metadata about the types referenced in the template.
|
|
27295
26496
|
*/
|
|
27296
26497
|
bind(target) {
|
|
27297
|
-
if (!target.template
|
|
26498
|
+
if (!target.template) {
|
|
27298
26499
|
throw new Error("Empty bound targets are not supported");
|
|
27299
26500
|
}
|
|
27300
26501
|
const directives = /* @__PURE__ */ new Map();
|
|
27301
26502
|
const eagerDirectives = [];
|
|
27302
|
-
const missingDirectives = /* @__PURE__ */ new Set();
|
|
27303
26503
|
const bindings = /* @__PURE__ */ new Map();
|
|
27304
26504
|
const references = /* @__PURE__ */ new Map();
|
|
27305
26505
|
const scopedNodeEntities = /* @__PURE__ */ new Map();
|
|
@@ -27312,15 +26512,10 @@ var R3TargetBinder = class {
|
|
|
27312
26512
|
if (target.template) {
|
|
27313
26513
|
const scope = Scope2.apply(target.template);
|
|
27314
26514
|
extractScopedNodeEntities(scope, scopedNodeEntities);
|
|
27315
|
-
|
|
27316
|
-
DirectiveBinder.apply(target.template, this.directiveMatcher, directives, eagerDirectives, missingDirectives, bindings, references);
|
|
27317
|
-
}
|
|
26515
|
+
DirectiveBinder.apply(target.template, this.directiveMatcher, directives, eagerDirectives, bindings, references);
|
|
27318
26516
|
TemplateBinder.applyWithScope(target.template, scope, expressions, symbols, nestingLevel, usedPipes, eagerPipes, deferBlocks);
|
|
27319
26517
|
}
|
|
27320
|
-
|
|
27321
|
-
TemplateBinder.applyWithScope(target.host, Scope2.apply(target.host), expressions, symbols, nestingLevel, usedPipes, eagerPipes, deferBlocks);
|
|
27322
|
-
}
|
|
27323
|
-
return new R3BoundTarget(target, directives, eagerDirectives, missingDirectives, bindings, references, expressions, symbols, nestingLevel, scopedNodeEntities, usedPipes, eagerPipes, deferBlocks);
|
|
26518
|
+
return new R3BoundTarget(target, directives, eagerDirectives, bindings, references, expressions, symbols, nestingLevel, scopedNodeEntities, usedPipes, eagerPipes, deferBlocks);
|
|
27324
26519
|
}
|
|
27325
26520
|
};
|
|
27326
26521
|
var Scope2 = class _Scope {
|
|
@@ -27334,9 +26529,9 @@ var Scope2 = class _Scope {
|
|
|
27334
26529
|
*/
|
|
27335
26530
|
namedEntities = /* @__PURE__ */ new Map();
|
|
27336
26531
|
/**
|
|
27337
|
-
* Set of
|
|
26532
|
+
* Set of elements that belong to this scope.
|
|
27338
26533
|
*/
|
|
27339
|
-
|
|
26534
|
+
elementsInScope = /* @__PURE__ */ new Set();
|
|
27340
26535
|
/**
|
|
27341
26536
|
* Child `Scope`s for immediately nested `ScopedNode`s.
|
|
27342
26537
|
*/
|
|
@@ -27378,15 +26573,16 @@ var Scope2 = class _Scope {
|
|
|
27378
26573
|
nodeOrNodes.children.forEach((node) => node.visit(this));
|
|
27379
26574
|
} else if (nodeOrNodes instanceof SwitchBlockCase || nodeOrNodes instanceof ForLoopBlockEmpty || nodeOrNodes instanceof DeferredBlock || nodeOrNodes instanceof DeferredBlockError || nodeOrNodes instanceof DeferredBlockPlaceholder || nodeOrNodes instanceof DeferredBlockLoading || nodeOrNodes instanceof Content) {
|
|
27380
26575
|
nodeOrNodes.children.forEach((node) => node.visit(this));
|
|
27381
|
-
} else
|
|
26576
|
+
} else {
|
|
27382
26577
|
nodeOrNodes.forEach((node) => node.visit(this));
|
|
27383
26578
|
}
|
|
27384
26579
|
}
|
|
27385
26580
|
visitElement(element2) {
|
|
27386
|
-
this.
|
|
26581
|
+
element2.references.forEach((node) => this.visitReference(node));
|
|
26582
|
+
element2.children.forEach((node) => node.visit(this));
|
|
26583
|
+
this.elementsInScope.add(element2);
|
|
27387
26584
|
}
|
|
27388
26585
|
visitTemplate(template2) {
|
|
27389
|
-
template2.directives.forEach((node) => node.visit(this));
|
|
27390
26586
|
template2.references.forEach((node) => this.visitReference(node));
|
|
27391
26587
|
this.ingestScopedNode(template2);
|
|
27392
26588
|
}
|
|
@@ -27436,12 +26632,6 @@ var Scope2 = class _Scope {
|
|
|
27436
26632
|
visitLetDeclaration(decl) {
|
|
27437
26633
|
this.maybeDeclare(decl);
|
|
27438
26634
|
}
|
|
27439
|
-
visitComponent(component) {
|
|
27440
|
-
this.visitElementLike(component);
|
|
27441
|
-
}
|
|
27442
|
-
visitDirective(directive) {
|
|
27443
|
-
directive.references.forEach((current) => this.visitReference(current));
|
|
27444
|
-
}
|
|
27445
26635
|
// Unused visitors.
|
|
27446
26636
|
visitBoundAttribute(attr) {
|
|
27447
26637
|
}
|
|
@@ -27459,12 +26649,6 @@ var Scope2 = class _Scope {
|
|
|
27459
26649
|
}
|
|
27460
26650
|
visitUnknownBlock(block) {
|
|
27461
26651
|
}
|
|
27462
|
-
visitElementLike(node) {
|
|
27463
|
-
node.directives.forEach((current) => current.visit(this));
|
|
27464
|
-
node.references.forEach((current) => this.visitReference(current));
|
|
27465
|
-
node.children.forEach((current) => current.visit(this));
|
|
27466
|
-
this.elementLikeInScope.add(node);
|
|
27467
|
-
}
|
|
27468
26652
|
maybeDeclare(thing) {
|
|
27469
26653
|
if (!this.namedEntities.has(thing.name)) {
|
|
27470
26654
|
this.namedEntities.set(thing.name, thing);
|
|
@@ -27506,19 +26690,17 @@ var DirectiveBinder = class _DirectiveBinder {
|
|
|
27506
26690
|
static {
|
|
27507
26691
|
__name(this, "DirectiveBinder");
|
|
27508
26692
|
}
|
|
27509
|
-
|
|
26693
|
+
matcher;
|
|
27510
26694
|
directives;
|
|
27511
26695
|
eagerDirectives;
|
|
27512
|
-
missingDirectives;
|
|
27513
26696
|
bindings;
|
|
27514
26697
|
references;
|
|
27515
26698
|
// Indicates whether we are visiting elements within a `defer` block
|
|
27516
26699
|
isInDeferBlock = false;
|
|
27517
|
-
constructor(
|
|
27518
|
-
this.
|
|
26700
|
+
constructor(matcher, directives, eagerDirectives, bindings, references) {
|
|
26701
|
+
this.matcher = matcher;
|
|
27519
26702
|
this.directives = directives;
|
|
27520
26703
|
this.eagerDirectives = eagerDirectives;
|
|
27521
|
-
this.missingDirectives = missingDirectives;
|
|
27522
26704
|
this.bindings = bindings;
|
|
27523
26705
|
this.references = references;
|
|
27524
26706
|
}
|
|
@@ -27534,8 +26716,8 @@ var DirectiveBinder = class _DirectiveBinder {
|
|
|
27534
26716
|
* map which resolves #references (`Reference`s) within the template to the named directive or
|
|
27535
26717
|
* template node.
|
|
27536
26718
|
*/
|
|
27537
|
-
static apply(template2,
|
|
27538
|
-
const matcher = new _DirectiveBinder(
|
|
26719
|
+
static apply(template2, selectorMatcher, directives, eagerDirectives, bindings, references) {
|
|
26720
|
+
const matcher = new _DirectiveBinder(selectorMatcher, directives, eagerDirectives, bindings, references);
|
|
27539
26721
|
matcher.ingest(template2);
|
|
27540
26722
|
}
|
|
27541
26723
|
ingest(template2) {
|
|
@@ -27547,6 +26729,45 @@ var DirectiveBinder = class _DirectiveBinder {
|
|
|
27547
26729
|
visitTemplate(template2) {
|
|
27548
26730
|
this.visitElementOrTemplate(template2);
|
|
27549
26731
|
}
|
|
26732
|
+
visitElementOrTemplate(node) {
|
|
26733
|
+
const cssSelector = createCssSelectorFromNode(node);
|
|
26734
|
+
const directives = [];
|
|
26735
|
+
this.matcher.match(cssSelector, (_selector, results) => directives.push(...results));
|
|
26736
|
+
if (directives.length > 0) {
|
|
26737
|
+
this.directives.set(node, directives);
|
|
26738
|
+
if (!this.isInDeferBlock) {
|
|
26739
|
+
this.eagerDirectives.push(...directives);
|
|
26740
|
+
}
|
|
26741
|
+
}
|
|
26742
|
+
node.references.forEach((ref) => {
|
|
26743
|
+
let dirTarget = null;
|
|
26744
|
+
if (ref.value.trim() === "") {
|
|
26745
|
+
dirTarget = directives.find((dir) => dir.isComponent) || null;
|
|
26746
|
+
} else {
|
|
26747
|
+
dirTarget = directives.find((dir) => dir.exportAs !== null && dir.exportAs.some((value) => value === ref.value)) || null;
|
|
26748
|
+
if (dirTarget === null) {
|
|
26749
|
+
return;
|
|
26750
|
+
}
|
|
26751
|
+
}
|
|
26752
|
+
if (dirTarget !== null) {
|
|
26753
|
+
this.references.set(ref, { directive: dirTarget, node });
|
|
26754
|
+
} else {
|
|
26755
|
+
this.references.set(ref, node);
|
|
26756
|
+
}
|
|
26757
|
+
});
|
|
26758
|
+
const setAttributeBinding = /* @__PURE__ */ __name((attribute2, ioType) => {
|
|
26759
|
+
const dir = directives.find((dir2) => dir2[ioType].hasBindingPropertyName(attribute2.name));
|
|
26760
|
+
const binding = dir !== void 0 ? dir : node;
|
|
26761
|
+
this.bindings.set(attribute2, binding);
|
|
26762
|
+
}, "setAttributeBinding");
|
|
26763
|
+
node.inputs.forEach((input) => setAttributeBinding(input, "inputs"));
|
|
26764
|
+
node.attributes.forEach((attr) => setAttributeBinding(attr, "inputs"));
|
|
26765
|
+
if (node instanceof Template) {
|
|
26766
|
+
node.templateAttrs.forEach((attr) => setAttributeBinding(attr, "inputs"));
|
|
26767
|
+
}
|
|
26768
|
+
node.outputs.forEach((output) => setAttributeBinding(output, "outputs"));
|
|
26769
|
+
node.children.forEach((child) => child.visit(this));
|
|
26770
|
+
}
|
|
27550
26771
|
visitDeferredBlock(deferred) {
|
|
27551
26772
|
const wasInDeferBlock = this.isInDeferBlock;
|
|
27552
26773
|
this.isInDeferBlock = true;
|
|
@@ -27590,93 +26811,6 @@ var DirectiveBinder = class _DirectiveBinder {
|
|
|
27590
26811
|
visitContent(content) {
|
|
27591
26812
|
content.children.forEach((child) => child.visit(this));
|
|
27592
26813
|
}
|
|
27593
|
-
visitComponent(node) {
|
|
27594
|
-
if (this.directiveMatcher instanceof SelectorlessMatcher) {
|
|
27595
|
-
const componentMatches = this.directiveMatcher.match(node.componentName);
|
|
27596
|
-
if (componentMatches.length > 0) {
|
|
27597
|
-
this.trackSelectorlessMatchesAndDirectives(node, componentMatches);
|
|
27598
|
-
} else {
|
|
27599
|
-
this.missingDirectives.add(node.componentName);
|
|
27600
|
-
}
|
|
27601
|
-
}
|
|
27602
|
-
node.directives.forEach((directive) => directive.visit(this));
|
|
27603
|
-
node.children.forEach((child) => child.visit(this));
|
|
27604
|
-
}
|
|
27605
|
-
visitDirective(node) {
|
|
27606
|
-
if (this.directiveMatcher instanceof SelectorlessMatcher) {
|
|
27607
|
-
const directives = this.directiveMatcher.match(node.name);
|
|
27608
|
-
if (directives.length > 0) {
|
|
27609
|
-
this.trackSelectorlessMatchesAndDirectives(node, directives);
|
|
27610
|
-
} else {
|
|
27611
|
-
this.missingDirectives.add(node.name);
|
|
27612
|
-
}
|
|
27613
|
-
}
|
|
27614
|
-
}
|
|
27615
|
-
visitElementOrTemplate(node) {
|
|
27616
|
-
if (this.directiveMatcher instanceof SelectorMatcher) {
|
|
27617
|
-
const directives = [];
|
|
27618
|
-
const cssSelector = createCssSelectorFromNode(node);
|
|
27619
|
-
this.directiveMatcher.match(cssSelector, (_, results) => directives.push(...results));
|
|
27620
|
-
this.trackSelectorBasedBindingsAndDirectives(node, directives);
|
|
27621
|
-
}
|
|
27622
|
-
node.directives.forEach((directive) => directive.visit(this));
|
|
27623
|
-
node.children.forEach((child) => child.visit(this));
|
|
27624
|
-
}
|
|
27625
|
-
trackMatchedDirectives(node, directives) {
|
|
27626
|
-
if (directives.length > 0) {
|
|
27627
|
-
this.directives.set(node, directives);
|
|
27628
|
-
if (!this.isInDeferBlock) {
|
|
27629
|
-
this.eagerDirectives.push(...directives);
|
|
27630
|
-
}
|
|
27631
|
-
}
|
|
27632
|
-
}
|
|
27633
|
-
trackSelectorlessMatchesAndDirectives(node, directives) {
|
|
27634
|
-
if (directives.length === 0) {
|
|
27635
|
-
return;
|
|
27636
|
-
}
|
|
27637
|
-
this.trackMatchedDirectives(node, directives);
|
|
27638
|
-
const setBinding = /* @__PURE__ */ __name((meta, attribute2, ioType) => {
|
|
27639
|
-
if (meta[ioType].hasBindingPropertyName(attribute2.name)) {
|
|
27640
|
-
this.bindings.set(attribute2, meta);
|
|
27641
|
-
}
|
|
27642
|
-
}, "setBinding");
|
|
27643
|
-
for (const directive of directives) {
|
|
27644
|
-
node.inputs.forEach((input) => setBinding(directive, input, "inputs"));
|
|
27645
|
-
node.attributes.forEach((attr) => setBinding(directive, attr, "inputs"));
|
|
27646
|
-
node.outputs.forEach((output) => setBinding(directive, output, "outputs"));
|
|
27647
|
-
}
|
|
27648
|
-
node.references.forEach((ref) => this.references.set(ref, { directive: directives[0], node }));
|
|
27649
|
-
}
|
|
27650
|
-
trackSelectorBasedBindingsAndDirectives(node, directives) {
|
|
27651
|
-
this.trackMatchedDirectives(node, directives);
|
|
27652
|
-
node.references.forEach((ref) => {
|
|
27653
|
-
let dirTarget = null;
|
|
27654
|
-
if (ref.value.trim() === "") {
|
|
27655
|
-
dirTarget = directives.find((dir) => dir.isComponent) || null;
|
|
27656
|
-
} else {
|
|
27657
|
-
dirTarget = directives.find((dir) => dir.exportAs !== null && dir.exportAs.some((value) => value === ref.value)) || null;
|
|
27658
|
-
if (dirTarget === null) {
|
|
27659
|
-
return;
|
|
27660
|
-
}
|
|
27661
|
-
}
|
|
27662
|
-
if (dirTarget !== null) {
|
|
27663
|
-
this.references.set(ref, { directive: dirTarget, node });
|
|
27664
|
-
} else {
|
|
27665
|
-
this.references.set(ref, node);
|
|
27666
|
-
}
|
|
27667
|
-
});
|
|
27668
|
-
const setAttributeBinding = /* @__PURE__ */ __name((attribute2, ioType) => {
|
|
27669
|
-
const dir = directives.find((dir2) => dir2[ioType].hasBindingPropertyName(attribute2.name));
|
|
27670
|
-
const binding = dir !== void 0 ? dir : node;
|
|
27671
|
-
this.bindings.set(attribute2, binding);
|
|
27672
|
-
}, "setAttributeBinding");
|
|
27673
|
-
node.inputs.forEach((input) => setAttributeBinding(input, "inputs"));
|
|
27674
|
-
node.attributes.forEach((attr) => setAttributeBinding(attr, "inputs"));
|
|
27675
|
-
if (node instanceof Template) {
|
|
27676
|
-
node.templateAttrs.forEach((attr) => setAttributeBinding(attr, "inputs"));
|
|
27677
|
-
}
|
|
27678
|
-
node.outputs.forEach((output) => setAttributeBinding(output, "outputs"));
|
|
27679
|
-
}
|
|
27680
26814
|
// Unused visitors.
|
|
27681
26815
|
visitVariable(variable2) {
|
|
27682
26816
|
}
|
|
@@ -27743,7 +26877,7 @@ var TemplateBinder = class _TemplateBinder extends RecursiveAstVisitor2 {
|
|
|
27743
26877
|
/**
|
|
27744
26878
|
* Process a template and extract metadata about expressions and symbols within.
|
|
27745
26879
|
*
|
|
27746
|
-
* @param
|
|
26880
|
+
* @param nodes the nodes of the template to process
|
|
27747
26881
|
* @param scope the `Scope` of the template being processed.
|
|
27748
26882
|
* @returns three maps which contain metadata about the template: `expressions` which interprets
|
|
27749
26883
|
* special `AST` nodes in expressions as pointing to references or variables declared within the
|
|
@@ -27752,10 +26886,10 @@ var TemplateBinder = class _TemplateBinder extends RecursiveAstVisitor2 {
|
|
|
27752
26886
|
* nesting level (how many levels deep within the template structure the `Template` is), starting
|
|
27753
26887
|
* at 1.
|
|
27754
26888
|
*/
|
|
27755
|
-
static applyWithScope(
|
|
27756
|
-
const template2 =
|
|
26889
|
+
static applyWithScope(nodes, scope, expressions, symbols, nestingLevel, usedPipes, eagerPipes, deferBlocks) {
|
|
26890
|
+
const template2 = nodes instanceof Template ? nodes : null;
|
|
27757
26891
|
const binder = new _TemplateBinder(expressions, symbols, usedPipes, eagerPipes, deferBlocks, nestingLevel, scope, template2, 0);
|
|
27758
|
-
binder.ingest(
|
|
26892
|
+
binder.ingest(nodes);
|
|
27759
26893
|
}
|
|
27760
26894
|
ingest(nodeOrNodes) {
|
|
27761
26895
|
if (nodeOrNodes instanceof Template) {
|
|
@@ -27784,8 +26918,6 @@ var TemplateBinder = class _TemplateBinder extends RecursiveAstVisitor2 {
|
|
|
27784
26918
|
} else if (nodeOrNodes instanceof SwitchBlockCase || nodeOrNodes instanceof ForLoopBlockEmpty || nodeOrNodes instanceof DeferredBlockError || nodeOrNodes instanceof DeferredBlockPlaceholder || nodeOrNodes instanceof DeferredBlockLoading || nodeOrNodes instanceof Content) {
|
|
27785
26919
|
nodeOrNodes.children.forEach((node) => node.visit(this));
|
|
27786
26920
|
this.nestingLevel.set(nodeOrNodes, this.level);
|
|
27787
|
-
} else if (nodeOrNodes instanceof HostElement) {
|
|
27788
|
-
this.nestingLevel.set(nodeOrNodes, 0);
|
|
27789
26921
|
} else {
|
|
27790
26922
|
nodeOrNodes.forEach(this.visitNode);
|
|
27791
26923
|
}
|
|
@@ -27793,14 +26925,12 @@ var TemplateBinder = class _TemplateBinder extends RecursiveAstVisitor2 {
|
|
|
27793
26925
|
visitElement(element2) {
|
|
27794
26926
|
element2.inputs.forEach(this.visitNode);
|
|
27795
26927
|
element2.outputs.forEach(this.visitNode);
|
|
27796
|
-
element2.directives.forEach(this.visitNode);
|
|
27797
26928
|
element2.children.forEach(this.visitNode);
|
|
27798
26929
|
element2.references.forEach(this.visitNode);
|
|
27799
26930
|
}
|
|
27800
26931
|
visitTemplate(template2) {
|
|
27801
26932
|
template2.inputs.forEach(this.visitNode);
|
|
27802
26933
|
template2.outputs.forEach(this.visitNode);
|
|
27803
|
-
template2.directives.forEach(this.visitNode);
|
|
27804
26934
|
template2.templateAttrs.forEach(this.visitNode);
|
|
27805
26935
|
template2.references.forEach(this.visitNode);
|
|
27806
26936
|
this.ingestScopedNode(template2);
|
|
@@ -27815,18 +26945,6 @@ var TemplateBinder = class _TemplateBinder extends RecursiveAstVisitor2 {
|
|
|
27815
26945
|
this.symbols.set(reference2, this.rootNode);
|
|
27816
26946
|
}
|
|
27817
26947
|
}
|
|
27818
|
-
visitComponent(component) {
|
|
27819
|
-
component.inputs.forEach(this.visitNode);
|
|
27820
|
-
component.outputs.forEach(this.visitNode);
|
|
27821
|
-
component.directives.forEach(this.visitNode);
|
|
27822
|
-
component.children.forEach(this.visitNode);
|
|
27823
|
-
component.references.forEach(this.visitNode);
|
|
27824
|
-
}
|
|
27825
|
-
visitDirective(directive) {
|
|
27826
|
-
directive.inputs.forEach(this.visitNode);
|
|
27827
|
-
directive.outputs.forEach(this.visitNode);
|
|
27828
|
-
directive.references.forEach(this.visitNode);
|
|
27829
|
-
}
|
|
27830
26948
|
// Unused template visitors
|
|
27831
26949
|
visitText(text2) {
|
|
27832
26950
|
}
|
|
@@ -27944,7 +27062,6 @@ var R3BoundTarget = class {
|
|
|
27944
27062
|
target;
|
|
27945
27063
|
directives;
|
|
27946
27064
|
eagerDirectives;
|
|
27947
|
-
missingDirectives;
|
|
27948
27065
|
bindings;
|
|
27949
27066
|
references;
|
|
27950
27067
|
exprTargets;
|
|
@@ -27957,11 +27074,10 @@ var R3BoundTarget = class {
|
|
|
27957
27074
|
deferredBlocks;
|
|
27958
27075
|
/** Map of deferred blocks to their scope. */
|
|
27959
27076
|
deferredScopes;
|
|
27960
|
-
constructor(target, directives, eagerDirectives,
|
|
27077
|
+
constructor(target, directives, eagerDirectives, bindings, references, exprTargets, symbols, nestingLevel, scopedNodeEntities, usedPipes, eagerPipes, rawDeferred) {
|
|
27961
27078
|
this.target = target;
|
|
27962
27079
|
this.directives = directives;
|
|
27963
27080
|
this.eagerDirectives = eagerDirectives;
|
|
27964
|
-
this.missingDirectives = missingDirectives;
|
|
27965
27081
|
this.bindings = bindings;
|
|
27966
27082
|
this.references = references;
|
|
27967
27083
|
this.exprTargets = exprTargets;
|
|
@@ -28058,7 +27174,7 @@ var R3BoundTarget = class {
|
|
|
28058
27174
|
const stack = [this.deferredScopes.get(block)];
|
|
28059
27175
|
while (stack.length > 0) {
|
|
28060
27176
|
const current = stack.pop();
|
|
28061
|
-
if (current.
|
|
27177
|
+
if (current.elementsInScope.has(element2)) {
|
|
28062
27178
|
return true;
|
|
28063
27179
|
}
|
|
28064
27180
|
stack.push(...current.childScopes.values());
|
|
@@ -28066,9 +27182,6 @@ var R3BoundTarget = class {
|
|
|
28066
27182
|
}
|
|
28067
27183
|
return false;
|
|
28068
27184
|
}
|
|
28069
|
-
referencedDirectiveExists(name) {
|
|
28070
|
-
return !this.missingDirectives.has(name);
|
|
28071
|
-
}
|
|
28072
27185
|
/**
|
|
28073
27186
|
* Finds an entity with a specific name in a scope.
|
|
28074
27187
|
* @param rootNode Root node of the scope.
|
|
@@ -28088,7 +27201,7 @@ var R3BoundTarget = class {
|
|
|
28088
27201
|
if (target instanceof Element$1) {
|
|
28089
27202
|
return target;
|
|
28090
27203
|
}
|
|
28091
|
-
if (target instanceof Template
|
|
27204
|
+
if (target instanceof Template) {
|
|
28092
27205
|
return null;
|
|
28093
27206
|
}
|
|
28094
27207
|
return this.referenceTargetToElement(target.node);
|
|
@@ -28572,7 +27685,7 @@ function parseJitTemplate(template2, typeName, sourceMapUrl, preserveWhitespaces
|
|
|
28572
27685
|
const errors = parsed.errors.map((err) => err.toString()).join(", ");
|
|
28573
27686
|
throw new Error(`Errors during JIT compilation of template for ${typeName}: ${errors}`);
|
|
28574
27687
|
}
|
|
28575
|
-
const binder = new R3TargetBinder(
|
|
27688
|
+
const binder = new R3TargetBinder(new SelectorMatcher());
|
|
28576
27689
|
const boundTarget = binder.bind({ template: parsed.nodes });
|
|
28577
27690
|
return {
|
|
28578
27691
|
template: parsed,
|
|
@@ -28782,6 +27895,7 @@ function publishFacade(global) {
|
|
|
28782
27895
|
ng.\u0275compilerFacade = new CompilerFacadeImpl();
|
|
28783
27896
|
}
|
|
28784
27897
|
__name(publishFacade, "publishFacade");
|
|
27898
|
+
var VERSION = new Version("19.2.14");
|
|
28785
27899
|
var CompilerConfig = class {
|
|
28786
27900
|
static {
|
|
28787
27901
|
__name(this, "CompilerConfig");
|
|
@@ -28881,7 +27995,7 @@ var _Visitor3 = class {
|
|
|
28881
27995
|
merge(nodes, translations, interpolationConfig) {
|
|
28882
27996
|
this._init(_VisitorMode.Merge, interpolationConfig);
|
|
28883
27997
|
this._translations = translations;
|
|
28884
|
-
const wrapper = new Element2("wrapper", [],
|
|
27998
|
+
const wrapper = new Element2("wrapper", [], nodes, void 0, void 0, void 0);
|
|
28885
27999
|
const translatedNode = wrapper.visit(this, null);
|
|
28886
28000
|
if (this._inI18nBlock) {
|
|
28887
28001
|
this._reportError(nodes[nodes.length - 1], "Unclosed block");
|
|
@@ -28958,83 +28072,41 @@ var _Visitor3 = class {
|
|
|
28958
28072
|
return text2;
|
|
28959
28073
|
}
|
|
28960
28074
|
visitElement(el, context) {
|
|
28961
|
-
|
|
28962
|
-
}
|
|
28963
|
-
visitAttribute(attribute2, context) {
|
|
28964
|
-
throw new Error("unreachable code");
|
|
28965
|
-
}
|
|
28966
|
-
visitBlock(block, context) {
|
|
28967
|
-
visitAll(this, block.children, context);
|
|
28968
|
-
}
|
|
28969
|
-
visitBlockParameter(parameter, context) {
|
|
28970
|
-
}
|
|
28971
|
-
visitLetDeclaration(decl, context) {
|
|
28972
|
-
}
|
|
28973
|
-
visitComponent(component, context) {
|
|
28974
|
-
return this._visitElementLike(component, context);
|
|
28975
|
-
}
|
|
28976
|
-
visitDirective(directive, context) {
|
|
28977
|
-
throw new Error("unreachable code");
|
|
28978
|
-
}
|
|
28979
|
-
_init(mode, interpolationConfig) {
|
|
28980
|
-
this._mode = mode;
|
|
28981
|
-
this._inI18nBlock = false;
|
|
28982
|
-
this._inI18nNode = false;
|
|
28983
|
-
this._depth = 0;
|
|
28984
|
-
this._inIcu = false;
|
|
28985
|
-
this._msgCountAtSectionStart = void 0;
|
|
28986
|
-
this._errors = [];
|
|
28987
|
-
this._messages = [];
|
|
28988
|
-
this._inImplicitNode = false;
|
|
28989
|
-
this._createI18nMessage = createI18nMessageFactory(
|
|
28990
|
-
interpolationConfig,
|
|
28991
|
-
DEFAULT_CONTAINER_BLOCKS,
|
|
28992
|
-
// When dropping significant whitespace we need to retain whitespace tokens or
|
|
28993
|
-
// else we won't be able to reuse source spans because empty tokens would be
|
|
28994
|
-
// removed and cause a mismatch.
|
|
28995
|
-
/* retainEmptyTokens */
|
|
28996
|
-
!this._preserveSignificantWhitespace,
|
|
28997
|
-
/* preserveExpressionWhitespace */
|
|
28998
|
-
this._preserveSignificantWhitespace
|
|
28999
|
-
);
|
|
29000
|
-
}
|
|
29001
|
-
_visitElementLike(node, context) {
|
|
29002
|
-
this._mayBeAddBlockChildren(node);
|
|
28075
|
+
this._mayBeAddBlockChildren(el);
|
|
29003
28076
|
this._depth++;
|
|
29004
28077
|
const wasInI18nNode = this._inI18nNode;
|
|
29005
28078
|
const wasInImplicitNode = this._inImplicitNode;
|
|
29006
28079
|
let childNodes = [];
|
|
29007
28080
|
let translatedChildNodes = void 0;
|
|
29008
|
-
const
|
|
29009
|
-
const i18nAttr = _getI18nAttr(node);
|
|
28081
|
+
const i18nAttr = _getI18nAttr(el);
|
|
29010
28082
|
const i18nMeta = i18nAttr ? i18nAttr.value : "";
|
|
29011
|
-
const isImplicit = this._implicitTags.some((tag) =>
|
|
28083
|
+
const isImplicit = this._implicitTags.some((tag) => el.name === tag) && !this._inIcu && !this._isInTranslatableSection;
|
|
29012
28084
|
const isTopLevelImplicit = !wasInImplicitNode && isImplicit;
|
|
29013
28085
|
this._inImplicitNode = wasInImplicitNode || isImplicit;
|
|
29014
28086
|
if (!this._isInTranslatableSection && !this._inIcu) {
|
|
29015
28087
|
if (i18nAttr || isTopLevelImplicit) {
|
|
29016
28088
|
this._inI18nNode = true;
|
|
29017
|
-
const message = this._addMessage(
|
|
29018
|
-
translatedChildNodes = this._translateMessage(
|
|
28089
|
+
const message = this._addMessage(el.children, i18nMeta);
|
|
28090
|
+
translatedChildNodes = this._translateMessage(el, message);
|
|
29019
28091
|
}
|
|
29020
28092
|
if (this._mode == _VisitorMode.Extract) {
|
|
29021
28093
|
const isTranslatable = i18nAttr || isTopLevelImplicit;
|
|
29022
28094
|
if (isTranslatable)
|
|
29023
|
-
this._openTranslatableSection(
|
|
29024
|
-
visitAll(this,
|
|
28095
|
+
this._openTranslatableSection(el);
|
|
28096
|
+
visitAll(this, el.children);
|
|
29025
28097
|
if (isTranslatable)
|
|
29026
|
-
this._closeTranslatableSection(
|
|
28098
|
+
this._closeTranslatableSection(el, el.children);
|
|
29027
28099
|
}
|
|
29028
28100
|
} else {
|
|
29029
28101
|
if (i18nAttr || isTopLevelImplicit) {
|
|
29030
|
-
this._reportError(
|
|
28102
|
+
this._reportError(el, "Could not mark an element as translatable inside a translatable section");
|
|
29031
28103
|
}
|
|
29032
28104
|
if (this._mode == _VisitorMode.Extract) {
|
|
29033
|
-
visitAll(this,
|
|
28105
|
+
visitAll(this, el.children);
|
|
29034
28106
|
}
|
|
29035
28107
|
}
|
|
29036
28108
|
if (this._mode === _VisitorMode.Merge) {
|
|
29037
|
-
const visitNodes = translatedChildNodes ||
|
|
28109
|
+
const visitNodes = translatedChildNodes || el.children;
|
|
29038
28110
|
visitNodes.forEach((child) => {
|
|
29039
28111
|
const visited = child.visit(this, context);
|
|
29040
28112
|
if (visited && !this._isInTranslatableSection) {
|
|
@@ -29042,26 +28114,53 @@ var _Visitor3 = class {
|
|
|
29042
28114
|
}
|
|
29043
28115
|
});
|
|
29044
28116
|
}
|
|
29045
|
-
this._visitAttributesOf(
|
|
28117
|
+
this._visitAttributesOf(el);
|
|
29046
28118
|
this._depth--;
|
|
29047
28119
|
this._inI18nNode = wasInI18nNode;
|
|
29048
28120
|
this._inImplicitNode = wasInImplicitNode;
|
|
29049
28121
|
if (this._mode === _VisitorMode.Merge) {
|
|
29050
|
-
|
|
29051
|
-
|
|
29052
|
-
} else {
|
|
29053
|
-
return new Component2(node.componentName, node.tagName, node.fullName, this._translateAttributes(node), this._translateDirectives(node), childNodes, node.sourceSpan, node.startSourceSpan, node.endSourceSpan);
|
|
29054
|
-
}
|
|
28122
|
+
const translatedAttrs = this._translateAttributes(el);
|
|
28123
|
+
return new Element2(el.name, translatedAttrs, childNodes, el.sourceSpan, el.startSourceSpan, el.endSourceSpan);
|
|
29055
28124
|
}
|
|
29056
28125
|
return null;
|
|
29057
28126
|
}
|
|
28127
|
+
visitAttribute(attribute2, context) {
|
|
28128
|
+
throw new Error("unreachable code");
|
|
28129
|
+
}
|
|
28130
|
+
visitBlock(block, context) {
|
|
28131
|
+
visitAll(this, block.children, context);
|
|
28132
|
+
}
|
|
28133
|
+
visitBlockParameter(parameter, context) {
|
|
28134
|
+
}
|
|
28135
|
+
visitLetDeclaration(decl, context) {
|
|
28136
|
+
}
|
|
28137
|
+
_init(mode, interpolationConfig) {
|
|
28138
|
+
this._mode = mode;
|
|
28139
|
+
this._inI18nBlock = false;
|
|
28140
|
+
this._inI18nNode = false;
|
|
28141
|
+
this._depth = 0;
|
|
28142
|
+
this._inIcu = false;
|
|
28143
|
+
this._msgCountAtSectionStart = void 0;
|
|
28144
|
+
this._errors = [];
|
|
28145
|
+
this._messages = [];
|
|
28146
|
+
this._inImplicitNode = false;
|
|
28147
|
+
this._createI18nMessage = createI18nMessageFactory(
|
|
28148
|
+
interpolationConfig,
|
|
28149
|
+
DEFAULT_CONTAINER_BLOCKS,
|
|
28150
|
+
// When dropping significant whitespace we need to retain whitespace tokens or
|
|
28151
|
+
// else we won't be able to reuse source spans because empty tokens would be
|
|
28152
|
+
// removed and cause a mismatch.
|
|
28153
|
+
/* retainEmptyTokens */
|
|
28154
|
+
!this._preserveSignificantWhitespace,
|
|
28155
|
+
/* preserveExpressionWhitespace */
|
|
28156
|
+
this._preserveSignificantWhitespace
|
|
28157
|
+
);
|
|
28158
|
+
}
|
|
29058
28159
|
// looks for translatable attributes
|
|
29059
28160
|
_visitAttributesOf(el) {
|
|
29060
28161
|
const explicitAttrNameToValue = {};
|
|
29061
|
-
const implicitAttrNames = this._implicitAttrs[el
|
|
29062
|
-
el.attrs.filter((attr) => attr
|
|
29063
|
-
explicitAttrNameToValue[attr.name.slice(_I18N_ATTR_PREFIX.length)] = attr.value;
|
|
29064
|
-
});
|
|
28162
|
+
const implicitAttrNames = this._implicitAttrs[el.name] || [];
|
|
28163
|
+
el.attrs.filter((attr) => attr.name.startsWith(_I18N_ATTR_PREFIX)).forEach((attr) => explicitAttrNameToValue[attr.name.slice(_I18N_ATTR_PREFIX.length)] = attr.value);
|
|
29065
28164
|
el.attrs.forEach((attr) => {
|
|
29066
28165
|
if (attr.name in explicitAttrNameToValue) {
|
|
29067
28166
|
this._addMessage([attr], explicitAttrNameToValue[attr.name]);
|
|
@@ -29131,15 +28230,16 @@ var _Visitor3 = class {
|
|
|
29131
28230
|
return [];
|
|
29132
28231
|
}
|
|
29133
28232
|
// translate the attributes of an element and remove i18n specific attributes
|
|
29134
|
-
_translateAttributes(
|
|
28233
|
+
_translateAttributes(el) {
|
|
28234
|
+
const attributes = el.attrs;
|
|
29135
28235
|
const i18nParsedMessageMeta = {};
|
|
29136
|
-
|
|
29137
|
-
node.attrs.forEach((attr) => {
|
|
28236
|
+
attributes.forEach((attr) => {
|
|
29138
28237
|
if (attr.name.startsWith(_I18N_ATTR_PREFIX)) {
|
|
29139
28238
|
i18nParsedMessageMeta[attr.name.slice(_I18N_ATTR_PREFIX.length)] = _parseMessageMeta(attr.value);
|
|
29140
28239
|
}
|
|
29141
28240
|
});
|
|
29142
|
-
|
|
28241
|
+
const translatedAttributes = [];
|
|
28242
|
+
attributes.forEach((attr) => {
|
|
29143
28243
|
if (attr.name === _I18N_ATTR || attr.name.startsWith(_I18N_ATTR_PREFIX)) {
|
|
29144
28244
|
return;
|
|
29145
28245
|
}
|
|
@@ -29172,10 +28272,10 @@ var _Visitor3 = class {
|
|
|
29172
28272
|
/* i18n */
|
|
29173
28273
|
));
|
|
29174
28274
|
} else {
|
|
29175
|
-
this._reportError(
|
|
28275
|
+
this._reportError(el, `Unexpected translation for attribute "${attr.name}" (id="${id || this._translations.digest(message)}")`);
|
|
29176
28276
|
}
|
|
29177
28277
|
} else {
|
|
29178
|
-
this._reportError(
|
|
28278
|
+
this._reportError(el, `Translation unavailable for attribute "${attr.name}" (id="${id || this._translations.digest(message)}")`);
|
|
29179
28279
|
}
|
|
29180
28280
|
} else {
|
|
29181
28281
|
translatedAttributes.push(attr);
|
|
@@ -29183,9 +28283,6 @@ var _Visitor3 = class {
|
|
|
29183
28283
|
});
|
|
29184
28284
|
return translatedAttributes;
|
|
29185
28285
|
}
|
|
29186
|
-
_translateDirectives(node) {
|
|
29187
|
-
return node.directives.map((dir) => new Directive2(dir.name, this._translateAttributes(dir), dir.sourceSpan, dir.startSourceSpan, dir.endSourceSpan));
|
|
29188
|
-
}
|
|
29189
28286
|
/**
|
|
29190
28287
|
* Add the node as a child of the block when:
|
|
29191
28288
|
* - we are in a block,
|
|
@@ -29262,7 +28359,7 @@ function _isClosingComment(n) {
|
|
|
29262
28359
|
}
|
|
29263
28360
|
__name(_isClosingComment, "_isClosingComment");
|
|
29264
28361
|
function _getI18nAttr(p) {
|
|
29265
|
-
return p.attrs.find((attr) => attr
|
|
28362
|
+
return p.attrs.find((attr) => attr.name === _I18N_ATTR) || null;
|
|
29266
28363
|
}
|
|
29267
28364
|
__name(_getI18nAttr, "_getI18nAttr");
|
|
29268
28365
|
function _parseMessageMeta(i18n2) {
|
|
@@ -29316,12 +28413,7 @@ var XmlParser = class extends Parser$1 {
|
|
|
29316
28413
|
super(getXmlTagDefinition);
|
|
29317
28414
|
}
|
|
29318
28415
|
parse(source, url, options = {}) {
|
|
29319
|
-
return super.parse(source, url, {
|
|
29320
|
-
...options,
|
|
29321
|
-
tokenizeBlocks: false,
|
|
29322
|
-
tokenizeLet: false,
|
|
29323
|
-
selectorlessEnabled: false
|
|
29324
|
-
});
|
|
28416
|
+
return super.parse(source, url, { ...options, tokenizeBlocks: false, tokenizeLet: false });
|
|
29325
28417
|
}
|
|
29326
28418
|
};
|
|
29327
28419
|
var _VERSION$1 = "1.2";
|
|
@@ -29547,10 +28639,6 @@ var XliffParser = class {
|
|
|
29547
28639
|
}
|
|
29548
28640
|
visitLetDeclaration(decl, context) {
|
|
29549
28641
|
}
|
|
29550
|
-
visitComponent(component, context) {
|
|
29551
|
-
}
|
|
29552
|
-
visitDirective(directive, context) {
|
|
29553
|
-
}
|
|
29554
28642
|
_addError(node, message) {
|
|
29555
28643
|
this._errors.push(new I18nError(node.sourceSpan, message));
|
|
29556
28644
|
}
|
|
@@ -29611,12 +28699,6 @@ var XmlToI18n$2 = class XmlToI18n {
|
|
|
29611
28699
|
}
|
|
29612
28700
|
visitLetDeclaration(decl, context) {
|
|
29613
28701
|
}
|
|
29614
|
-
visitComponent(component, context) {
|
|
29615
|
-
this._addError(component, "Unexpected node");
|
|
29616
|
-
}
|
|
29617
|
-
visitDirective(directive, context) {
|
|
29618
|
-
this._addError(directive, "Unexpected node");
|
|
29619
|
-
}
|
|
29620
28702
|
_addError(node, message) {
|
|
29621
28703
|
this._errors.push(new I18nError(node.sourceSpan, message));
|
|
29622
28704
|
}
|
|
@@ -29881,10 +28963,6 @@ var Xliff2Parser = class {
|
|
|
29881
28963
|
}
|
|
29882
28964
|
visitLetDeclaration(decl, context) {
|
|
29883
28965
|
}
|
|
29884
|
-
visitComponent(component, context) {
|
|
29885
|
-
}
|
|
29886
|
-
visitDirective(directive, context) {
|
|
29887
|
-
}
|
|
29888
28966
|
_addError(node, message) {
|
|
29889
28967
|
this._errors.push(new I18nError(node.sourceSpan, message));
|
|
29890
28968
|
}
|
|
@@ -29960,12 +29038,6 @@ var XmlToI18n$1 = class XmlToI18n2 {
|
|
|
29960
29038
|
}
|
|
29961
29039
|
visitLetDeclaration(decl, context) {
|
|
29962
29040
|
}
|
|
29963
|
-
visitComponent(component, context) {
|
|
29964
|
-
this._addError(component, "Unexpected node");
|
|
29965
|
-
}
|
|
29966
|
-
visitDirective(directive, context) {
|
|
29967
|
-
this._addError(directive, "Unexpected node");
|
|
29968
|
-
}
|
|
29969
29041
|
_addError(node, message) {
|
|
29970
29042
|
this._errors.push(new I18nError(node.sourceSpan, message));
|
|
29971
29043
|
}
|
|
@@ -30112,12 +29184,6 @@ var XtbParser = class {
|
|
|
30112
29184
|
}
|
|
30113
29185
|
visitLetDeclaration(decl, context) {
|
|
30114
29186
|
}
|
|
30115
|
-
visitComponent(component, context) {
|
|
30116
|
-
this._addError(component, "Unexpected node");
|
|
30117
|
-
}
|
|
30118
|
-
visitDirective(directive, context) {
|
|
30119
|
-
this._addError(directive, "Unexpected node");
|
|
30120
|
-
}
|
|
30121
29187
|
_addError(node, message) {
|
|
30122
29188
|
this._errors.push(new I18nError(node.sourceSpan, message));
|
|
30123
29189
|
}
|
|
@@ -30175,12 +29241,6 @@ var XmlToI18n3 = class {
|
|
|
30175
29241
|
}
|
|
30176
29242
|
visitLetDeclaration(decl, context) {
|
|
30177
29243
|
}
|
|
30178
|
-
visitComponent(component, context) {
|
|
30179
|
-
this._addError(component, "Unexpected node");
|
|
30180
|
-
}
|
|
30181
|
-
visitDirective(directive, context) {
|
|
30182
|
-
this._addError(directive, "Unexpected node");
|
|
30183
|
-
}
|
|
30184
29244
|
_addError(node, message) {
|
|
30185
29245
|
this._errors.push(new I18nError(node.sourceSpan, message));
|
|
30186
29246
|
}
|
|
@@ -30518,12 +29578,96 @@ function compileComponentMetadataAsyncResolver(dependencies) {
|
|
|
30518
29578
|
return arrowFn([], literalArr(dynamicImports));
|
|
30519
29579
|
}
|
|
30520
29580
|
__name(compileComponentMetadataAsyncResolver, "compileComponentMetadataAsyncResolver");
|
|
29581
|
+
function compileClassDebugInfo(debugInfo) {
|
|
29582
|
+
const debugInfoObject = {
|
|
29583
|
+
className: debugInfo.className
|
|
29584
|
+
};
|
|
29585
|
+
if (debugInfo.filePath) {
|
|
29586
|
+
debugInfoObject.filePath = debugInfo.filePath;
|
|
29587
|
+
debugInfoObject.lineNumber = debugInfo.lineNumber;
|
|
29588
|
+
}
|
|
29589
|
+
if (debugInfo.forbidOrphanRendering) {
|
|
29590
|
+
debugInfoObject.forbidOrphanRendering = literal(true);
|
|
29591
|
+
}
|
|
29592
|
+
const fnCall = importExpr(Identifiers.setClassDebugInfo).callFn([debugInfo.type, mapLiteral(debugInfoObject)]);
|
|
29593
|
+
const iife = arrowFn([], [devOnlyGuardedExpression(fnCall).toStmt()]);
|
|
29594
|
+
return iife.callFn([]);
|
|
29595
|
+
}
|
|
29596
|
+
__name(compileClassDebugInfo, "compileClassDebugInfo");
|
|
29597
|
+
function compileHmrInitializer(meta) {
|
|
29598
|
+
const moduleName = "m";
|
|
29599
|
+
const dataName = "d";
|
|
29600
|
+
const timestampName = "t";
|
|
29601
|
+
const idName = "id";
|
|
29602
|
+
const importCallbackName = `${meta.className}_HmrLoad`;
|
|
29603
|
+
const namespaces = meta.namespaceDependencies.map((dep) => {
|
|
29604
|
+
return new ExternalExpr({ moduleName: dep.moduleName, name: null });
|
|
29605
|
+
});
|
|
29606
|
+
const defaultRead = variable(moduleName).prop("default");
|
|
29607
|
+
const replaceCall = importExpr(Identifiers.replaceMetadata).callFn([
|
|
29608
|
+
meta.type,
|
|
29609
|
+
defaultRead,
|
|
29610
|
+
literalArr(namespaces),
|
|
29611
|
+
literalArr(meta.localDependencies.map((l) => l.runtimeRepresentation)),
|
|
29612
|
+
variable("import").prop("meta"),
|
|
29613
|
+
variable(idName)
|
|
29614
|
+
]);
|
|
29615
|
+
const replaceCallback = arrowFn([new FnParam(moduleName)], defaultRead.and(replaceCall));
|
|
29616
|
+
const url = importExpr(Identifiers.getReplaceMetadataURL).callFn([
|
|
29617
|
+
variable(idName),
|
|
29618
|
+
variable(timestampName),
|
|
29619
|
+
variable("import").prop("meta").prop("url")
|
|
29620
|
+
]);
|
|
29621
|
+
const importCallback = new DeclareFunctionStmt(importCallbackName, [new FnParam(timestampName)], [
|
|
29622
|
+
// The vite-ignore special comment is required to prevent Vite from generating a superfluous
|
|
29623
|
+
// warning for each usage within the development code. If Vite provides a method to
|
|
29624
|
+
// programmatically avoid this warning in the future, this added comment can be removed here.
|
|
29625
|
+
new DynamicImportExpr(url, null, "@vite-ignore").prop("then").callFn([replaceCallback]).toStmt()
|
|
29626
|
+
], null, StmtModifier.Final);
|
|
29627
|
+
const updateCallback = arrowFn([new FnParam(dataName)], variable(dataName).prop("id").identical(variable(idName)).and(variable(importCallbackName).callFn([variable(dataName).prop("timestamp")])));
|
|
29628
|
+
const initialCall = variable(importCallbackName).callFn([variable("Date").prop("now").callFn([])]);
|
|
29629
|
+
const hotRead = variable("import").prop("meta").prop("hot");
|
|
29630
|
+
const hotListener = hotRead.clone().prop("on").callFn([literal("angular:component-update"), updateCallback]);
|
|
29631
|
+
return arrowFn([], [
|
|
29632
|
+
// const id = <id>;
|
|
29633
|
+
new DeclareVarStmt(idName, literal(encodeURIComponent(`${meta.filePath}@${meta.className}`)), null, StmtModifier.Final),
|
|
29634
|
+
// function Cmp_HmrLoad() {...}.
|
|
29635
|
+
importCallback,
|
|
29636
|
+
// ngDevMode && Cmp_HmrLoad(Date.now());
|
|
29637
|
+
devOnlyGuardedExpression(initialCall).toStmt(),
|
|
29638
|
+
// ngDevMode && import.meta.hot && import.meta.hot.on(...)
|
|
29639
|
+
devOnlyGuardedExpression(hotRead.and(hotListener)).toStmt()
|
|
29640
|
+
]).callFn([]);
|
|
29641
|
+
}
|
|
29642
|
+
__name(compileHmrInitializer, "compileHmrInitializer");
|
|
29643
|
+
function compileHmrUpdateCallback(definitions, constantStatements, meta) {
|
|
29644
|
+
const namespaces = "\u0275\u0275namespaces";
|
|
29645
|
+
const params = [meta.className, namespaces].map((name) => new FnParam(name, DYNAMIC_TYPE));
|
|
29646
|
+
const body = [];
|
|
29647
|
+
for (const local of meta.localDependencies) {
|
|
29648
|
+
params.push(new FnParam(local.name));
|
|
29649
|
+
}
|
|
29650
|
+
for (let i = 0; i < meta.namespaceDependencies.length; i++) {
|
|
29651
|
+
body.push(new DeclareVarStmt(meta.namespaceDependencies[i].assignedName, variable(namespaces).key(literal(i)), DYNAMIC_TYPE, StmtModifier.Final));
|
|
29652
|
+
}
|
|
29653
|
+
body.push(...constantStatements);
|
|
29654
|
+
for (const field of definitions) {
|
|
29655
|
+
if (field.initializer !== null) {
|
|
29656
|
+
body.push(variable(meta.className).prop(field.name).set(field.initializer).toStmt());
|
|
29657
|
+
for (const stmt of field.statements) {
|
|
29658
|
+
body.push(stmt);
|
|
29659
|
+
}
|
|
29660
|
+
}
|
|
29661
|
+
}
|
|
29662
|
+
return new DeclareFunctionStmt(`${meta.className}_UpdateMetadata`, params, body, null, StmtModifier.Final);
|
|
29663
|
+
}
|
|
29664
|
+
__name(compileHmrUpdateCallback, "compileHmrUpdateCallback");
|
|
30521
29665
|
var MINIMUM_PARTIAL_LINKER_VERSION$5 = "12.0.0";
|
|
30522
29666
|
var MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = "18.0.0";
|
|
30523
29667
|
function compileDeclareClassMetadata(metadata) {
|
|
30524
29668
|
const definitionMap = new DefinitionMap();
|
|
30525
29669
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
|
|
30526
|
-
definitionMap.set("version", literal("
|
|
29670
|
+
definitionMap.set("version", literal("19.2.14"));
|
|
30527
29671
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
30528
29672
|
definitionMap.set("type", metadata.type);
|
|
30529
29673
|
definitionMap.set("decorators", metadata.decorators);
|
|
@@ -30542,7 +29686,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
|
|
|
30542
29686
|
callbackReturnDefinitionMap.set("ctorParameters", metadata.ctorParameters ?? literal(null));
|
|
30543
29687
|
callbackReturnDefinitionMap.set("propDecorators", metadata.propDecorators ?? literal(null));
|
|
30544
29688
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
|
|
30545
|
-
definitionMap.set("version", literal("
|
|
29689
|
+
definitionMap.set("version", literal("19.2.14"));
|
|
30546
29690
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
30547
29691
|
definitionMap.set("type", metadata.type);
|
|
30548
29692
|
definitionMap.set("resolveDeferredDeps", compileComponentMetadataAsyncResolver(dependencies));
|
|
@@ -30611,7 +29755,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
30611
29755
|
const definitionMap = new DefinitionMap();
|
|
30612
29756
|
const minVersion = getMinimumVersionForPartialOutput(meta);
|
|
30613
29757
|
definitionMap.set("minVersion", literal(minVersion));
|
|
30614
|
-
definitionMap.set("version", literal("
|
|
29758
|
+
definitionMap.set("version", literal("19.2.14"));
|
|
30615
29759
|
definitionMap.set("type", meta.type.value);
|
|
30616
29760
|
if (meta.isStandalone !== void 0) {
|
|
30617
29761
|
definitionMap.set("isStandalone", literal(meta.isStandalone));
|
|
@@ -30938,7 +30082,7 @@ var MINIMUM_PARTIAL_LINKER_VERSION$4 = "12.0.0";
|
|
|
30938
30082
|
function compileDeclareFactoryFunction(meta) {
|
|
30939
30083
|
const definitionMap = new DefinitionMap();
|
|
30940
30084
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
|
|
30941
|
-
definitionMap.set("version", literal("
|
|
30085
|
+
definitionMap.set("version", literal("19.2.14"));
|
|
30942
30086
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
30943
30087
|
definitionMap.set("type", meta.type.value);
|
|
30944
30088
|
definitionMap.set("deps", compileDependencies(meta.deps));
|
|
@@ -30961,7 +30105,7 @@ __name(compileDeclareInjectableFromMetadata, "compileDeclareInjectableFromMetada
|
|
|
30961
30105
|
function createInjectableDefinitionMap(meta) {
|
|
30962
30106
|
const definitionMap = new DefinitionMap();
|
|
30963
30107
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
|
|
30964
|
-
definitionMap.set("version", literal("
|
|
30108
|
+
definitionMap.set("version", literal("19.2.14"));
|
|
30965
30109
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
30966
30110
|
definitionMap.set("type", meta.type.value);
|
|
30967
30111
|
if (meta.providedIn !== void 0) {
|
|
@@ -30999,7 +30143,7 @@ __name(compileDeclareInjectorFromMetadata, "compileDeclareInjectorFromMetadata")
|
|
|
30999
30143
|
function createInjectorDefinitionMap(meta) {
|
|
31000
30144
|
const definitionMap = new DefinitionMap();
|
|
31001
30145
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
|
|
31002
|
-
definitionMap.set("version", literal("
|
|
30146
|
+
definitionMap.set("version", literal("19.2.14"));
|
|
31003
30147
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
31004
30148
|
definitionMap.set("type", meta.type.value);
|
|
31005
30149
|
definitionMap.set("providers", meta.providers);
|
|
@@ -31023,7 +30167,7 @@ function createNgModuleDefinitionMap(meta) {
|
|
|
31023
30167
|
throw new Error("Invalid path! Local compilation mode should not get into the partial compilation path");
|
|
31024
30168
|
}
|
|
31025
30169
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
|
|
31026
|
-
definitionMap.set("version", literal("
|
|
30170
|
+
definitionMap.set("version", literal("19.2.14"));
|
|
31027
30171
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
31028
30172
|
definitionMap.set("type", meta.type.value);
|
|
31029
30173
|
if (meta.bootstrap.length > 0) {
|
|
@@ -31058,7 +30202,7 @@ __name(compileDeclarePipeFromMetadata, "compileDeclarePipeFromMetadata");
|
|
|
31058
30202
|
function createPipeDefinitionMap(meta) {
|
|
31059
30203
|
const definitionMap = new DefinitionMap();
|
|
31060
30204
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
31061
|
-
definitionMap.set("version", literal("
|
|
30205
|
+
definitionMap.set("version", literal("19.2.14"));
|
|
31062
30206
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
31063
30207
|
definitionMap.set("type", meta.type.value);
|
|
31064
30208
|
if (meta.isStandalone !== void 0) {
|
|
@@ -31071,91 +30215,6 @@ function createPipeDefinitionMap(meta) {
|
|
|
31071
30215
|
return definitionMap;
|
|
31072
30216
|
}
|
|
31073
30217
|
__name(createPipeDefinitionMap, "createPipeDefinitionMap");
|
|
31074
|
-
function compileClassDebugInfo(debugInfo) {
|
|
31075
|
-
const debugInfoObject = {
|
|
31076
|
-
className: debugInfo.className
|
|
31077
|
-
};
|
|
31078
|
-
if (debugInfo.filePath) {
|
|
31079
|
-
debugInfoObject.filePath = debugInfo.filePath;
|
|
31080
|
-
debugInfoObject.lineNumber = debugInfo.lineNumber;
|
|
31081
|
-
}
|
|
31082
|
-
if (debugInfo.forbidOrphanRendering) {
|
|
31083
|
-
debugInfoObject.forbidOrphanRendering = literal(true);
|
|
31084
|
-
}
|
|
31085
|
-
const fnCall = importExpr(Identifiers.setClassDebugInfo).callFn([debugInfo.type, mapLiteral(debugInfoObject)]);
|
|
31086
|
-
const iife = arrowFn([], [devOnlyGuardedExpression(fnCall).toStmt()]);
|
|
31087
|
-
return iife.callFn([]);
|
|
31088
|
-
}
|
|
31089
|
-
__name(compileClassDebugInfo, "compileClassDebugInfo");
|
|
31090
|
-
function compileHmrInitializer(meta) {
|
|
31091
|
-
const moduleName = "m";
|
|
31092
|
-
const dataName = "d";
|
|
31093
|
-
const timestampName = "t";
|
|
31094
|
-
const idName = "id";
|
|
31095
|
-
const importCallbackName = `${meta.className}_HmrLoad`;
|
|
31096
|
-
const namespaces = meta.namespaceDependencies.map((dep) => {
|
|
31097
|
-
return new ExternalExpr({ moduleName: dep.moduleName, name: null });
|
|
31098
|
-
});
|
|
31099
|
-
const defaultRead = variable(moduleName).prop("default");
|
|
31100
|
-
const replaceCall = importExpr(Identifiers.replaceMetadata).callFn([
|
|
31101
|
-
meta.type,
|
|
31102
|
-
defaultRead,
|
|
31103
|
-
literalArr(namespaces),
|
|
31104
|
-
literalArr(meta.localDependencies.map((l) => l.runtimeRepresentation)),
|
|
31105
|
-
variable("import").prop("meta"),
|
|
31106
|
-
variable(idName)
|
|
31107
|
-
]);
|
|
31108
|
-
const replaceCallback = arrowFn([new FnParam(moduleName)], defaultRead.and(replaceCall));
|
|
31109
|
-
const url = importExpr(Identifiers.getReplaceMetadataURL).callFn([
|
|
31110
|
-
variable(idName),
|
|
31111
|
-
variable(timestampName),
|
|
31112
|
-
variable("import").prop("meta").prop("url")
|
|
31113
|
-
]);
|
|
31114
|
-
const importCallback = new DeclareFunctionStmt(importCallbackName, [new FnParam(timestampName)], [
|
|
31115
|
-
// The vite-ignore special comment is required to prevent Vite from generating a superfluous
|
|
31116
|
-
// warning for each usage within the development code. If Vite provides a method to
|
|
31117
|
-
// programmatically avoid this warning in the future, this added comment can be removed here.
|
|
31118
|
-
new DynamicImportExpr(url, null, "@vite-ignore").prop("then").callFn([replaceCallback]).toStmt()
|
|
31119
|
-
], null, StmtModifier.Final);
|
|
31120
|
-
const updateCallback = arrowFn([new FnParam(dataName)], variable(dataName).prop("id").identical(variable(idName)).and(variable(importCallbackName).callFn([variable(dataName).prop("timestamp")])));
|
|
31121
|
-
const initialCall = variable(importCallbackName).callFn([variable("Date").prop("now").callFn([])]);
|
|
31122
|
-
const hotRead = variable("import").prop("meta").prop("hot");
|
|
31123
|
-
const hotListener = hotRead.clone().prop("on").callFn([literal("angular:component-update"), updateCallback]);
|
|
31124
|
-
return arrowFn([], [
|
|
31125
|
-
// const id = <id>;
|
|
31126
|
-
new DeclareVarStmt(idName, literal(encodeURIComponent(`${meta.filePath}@${meta.className}`)), null, StmtModifier.Final),
|
|
31127
|
-
// function Cmp_HmrLoad() {...}.
|
|
31128
|
-
importCallback,
|
|
31129
|
-
// ngDevMode && Cmp_HmrLoad(Date.now());
|
|
31130
|
-
devOnlyGuardedExpression(initialCall).toStmt(),
|
|
31131
|
-
// ngDevMode && import.meta.hot && import.meta.hot.on(...)
|
|
31132
|
-
devOnlyGuardedExpression(hotRead.and(hotListener)).toStmt()
|
|
31133
|
-
]).callFn([]);
|
|
31134
|
-
}
|
|
31135
|
-
__name(compileHmrInitializer, "compileHmrInitializer");
|
|
31136
|
-
function compileHmrUpdateCallback(definitions, constantStatements, meta) {
|
|
31137
|
-
const namespaces = "\u0275\u0275namespaces";
|
|
31138
|
-
const params = [meta.className, namespaces].map((name) => new FnParam(name, DYNAMIC_TYPE));
|
|
31139
|
-
const body = [];
|
|
31140
|
-
for (const local of meta.localDependencies) {
|
|
31141
|
-
params.push(new FnParam(local.name));
|
|
31142
|
-
}
|
|
31143
|
-
for (let i = 0; i < meta.namespaceDependencies.length; i++) {
|
|
31144
|
-
body.push(new DeclareVarStmt(meta.namespaceDependencies[i].assignedName, variable(namespaces).key(literal(i)), DYNAMIC_TYPE, StmtModifier.Final));
|
|
31145
|
-
}
|
|
31146
|
-
body.push(...constantStatements);
|
|
31147
|
-
for (const field of definitions) {
|
|
31148
|
-
if (field.initializer !== null) {
|
|
31149
|
-
body.push(variable(meta.className).prop(field.name).set(field.initializer).toStmt());
|
|
31150
|
-
for (const stmt of field.statements) {
|
|
31151
|
-
body.push(stmt);
|
|
31152
|
-
}
|
|
31153
|
-
}
|
|
31154
|
-
}
|
|
31155
|
-
return new DeclareFunctionStmt(`${meta.className}_UpdateMetadata`, params, body, null, StmtModifier.Final);
|
|
31156
|
-
}
|
|
31157
|
-
__name(compileHmrUpdateCallback, "compileHmrUpdateCallback");
|
|
31158
|
-
var VERSION = new Version("20.0.0");
|
|
31159
30218
|
publishFacade(_global);
|
|
31160
30219
|
// Annotate the CommonJS export names for ESM import in node:
|
|
31161
30220
|
0 && (module.exports = {
|
|
@@ -31184,7 +30243,6 @@ publishFacade(_global);
|
|
|
31184
30243
|
Comment,
|
|
31185
30244
|
CompilerConfig,
|
|
31186
30245
|
CompilerFacadeImpl,
|
|
31187
|
-
Component,
|
|
31188
30246
|
Conditional,
|
|
31189
30247
|
ConditionalExpr,
|
|
31190
30248
|
ConstantPool,
|
|
@@ -31193,7 +30251,6 @@ publishFacade(_global);
|
|
|
31193
30251
|
DYNAMIC_TYPE,
|
|
31194
30252
|
DeclareFunctionStmt,
|
|
31195
30253
|
DeclareVarStmt,
|
|
31196
|
-
Directive,
|
|
31197
30254
|
DomElementSchemaRegistry,
|
|
31198
30255
|
DynamicImportExpr,
|
|
31199
30256
|
EOF,
|
|
@@ -31241,8 +30298,6 @@ publishFacade(_global);
|
|
|
31241
30298
|
NodeWithI18n,
|
|
31242
30299
|
NonNullAssert,
|
|
31243
30300
|
NotExpr,
|
|
31244
|
-
ParenthesizedExpr,
|
|
31245
|
-
ParenthesizedExpression,
|
|
31246
30301
|
ParseError,
|
|
31247
30302
|
ParseErrorLevel,
|
|
31248
30303
|
ParseLocation,
|
|
@@ -31260,6 +30315,7 @@ publishFacade(_global);
|
|
|
31260
30315
|
PrefixNot,
|
|
31261
30316
|
PropertyRead,
|
|
31262
30317
|
PropertyWrite,
|
|
30318
|
+
R3BoundTarget,
|
|
31263
30319
|
R3Identifiers,
|
|
31264
30320
|
R3NgModuleMetadataKind,
|
|
31265
30321
|
R3SelectorScopeMode,
|
|
@@ -31280,7 +30336,6 @@ publishFacade(_global);
|
|
|
31280
30336
|
SelectorContext,
|
|
31281
30337
|
SelectorListContext,
|
|
31282
30338
|
SelectorMatcher,
|
|
31283
|
-
SelectorlessMatcher,
|
|
31284
30339
|
Serializer,
|
|
31285
30340
|
SplitInterpolation,
|
|
31286
30341
|
Statement,
|
|
@@ -31288,7 +30343,6 @@ publishFacade(_global);
|
|
|
31288
30343
|
StringToken,
|
|
31289
30344
|
StringTokenKind,
|
|
31290
30345
|
TagContentType,
|
|
31291
|
-
TaggedTemplateLiteral,
|
|
31292
30346
|
TaggedTemplateLiteralExpr,
|
|
31293
30347
|
TemplateBindingParseResult,
|
|
31294
30348
|
TemplateLiteral,
|
|
@@ -31302,18 +30356,15 @@ publishFacade(_global);
|
|
|
31302
30356
|
TmplAstBoundDeferredTrigger,
|
|
31303
30357
|
TmplAstBoundEvent,
|
|
31304
30358
|
TmplAstBoundText,
|
|
31305
|
-
TmplAstComponent,
|
|
31306
30359
|
TmplAstContent,
|
|
31307
30360
|
TmplAstDeferredBlock,
|
|
31308
30361
|
TmplAstDeferredBlockError,
|
|
31309
30362
|
TmplAstDeferredBlockLoading,
|
|
31310
30363
|
TmplAstDeferredBlockPlaceholder,
|
|
31311
30364
|
TmplAstDeferredTrigger,
|
|
31312
|
-
TmplAstDirective,
|
|
31313
30365
|
TmplAstElement,
|
|
31314
30366
|
TmplAstForLoopBlock,
|
|
31315
30367
|
TmplAstForLoopBlockEmpty,
|
|
31316
|
-
TmplAstHostElement,
|
|
31317
30368
|
TmplAstHoverDeferredTrigger,
|
|
31318
30369
|
TmplAstIcu,
|
|
31319
30370
|
TmplAstIdleDeferredTrigger,
|
|
@@ -31349,8 +30400,6 @@ publishFacade(_global);
|
|
|
31349
30400
|
VariableBinding,
|
|
31350
30401
|
Version,
|
|
31351
30402
|
ViewEncapsulation,
|
|
31352
|
-
VoidExpr,
|
|
31353
|
-
VoidExpression,
|
|
31354
30403
|
WrappedNodeExpr,
|
|
31355
30404
|
WriteKeyExpr,
|
|
31356
30405
|
WritePropExpr,
|
|
@@ -31413,6 +30462,7 @@ publishFacade(_global);
|
|
|
31413
30462
|
publishFacade,
|
|
31414
30463
|
r3JitTypeSourceSpan,
|
|
31415
30464
|
sanitizeIdentifier,
|
|
30465
|
+
setEnableTemplateSourceLocations,
|
|
31416
30466
|
splitNsName,
|
|
31417
30467
|
tmplAstVisitAll,
|
|
31418
30468
|
verifyHostBindings,
|
|
@@ -31422,7 +30472,7 @@ publishFacade(_global);
|
|
|
31422
30472
|
|
|
31423
30473
|
@angular/compiler/fesm2022/compiler.mjs:
|
|
31424
30474
|
(**
|
|
31425
|
-
* @license Angular
|
|
30475
|
+
* @license Angular v19.2.14
|
|
31426
30476
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
31427
30477
|
* License: MIT
|
|
31428
30478
|
*)
|