@angular/compiler 20.1.0-next.1 → 20.1.0-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/compiler.mjs +385 -268
- package/fesm2022/compiler.mjs.map +1 -1
- package/index.d.ts +39 -23
- package/package.json +1 -1
package/fesm2022/compiler.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v20.1.0-next.
|
|
2
|
+
* @license Angular v20.1.0-next.3
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -961,6 +961,15 @@ var BinaryOperator;
|
|
|
961
961
|
BinaryOperator[BinaryOperator["NullishCoalesce"] = 18] = "NullishCoalesce";
|
|
962
962
|
BinaryOperator[BinaryOperator["Exponentiation"] = 19] = "Exponentiation";
|
|
963
963
|
BinaryOperator[BinaryOperator["In"] = 20] = "In";
|
|
964
|
+
BinaryOperator[BinaryOperator["AdditionAssignment"] = 21] = "AdditionAssignment";
|
|
965
|
+
BinaryOperator[BinaryOperator["SubtractionAssignment"] = 22] = "SubtractionAssignment";
|
|
966
|
+
BinaryOperator[BinaryOperator["MultiplicationAssignment"] = 23] = "MultiplicationAssignment";
|
|
967
|
+
BinaryOperator[BinaryOperator["DivisionAssignment"] = 24] = "DivisionAssignment";
|
|
968
|
+
BinaryOperator[BinaryOperator["RemainderAssignment"] = 25] = "RemainderAssignment";
|
|
969
|
+
BinaryOperator[BinaryOperator["ExponentiationAssignment"] = 26] = "ExponentiationAssignment";
|
|
970
|
+
BinaryOperator[BinaryOperator["AndAssignment"] = 27] = "AndAssignment";
|
|
971
|
+
BinaryOperator[BinaryOperator["OrAssignment"] = 28] = "OrAssignment";
|
|
972
|
+
BinaryOperator[BinaryOperator["NullishCoalesceAssignment"] = 29] = "NullishCoalesceAssignment";
|
|
964
973
|
})(BinaryOperator || (BinaryOperator = {}));
|
|
965
974
|
function nullSafeIsEquivalent(base, other) {
|
|
966
975
|
if (base == null || other == null) {
|
|
@@ -1680,6 +1689,19 @@ class BinaryOperatorExpr extends Expression {
|
|
|
1680
1689
|
clone() {
|
|
1681
1690
|
return new BinaryOperatorExpr(this.operator, this.lhs.clone(), this.rhs.clone(), this.type, this.sourceSpan);
|
|
1682
1691
|
}
|
|
1692
|
+
isAssignment() {
|
|
1693
|
+
const op = this.operator;
|
|
1694
|
+
return (op === BinaryOperator.Assign ||
|
|
1695
|
+
op === BinaryOperator.AdditionAssignment ||
|
|
1696
|
+
op === BinaryOperator.SubtractionAssignment ||
|
|
1697
|
+
op === BinaryOperator.MultiplicationAssignment ||
|
|
1698
|
+
op === BinaryOperator.DivisionAssignment ||
|
|
1699
|
+
op === BinaryOperator.RemainderAssignment ||
|
|
1700
|
+
op === BinaryOperator.ExponentiationAssignment ||
|
|
1701
|
+
op === BinaryOperator.AndAssignment ||
|
|
1702
|
+
op === BinaryOperator.OrAssignment ||
|
|
1703
|
+
op === BinaryOperator.NullishCoalesceAssignment);
|
|
1704
|
+
}
|
|
1683
1705
|
}
|
|
1684
1706
|
class ReadPropExpr extends Expression {
|
|
1685
1707
|
receiver;
|
|
@@ -2596,6 +2618,23 @@ class Identifiers {
|
|
|
2596
2618
|
static element = { name: 'ɵɵelement', moduleName: CORE };
|
|
2597
2619
|
static elementStart = { name: 'ɵɵelementStart', moduleName: CORE };
|
|
2598
2620
|
static elementEnd = { name: 'ɵɵelementEnd', moduleName: CORE };
|
|
2621
|
+
static domElement = { name: 'ɵɵdomElement', moduleName: CORE };
|
|
2622
|
+
static domElementStart = { name: 'ɵɵdomElementStart', moduleName: CORE };
|
|
2623
|
+
static domElementEnd = { name: 'ɵɵdomElementEnd', moduleName: CORE };
|
|
2624
|
+
static domElementContainer = {
|
|
2625
|
+
name: 'ɵɵdomElementContainer',
|
|
2626
|
+
moduleName: CORE,
|
|
2627
|
+
};
|
|
2628
|
+
static domElementContainerStart = {
|
|
2629
|
+
name: 'ɵɵdomElementContainerStart',
|
|
2630
|
+
moduleName: CORE,
|
|
2631
|
+
};
|
|
2632
|
+
static domElementContainerEnd = {
|
|
2633
|
+
name: 'ɵɵdomElementContainerEnd',
|
|
2634
|
+
moduleName: CORE,
|
|
2635
|
+
};
|
|
2636
|
+
static domTemplate = { name: 'ɵɵdomTemplate', moduleName: CORE };
|
|
2637
|
+
static domListener = { name: 'ɵɵdomListener', moduleName: CORE };
|
|
2599
2638
|
static advance = { name: 'ɵɵadvance', moduleName: CORE };
|
|
2600
2639
|
static syntheticHostProperty = {
|
|
2601
2640
|
name: 'ɵɵsyntheticHostProperty',
|
|
@@ -3210,6 +3249,38 @@ class _EmittedLine {
|
|
|
3210
3249
|
this.indent = indent;
|
|
3211
3250
|
}
|
|
3212
3251
|
}
|
|
3252
|
+
const BINARY_OPERATORS$1 = new Map([
|
|
3253
|
+
[BinaryOperator.And, '&&'],
|
|
3254
|
+
[BinaryOperator.Bigger, '>'],
|
|
3255
|
+
[BinaryOperator.BiggerEquals, '>='],
|
|
3256
|
+
[BinaryOperator.BitwiseOr, '|'],
|
|
3257
|
+
[BinaryOperator.BitwiseAnd, '&'],
|
|
3258
|
+
[BinaryOperator.Divide, '/'],
|
|
3259
|
+
[BinaryOperator.Assign, '='],
|
|
3260
|
+
[BinaryOperator.Equals, '=='],
|
|
3261
|
+
[BinaryOperator.Identical, '==='],
|
|
3262
|
+
[BinaryOperator.Lower, '<'],
|
|
3263
|
+
[BinaryOperator.LowerEquals, '<='],
|
|
3264
|
+
[BinaryOperator.Minus, '-'],
|
|
3265
|
+
[BinaryOperator.Modulo, '%'],
|
|
3266
|
+
[BinaryOperator.Exponentiation, '**'],
|
|
3267
|
+
[BinaryOperator.Multiply, '*'],
|
|
3268
|
+
[BinaryOperator.NotEquals, '!='],
|
|
3269
|
+
[BinaryOperator.NotIdentical, '!=='],
|
|
3270
|
+
[BinaryOperator.NullishCoalesce, '??'],
|
|
3271
|
+
[BinaryOperator.Or, '||'],
|
|
3272
|
+
[BinaryOperator.Plus, '+'],
|
|
3273
|
+
[BinaryOperator.In, 'in'],
|
|
3274
|
+
[BinaryOperator.AdditionAssignment, '+='],
|
|
3275
|
+
[BinaryOperator.SubtractionAssignment, '-='],
|
|
3276
|
+
[BinaryOperator.MultiplicationAssignment, '*='],
|
|
3277
|
+
[BinaryOperator.DivisionAssignment, '/='],
|
|
3278
|
+
[BinaryOperator.RemainderAssignment, '%='],
|
|
3279
|
+
[BinaryOperator.ExponentiationAssignment, '**='],
|
|
3280
|
+
[BinaryOperator.AndAssignment, '&&='],
|
|
3281
|
+
[BinaryOperator.OrAssignment, '||='],
|
|
3282
|
+
[BinaryOperator.NullishCoalesceAssignment, '??='],
|
|
3283
|
+
]);
|
|
3213
3284
|
class EmitterVisitorContext {
|
|
3214
3285
|
_indent;
|
|
3215
3286
|
static createRoot() {
|
|
@@ -3532,79 +3603,15 @@ class AbstractEmitterVisitor {
|
|
|
3532
3603
|
return null;
|
|
3533
3604
|
}
|
|
3534
3605
|
visitBinaryOperatorExpr(ast, ctx) {
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
opStr = '=';
|
|
3539
|
-
break;
|
|
3540
|
-
case BinaryOperator.Equals:
|
|
3541
|
-
opStr = '==';
|
|
3542
|
-
break;
|
|
3543
|
-
case BinaryOperator.Identical:
|
|
3544
|
-
opStr = '===';
|
|
3545
|
-
break;
|
|
3546
|
-
case BinaryOperator.NotEquals:
|
|
3547
|
-
opStr = '!=';
|
|
3548
|
-
break;
|
|
3549
|
-
case BinaryOperator.NotIdentical:
|
|
3550
|
-
opStr = '!==';
|
|
3551
|
-
break;
|
|
3552
|
-
case BinaryOperator.And:
|
|
3553
|
-
opStr = '&&';
|
|
3554
|
-
break;
|
|
3555
|
-
case BinaryOperator.BitwiseOr:
|
|
3556
|
-
opStr = '|';
|
|
3557
|
-
break;
|
|
3558
|
-
case BinaryOperator.BitwiseAnd:
|
|
3559
|
-
opStr = '&';
|
|
3560
|
-
break;
|
|
3561
|
-
case BinaryOperator.Or:
|
|
3562
|
-
opStr = '||';
|
|
3563
|
-
break;
|
|
3564
|
-
case BinaryOperator.Plus:
|
|
3565
|
-
opStr = '+';
|
|
3566
|
-
break;
|
|
3567
|
-
case BinaryOperator.Minus:
|
|
3568
|
-
opStr = '-';
|
|
3569
|
-
break;
|
|
3570
|
-
case BinaryOperator.Divide:
|
|
3571
|
-
opStr = '/';
|
|
3572
|
-
break;
|
|
3573
|
-
case BinaryOperator.Multiply:
|
|
3574
|
-
opStr = '*';
|
|
3575
|
-
break;
|
|
3576
|
-
case BinaryOperator.Modulo:
|
|
3577
|
-
opStr = '%';
|
|
3578
|
-
break;
|
|
3579
|
-
case BinaryOperator.Exponentiation:
|
|
3580
|
-
opStr = '**';
|
|
3581
|
-
break;
|
|
3582
|
-
case BinaryOperator.Lower:
|
|
3583
|
-
opStr = '<';
|
|
3584
|
-
break;
|
|
3585
|
-
case BinaryOperator.LowerEquals:
|
|
3586
|
-
opStr = '<=';
|
|
3587
|
-
break;
|
|
3588
|
-
case BinaryOperator.Bigger:
|
|
3589
|
-
opStr = '>';
|
|
3590
|
-
break;
|
|
3591
|
-
case BinaryOperator.BiggerEquals:
|
|
3592
|
-
opStr = '>=';
|
|
3593
|
-
break;
|
|
3594
|
-
case BinaryOperator.NullishCoalesce:
|
|
3595
|
-
opStr = '??';
|
|
3596
|
-
break;
|
|
3597
|
-
case BinaryOperator.In:
|
|
3598
|
-
opStr = 'in';
|
|
3599
|
-
break;
|
|
3600
|
-
default:
|
|
3601
|
-
throw new Error(`Unknown operator ${ast.operator}`);
|
|
3606
|
+
const operator = BINARY_OPERATORS$1.get(ast.operator);
|
|
3607
|
+
if (!operator) {
|
|
3608
|
+
throw new Error(`Unknown operator ${ast.operator}`);
|
|
3602
3609
|
}
|
|
3603
3610
|
const parens = ast !== this.lastIfCondition;
|
|
3604
3611
|
if (parens)
|
|
3605
3612
|
ctx.print(ast, `(`);
|
|
3606
3613
|
ast.lhs.visitExpression(this, ctx);
|
|
3607
|
-
ctx.print(ast, ` ${
|
|
3614
|
+
ctx.print(ast, ` ${operator} `);
|
|
3608
3615
|
ast.rhs.visitExpression(this, ctx);
|
|
3609
3616
|
if (parens)
|
|
3610
3617
|
ctx.print(ast, `)`);
|
|
@@ -3969,18 +3976,6 @@ function getInjectFn(target) {
|
|
|
3969
3976
|
}
|
|
3970
3977
|
}
|
|
3971
3978
|
|
|
3972
|
-
class ParserError {
|
|
3973
|
-
input;
|
|
3974
|
-
errLocation;
|
|
3975
|
-
ctxLocation;
|
|
3976
|
-
message;
|
|
3977
|
-
constructor(message, input, errLocation, ctxLocation) {
|
|
3978
|
-
this.input = input;
|
|
3979
|
-
this.errLocation = errLocation;
|
|
3980
|
-
this.ctxLocation = ctxLocation;
|
|
3981
|
-
this.message = `Parser Error: ${message} ${errLocation} [${input}] in ${ctxLocation}`;
|
|
3982
|
-
}
|
|
3983
|
-
}
|
|
3984
3979
|
class ParseSpan {
|
|
3985
3980
|
start;
|
|
3986
3981
|
end;
|
|
@@ -4199,6 +4194,18 @@ class Binary extends AST {
|
|
|
4199
4194
|
visit(visitor, context = null) {
|
|
4200
4195
|
return visitor.visitBinary(this, context);
|
|
4201
4196
|
}
|
|
4197
|
+
static isAssignmentOperation(op) {
|
|
4198
|
+
return (op === '=' ||
|
|
4199
|
+
op === '+=' ||
|
|
4200
|
+
op === '-=' ||
|
|
4201
|
+
op === '*=' ||
|
|
4202
|
+
op === '/=' ||
|
|
4203
|
+
op === '%=' ||
|
|
4204
|
+
op === '**=' ||
|
|
4205
|
+
op === '&&=' ||
|
|
4206
|
+
op === '||=' ||
|
|
4207
|
+
op === '??=');
|
|
4208
|
+
}
|
|
4202
4209
|
}
|
|
4203
4210
|
/**
|
|
4204
4211
|
* For backwards compatibility reasons, `Unary` inherits from `Binary` and mimics the binary AST
|
|
@@ -11148,6 +11155,14 @@ var CompilationJobKind;
|
|
|
11148
11155
|
CompilationJobKind[CompilationJobKind["Host"] = 1] = "Host";
|
|
11149
11156
|
CompilationJobKind[CompilationJobKind["Both"] = 2] = "Both";
|
|
11150
11157
|
})(CompilationJobKind || (CompilationJobKind = {}));
|
|
11158
|
+
/** Possible modes in which a component's template can be compiled. */
|
|
11159
|
+
var TemplateCompilationMode;
|
|
11160
|
+
(function (TemplateCompilationMode) {
|
|
11161
|
+
/** Supports the full instruction set, including directives. */
|
|
11162
|
+
TemplateCompilationMode[TemplateCompilationMode["Full"] = 0] = "Full";
|
|
11163
|
+
/** Uses a narrower instruction set that doesn't support directives and allows optimizations. */
|
|
11164
|
+
TemplateCompilationMode[TemplateCompilationMode["DomOnly"] = 1] = "DomOnly";
|
|
11165
|
+
})(TemplateCompilationMode || (TemplateCompilationMode = {}));
|
|
11151
11166
|
/**
|
|
11152
11167
|
* An entire ongoing compilation, which will result in one or more template functions when complete.
|
|
11153
11168
|
* Contains one or more corresponding compilation units.
|
|
@@ -11156,10 +11171,12 @@ class CompilationJob {
|
|
|
11156
11171
|
componentName;
|
|
11157
11172
|
pool;
|
|
11158
11173
|
compatibility;
|
|
11159
|
-
|
|
11174
|
+
mode;
|
|
11175
|
+
constructor(componentName, pool, compatibility, mode) {
|
|
11160
11176
|
this.componentName = componentName;
|
|
11161
11177
|
this.pool = pool;
|
|
11162
11178
|
this.compatibility = compatibility;
|
|
11179
|
+
this.mode = mode;
|
|
11163
11180
|
}
|
|
11164
11181
|
kind = CompilationJobKind.Both;
|
|
11165
11182
|
/**
|
|
@@ -11184,8 +11201,8 @@ class ComponentCompilationJob extends CompilationJob {
|
|
|
11184
11201
|
allDeferrableDepsFn;
|
|
11185
11202
|
relativeTemplatePath;
|
|
11186
11203
|
enableDebugLocations;
|
|
11187
|
-
constructor(componentName, pool, compatibility, relativeContextFilePath, i18nUseExternalIds, deferMeta, allDeferrableDepsFn, relativeTemplatePath, enableDebugLocations) {
|
|
11188
|
-
super(componentName, pool, compatibility);
|
|
11204
|
+
constructor(componentName, pool, compatibility, mode, relativeContextFilePath, i18nUseExternalIds, deferMeta, allDeferrableDepsFn, relativeTemplatePath, enableDebugLocations) {
|
|
11205
|
+
super(componentName, pool, compatibility, mode);
|
|
11189
11206
|
this.relativeContextFilePath = relativeContextFilePath;
|
|
11190
11207
|
this.i18nUseExternalIds = i18nUseExternalIds;
|
|
11191
11208
|
this.deferMeta = deferMeta;
|
|
@@ -11330,8 +11347,8 @@ class ViewCompilationUnit extends CompilationUnit {
|
|
|
11330
11347
|
* Compilation-in-progress of a host binding, which contains a single unit for that host binding.
|
|
11331
11348
|
*/
|
|
11332
11349
|
class HostBindingCompilationJob extends CompilationJob {
|
|
11333
|
-
constructor(componentName, pool, compatibility) {
|
|
11334
|
-
super(componentName, pool, compatibility);
|
|
11350
|
+
constructor(componentName, pool, compatibility, mode) {
|
|
11351
|
+
super(componentName, pool, compatibility, mode);
|
|
11335
11352
|
this.root = new HostBindingCompilationUnit(this);
|
|
11336
11353
|
}
|
|
11337
11354
|
kind = CompilationJobKind.Host;
|
|
@@ -11764,6 +11781,14 @@ const CHAIN_COMPATIBILITY = new Map([
|
|
|
11764
11781
|
[Identifiers.declareLet, Identifiers.declareLet],
|
|
11765
11782
|
[Identifiers.conditionalCreate, Identifiers.conditionalBranchCreate],
|
|
11766
11783
|
[Identifiers.conditionalBranchCreate, Identifiers.conditionalBranchCreate],
|
|
11784
|
+
[Identifiers.domElement, Identifiers.domElement],
|
|
11785
|
+
[Identifiers.domElementStart, Identifiers.domElementStart],
|
|
11786
|
+
[Identifiers.domElementEnd, Identifiers.domElementEnd],
|
|
11787
|
+
[Identifiers.domElementContainer, Identifiers.domElementContainer],
|
|
11788
|
+
[Identifiers.domElementContainerStart, Identifiers.domElementContainerStart],
|
|
11789
|
+
[Identifiers.domElementContainerEnd, Identifiers.domElementContainerEnd],
|
|
11790
|
+
[Identifiers.domListener, Identifiers.domListener],
|
|
11791
|
+
[Identifiers.domTemplate, Identifiers.domTemplate],
|
|
11767
11792
|
]);
|
|
11768
11793
|
/**
|
|
11769
11794
|
* Chaining results in repeated call expressions, causing a deep AST of receiver expressions. To prevent running out of
|
|
@@ -11936,6 +11961,15 @@ const BINARY_OPERATORS = new Map([
|
|
|
11936
11961
|
['||', BinaryOperator.Or],
|
|
11937
11962
|
['+', BinaryOperator.Plus],
|
|
11938
11963
|
['in', BinaryOperator.In],
|
|
11964
|
+
['+=', BinaryOperator.AdditionAssignment],
|
|
11965
|
+
['-=', BinaryOperator.SubtractionAssignment],
|
|
11966
|
+
['*=', BinaryOperator.MultiplicationAssignment],
|
|
11967
|
+
['/=', BinaryOperator.DivisionAssignment],
|
|
11968
|
+
['%=', BinaryOperator.RemainderAssignment],
|
|
11969
|
+
['**=', BinaryOperator.ExponentiationAssignment],
|
|
11970
|
+
['&&=', BinaryOperator.AndAssignment],
|
|
11971
|
+
['||=', BinaryOperator.OrAssignment],
|
|
11972
|
+
['??=', BinaryOperator.NullishCoalesceAssignment],
|
|
11939
11973
|
]);
|
|
11940
11974
|
function namespaceForKey(namespacePrefixKey) {
|
|
11941
11975
|
const NAMESPACES = new Map([
|
|
@@ -15714,13 +15748,6 @@ const NAMED_ENTITIES = {
|
|
|
15714
15748
|
const NGSP_UNICODE = '\uE500';
|
|
15715
15749
|
NAMED_ENTITIES['ngsp'] = NGSP_UNICODE;
|
|
15716
15750
|
|
|
15717
|
-
class TokenError extends ParseError {
|
|
15718
|
-
tokenType;
|
|
15719
|
-
constructor(errorMsg, tokenType, span) {
|
|
15720
|
-
super(span, errorMsg);
|
|
15721
|
-
this.tokenType = tokenType;
|
|
15722
|
-
}
|
|
15723
|
-
}
|
|
15724
15751
|
class TokenizeResult {
|
|
15725
15752
|
tokens;
|
|
15726
15753
|
errors;
|
|
@@ -15752,12 +15779,6 @@ var CharacterReferenceType;
|
|
|
15752
15779
|
CharacterReferenceType["HEX"] = "hexadecimal";
|
|
15753
15780
|
CharacterReferenceType["DEC"] = "decimal";
|
|
15754
15781
|
})(CharacterReferenceType || (CharacterReferenceType = {}));
|
|
15755
|
-
class _ControlFlowError {
|
|
15756
|
-
error;
|
|
15757
|
-
constructor(error) {
|
|
15758
|
-
this.error = error;
|
|
15759
|
-
}
|
|
15760
|
-
}
|
|
15761
15782
|
// See https://www.w3.org/TR/html51/syntax.html#writing-html-documents
|
|
15762
15783
|
class _Tokenizer {
|
|
15763
15784
|
_getTagDefinition;
|
|
@@ -16067,10 +16088,10 @@ class _Tokenizer {
|
|
|
16067
16088
|
}
|
|
16068
16089
|
_endToken(parts, end) {
|
|
16069
16090
|
if (this._currentTokenStart === null) {
|
|
16070
|
-
throw new
|
|
16091
|
+
throw new ParseError(this._cursor.getSpan(end), 'Programming error - attempted to end a token when there was no start to the token');
|
|
16071
16092
|
}
|
|
16072
16093
|
if (this._currentTokenType === null) {
|
|
16073
|
-
throw new
|
|
16094
|
+
throw new ParseError(this._cursor.getSpan(this._currentTokenStart), 'Programming error - attempted to end a token which has no token type');
|
|
16074
16095
|
}
|
|
16075
16096
|
const token = {
|
|
16076
16097
|
type: this._currentTokenType,
|
|
@@ -16086,17 +16107,17 @@ class _Tokenizer {
|
|
|
16086
16107
|
if (this._isInExpansionForm()) {
|
|
16087
16108
|
msg += ` (Do you have an unescaped "{" in your template? Use "{{ '{' }}") to escape it.)`;
|
|
16088
16109
|
}
|
|
16089
|
-
const error = new
|
|
16110
|
+
const error = new ParseError(span, msg);
|
|
16090
16111
|
this._currentTokenStart = null;
|
|
16091
16112
|
this._currentTokenType = null;
|
|
16092
|
-
return
|
|
16113
|
+
return error;
|
|
16093
16114
|
}
|
|
16094
16115
|
handleError(e) {
|
|
16095
16116
|
if (e instanceof CursorError) {
|
|
16096
16117
|
e = this._createError(e.msg, this._cursor.getSpan(e.cursor));
|
|
16097
16118
|
}
|
|
16098
|
-
if (e instanceof
|
|
16099
|
-
this.errors.push(e
|
|
16119
|
+
if (e instanceof ParseError) {
|
|
16120
|
+
this.errors.push(e);
|
|
16100
16121
|
}
|
|
16101
16122
|
else {
|
|
16102
16123
|
throw e;
|
|
@@ -16336,7 +16357,7 @@ class _Tokenizer {
|
|
|
16336
16357
|
}
|
|
16337
16358
|
}
|
|
16338
16359
|
catch (e) {
|
|
16339
|
-
if (e instanceof
|
|
16360
|
+
if (e instanceof ParseError) {
|
|
16340
16361
|
if (openToken) {
|
|
16341
16362
|
// We errored before we could close the opening tag, so it is incomplete.
|
|
16342
16363
|
openToken.type =
|
|
@@ -17117,7 +17138,7 @@ let Parser$1 = class Parser {
|
|
|
17117
17138
|
const tokenizeResult = tokenize(source, url, this.getTagDefinition, options);
|
|
17118
17139
|
const parser = new _TreeBuilder(tokenizeResult.tokens, this.getTagDefinition);
|
|
17119
17140
|
parser.build();
|
|
17120
|
-
return new ParseTreeResult(parser.rootNodes, tokenizeResult.errors
|
|
17141
|
+
return new ParseTreeResult(parser.rootNodes, [...tokenizeResult.errors, ...parser.errors]);
|
|
17121
17142
|
}
|
|
17122
17143
|
};
|
|
17123
17144
|
class _TreeBuilder {
|
|
@@ -18208,13 +18229,17 @@ class _Scanner {
|
|
|
18208
18229
|
case $HASH:
|
|
18209
18230
|
return this.scanPrivateIdentifier();
|
|
18210
18231
|
case $PLUS:
|
|
18232
|
+
return this.scanComplexOperator(start, '+', $EQ, '=');
|
|
18211
18233
|
case $MINUS:
|
|
18234
|
+
return this.scanComplexOperator(start, '-', $EQ, '=');
|
|
18212
18235
|
case $SLASH:
|
|
18236
|
+
return this.scanComplexOperator(start, '/', $EQ, '=');
|
|
18213
18237
|
case $PERCENT:
|
|
18238
|
+
return this.scanComplexOperator(start, '%', $EQ, '=');
|
|
18214
18239
|
case $CARET:
|
|
18215
|
-
return this.scanOperator(start,
|
|
18240
|
+
return this.scanOperator(start, '^');
|
|
18216
18241
|
case $STAR:
|
|
18217
|
-
return this.
|
|
18242
|
+
return this.scanStar(start);
|
|
18218
18243
|
case $QUESTION:
|
|
18219
18244
|
return this.scanQuestion(start);
|
|
18220
18245
|
case $LT:
|
|
@@ -18224,9 +18249,9 @@ class _Scanner {
|
|
|
18224
18249
|
case $EQ:
|
|
18225
18250
|
return this.scanComplexOperator(start, String.fromCharCode(peek), $EQ, '=', $EQ, '=');
|
|
18226
18251
|
case $AMPERSAND:
|
|
18227
|
-
return this.scanComplexOperator(start, '&', $AMPERSAND, '&');
|
|
18252
|
+
return this.scanComplexOperator(start, '&', $AMPERSAND, '&', $EQ, '=');
|
|
18228
18253
|
case $BAR:
|
|
18229
|
-
return this.scanComplexOperator(start, '|', $BAR, '|');
|
|
18254
|
+
return this.scanComplexOperator(start, '|', $BAR, '|', $EQ, '=');
|
|
18230
18255
|
case $NBSP:
|
|
18231
18256
|
while (isWhitespace(this.peek))
|
|
18232
18257
|
this.advance();
|
|
@@ -18372,13 +18397,23 @@ class _Scanner {
|
|
|
18372
18397
|
}
|
|
18373
18398
|
scanQuestion(start) {
|
|
18374
18399
|
this.advance();
|
|
18375
|
-
let
|
|
18376
|
-
//
|
|
18377
|
-
if (this.peek === $QUESTION
|
|
18378
|
-
|
|
18400
|
+
let operator = '?';
|
|
18401
|
+
// `a ?? b` or `a ??= b`.
|
|
18402
|
+
if (this.peek === $QUESTION) {
|
|
18403
|
+
operator += '?';
|
|
18379
18404
|
this.advance();
|
|
18405
|
+
// @ts-expect-error
|
|
18406
|
+
if (this.peek === $EQ) {
|
|
18407
|
+
operator += '=';
|
|
18408
|
+
this.advance();
|
|
18409
|
+
}
|
|
18380
18410
|
}
|
|
18381
|
-
|
|
18411
|
+
else if (this.peek === $PERIOD) {
|
|
18412
|
+
// `a?.b`
|
|
18413
|
+
operator += '.';
|
|
18414
|
+
this.advance();
|
|
18415
|
+
}
|
|
18416
|
+
return newOperatorToken(start, this.index, operator);
|
|
18382
18417
|
}
|
|
18383
18418
|
scanTemplateLiteralPart(start) {
|
|
18384
18419
|
let buffer = '';
|
|
@@ -18442,6 +18477,25 @@ class _Scanner {
|
|
|
18442
18477
|
buffer += String.fromCharCode(unescapedCode);
|
|
18443
18478
|
return buffer;
|
|
18444
18479
|
}
|
|
18480
|
+
scanStar(start) {
|
|
18481
|
+
this.advance();
|
|
18482
|
+
// `*`, `**`, `**=` or `*=`
|
|
18483
|
+
let operator = '*';
|
|
18484
|
+
if (this.peek === $STAR) {
|
|
18485
|
+
operator += '*';
|
|
18486
|
+
this.advance();
|
|
18487
|
+
// @ts-expect-error
|
|
18488
|
+
if (this.peek === $EQ) {
|
|
18489
|
+
operator += '=';
|
|
18490
|
+
this.advance();
|
|
18491
|
+
}
|
|
18492
|
+
}
|
|
18493
|
+
else if (this.peek === $EQ) {
|
|
18494
|
+
operator += '=';
|
|
18495
|
+
this.advance();
|
|
18496
|
+
}
|
|
18497
|
+
return newOperatorToken(start, this.index, operator);
|
|
18498
|
+
}
|
|
18445
18499
|
}
|
|
18446
18500
|
function isIdentifierStart(code) {
|
|
18447
18501
|
return (($a <= code && code <= $z) ||
|
|
@@ -18502,6 +18556,9 @@ class TemplateBindingParseResult {
|
|
|
18502
18556
|
this.errors = errors;
|
|
18503
18557
|
}
|
|
18504
18558
|
}
|
|
18559
|
+
function getLocation(span) {
|
|
18560
|
+
return span.start.toString() || '(unknown)';
|
|
18561
|
+
}
|
|
18505
18562
|
class Parser {
|
|
18506
18563
|
_lexer;
|
|
18507
18564
|
_supportsDirectPipeReferences;
|
|
@@ -18509,18 +18566,18 @@ class Parser {
|
|
|
18509
18566
|
this._lexer = _lexer;
|
|
18510
18567
|
this._supportsDirectPipeReferences = _supportsDirectPipeReferences;
|
|
18511
18568
|
}
|
|
18512
|
-
parseAction(input,
|
|
18569
|
+
parseAction(input, parseSourceSpan, absoluteOffset, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
|
|
18513
18570
|
const errors = [];
|
|
18514
|
-
this._checkNoInterpolation(errors, input,
|
|
18571
|
+
this._checkNoInterpolation(errors, input, parseSourceSpan, interpolationConfig);
|
|
18515
18572
|
const sourceToLex = this._stripComments(input);
|
|
18516
18573
|
const tokens = this._lexer.tokenize(sourceToLex);
|
|
18517
|
-
const ast = new _ParseAST(input,
|
|
18518
|
-
return new ASTWithSource(ast, input,
|
|
18574
|
+
const ast = new _ParseAST(input, parseSourceSpan, absoluteOffset, tokens, 1 /* ParseFlags.Action */, errors, 0, this._supportsDirectPipeReferences).parseChain();
|
|
18575
|
+
return new ASTWithSource(ast, input, getLocation(parseSourceSpan), absoluteOffset, errors);
|
|
18519
18576
|
}
|
|
18520
|
-
parseBinding(input,
|
|
18577
|
+
parseBinding(input, parseSourceSpan, absoluteOffset, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
|
|
18521
18578
|
const errors = [];
|
|
18522
|
-
const ast = this._parseBindingAst(input,
|
|
18523
|
-
return new ASTWithSource(ast, input,
|
|
18579
|
+
const ast = this._parseBindingAst(input, parseSourceSpan, absoluteOffset, interpolationConfig, errors);
|
|
18580
|
+
return new ASTWithSource(ast, input, getLocation(parseSourceSpan), absoluteOffset, errors);
|
|
18524
18581
|
}
|
|
18525
18582
|
checkSimpleExpression(ast) {
|
|
18526
18583
|
const checker = new SimpleExpressionChecker();
|
|
@@ -18528,20 +18585,20 @@ class Parser {
|
|
|
18528
18585
|
return checker.errors;
|
|
18529
18586
|
}
|
|
18530
18587
|
// Host bindings parsed here
|
|
18531
|
-
parseSimpleBinding(input,
|
|
18588
|
+
parseSimpleBinding(input, parseSourceSpan, absoluteOffset, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
|
|
18532
18589
|
const errors = [];
|
|
18533
|
-
const ast = this._parseBindingAst(input,
|
|
18590
|
+
const ast = this._parseBindingAst(input, parseSourceSpan, absoluteOffset, interpolationConfig, errors);
|
|
18534
18591
|
const simplExpressionErrors = this.checkSimpleExpression(ast);
|
|
18535
18592
|
if (simplExpressionErrors.length > 0) {
|
|
18536
|
-
errors.push(
|
|
18593
|
+
errors.push(getParseError(`Host binding expression cannot contain ${simplExpressionErrors.join(' ')}`, input, '', parseSourceSpan));
|
|
18537
18594
|
}
|
|
18538
|
-
return new ASTWithSource(ast, input,
|
|
18595
|
+
return new ASTWithSource(ast, input, getLocation(parseSourceSpan), absoluteOffset, errors);
|
|
18539
18596
|
}
|
|
18540
|
-
_parseBindingAst(input,
|
|
18541
|
-
this._checkNoInterpolation(errors, input,
|
|
18597
|
+
_parseBindingAst(input, parseSourceSpan, absoluteOffset, interpolationConfig, errors) {
|
|
18598
|
+
this._checkNoInterpolation(errors, input, parseSourceSpan, interpolationConfig);
|
|
18542
18599
|
const sourceToLex = this._stripComments(input);
|
|
18543
18600
|
const tokens = this._lexer.tokenize(sourceToLex);
|
|
18544
|
-
return new _ParseAST(input,
|
|
18601
|
+
return new _ParseAST(input, parseSourceSpan, absoluteOffset, tokens, 0 /* ParseFlags.None */, errors, 0, this._supportsDirectPipeReferences).parseChain();
|
|
18545
18602
|
}
|
|
18546
18603
|
/**
|
|
18547
18604
|
* Parse microsyntax template expression and return a list of bindings or
|
|
@@ -18569,18 +18626,18 @@ class Parser {
|
|
|
18569
18626
|
* @param absoluteKeyOffset start of the `templateKey`
|
|
18570
18627
|
* @param absoluteValueOffset start of the `templateValue`
|
|
18571
18628
|
*/
|
|
18572
|
-
parseTemplateBindings(templateKey, templateValue,
|
|
18629
|
+
parseTemplateBindings(templateKey, templateValue, parseSourceSpan, absoluteKeyOffset, absoluteValueOffset) {
|
|
18573
18630
|
const tokens = this._lexer.tokenize(templateValue);
|
|
18574
18631
|
const errors = [];
|
|
18575
|
-
const parser = new _ParseAST(templateValue,
|
|
18632
|
+
const parser = new _ParseAST(templateValue, parseSourceSpan, absoluteValueOffset, tokens, 0 /* ParseFlags.None */, errors, 0 /* relative offset */, this._supportsDirectPipeReferences);
|
|
18576
18633
|
return parser.parseTemplateBindings({
|
|
18577
18634
|
source: templateKey,
|
|
18578
18635
|
span: new AbsoluteSourceSpan(absoluteKeyOffset, absoluteKeyOffset + templateKey.length),
|
|
18579
18636
|
});
|
|
18580
18637
|
}
|
|
18581
|
-
parseInterpolation(input,
|
|
18638
|
+
parseInterpolation(input, parseSourceSpan, absoluteOffset, interpolatedTokens, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
|
|
18582
18639
|
const errors = [];
|
|
18583
|
-
const { strings, expressions, offsets } = this.splitInterpolation(input,
|
|
18640
|
+
const { strings, expressions, offsets } = this.splitInterpolation(input, parseSourceSpan, errors, interpolatedTokens, interpolationConfig);
|
|
18584
18641
|
if (expressions.length === 0)
|
|
18585
18642
|
return null;
|
|
18586
18643
|
const expressionNodes = [];
|
|
@@ -18588,23 +18645,23 @@ class Parser {
|
|
|
18588
18645
|
const expressionText = expressions[i].text;
|
|
18589
18646
|
const sourceToLex = this._stripComments(expressionText);
|
|
18590
18647
|
const tokens = this._lexer.tokenize(sourceToLex);
|
|
18591
|
-
const ast = new _ParseAST(input,
|
|
18648
|
+
const ast = new _ParseAST(input, parseSourceSpan, absoluteOffset, tokens, 0 /* ParseFlags.None */, errors, offsets[i], this._supportsDirectPipeReferences).parseChain();
|
|
18592
18649
|
expressionNodes.push(ast);
|
|
18593
18650
|
}
|
|
18594
|
-
return this.createInterpolationAst(strings.map((s) => s.text), expressionNodes, input,
|
|
18651
|
+
return this.createInterpolationAst(strings.map((s) => s.text), expressionNodes, input, getLocation(parseSourceSpan), absoluteOffset, errors);
|
|
18595
18652
|
}
|
|
18596
18653
|
/**
|
|
18597
18654
|
* Similar to `parseInterpolation`, but treats the provided string as a single expression
|
|
18598
18655
|
* element that would normally appear within the interpolation prefix and suffix (`{{` and `}}`).
|
|
18599
18656
|
* This is used for parsing the switch expression in ICUs.
|
|
18600
18657
|
*/
|
|
18601
|
-
parseInterpolationExpression(expression,
|
|
18658
|
+
parseInterpolationExpression(expression, parseSourceSpan, absoluteOffset) {
|
|
18602
18659
|
const sourceToLex = this._stripComments(expression);
|
|
18603
18660
|
const tokens = this._lexer.tokenize(sourceToLex);
|
|
18604
18661
|
const errors = [];
|
|
18605
|
-
const ast = new _ParseAST(expression,
|
|
18662
|
+
const ast = new _ParseAST(expression, parseSourceSpan, absoluteOffset, tokens, 0 /* ParseFlags.None */, errors, 0, this._supportsDirectPipeReferences).parseChain();
|
|
18606
18663
|
const strings = ['', '']; // The prefix and suffix strings are both empty
|
|
18607
|
-
return this.createInterpolationAst(strings, [ast], expression,
|
|
18664
|
+
return this.createInterpolationAst(strings, [ast], expression, getLocation(parseSourceSpan), absoluteOffset, errors);
|
|
18608
18665
|
}
|
|
18609
18666
|
createInterpolationAst(strings, expressions, input, location, absoluteOffset, errors) {
|
|
18610
18667
|
const span = new ParseSpan(0, input.length);
|
|
@@ -18618,7 +18675,7 @@ class Parser {
|
|
|
18618
18675
|
* `SplitInterpolation` with splits that look like
|
|
18619
18676
|
* <raw text> <expression> <raw text> ... <raw text> <expression> <raw text>
|
|
18620
18677
|
*/
|
|
18621
|
-
splitInterpolation(input,
|
|
18678
|
+
splitInterpolation(input, parseSourceSpan, errors, interpolatedTokens, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
|
|
18622
18679
|
const strings = [];
|
|
18623
18680
|
const expressions = [];
|
|
18624
18681
|
const offsets = [];
|
|
@@ -18656,7 +18713,7 @@ class Parser {
|
|
|
18656
18713
|
const fullEnd = exprEnd + interpEnd.length;
|
|
18657
18714
|
const text = input.substring(exprStart, exprEnd);
|
|
18658
18715
|
if (text.trim().length === 0) {
|
|
18659
|
-
errors.push(
|
|
18716
|
+
errors.push(getParseError('Blank expressions are not allowed in interpolated strings', input, `at column ${i} in`, parseSourceSpan));
|
|
18660
18717
|
}
|
|
18661
18718
|
expressions.push({ text, start: fullStart, end: fullEnd });
|
|
18662
18719
|
const startInOriginalTemplate = inputToTemplateIndexMap?.get(fullStart) ?? fullStart;
|
|
@@ -18679,9 +18736,11 @@ class Parser {
|
|
|
18679
18736
|
}
|
|
18680
18737
|
return new SplitInterpolation(strings, expressions, offsets);
|
|
18681
18738
|
}
|
|
18682
|
-
wrapLiteralPrimitive(input,
|
|
18739
|
+
wrapLiteralPrimitive(input, sourceSpanOrLocation, absoluteOffset) {
|
|
18683
18740
|
const span = new ParseSpan(0, input == null ? 0 : input.length);
|
|
18684
|
-
return new ASTWithSource(new LiteralPrimitive(span, span.toAbsolute(absoluteOffset), input), input,
|
|
18741
|
+
return new ASTWithSource(new LiteralPrimitive(span, span.toAbsolute(absoluteOffset), input), input, typeof sourceSpanOrLocation === 'string'
|
|
18742
|
+
? sourceSpanOrLocation
|
|
18743
|
+
: getLocation(sourceSpanOrLocation), absoluteOffset, []);
|
|
18685
18744
|
}
|
|
18686
18745
|
_stripComments(input) {
|
|
18687
18746
|
const i = this._commentStart(input);
|
|
@@ -18703,7 +18762,7 @@ class Parser {
|
|
|
18703
18762
|
}
|
|
18704
18763
|
return null;
|
|
18705
18764
|
}
|
|
18706
|
-
_checkNoInterpolation(errors, input,
|
|
18765
|
+
_checkNoInterpolation(errors, input, parseSourceSpan, { start, end }) {
|
|
18707
18766
|
let startIndex = -1;
|
|
18708
18767
|
let endIndex = -1;
|
|
18709
18768
|
for (const charIndex of this._forEachUnquotedChar(input, 0)) {
|
|
@@ -18720,7 +18779,7 @@ class Parser {
|
|
|
18720
18779
|
}
|
|
18721
18780
|
}
|
|
18722
18781
|
if (startIndex > -1 && endIndex > -1) {
|
|
18723
|
-
errors.push(
|
|
18782
|
+
errors.push(getParseError(`Got interpolation (${start}${end}) where expression was expected`, input, `at column ${startIndex} in`, parseSourceSpan));
|
|
18724
18783
|
}
|
|
18725
18784
|
}
|
|
18726
18785
|
/**
|
|
@@ -18779,7 +18838,7 @@ var ParseContextFlags;
|
|
|
18779
18838
|
})(ParseContextFlags || (ParseContextFlags = {}));
|
|
18780
18839
|
class _ParseAST {
|
|
18781
18840
|
input;
|
|
18782
|
-
|
|
18841
|
+
parseSourceSpan;
|
|
18783
18842
|
absoluteOffset;
|
|
18784
18843
|
tokens;
|
|
18785
18844
|
parseFlags;
|
|
@@ -18796,9 +18855,9 @@ class _ParseAST {
|
|
|
18796
18855
|
// and may change for subsequent expressions visited by the parser.
|
|
18797
18856
|
sourceSpanCache = new Map();
|
|
18798
18857
|
index = 0;
|
|
18799
|
-
constructor(input,
|
|
18858
|
+
constructor(input, parseSourceSpan, absoluteOffset, tokens, parseFlags, errors, offset, supportsDirectPipeReferences) {
|
|
18800
18859
|
this.input = input;
|
|
18801
|
-
this.
|
|
18860
|
+
this.parseSourceSpan = parseSourceSpan;
|
|
18802
18861
|
this.absoluteOffset = absoluteOffset;
|
|
18803
18862
|
this.tokens = tokens;
|
|
18804
18863
|
this.parseFlags = parseFlags;
|
|
@@ -18926,6 +18985,9 @@ class _ParseAST {
|
|
|
18926
18985
|
return false;
|
|
18927
18986
|
}
|
|
18928
18987
|
}
|
|
18988
|
+
isAssignmentOperator(token) {
|
|
18989
|
+
return token.type === TokenType.Operator && Binary.isAssignmentOperation(token.strValue);
|
|
18990
|
+
}
|
|
18929
18991
|
expectOperator(operator) {
|
|
18930
18992
|
if (this.consumeOptionalOperator(operator))
|
|
18931
18993
|
return;
|
|
@@ -19409,7 +19471,8 @@ class _ParseAST {
|
|
|
19409
19471
|
});
|
|
19410
19472
|
const nameSpan = this.sourceSpan(nameStart);
|
|
19411
19473
|
if (isSafe) {
|
|
19412
|
-
if (this.
|
|
19474
|
+
if (this.isAssignmentOperator(this.next)) {
|
|
19475
|
+
this.advance();
|
|
19413
19476
|
this.error("The '?.' operator cannot be used in the assignment");
|
|
19414
19477
|
return new EmptyExpr$1(this.span(start), this.sourceSpan(start));
|
|
19415
19478
|
}
|
|
@@ -19418,14 +19481,16 @@ class _ParseAST {
|
|
|
19418
19481
|
}
|
|
19419
19482
|
}
|
|
19420
19483
|
else {
|
|
19421
|
-
if (this.
|
|
19484
|
+
if (this.isAssignmentOperator(this.next)) {
|
|
19485
|
+
const operation = this.next.strValue;
|
|
19486
|
+
this.advance();
|
|
19422
19487
|
if (!(this.parseFlags & 1 /* ParseFlags.Action */)) {
|
|
19423
19488
|
this.error('Bindings cannot contain assignments');
|
|
19424
19489
|
return new EmptyExpr$1(this.span(start), this.sourceSpan(start));
|
|
19425
19490
|
}
|
|
19426
19491
|
const receiver = new PropertyRead(this.span(start), this.sourceSpan(start), nameSpan, readReceiver, id);
|
|
19427
19492
|
const value = this.parseConditional();
|
|
19428
|
-
return new Binary(this.span(start), this.sourceSpan(start),
|
|
19493
|
+
return new Binary(this.span(start), this.sourceSpan(start), operation, receiver, value);
|
|
19429
19494
|
}
|
|
19430
19495
|
else {
|
|
19431
19496
|
return new PropertyRead(this.span(start), this.sourceSpan(start), nameSpan, readReceiver, id);
|
|
@@ -19540,14 +19605,16 @@ class _ParseAST {
|
|
|
19540
19605
|
}
|
|
19541
19606
|
this.rbracketsExpected--;
|
|
19542
19607
|
this.expectCharacter($RBRACKET);
|
|
19543
|
-
if (this.
|
|
19608
|
+
if (this.isAssignmentOperator(this.next)) {
|
|
19609
|
+
const operation = this.next.strValue;
|
|
19610
|
+
this.advance();
|
|
19544
19611
|
if (isSafe) {
|
|
19545
19612
|
this.error("The '?.' operator cannot be used in the assignment");
|
|
19546
19613
|
}
|
|
19547
19614
|
else {
|
|
19548
19615
|
const binaryReceiver = new KeyedRead(this.span(start), this.sourceSpan(start), receiver, key);
|
|
19549
19616
|
const value = this.parseConditional();
|
|
19550
|
-
return new Binary(this.span(start), this.sourceSpan(start),
|
|
19617
|
+
return new Binary(this.span(start), this.sourceSpan(start), operation, binaryReceiver, value);
|
|
19551
19618
|
}
|
|
19552
19619
|
}
|
|
19553
19620
|
else {
|
|
@@ -19611,7 +19678,7 @@ class _ParseAST {
|
|
|
19611
19678
|
const ast = this.parsePipe(); // example: "condition | async"
|
|
19612
19679
|
const { start, end } = ast.span;
|
|
19613
19680
|
const value = this.input.substring(start, end);
|
|
19614
|
-
return new ASTWithSource(ast, value, this.
|
|
19681
|
+
return new ASTWithSource(ast, value, getLocation(this.parseSourceSpan), this.absoluteOffset + start, this.errors);
|
|
19615
19682
|
}
|
|
19616
19683
|
/**
|
|
19617
19684
|
* Return the binding for a variable declared using `as`. Note that the order
|
|
@@ -19715,13 +19782,11 @@ class _ParseAST {
|
|
|
19715
19782
|
* Records an error and skips over the token stream until reaching a recoverable point. See
|
|
19716
19783
|
* `this.skip` for more details on token skipping.
|
|
19717
19784
|
*/
|
|
19718
|
-
error(message, index =
|
|
19719
|
-
this.errors.push(
|
|
19785
|
+
error(message, index = this.index) {
|
|
19786
|
+
this.errors.push(getParseError(message, this.input, this.getErrorLocationText(index), this.parseSourceSpan));
|
|
19720
19787
|
this.skip();
|
|
19721
19788
|
}
|
|
19722
|
-
|
|
19723
|
-
if (index == null)
|
|
19724
|
-
index = this.index;
|
|
19789
|
+
getErrorLocationText(index) {
|
|
19725
19790
|
return index < this.tokens.length
|
|
19726
19791
|
? `at column ${this.tokens[index].index + 1} in`
|
|
19727
19792
|
: `at the end of the expression`;
|
|
@@ -19755,7 +19820,7 @@ class _ParseAST {
|
|
|
19755
19820
|
* none of the calling productions are not expecting the closing token else we will never
|
|
19756
19821
|
* make progress in the case of an extraneous group closing symbol (such as a stray ')').
|
|
19757
19822
|
* That is, we skip a closing symbol if we are not in a grouping production.
|
|
19758
|
-
* -
|
|
19823
|
+
* - Assignment in a `Writable` context
|
|
19759
19824
|
* - In this context, we are able to recover after seeing the `=` operator, which
|
|
19760
19825
|
* signals the presence of an independent rvalue expression following the `=` operator.
|
|
19761
19826
|
*
|
|
@@ -19770,15 +19835,23 @@ class _ParseAST {
|
|
|
19770
19835
|
(this.rparensExpected <= 0 || !n.isCharacter($RPAREN)) &&
|
|
19771
19836
|
(this.rbracesExpected <= 0 || !n.isCharacter($RBRACE)) &&
|
|
19772
19837
|
(this.rbracketsExpected <= 0 || !n.isCharacter($RBRACKET)) &&
|
|
19773
|
-
(!(this.context & ParseContextFlags.Writable) || !
|
|
19838
|
+
(!(this.context & ParseContextFlags.Writable) || !this.isAssignmentOperator(n))) {
|
|
19774
19839
|
if (this.next.isError()) {
|
|
19775
|
-
this.errors.push(
|
|
19840
|
+
this.errors.push(getParseError(this.next.toString(), this.input, this.getErrorLocationText(this.next.index), this.parseSourceSpan));
|
|
19776
19841
|
}
|
|
19777
19842
|
this.advance();
|
|
19778
19843
|
n = this.next;
|
|
19779
19844
|
}
|
|
19780
19845
|
}
|
|
19781
19846
|
}
|
|
19847
|
+
function getParseError(message, input, locationText, parseSourceSpan) {
|
|
19848
|
+
if (locationText.length > 0) {
|
|
19849
|
+
locationText = ` ${locationText} `;
|
|
19850
|
+
}
|
|
19851
|
+
const location = getLocation(parseSourceSpan);
|
|
19852
|
+
const error = `Parser Error: ${message}${locationText}[${input}] in ${location}`;
|
|
19853
|
+
return new ParseError(parseSourceSpan, error);
|
|
19854
|
+
}
|
|
19782
19855
|
class SimpleExpressionChecker extends RecursiveAstVisitor {
|
|
19783
19856
|
errors = [];
|
|
19784
19857
|
visitPipe() {
|
|
@@ -21033,7 +21106,7 @@ class _I18nVisitor {
|
|
|
21033
21106
|
normalizeExpression(token) {
|
|
21034
21107
|
const expression = token.parts[1];
|
|
21035
21108
|
const expr = this._expressionParser.parseBinding(expression,
|
|
21036
|
-
/* location */ token.sourceSpan
|
|
21109
|
+
/* location */ token.sourceSpan,
|
|
21037
21110
|
/* absoluteOffset */ token.sourceSpan.start.offset, this._interpolationConfig);
|
|
21038
21111
|
return serialize(expr);
|
|
21039
21112
|
}
|
|
@@ -21099,15 +21172,6 @@ function extractPlaceholderName(input) {
|
|
|
21099
21172
|
return input.split(_CUSTOM_PH_EXP)[2];
|
|
21100
21173
|
}
|
|
21101
21174
|
|
|
21102
|
-
/**
|
|
21103
|
-
* An i18n error.
|
|
21104
|
-
*/
|
|
21105
|
-
class I18nError extends ParseError {
|
|
21106
|
-
constructor(span, msg) {
|
|
21107
|
-
super(span, msg);
|
|
21108
|
-
}
|
|
21109
|
-
}
|
|
21110
|
-
|
|
21111
21175
|
/**
|
|
21112
21176
|
* Set of tagName|propertyName corresponding to Trusted Types sinks. Properties applying to all
|
|
21113
21177
|
* tags use '*'.
|
|
@@ -21389,7 +21453,7 @@ class I18nMetaVisitor {
|
|
|
21389
21453
|
}
|
|
21390
21454
|
}
|
|
21391
21455
|
_reportError(node, msg) {
|
|
21392
|
-
this._errors.push(new
|
|
21456
|
+
this._errors.push(new ParseError(node.sourceSpan, msg));
|
|
21393
21457
|
}
|
|
21394
21458
|
}
|
|
21395
21459
|
/** I18n separators for metadata **/
|
|
@@ -22973,21 +23037,7 @@ function elementOrContainerBase(instruction, slot, tag, constIndex, localRefInde
|
|
|
22973
23037
|
}
|
|
22974
23038
|
return call(instruction, args, sourceSpan);
|
|
22975
23039
|
}
|
|
22976
|
-
function
|
|
22977
|
-
return call(Identifiers.elementEnd, [], sourceSpan);
|
|
22978
|
-
}
|
|
22979
|
-
function elementContainerStart(slot, constIndex, localRefIndex, sourceSpan) {
|
|
22980
|
-
return elementOrContainerBase(Identifiers.elementContainerStart, slot,
|
|
22981
|
-
/* tag */ null, constIndex, localRefIndex, sourceSpan);
|
|
22982
|
-
}
|
|
22983
|
-
function elementContainer(slot, constIndex, localRefIndex, sourceSpan) {
|
|
22984
|
-
return elementOrContainerBase(Identifiers.elementContainer, slot,
|
|
22985
|
-
/* tag */ null, constIndex, localRefIndex, sourceSpan);
|
|
22986
|
-
}
|
|
22987
|
-
function elementContainerEnd() {
|
|
22988
|
-
return call(Identifiers.elementContainerEnd, [], null);
|
|
22989
|
-
}
|
|
22990
|
-
function template(slot, templateFnRef, decls, vars, tag, constIndex, localRefs, sourceSpan) {
|
|
23040
|
+
function templateBase(instruction, slot, templateFnRef, decls, vars, tag, constIndex, localRefs, sourceSpan) {
|
|
22991
23041
|
const args = [
|
|
22992
23042
|
literal(slot),
|
|
22993
23043
|
templateFnRef,
|
|
@@ -23003,7 +23053,37 @@ function template(slot, templateFnRef, decls, vars, tag, constIndex, localRefs,
|
|
|
23003
23053
|
while (args[args.length - 1].isEquivalent(NULL_EXPR)) {
|
|
23004
23054
|
args.pop();
|
|
23005
23055
|
}
|
|
23006
|
-
return call(
|
|
23056
|
+
return call(instruction, args, sourceSpan);
|
|
23057
|
+
}
|
|
23058
|
+
function propertyBase(instruction, name, expression, sanitizer, sourceSpan) {
|
|
23059
|
+
const args = [literal(name)];
|
|
23060
|
+
if (expression instanceof Interpolation) {
|
|
23061
|
+
args.push(interpolationToExpression(expression, sourceSpan));
|
|
23062
|
+
}
|
|
23063
|
+
else {
|
|
23064
|
+
args.push(expression);
|
|
23065
|
+
}
|
|
23066
|
+
if (sanitizer !== null) {
|
|
23067
|
+
args.push(sanitizer);
|
|
23068
|
+
}
|
|
23069
|
+
return call(instruction, args, sourceSpan);
|
|
23070
|
+
}
|
|
23071
|
+
function elementEnd(sourceSpan) {
|
|
23072
|
+
return call(Identifiers.elementEnd, [], sourceSpan);
|
|
23073
|
+
}
|
|
23074
|
+
function elementContainerStart(slot, constIndex, localRefIndex, sourceSpan) {
|
|
23075
|
+
return elementOrContainerBase(Identifiers.elementContainerStart, slot,
|
|
23076
|
+
/* tag */ null, constIndex, localRefIndex, sourceSpan);
|
|
23077
|
+
}
|
|
23078
|
+
function elementContainer(slot, constIndex, localRefIndex, sourceSpan) {
|
|
23079
|
+
return elementOrContainerBase(Identifiers.elementContainer, slot,
|
|
23080
|
+
/* tag */ null, constIndex, localRefIndex, sourceSpan);
|
|
23081
|
+
}
|
|
23082
|
+
function elementContainerEnd() {
|
|
23083
|
+
return call(Identifiers.elementContainerEnd, [], null);
|
|
23084
|
+
}
|
|
23085
|
+
function template(slot, templateFnRef, decls, vars, tag, constIndex, localRefs, sourceSpan) {
|
|
23086
|
+
return templateBase(Identifiers.templateCreate, slot, templateFnRef, decls, vars, tag, constIndex, localRefs, sourceSpan);
|
|
23007
23087
|
}
|
|
23008
23088
|
function disableBindings() {
|
|
23009
23089
|
return call(Identifiers.disableBindings, [], null);
|
|
@@ -23269,17 +23349,7 @@ function i18nAttributes(slot, i18nAttributesConfig) {
|
|
|
23269
23349
|
return call(Identifiers.i18nAttributes, args, null);
|
|
23270
23350
|
}
|
|
23271
23351
|
function property(name, expression, sanitizer, sourceSpan) {
|
|
23272
|
-
|
|
23273
|
-
if (expression instanceof Interpolation) {
|
|
23274
|
-
args.push(interpolationToExpression(expression, sourceSpan));
|
|
23275
|
-
}
|
|
23276
|
-
else {
|
|
23277
|
-
args.push(expression);
|
|
23278
|
-
}
|
|
23279
|
-
if (sanitizer !== null) {
|
|
23280
|
-
args.push(sanitizer);
|
|
23281
|
-
}
|
|
23282
|
-
return call(Identifiers.property, args, sourceSpan);
|
|
23352
|
+
return propertyBase(Identifiers.property, name, expression, sanitizer, sourceSpan);
|
|
23283
23353
|
}
|
|
23284
23354
|
function twoWayProperty(name, expression, sanitizer, sourceSpan) {
|
|
23285
23355
|
const args = [literal(name), expression];
|
|
@@ -23332,6 +23402,36 @@ function classMap(expression, sourceSpan) {
|
|
|
23332
23402
|
: expression;
|
|
23333
23403
|
return call(Identifiers.classMap, [value], sourceSpan);
|
|
23334
23404
|
}
|
|
23405
|
+
function domElement(slot, tag, constIndex, localRefIndex, sourceSpan) {
|
|
23406
|
+
return elementOrContainerBase(Identifiers.domElement, slot, tag, constIndex, localRefIndex, sourceSpan);
|
|
23407
|
+
}
|
|
23408
|
+
function domElementStart(slot, tag, constIndex, localRefIndex, sourceSpan) {
|
|
23409
|
+
return elementOrContainerBase(Identifiers.domElementStart, slot, tag, constIndex, localRefIndex, sourceSpan);
|
|
23410
|
+
}
|
|
23411
|
+
function domElementEnd(sourceSpan) {
|
|
23412
|
+
return call(Identifiers.domElementEnd, [], sourceSpan);
|
|
23413
|
+
}
|
|
23414
|
+
function domElementContainerStart(slot, constIndex, localRefIndex, sourceSpan) {
|
|
23415
|
+
return elementOrContainerBase(Identifiers.domElementContainerStart, slot,
|
|
23416
|
+
/* tag */ null, constIndex, localRefIndex, sourceSpan);
|
|
23417
|
+
}
|
|
23418
|
+
function domElementContainer(slot, constIndex, localRefIndex, sourceSpan) {
|
|
23419
|
+
return elementOrContainerBase(Identifiers.domElementContainer, slot,
|
|
23420
|
+
/* tag */ null, constIndex, localRefIndex, sourceSpan);
|
|
23421
|
+
}
|
|
23422
|
+
function domElementContainerEnd() {
|
|
23423
|
+
return call(Identifiers.domElementContainerEnd, [], null);
|
|
23424
|
+
}
|
|
23425
|
+
function domListener(name, handlerFn, eventTargetResolver, sourceSpan) {
|
|
23426
|
+
const args = [literal(name), handlerFn];
|
|
23427
|
+
if (eventTargetResolver !== null) {
|
|
23428
|
+
args.push(importExpr(eventTargetResolver));
|
|
23429
|
+
}
|
|
23430
|
+
return call(Identifiers.domListener, args, sourceSpan);
|
|
23431
|
+
}
|
|
23432
|
+
function domTemplate(slot, templateFnRef, decls, vars, tag, constIndex, localRefs, sourceSpan) {
|
|
23433
|
+
return templateBase(Identifiers.domTemplate, slot, templateFnRef, decls, vars, tag, constIndex, localRefs, sourceSpan);
|
|
23434
|
+
}
|
|
23335
23435
|
const PIPE_BINDINGS = [
|
|
23336
23436
|
Identifiers.pipeBind1,
|
|
23337
23437
|
Identifiers.pipeBind2,
|
|
@@ -23359,11 +23459,7 @@ function i18nApply(slot, sourceSpan) {
|
|
|
23359
23459
|
return call(Identifiers.i18nApply, [literal(slot)], sourceSpan);
|
|
23360
23460
|
}
|
|
23361
23461
|
function domProperty(name, expression, sanitizer, sourceSpan) {
|
|
23362
|
-
|
|
23363
|
-
if (sanitizer !== null) {
|
|
23364
|
-
args.push(sanitizer);
|
|
23365
|
-
}
|
|
23366
|
-
return call(Identifiers.domProperty, args, sourceSpan);
|
|
23462
|
+
return propertyBase(Identifiers.domProperty, name, expression, sanitizer, sourceSpan);
|
|
23367
23463
|
}
|
|
23368
23464
|
function syntheticHostProperty(name, expression, sourceSpan) {
|
|
23369
23465
|
return call(Identifiers.syntheticHostProperty, [literal(name), expression], sourceSpan);
|
|
@@ -23528,22 +23624,34 @@ function reifyCreateOperations(unit, ops) {
|
|
|
23528
23624
|
OpList.replace(op, text(op.handle.slot, op.initialValue, op.sourceSpan));
|
|
23529
23625
|
break;
|
|
23530
23626
|
case OpKind.ElementStart:
|
|
23531
|
-
OpList.replace(op,
|
|
23627
|
+
OpList.replace(op, unit.job.mode === TemplateCompilationMode.DomOnly
|
|
23628
|
+
? domElementStart(op.handle.slot, op.tag, op.attributes, op.localRefs, op.startSourceSpan)
|
|
23629
|
+
: elementStart(op.handle.slot, op.tag, op.attributes, op.localRefs, op.startSourceSpan));
|
|
23532
23630
|
break;
|
|
23533
23631
|
case OpKind.Element:
|
|
23534
|
-
OpList.replace(op,
|
|
23632
|
+
OpList.replace(op, unit.job.mode === TemplateCompilationMode.DomOnly
|
|
23633
|
+
? domElement(op.handle.slot, op.tag, op.attributes, op.localRefs, op.wholeSourceSpan)
|
|
23634
|
+
: element(op.handle.slot, op.tag, op.attributes, op.localRefs, op.wholeSourceSpan));
|
|
23535
23635
|
break;
|
|
23536
23636
|
case OpKind.ElementEnd:
|
|
23537
|
-
OpList.replace(op,
|
|
23637
|
+
OpList.replace(op, unit.job.mode === TemplateCompilationMode.DomOnly
|
|
23638
|
+
? domElementEnd(op.sourceSpan)
|
|
23639
|
+
: elementEnd(op.sourceSpan));
|
|
23538
23640
|
break;
|
|
23539
23641
|
case OpKind.ContainerStart:
|
|
23540
|
-
OpList.replace(op,
|
|
23642
|
+
OpList.replace(op, unit.job.mode === TemplateCompilationMode.DomOnly
|
|
23643
|
+
? domElementContainerStart(op.handle.slot, op.attributes, op.localRefs, op.startSourceSpan)
|
|
23644
|
+
: elementContainerStart(op.handle.slot, op.attributes, op.localRefs, op.startSourceSpan));
|
|
23541
23645
|
break;
|
|
23542
23646
|
case OpKind.Container:
|
|
23543
|
-
OpList.replace(op,
|
|
23647
|
+
OpList.replace(op, unit.job.mode === TemplateCompilationMode.DomOnly
|
|
23648
|
+
? domElementContainer(op.handle.slot, op.attributes, op.localRefs, op.wholeSourceSpan)
|
|
23649
|
+
: elementContainer(op.handle.slot, op.attributes, op.localRefs, op.wholeSourceSpan));
|
|
23544
23650
|
break;
|
|
23545
23651
|
case OpKind.ContainerEnd:
|
|
23546
|
-
OpList.replace(op,
|
|
23652
|
+
OpList.replace(op, unit.job.mode === TemplateCompilationMode.DomOnly
|
|
23653
|
+
? domElementContainerEnd()
|
|
23654
|
+
: elementContainerEnd());
|
|
23547
23655
|
break;
|
|
23548
23656
|
case OpKind.I18nStart:
|
|
23549
23657
|
OpList.replace(op, i18nStart(op.handle.slot, op.messageIndex, op.subTemplateIndex, op.sourceSpan));
|
|
@@ -23568,7 +23676,12 @@ function reifyCreateOperations(unit, ops) {
|
|
|
23568
23676
|
throw new Error(`AssertionError: local refs array should have been extracted into a constant`);
|
|
23569
23677
|
}
|
|
23570
23678
|
const childView = unit.job.views.get(op.xref);
|
|
23571
|
-
OpList.replace(op,
|
|
23679
|
+
OpList.replace(op,
|
|
23680
|
+
// Block templates can't have directives so we can always generate them as DOM-only.
|
|
23681
|
+
op.templateKind === TemplateKind.Block ||
|
|
23682
|
+
unit.job.mode === TemplateCompilationMode.DomOnly
|
|
23683
|
+
? domTemplate(op.handle.slot, variable(childView.fnName), childView.decls, childView.vars, op.tag, op.attributes, op.localRefs, op.startSourceSpan)
|
|
23684
|
+
: template(op.handle.slot, variable(childView.fnName), childView.decls, childView.vars, op.tag, op.attributes, op.localRefs, op.startSourceSpan));
|
|
23572
23685
|
break;
|
|
23573
23686
|
case OpKind.DisableBindings:
|
|
23574
23687
|
OpList.replace(op, disableBindings());
|
|
@@ -23590,7 +23703,11 @@ function reifyCreateOperations(unit, ops) {
|
|
|
23590
23703
|
if (eventTargetResolver === undefined) {
|
|
23591
23704
|
throw new Error(`Unexpected global target '${op.eventTarget}' defined for '${op.name}' event. Supported list of global targets: window,document,body.`);
|
|
23592
23705
|
}
|
|
23593
|
-
OpList.replace(op,
|
|
23706
|
+
OpList.replace(op, unit.job.mode === TemplateCompilationMode.DomOnly &&
|
|
23707
|
+
!op.hostListener &&
|
|
23708
|
+
!op.isAnimationListener
|
|
23709
|
+
? domListener(op.name, listenerFn, eventTargetResolver, op.sourceSpan)
|
|
23710
|
+
: listener(op.name, listenerFn, eventTargetResolver, op.hostListener && op.isAnimationListener, op.sourceSpan));
|
|
23594
23711
|
break;
|
|
23595
23712
|
case OpKind.TwoWayListener:
|
|
23596
23713
|
OpList.replace(op, twoWayListener(op.name, reifyListenerHandler(unit, op.handlerFnName, op.handlerOps, true), op.sourceSpan));
|
|
@@ -23748,7 +23865,7 @@ function reifyCreateOperations(unit, ops) {
|
|
|
23748
23865
|
}
|
|
23749
23866
|
}
|
|
23750
23867
|
}
|
|
23751
|
-
function reifyUpdateOperations(
|
|
23868
|
+
function reifyUpdateOperations(unit, ops) {
|
|
23752
23869
|
for (const op of ops) {
|
|
23753
23870
|
transformExpressionsInOp(op, reifyIrExpression, VisitorContextFlag.None);
|
|
23754
23871
|
switch (op.kind) {
|
|
@@ -23756,7 +23873,9 @@ function reifyUpdateOperations(_unit, ops) {
|
|
|
23756
23873
|
OpList.replace(op, advance(op.delta, op.sourceSpan));
|
|
23757
23874
|
break;
|
|
23758
23875
|
case OpKind.Property:
|
|
23759
|
-
OpList.replace(op,
|
|
23876
|
+
OpList.replace(op, unit.job.mode === TemplateCompilationMode.DomOnly && !op.isAnimationTrigger
|
|
23877
|
+
? domProperty(op.name, op.expression, op.sanitizer, op.sourceSpan)
|
|
23878
|
+
: property(op.name, op.expression, op.sanitizer, op.sourceSpan));
|
|
23760
23879
|
break;
|
|
23761
23880
|
case OpKind.TwoWayProperty:
|
|
23762
23881
|
OpList.replace(op, twoWayProperty(op.name, op.expression, op.sanitizer, op.sourceSpan));
|
|
@@ -25994,8 +26113,8 @@ function isSingleI18nIcu(meta) {
|
|
|
25994
26113
|
* representation.
|
|
25995
26114
|
* TODO: Refactor more of the ingestion code into phases.
|
|
25996
26115
|
*/
|
|
25997
|
-
function ingestComponent(componentName, template, constantPool, relativeContextFilePath, i18nUseExternalIds, deferMeta, allDeferrableDepsFn, relativeTemplatePath, enableDebugLocations) {
|
|
25998
|
-
const job = new ComponentCompilationJob(componentName, constantPool, compatibilityMode, relativeContextFilePath, i18nUseExternalIds, deferMeta, allDeferrableDepsFn, relativeTemplatePath, enableDebugLocations);
|
|
26116
|
+
function ingestComponent(componentName, template, constantPool, compilationMode, relativeContextFilePath, i18nUseExternalIds, deferMeta, allDeferrableDepsFn, relativeTemplatePath, enableDebugLocations) {
|
|
26117
|
+
const job = new ComponentCompilationJob(componentName, constantPool, compatibilityMode, compilationMode, relativeContextFilePath, i18nUseExternalIds, deferMeta, allDeferrableDepsFn, relativeTemplatePath, enableDebugLocations);
|
|
25999
26118
|
ingestNodes(job.root, template);
|
|
26000
26119
|
return job;
|
|
26001
26120
|
}
|
|
@@ -26004,7 +26123,7 @@ function ingestComponent(componentName, template, constantPool, relativeContextF
|
|
|
26004
26123
|
* representation.
|
|
26005
26124
|
*/
|
|
26006
26125
|
function ingestHostBinding(input, bindingParser, constantPool) {
|
|
26007
|
-
const job = new HostBindingCompilationJob(input.componentName, constantPool, compatibilityMode);
|
|
26126
|
+
const job = new HostBindingCompilationJob(input.componentName, constantPool, compatibilityMode, TemplateCompilationMode.DomOnly);
|
|
26008
26127
|
for (const property of input.properties ?? []) {
|
|
26009
26128
|
let bindingKind = BindingKind.Property;
|
|
26010
26129
|
// TODO: this should really be handled in the parser.
|
|
@@ -27297,17 +27416,17 @@ class BindingParser {
|
|
|
27297
27416
|
return targetEvents;
|
|
27298
27417
|
}
|
|
27299
27418
|
parseInterpolation(value, sourceSpan, interpolatedTokens) {
|
|
27300
|
-
const sourceInfo = sourceSpan.start.toString();
|
|
27301
27419
|
const absoluteOffset = sourceSpan.fullStart.offset;
|
|
27302
27420
|
try {
|
|
27303
|
-
const ast = this._exprParser.parseInterpolation(value,
|
|
27304
|
-
if (ast)
|
|
27305
|
-
this.
|
|
27421
|
+
const ast = this._exprParser.parseInterpolation(value, sourceSpan, absoluteOffset, interpolatedTokens, this._interpolationConfig);
|
|
27422
|
+
if (ast) {
|
|
27423
|
+
this.errors.push(...ast.errors);
|
|
27424
|
+
}
|
|
27306
27425
|
return ast;
|
|
27307
27426
|
}
|
|
27308
27427
|
catch (e) {
|
|
27309
27428
|
this._reportError(`${e}`, sourceSpan);
|
|
27310
|
-
return this._exprParser.wrapLiteralPrimitive('ERROR',
|
|
27429
|
+
return this._exprParser.wrapLiteralPrimitive('ERROR', sourceSpan, absoluteOffset);
|
|
27311
27430
|
}
|
|
27312
27431
|
}
|
|
27313
27432
|
/**
|
|
@@ -27316,17 +27435,17 @@ class BindingParser {
|
|
|
27316
27435
|
* This is used for parsing the switch expression in ICUs.
|
|
27317
27436
|
*/
|
|
27318
27437
|
parseInterpolationExpression(expression, sourceSpan) {
|
|
27319
|
-
const sourceInfo = sourceSpan.start.toString();
|
|
27320
27438
|
const absoluteOffset = sourceSpan.start.offset;
|
|
27321
27439
|
try {
|
|
27322
|
-
const ast = this._exprParser.parseInterpolationExpression(expression,
|
|
27323
|
-
if (ast)
|
|
27324
|
-
this.
|
|
27440
|
+
const ast = this._exprParser.parseInterpolationExpression(expression, sourceSpan, absoluteOffset);
|
|
27441
|
+
if (ast) {
|
|
27442
|
+
this.errors.push(...ast.errors);
|
|
27443
|
+
}
|
|
27325
27444
|
return ast;
|
|
27326
27445
|
}
|
|
27327
27446
|
catch (e) {
|
|
27328
27447
|
this._reportError(`${e}`, sourceSpan);
|
|
27329
|
-
return this._exprParser.wrapLiteralPrimitive('ERROR',
|
|
27448
|
+
return this._exprParser.wrapLiteralPrimitive('ERROR', sourceSpan, absoluteOffset);
|
|
27330
27449
|
}
|
|
27331
27450
|
}
|
|
27332
27451
|
/**
|
|
@@ -27383,10 +27502,9 @@ class BindingParser {
|
|
|
27383
27502
|
* @param absoluteValueOffset start of the `tplValue`
|
|
27384
27503
|
*/
|
|
27385
27504
|
_parseTemplateBindings(tplKey, tplValue, sourceSpan, absoluteKeyOffset, absoluteValueOffset) {
|
|
27386
|
-
const sourceInfo = sourceSpan.start.toString();
|
|
27387
27505
|
try {
|
|
27388
|
-
const bindingsResult = this._exprParser.parseTemplateBindings(tplKey, tplValue,
|
|
27389
|
-
|
|
27506
|
+
const bindingsResult = this._exprParser.parseTemplateBindings(tplKey, tplValue, sourceSpan, absoluteKeyOffset, absoluteValueOffset);
|
|
27507
|
+
bindingsResult.errors.forEach((e) => this.errors.push(e));
|
|
27390
27508
|
bindingsResult.warnings.forEach((warning) => {
|
|
27391
27509
|
this._reportError(warning, sourceSpan, ParseErrorLevel.WARNING);
|
|
27392
27510
|
});
|
|
@@ -27463,18 +27581,18 @@ class BindingParser {
|
|
|
27463
27581
|
targetProps.push(new ParsedProperty(name, ast, ParsedPropertyType.ANIMATION, sourceSpan, keySpan, valueSpan));
|
|
27464
27582
|
}
|
|
27465
27583
|
parseBinding(value, isHostBinding, sourceSpan, absoluteOffset) {
|
|
27466
|
-
const sourceInfo = ((sourceSpan && sourceSpan.start) || '(unknown)').toString();
|
|
27467
27584
|
try {
|
|
27468
27585
|
const ast = isHostBinding
|
|
27469
|
-
? this._exprParser.parseSimpleBinding(value,
|
|
27470
|
-
: this._exprParser.parseBinding(value,
|
|
27471
|
-
if (ast)
|
|
27472
|
-
this.
|
|
27586
|
+
? this._exprParser.parseSimpleBinding(value, sourceSpan, absoluteOffset, this._interpolationConfig)
|
|
27587
|
+
: this._exprParser.parseBinding(value, sourceSpan, absoluteOffset, this._interpolationConfig);
|
|
27588
|
+
if (ast) {
|
|
27589
|
+
this.errors.push(...ast.errors);
|
|
27590
|
+
}
|
|
27473
27591
|
return ast;
|
|
27474
27592
|
}
|
|
27475
27593
|
catch (e) {
|
|
27476
27594
|
this._reportError(`${e}`, sourceSpan);
|
|
27477
|
-
return this._exprParser.wrapLiteralPrimitive('ERROR',
|
|
27595
|
+
return this._exprParser.wrapLiteralPrimitive('ERROR', sourceSpan, absoluteOffset);
|
|
27478
27596
|
}
|
|
27479
27597
|
}
|
|
27480
27598
|
createBoundElementProperty(elementSelector, boundProp, skipValidation = false, mapPropertyName = true) {
|
|
@@ -27588,31 +27706,25 @@ class BindingParser {
|
|
|
27588
27706
|
// so don't add the event name to the matchableAttrs
|
|
27589
27707
|
}
|
|
27590
27708
|
_parseAction(value, sourceSpan) {
|
|
27591
|
-
const sourceInfo = ((sourceSpan && sourceSpan.start) || '(unknown').toString();
|
|
27592
27709
|
const absoluteOffset = sourceSpan && sourceSpan.start ? sourceSpan.start.offset : 0;
|
|
27593
27710
|
try {
|
|
27594
|
-
const ast = this._exprParser.parseAction(value,
|
|
27711
|
+
const ast = this._exprParser.parseAction(value, sourceSpan, absoluteOffset, this._interpolationConfig);
|
|
27595
27712
|
if (ast) {
|
|
27596
|
-
this.
|
|
27713
|
+
this.errors.push(...ast.errors);
|
|
27597
27714
|
}
|
|
27598
27715
|
if (!ast || ast.ast instanceof EmptyExpr$1) {
|
|
27599
27716
|
this._reportError(`Empty expressions are not allowed`, sourceSpan);
|
|
27600
|
-
return this._exprParser.wrapLiteralPrimitive('ERROR',
|
|
27717
|
+
return this._exprParser.wrapLiteralPrimitive('ERROR', sourceSpan, absoluteOffset);
|
|
27601
27718
|
}
|
|
27602
27719
|
return ast;
|
|
27603
27720
|
}
|
|
27604
27721
|
catch (e) {
|
|
27605
27722
|
this._reportError(`${e}`, sourceSpan);
|
|
27606
|
-
return this._exprParser.wrapLiteralPrimitive('ERROR',
|
|
27723
|
+
return this._exprParser.wrapLiteralPrimitive('ERROR', sourceSpan, absoluteOffset);
|
|
27607
27724
|
}
|
|
27608
27725
|
}
|
|
27609
|
-
_reportError(message, sourceSpan, level = ParseErrorLevel.ERROR
|
|
27610
|
-
this.errors.push(new ParseError(sourceSpan, message, level
|
|
27611
|
-
}
|
|
27612
|
-
_reportExpressionParserErrors(errors, sourceSpan) {
|
|
27613
|
-
for (const error of errors) {
|
|
27614
|
-
this._reportError(error.message, sourceSpan, undefined, error);
|
|
27615
|
-
}
|
|
27726
|
+
_reportError(message, sourceSpan, level = ParseErrorLevel.ERROR) {
|
|
27727
|
+
this.errors.push(new ParseError(sourceSpan, message, level));
|
|
27616
27728
|
}
|
|
27617
27729
|
/**
|
|
27618
27730
|
* @param propName the name of the property / attribute
|
|
@@ -29650,8 +29762,11 @@ function compileComponentFromMetadata(meta, constantPool, bindingParser) {
|
|
|
29650
29762
|
constantPool.statements.push(new DeclareVarStmt(fnName, meta.defer.dependenciesFn, undefined, StmtModifier.Final));
|
|
29651
29763
|
allDeferrableDepsFn = variable(fnName);
|
|
29652
29764
|
}
|
|
29765
|
+
const compilationMode = meta.isStandalone && !meta.hasDirectiveDependencies
|
|
29766
|
+
? TemplateCompilationMode.DomOnly
|
|
29767
|
+
: TemplateCompilationMode.Full;
|
|
29653
29768
|
// First the template is ingested into IR:
|
|
29654
|
-
const tpl = ingestComponent(meta.name, meta.template.nodes, constantPool, meta.relativeContextFilePath, meta.i18nUseExternalIds, meta.defer, allDeferrableDepsFn, meta.relativeTemplatePath, getTemplateSourceLocationsEnabled());
|
|
29769
|
+
const tpl = ingestComponent(meta.name, meta.template.nodes, constantPool, compilationMode, meta.relativeContextFilePath, meta.i18nUseExternalIds, meta.defer, allDeferrableDepsFn, meta.relativeTemplatePath, getTemplateSourceLocationsEnabled());
|
|
29655
29770
|
// Then the IR is transformed to prepare it for cod egeneration.
|
|
29656
29771
|
transform(tpl, CompilationJobKind.Tmpl);
|
|
29657
29772
|
// Finally we emit the template function:
|
|
@@ -31513,6 +31628,7 @@ function convertDeclareComponentFacadeToMetadata(decl, typeSourceSpan, sourceMap
|
|
|
31513
31628
|
declarations.push(...decl.directives.map((dir) => convertDirectiveDeclarationToMetadata(dir)));
|
|
31514
31629
|
decl.pipes && declarations.push(...convertPipeMapToMetadata(decl.pipes));
|
|
31515
31630
|
}
|
|
31631
|
+
const hasDirectiveDependencies = declarations.every(({ kind }) => kind === R3TemplateDependencyKind.Directive || kind === R3TemplateDependencyKind.NgModule);
|
|
31516
31632
|
return {
|
|
31517
31633
|
...convertDeclareDirectiveFacadeToMetadata(decl, typeSourceSpan),
|
|
31518
31634
|
template,
|
|
@@ -31528,6 +31644,7 @@ function convertDeclareComponentFacadeToMetadata(decl, typeSourceSpan, sourceMap
|
|
|
31528
31644
|
relativeContextFilePath: '',
|
|
31529
31645
|
i18nUseExternalIds: true,
|
|
31530
31646
|
relativeTemplatePath: null,
|
|
31647
|
+
hasDirectiveDependencies,
|
|
31531
31648
|
};
|
|
31532
31649
|
}
|
|
31533
31650
|
function convertDeclarationFacadeToMetadata(declaration) {
|
|
@@ -32271,7 +32388,7 @@ class _Visitor {
|
|
|
32271
32388
|
this._msgCountAtSectionStart = undefined;
|
|
32272
32389
|
}
|
|
32273
32390
|
_reportError(node, msg) {
|
|
32274
|
-
this._errors.push(new
|
|
32391
|
+
this._errors.push(new ParseError(node.sourceSpan, msg));
|
|
32275
32392
|
}
|
|
32276
32393
|
}
|
|
32277
32394
|
function _isOpeningComment(n) {
|
|
@@ -32561,7 +32678,7 @@ class XliffParser {
|
|
|
32561
32678
|
visitComponent(component, context) { }
|
|
32562
32679
|
visitDirective(directive, context) { }
|
|
32563
32680
|
_addError(node, message) {
|
|
32564
|
-
this._errors.push(new
|
|
32681
|
+
this._errors.push(new ParseError(node.sourceSpan, message));
|
|
32565
32682
|
}
|
|
32566
32683
|
}
|
|
32567
32684
|
// Convert ml nodes (xliff syntax) to i18n nodes
|
|
@@ -32622,7 +32739,7 @@ let XmlToI18n$2 = class XmlToI18n {
|
|
|
32622
32739
|
this._addError(directive, 'Unexpected node');
|
|
32623
32740
|
}
|
|
32624
32741
|
_addError(node, message) {
|
|
32625
|
-
this._errors.push(new
|
|
32742
|
+
this._errors.push(new ParseError(node.sourceSpan, message));
|
|
32626
32743
|
}
|
|
32627
32744
|
};
|
|
32628
32745
|
function getCtypeForTag(tag) {
|
|
@@ -32884,7 +33001,7 @@ class Xliff2Parser {
|
|
|
32884
33001
|
visitComponent(component, context) { }
|
|
32885
33002
|
visitDirective(directive, context) { }
|
|
32886
33003
|
_addError(node, message) {
|
|
32887
|
-
this._errors.push(new
|
|
33004
|
+
this._errors.push(new ParseError(node.sourceSpan, message));
|
|
32888
33005
|
}
|
|
32889
33006
|
}
|
|
32890
33007
|
// Convert ml nodes (xliff syntax) to i18n nodes
|
|
@@ -32962,7 +33079,7 @@ let XmlToI18n$1 = class XmlToI18n {
|
|
|
32962
33079
|
this._addError(directive, 'Unexpected node');
|
|
32963
33080
|
}
|
|
32964
33081
|
_addError(node, message) {
|
|
32965
|
-
this._errors.push(new
|
|
33082
|
+
this._errors.push(new ParseError(node.sourceSpan, message));
|
|
32966
33083
|
}
|
|
32967
33084
|
};
|
|
32968
33085
|
function getTypeForTag(tag) {
|
|
@@ -33107,7 +33224,7 @@ class XtbParser {
|
|
|
33107
33224
|
this._addError(directive, 'Unexpected node');
|
|
33108
33225
|
}
|
|
33109
33226
|
_addError(node, message) {
|
|
33110
|
-
this._errors.push(new
|
|
33227
|
+
this._errors.push(new ParseError(node.sourceSpan, message));
|
|
33111
33228
|
}
|
|
33112
33229
|
}
|
|
33113
33230
|
// Convert ml nodes (xtb syntax) to i18n nodes
|
|
@@ -33166,7 +33283,7 @@ class XmlToI18n {
|
|
|
33166
33283
|
this._addError(directive, 'Unexpected node');
|
|
33167
33284
|
}
|
|
33168
33285
|
_addError(node, message) {
|
|
33169
|
-
this._errors.push(new
|
|
33286
|
+
this._errors.push(new ParseError(node.sourceSpan, message));
|
|
33170
33287
|
}
|
|
33171
33288
|
}
|
|
33172
33289
|
|
|
@@ -33332,7 +33449,7 @@ class I18nToHtmlVisitor {
|
|
|
33332
33449
|
return text;
|
|
33333
33450
|
}
|
|
33334
33451
|
_addError(el, msg) {
|
|
33335
|
-
this._errors.push(new
|
|
33452
|
+
this._errors.push(new ParseError(el.sourceSpan, msg));
|
|
33336
33453
|
}
|
|
33337
33454
|
}
|
|
33338
33455
|
|
|
@@ -33569,7 +33686,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
|
|
|
33569
33686
|
function compileDeclareClassMetadata(metadata) {
|
|
33570
33687
|
const definitionMap = new DefinitionMap();
|
|
33571
33688
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
|
|
33572
|
-
definitionMap.set('version', literal('20.1.0-next.
|
|
33689
|
+
definitionMap.set('version', literal('20.1.0-next.3'));
|
|
33573
33690
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
33574
33691
|
definitionMap.set('type', metadata.type);
|
|
33575
33692
|
definitionMap.set('decorators', metadata.decorators);
|
|
@@ -33587,7 +33704,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
|
|
|
33587
33704
|
callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? literal(null));
|
|
33588
33705
|
callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? literal(null));
|
|
33589
33706
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
|
|
33590
|
-
definitionMap.set('version', literal('20.1.0-next.
|
|
33707
|
+
definitionMap.set('version', literal('20.1.0-next.3'));
|
|
33591
33708
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
33592
33709
|
definitionMap.set('type', metadata.type);
|
|
33593
33710
|
definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
|
|
@@ -33682,7 +33799,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
33682
33799
|
const definitionMap = new DefinitionMap();
|
|
33683
33800
|
const minVersion = getMinimumVersionForPartialOutput(meta);
|
|
33684
33801
|
definitionMap.set('minVersion', literal(minVersion));
|
|
33685
|
-
definitionMap.set('version', literal('20.1.0-next.
|
|
33802
|
+
definitionMap.set('version', literal('20.1.0-next.3'));
|
|
33686
33803
|
// e.g. `type: MyDirective`
|
|
33687
33804
|
definitionMap.set('type', meta.type.value);
|
|
33688
33805
|
if (meta.isStandalone !== undefined) {
|
|
@@ -34098,7 +34215,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
|
|
|
34098
34215
|
function compileDeclareFactoryFunction(meta) {
|
|
34099
34216
|
const definitionMap = new DefinitionMap();
|
|
34100
34217
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
|
|
34101
|
-
definitionMap.set('version', literal('20.1.0-next.
|
|
34218
|
+
definitionMap.set('version', literal('20.1.0-next.3'));
|
|
34102
34219
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
34103
34220
|
definitionMap.set('type', meta.type.value);
|
|
34104
34221
|
definitionMap.set('deps', compileDependencies(meta.deps));
|
|
@@ -34133,7 +34250,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
34133
34250
|
function createInjectableDefinitionMap(meta) {
|
|
34134
34251
|
const definitionMap = new DefinitionMap();
|
|
34135
34252
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
|
|
34136
|
-
definitionMap.set('version', literal('20.1.0-next.
|
|
34253
|
+
definitionMap.set('version', literal('20.1.0-next.3'));
|
|
34137
34254
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
34138
34255
|
definitionMap.set('type', meta.type.value);
|
|
34139
34256
|
// Only generate providedIn property if it has a non-null value
|
|
@@ -34184,7 +34301,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
34184
34301
|
function createInjectorDefinitionMap(meta) {
|
|
34185
34302
|
const definitionMap = new DefinitionMap();
|
|
34186
34303
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
|
|
34187
|
-
definitionMap.set('version', literal('20.1.0-next.
|
|
34304
|
+
definitionMap.set('version', literal('20.1.0-next.3'));
|
|
34188
34305
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
34189
34306
|
definitionMap.set('type', meta.type.value);
|
|
34190
34307
|
definitionMap.set('providers', meta.providers);
|
|
@@ -34217,7 +34334,7 @@ function createNgModuleDefinitionMap(meta) {
|
|
|
34217
34334
|
throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
|
|
34218
34335
|
}
|
|
34219
34336
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
|
|
34220
|
-
definitionMap.set('version', literal('20.1.0-next.
|
|
34337
|
+
definitionMap.set('version', literal('20.1.0-next.3'));
|
|
34221
34338
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
34222
34339
|
definitionMap.set('type', meta.type.value);
|
|
34223
34340
|
// We only generate the keys in the metadata if the arrays contain values.
|
|
@@ -34268,7 +34385,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
34268
34385
|
function createPipeDefinitionMap(meta) {
|
|
34269
34386
|
const definitionMap = new DefinitionMap();
|
|
34270
34387
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
34271
|
-
definitionMap.set('version', literal('20.1.0-next.
|
|
34388
|
+
definitionMap.set('version', literal('20.1.0-next.3'));
|
|
34272
34389
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
34273
34390
|
// e.g. `type: MyPipe`
|
|
34274
34391
|
definitionMap.set('type', meta.type.value);
|
|
@@ -34424,7 +34541,7 @@ function compileHmrUpdateCallback(definitions, constantStatements, meta) {
|
|
|
34424
34541
|
* @description
|
|
34425
34542
|
* Entry point for all public APIs of the compiler package.
|
|
34426
34543
|
*/
|
|
34427
|
-
const VERSION = new Version('20.1.0-next.
|
|
34544
|
+
const VERSION = new Version('20.1.0-next.3');
|
|
34428
34545
|
|
|
34429
34546
|
//////////////////////////////////////
|
|
34430
34547
|
// THIS FILE HAS GLOBAL SIDE EFFECT //
|
|
@@ -34450,5 +34567,5 @@ const VERSION = new Version('20.1.0-next.1');
|
|
|
34450
34567
|
// the late binding of the Compiler to the @angular/core for jit compilation.
|
|
34451
34568
|
publishFacade(_global);
|
|
34452
34569
|
|
|
34453
|
-
export { AST, ASTWithName, ASTWithSource, AbsoluteSourceSpan, ArrayType, ArrowFunctionExpr, Attribute, Binary, BinaryOperator, BinaryOperatorExpr, BindingPipe, BindingPipeType, BindingType, Block, BlockParameter, BoundElementProperty, BuiltinType, BuiltinTypeName, CUSTOM_ELEMENTS_SCHEMA, Call, Chain, ChangeDetectionStrategy, CombinedRecursiveAstVisitor, CommaExpr, Comment, CompilerConfig, CompilerFacadeImpl, Component, Conditional, ConditionalExpr, ConstantPool, CssSelector, DEFAULT_INTERPOLATION_CONFIG, DYNAMIC_TYPE, DeclareFunctionStmt, DeclareVarStmt, Directive, DomElementSchemaRegistry, DynamicImportExpr, EOF, Element, ElementSchemaRegistry, EmitterVisitorContext, EmptyExpr$1 as EmptyExpr, Expansion, ExpansionCase, Expression, ExpressionBinding, ExpressionStatement, ExpressionType, ExternalExpr, ExternalReference, FactoryTarget, FunctionExpr, HtmlParser, HtmlTagDefinition, I18NHtmlParser, IfStmt, ImplicitReceiver, InstantiateExpr, Interpolation$1 as Interpolation, InterpolationConfig, InvokeFunctionExpr, JSDocComment, JitEvaluator, KeyedRead, LeadingComment, LetDeclaration, Lexer, LiteralArray, LiteralArrayExpr, LiteralExpr, LiteralMap, LiteralMapExpr, LiteralPrimitive, LocalizedString, MapType, MessageBundle, NONE_TYPE, NO_ERRORS_SCHEMA, NodeWithI18n, NonNullAssert, NotExpr, ParenthesizedExpr, ParenthesizedExpression, ParseError, ParseErrorLevel, ParseLocation, ParseSourceFile, ParseSourceSpan, ParseSpan, ParseTreeResult, ParsedEvent, ParsedEventType, ParsedProperty, ParsedPropertyType, ParsedVariable, Parser,
|
|
34570
|
+
export { AST, ASTWithName, ASTWithSource, AbsoluteSourceSpan, ArrayType, ArrowFunctionExpr, Attribute, Binary, BinaryOperator, BinaryOperatorExpr, BindingPipe, BindingPipeType, BindingType, Block, BlockParameter, BoundElementProperty, BuiltinType, BuiltinTypeName, CUSTOM_ELEMENTS_SCHEMA, Call, Chain, ChangeDetectionStrategy, CombinedRecursiveAstVisitor, CommaExpr, Comment, CompilerConfig, CompilerFacadeImpl, Component, Conditional, ConditionalExpr, ConstantPool, CssSelector, DEFAULT_INTERPOLATION_CONFIG, DYNAMIC_TYPE, DeclareFunctionStmt, DeclareVarStmt, Directive, DomElementSchemaRegistry, DynamicImportExpr, EOF, Element, ElementSchemaRegistry, EmitterVisitorContext, EmptyExpr$1 as EmptyExpr, Expansion, ExpansionCase, Expression, ExpressionBinding, ExpressionStatement, ExpressionType, ExternalExpr, ExternalReference, FactoryTarget, FunctionExpr, HtmlParser, HtmlTagDefinition, I18NHtmlParser, IfStmt, ImplicitReceiver, InstantiateExpr, Interpolation$1 as Interpolation, InterpolationConfig, InvokeFunctionExpr, JSDocComment, JitEvaluator, KeyedRead, LeadingComment, LetDeclaration, Lexer, LiteralArray, LiteralArrayExpr, LiteralExpr, LiteralMap, LiteralMapExpr, LiteralPrimitive, LocalizedString, MapType, MessageBundle, NONE_TYPE, NO_ERRORS_SCHEMA, NodeWithI18n, NonNullAssert, NotExpr, ParenthesizedExpr, ParenthesizedExpression, ParseError, ParseErrorLevel, ParseLocation, ParseSourceFile, ParseSourceSpan, ParseSpan, ParseTreeResult, ParsedEvent, ParsedEventType, ParsedProperty, ParsedPropertyType, ParsedVariable, Parser, PrefixNot, PropertyRead, Identifiers as R3Identifiers, R3NgModuleMetadataKind, R3SelectorScopeMode, R3TargetBinder, R3TemplateDependencyKind, ReadKeyExpr, ReadPropExpr, ReadVarExpr, RecursiveAstVisitor, RecursiveVisitor, ResourceLoader, ReturnStatement, SECURITY_SCHEMA, STRING_TYPE, SafeCall, SafeKeyedRead, SafePropertyRead, SelectorContext, SelectorListContext, SelectorMatcher, SelectorlessMatcher, Serializer, SplitInterpolation, Statement, StmtModifier, StringToken, StringTokenKind, TagContentType, TaggedTemplateLiteral, TaggedTemplateLiteralExpr, TemplateBindingParseResult, TemplateLiteral, TemplateLiteralElement, TemplateLiteralElementExpr, TemplateLiteralExpr, Text, ThisReceiver, BlockNode as TmplAstBlockNode, BoundAttribute as TmplAstBoundAttribute, BoundDeferredTrigger as TmplAstBoundDeferredTrigger, BoundEvent as TmplAstBoundEvent, BoundText as TmplAstBoundText, Component$1 as TmplAstComponent, Content as TmplAstContent, DeferredBlock as TmplAstDeferredBlock, DeferredBlockError as TmplAstDeferredBlockError, DeferredBlockLoading as TmplAstDeferredBlockLoading, DeferredBlockPlaceholder as TmplAstDeferredBlockPlaceholder, DeferredTrigger as TmplAstDeferredTrigger, Directive$1 as TmplAstDirective, Element$1 as TmplAstElement, ForLoopBlock as TmplAstForLoopBlock, ForLoopBlockEmpty as TmplAstForLoopBlockEmpty, HostElement as TmplAstHostElement, HoverDeferredTrigger as TmplAstHoverDeferredTrigger, Icu$1 as TmplAstIcu, IdleDeferredTrigger as TmplAstIdleDeferredTrigger, IfBlock as TmplAstIfBlock, IfBlockBranch as TmplAstIfBlockBranch, ImmediateDeferredTrigger as TmplAstImmediateDeferredTrigger, InteractionDeferredTrigger as TmplAstInteractionDeferredTrigger, LetDeclaration$1 as TmplAstLetDeclaration, NeverDeferredTrigger as TmplAstNeverDeferredTrigger, RecursiveVisitor$1 as TmplAstRecursiveVisitor, Reference as TmplAstReference, SwitchBlock as TmplAstSwitchBlock, SwitchBlockCase as TmplAstSwitchBlockCase, Template as TmplAstTemplate, Text$3 as TmplAstText, TextAttribute as TmplAstTextAttribute, TimerDeferredTrigger as TmplAstTimerDeferredTrigger, UnknownBlock as TmplAstUnknownBlock, Variable as TmplAstVariable, ViewportDeferredTrigger as TmplAstViewportDeferredTrigger, Token, TokenType, TransplantedType, TreeError, Type, TypeModifier, TypeofExpr, TypeofExpression, Unary, UnaryOperator, UnaryOperatorExpr, VERSION, VariableBinding, Version, ViewEncapsulation$1 as ViewEncapsulation, VoidExpr, VoidExpression, WrappedNodeExpr, Xliff, Xliff2, Xmb, XmlParser, Xtb, compileClassDebugInfo, compileClassMetadata, compileComponentClassMetadata, compileComponentDeclareClassMetadata, compileComponentFromMetadata, compileDeclareClassMetadata, compileDeclareComponentFromMetadata, compileDeclareDirectiveFromMetadata, compileDeclareFactoryFunction, compileDeclareInjectableFromMetadata, compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileDeclarePipeFromMetadata, compileDeferResolverFunction, compileDirectiveFromMetadata, compileFactoryFunction, compileHmrInitializer, compileHmrUpdateCallback, compileInjectable, compileInjector, compileNgModule, compileOpaqueAsyncClassMetadata, compilePipeFromMetadata, computeMsgId, core, createCssSelectorFromNode, createInjectableType, createMayBeForwardRefExpression, devOnlyGuardedExpression, emitDistinctChangesOnlyDefaultValue, encapsulateStyle, escapeRegExp, findMatchingDirectivesAndPipes, getHtmlTagDefinition, getNsPrefix, getSafePropertyAccessString, identifierName, isNgContainer, isNgContent, isNgTemplate, jsDocComment, leadingComment, literal, literalMap, makeBindingParser, mergeNsAndName, output_ast as outputAst, parseHostBindings, parseTemplate, preserveWhitespacesDefault, publishFacade, r3JitTypeSourceSpan, sanitizeIdentifier, setEnableTemplateSourceLocations, splitNsName, visitAll$1 as tmplAstVisitAll, verifyHostBindings, visitAll };
|
|
34454
34571
|
//# sourceMappingURL=compiler.mjs.map
|