@angular/compiler 20.0.0-rc.2 → 20.0.0-rc.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 +71 -338
- package/fesm2022/compiler.mjs.map +1 -1
- package/index.d.ts +1 -38
- package/package.json +1 -1
package/fesm2022/compiler.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v20.0.0-rc.
|
|
2
|
+
* @license Angular v20.0.0-rc.3
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -2715,116 +2715,8 @@ class Identifiers {
|
|
|
2715
2715
|
};
|
|
2716
2716
|
static elementContainer = { name: 'ɵɵelementContainer', moduleName: CORE };
|
|
2717
2717
|
static styleMap = { name: 'ɵɵstyleMap', moduleName: CORE };
|
|
2718
|
-
static styleMapInterpolate1 = {
|
|
2719
|
-
name: 'ɵɵstyleMapInterpolate1',
|
|
2720
|
-
moduleName: CORE,
|
|
2721
|
-
};
|
|
2722
|
-
static styleMapInterpolate2 = {
|
|
2723
|
-
name: 'ɵɵstyleMapInterpolate2',
|
|
2724
|
-
moduleName: CORE,
|
|
2725
|
-
};
|
|
2726
|
-
static styleMapInterpolate3 = {
|
|
2727
|
-
name: 'ɵɵstyleMapInterpolate3',
|
|
2728
|
-
moduleName: CORE,
|
|
2729
|
-
};
|
|
2730
|
-
static styleMapInterpolate4 = {
|
|
2731
|
-
name: 'ɵɵstyleMapInterpolate4',
|
|
2732
|
-
moduleName: CORE,
|
|
2733
|
-
};
|
|
2734
|
-
static styleMapInterpolate5 = {
|
|
2735
|
-
name: 'ɵɵstyleMapInterpolate5',
|
|
2736
|
-
moduleName: CORE,
|
|
2737
|
-
};
|
|
2738
|
-
static styleMapInterpolate6 = {
|
|
2739
|
-
name: 'ɵɵstyleMapInterpolate6',
|
|
2740
|
-
moduleName: CORE,
|
|
2741
|
-
};
|
|
2742
|
-
static styleMapInterpolate7 = {
|
|
2743
|
-
name: 'ɵɵstyleMapInterpolate7',
|
|
2744
|
-
moduleName: CORE,
|
|
2745
|
-
};
|
|
2746
|
-
static styleMapInterpolate8 = {
|
|
2747
|
-
name: 'ɵɵstyleMapInterpolate8',
|
|
2748
|
-
moduleName: CORE,
|
|
2749
|
-
};
|
|
2750
|
-
static styleMapInterpolateV = {
|
|
2751
|
-
name: 'ɵɵstyleMapInterpolateV',
|
|
2752
|
-
moduleName: CORE,
|
|
2753
|
-
};
|
|
2754
2718
|
static classMap = { name: 'ɵɵclassMap', moduleName: CORE };
|
|
2755
|
-
static classMapInterpolate1 = {
|
|
2756
|
-
name: 'ɵɵclassMapInterpolate1',
|
|
2757
|
-
moduleName: CORE,
|
|
2758
|
-
};
|
|
2759
|
-
static classMapInterpolate2 = {
|
|
2760
|
-
name: 'ɵɵclassMapInterpolate2',
|
|
2761
|
-
moduleName: CORE,
|
|
2762
|
-
};
|
|
2763
|
-
static classMapInterpolate3 = {
|
|
2764
|
-
name: 'ɵɵclassMapInterpolate3',
|
|
2765
|
-
moduleName: CORE,
|
|
2766
|
-
};
|
|
2767
|
-
static classMapInterpolate4 = {
|
|
2768
|
-
name: 'ɵɵclassMapInterpolate4',
|
|
2769
|
-
moduleName: CORE,
|
|
2770
|
-
};
|
|
2771
|
-
static classMapInterpolate5 = {
|
|
2772
|
-
name: 'ɵɵclassMapInterpolate5',
|
|
2773
|
-
moduleName: CORE,
|
|
2774
|
-
};
|
|
2775
|
-
static classMapInterpolate6 = {
|
|
2776
|
-
name: 'ɵɵclassMapInterpolate6',
|
|
2777
|
-
moduleName: CORE,
|
|
2778
|
-
};
|
|
2779
|
-
static classMapInterpolate7 = {
|
|
2780
|
-
name: 'ɵɵclassMapInterpolate7',
|
|
2781
|
-
moduleName: CORE,
|
|
2782
|
-
};
|
|
2783
|
-
static classMapInterpolate8 = {
|
|
2784
|
-
name: 'ɵɵclassMapInterpolate8',
|
|
2785
|
-
moduleName: CORE,
|
|
2786
|
-
};
|
|
2787
|
-
static classMapInterpolateV = {
|
|
2788
|
-
name: 'ɵɵclassMapInterpolateV',
|
|
2789
|
-
moduleName: CORE,
|
|
2790
|
-
};
|
|
2791
2719
|
static styleProp = { name: 'ɵɵstyleProp', moduleName: CORE };
|
|
2792
|
-
static stylePropInterpolate1 = {
|
|
2793
|
-
name: 'ɵɵstylePropInterpolate1',
|
|
2794
|
-
moduleName: CORE,
|
|
2795
|
-
};
|
|
2796
|
-
static stylePropInterpolate2 = {
|
|
2797
|
-
name: 'ɵɵstylePropInterpolate2',
|
|
2798
|
-
moduleName: CORE,
|
|
2799
|
-
};
|
|
2800
|
-
static stylePropInterpolate3 = {
|
|
2801
|
-
name: 'ɵɵstylePropInterpolate3',
|
|
2802
|
-
moduleName: CORE,
|
|
2803
|
-
};
|
|
2804
|
-
static stylePropInterpolate4 = {
|
|
2805
|
-
name: 'ɵɵstylePropInterpolate4',
|
|
2806
|
-
moduleName: CORE,
|
|
2807
|
-
};
|
|
2808
|
-
static stylePropInterpolate5 = {
|
|
2809
|
-
name: 'ɵɵstylePropInterpolate5',
|
|
2810
|
-
moduleName: CORE,
|
|
2811
|
-
};
|
|
2812
|
-
static stylePropInterpolate6 = {
|
|
2813
|
-
name: 'ɵɵstylePropInterpolate6',
|
|
2814
|
-
moduleName: CORE,
|
|
2815
|
-
};
|
|
2816
|
-
static stylePropInterpolate7 = {
|
|
2817
|
-
name: 'ɵɵstylePropInterpolate7',
|
|
2818
|
-
moduleName: CORE,
|
|
2819
|
-
};
|
|
2820
|
-
static stylePropInterpolate8 = {
|
|
2821
|
-
name: 'ɵɵstylePropInterpolate8',
|
|
2822
|
-
moduleName: CORE,
|
|
2823
|
-
};
|
|
2824
|
-
static stylePropInterpolateV = {
|
|
2825
|
-
name: 'ɵɵstylePropInterpolateV',
|
|
2826
|
-
moduleName: CORE,
|
|
2827
|
-
};
|
|
2828
2720
|
static interpolate = {
|
|
2829
2721
|
name: 'ɵɵinterpolate',
|
|
2830
2722
|
moduleName: CORE,
|
|
@@ -2980,46 +2872,6 @@ class Identifiers {
|
|
|
2980
2872
|
static pipeBindV = { name: 'ɵɵpipeBindV', moduleName: CORE };
|
|
2981
2873
|
static domProperty = { name: 'ɵɵdomProperty', moduleName: CORE };
|
|
2982
2874
|
static property = { name: 'ɵɵproperty', moduleName: CORE };
|
|
2983
|
-
static propertyInterpolate = {
|
|
2984
|
-
name: 'ɵɵpropertyInterpolate',
|
|
2985
|
-
moduleName: CORE,
|
|
2986
|
-
};
|
|
2987
|
-
static propertyInterpolate1 = {
|
|
2988
|
-
name: 'ɵɵpropertyInterpolate1',
|
|
2989
|
-
moduleName: CORE,
|
|
2990
|
-
};
|
|
2991
|
-
static propertyInterpolate2 = {
|
|
2992
|
-
name: 'ɵɵpropertyInterpolate2',
|
|
2993
|
-
moduleName: CORE,
|
|
2994
|
-
};
|
|
2995
|
-
static propertyInterpolate3 = {
|
|
2996
|
-
name: 'ɵɵpropertyInterpolate3',
|
|
2997
|
-
moduleName: CORE,
|
|
2998
|
-
};
|
|
2999
|
-
static propertyInterpolate4 = {
|
|
3000
|
-
name: 'ɵɵpropertyInterpolate4',
|
|
3001
|
-
moduleName: CORE,
|
|
3002
|
-
};
|
|
3003
|
-
static propertyInterpolate5 = {
|
|
3004
|
-
name: 'ɵɵpropertyInterpolate5',
|
|
3005
|
-
moduleName: CORE,
|
|
3006
|
-
};
|
|
3007
|
-
static propertyInterpolate6 = {
|
|
3008
|
-
name: 'ɵɵpropertyInterpolate6',
|
|
3009
|
-
moduleName: CORE,
|
|
3010
|
-
};
|
|
3011
|
-
static propertyInterpolate7 = {
|
|
3012
|
-
name: 'ɵɵpropertyInterpolate7',
|
|
3013
|
-
moduleName: CORE,
|
|
3014
|
-
};
|
|
3015
|
-
static propertyInterpolate8 = {
|
|
3016
|
-
name: 'ɵɵpropertyInterpolate8',
|
|
3017
|
-
moduleName: CORE,
|
|
3018
|
-
};
|
|
3019
|
-
static propertyInterpolateV = {
|
|
3020
|
-
name: 'ɵɵpropertyInterpolateV',
|
|
3021
|
-
moduleName: CORE,
|
|
3022
|
-
};
|
|
3023
2875
|
static i18n = { name: 'ɵɵi18n', moduleName: CORE };
|
|
3024
2876
|
static i18nAttributes = { name: 'ɵɵi18nAttributes', moduleName: CORE };
|
|
3025
2877
|
static i18nExp = { name: 'ɵɵi18nExp', moduleName: CORE };
|
|
@@ -12060,15 +11912,6 @@ const CHAIN_COMPATIBILITY = new Map([
|
|
|
12060
11912
|
[Identifiers.listener, Identifiers.listener],
|
|
12061
11913
|
[Identifiers.property, Identifiers.property],
|
|
12062
11914
|
[Identifiers.styleProp, Identifiers.styleProp],
|
|
12063
|
-
[Identifiers.stylePropInterpolate1, Identifiers.stylePropInterpolate1],
|
|
12064
|
-
[Identifiers.stylePropInterpolate2, Identifiers.stylePropInterpolate2],
|
|
12065
|
-
[Identifiers.stylePropInterpolate3, Identifiers.stylePropInterpolate3],
|
|
12066
|
-
[Identifiers.stylePropInterpolate4, Identifiers.stylePropInterpolate4],
|
|
12067
|
-
[Identifiers.stylePropInterpolate5, Identifiers.stylePropInterpolate5],
|
|
12068
|
-
[Identifiers.stylePropInterpolate6, Identifiers.stylePropInterpolate6],
|
|
12069
|
-
[Identifiers.stylePropInterpolate7, Identifiers.stylePropInterpolate7],
|
|
12070
|
-
[Identifiers.stylePropInterpolate8, Identifiers.stylePropInterpolate8],
|
|
12071
|
-
[Identifiers.stylePropInterpolateV, Identifiers.stylePropInterpolateV],
|
|
12072
11915
|
[Identifiers.syntheticHostListener, Identifiers.syntheticHostListener],
|
|
12073
11916
|
[Identifiers.syntheticHostProperty, Identifiers.syntheticHostProperty],
|
|
12074
11917
|
[Identifiers.templateCreate, Identifiers.templateCreate],
|
|
@@ -12152,11 +11995,11 @@ function chainOperationsInList(opList) {
|
|
|
12152
11995
|
}
|
|
12153
11996
|
|
|
12154
11997
|
/**
|
|
12155
|
-
* Attribute interpolations of the form `[attr.foo]="{{foo}}""` should be "collapsed"
|
|
12156
|
-
*
|
|
11998
|
+
* Attribute or style interpolations of the form `[attr.foo]="{{foo}}""` should be "collapsed"
|
|
11999
|
+
* into a plain instruction, instead of an interpolated one.
|
|
12157
12000
|
*
|
|
12158
|
-
* (We cannot do this for singleton property interpolations,
|
|
12159
|
-
*
|
|
12001
|
+
* (We cannot do this for singleton property interpolations,
|
|
12002
|
+
* because they need to stringify their expressions)
|
|
12160
12003
|
*
|
|
12161
12004
|
* The reification step is also capable of performing this transformation, but doing it early in the
|
|
12162
12005
|
* pipeline allows other phases to accurately know what instruction will be emitted.
|
|
@@ -12164,7 +12007,10 @@ function chainOperationsInList(opList) {
|
|
|
12164
12007
|
function collapseSingletonInterpolations(job) {
|
|
12165
12008
|
for (const unit of job.units) {
|
|
12166
12009
|
for (const op of unit.update) {
|
|
12167
|
-
const eligibleOpKind = op.kind === OpKind.Attribute
|
|
12010
|
+
const eligibleOpKind = op.kind === OpKind.Attribute ||
|
|
12011
|
+
op.kind === OpKind.StyleProp ||
|
|
12012
|
+
op.kind == OpKind.StyleMap ||
|
|
12013
|
+
op.kind === OpKind.ClassMap;
|
|
12168
12014
|
if (eligibleOpKind &&
|
|
12169
12015
|
op.expression instanceof Interpolation &&
|
|
12170
12016
|
op.expression.strings.length === 2 &&
|
|
@@ -18441,8 +18287,7 @@ class _Scanner {
|
|
|
18441
18287
|
length;
|
|
18442
18288
|
peek = 0;
|
|
18443
18289
|
index = -1;
|
|
18444
|
-
|
|
18445
|
-
braceDepth = 0;
|
|
18290
|
+
braceStack = [];
|
|
18446
18291
|
constructor(input) {
|
|
18447
18292
|
this.input = input;
|
|
18448
18293
|
this.length = input.length;
|
|
@@ -18550,18 +18395,17 @@ class _Scanner {
|
|
|
18550
18395
|
return newOperatorToken(start, this.index, str);
|
|
18551
18396
|
}
|
|
18552
18397
|
scanOpenBrace(start, code) {
|
|
18553
|
-
this.
|
|
18398
|
+
this.braceStack.push('expression');
|
|
18554
18399
|
this.advance();
|
|
18555
18400
|
return newCharacterToken(start, this.index, code);
|
|
18556
18401
|
}
|
|
18557
18402
|
scanCloseBrace(start, code) {
|
|
18558
18403
|
this.advance();
|
|
18559
|
-
|
|
18560
|
-
|
|
18404
|
+
const currentBrace = this.braceStack.pop();
|
|
18405
|
+
if (currentBrace === 'interpolation') {
|
|
18561
18406
|
this.tokens.push(newOperatorToken(start, this.index, '}'));
|
|
18562
18407
|
return this.scanTemplateLiteralPart(this.index);
|
|
18563
18408
|
}
|
|
18564
|
-
this.braceDepth--;
|
|
18565
18409
|
return newCharacterToken(start, this.index, code);
|
|
18566
18410
|
}
|
|
18567
18411
|
/**
|
|
@@ -18704,7 +18548,7 @@ class _Scanner {
|
|
|
18704
18548
|
this.advance();
|
|
18705
18549
|
// @ts-expect-error
|
|
18706
18550
|
if (this.peek === $LBRACE) {
|
|
18707
|
-
this.
|
|
18551
|
+
this.braceStack.push('interpolation');
|
|
18708
18552
|
this.tokens.push(new StringToken(start, dollar, buffer + this.input.substring(marker, dollar), StringTokenKind.TemplateLiteralPart));
|
|
18709
18553
|
this.advance();
|
|
18710
18554
|
return newOperatorToken(dollar, this.index, this.input.substring(dollar, this.index));
|
|
@@ -23565,7 +23409,13 @@ function i18nAttributes(slot, i18nAttributesConfig) {
|
|
|
23565
23409
|
return call(Identifiers.i18nAttributes, args, null);
|
|
23566
23410
|
}
|
|
23567
23411
|
function property(name, expression, sanitizer, sourceSpan) {
|
|
23568
|
-
const args = [literal(name)
|
|
23412
|
+
const args = [literal(name)];
|
|
23413
|
+
if (expression instanceof Interpolation) {
|
|
23414
|
+
args.push(interpolationToExpression(expression, sourceSpan));
|
|
23415
|
+
}
|
|
23416
|
+
else {
|
|
23417
|
+
args.push(expression);
|
|
23418
|
+
}
|
|
23569
23419
|
if (sanitizer !== null) {
|
|
23570
23420
|
args.push(sanitizer);
|
|
23571
23421
|
}
|
|
@@ -23578,8 +23428,14 @@ function twoWayProperty(name, expression, sanitizer, sourceSpan) {
|
|
|
23578
23428
|
}
|
|
23579
23429
|
return call(Identifiers.twoWayProperty, args, sourceSpan);
|
|
23580
23430
|
}
|
|
23581
|
-
function attribute(name, expression, sanitizer, namespace) {
|
|
23582
|
-
const args = [literal(name)
|
|
23431
|
+
function attribute(name, expression, sanitizer, namespace, sourceSpan) {
|
|
23432
|
+
const args = [literal(name)];
|
|
23433
|
+
if (expression instanceof Interpolation) {
|
|
23434
|
+
args.push(interpolationToExpression(expression, sourceSpan));
|
|
23435
|
+
}
|
|
23436
|
+
else {
|
|
23437
|
+
args.push(expression);
|
|
23438
|
+
}
|
|
23583
23439
|
if (sanitizer !== null || namespace !== null) {
|
|
23584
23440
|
args.push(sanitizer ?? literal(null));
|
|
23585
23441
|
}
|
|
@@ -23589,7 +23445,13 @@ function attribute(name, expression, sanitizer, namespace) {
|
|
|
23589
23445
|
return call(Identifiers.attribute, args, null);
|
|
23590
23446
|
}
|
|
23591
23447
|
function styleProp(name, expression, unit, sourceSpan) {
|
|
23592
|
-
const args = [literal(name)
|
|
23448
|
+
const args = [literal(name)];
|
|
23449
|
+
if (expression instanceof Interpolation) {
|
|
23450
|
+
args.push(interpolationToExpression(expression, sourceSpan));
|
|
23451
|
+
}
|
|
23452
|
+
else {
|
|
23453
|
+
args.push(expression);
|
|
23454
|
+
}
|
|
23593
23455
|
if (unit !== null) {
|
|
23594
23456
|
args.push(literal(unit));
|
|
23595
23457
|
}
|
|
@@ -23599,10 +23461,16 @@ function classProp(name, expression, sourceSpan) {
|
|
|
23599
23461
|
return call(Identifiers.classProp, [literal(name), expression], sourceSpan);
|
|
23600
23462
|
}
|
|
23601
23463
|
function styleMap(expression, sourceSpan) {
|
|
23602
|
-
|
|
23464
|
+
const value = expression instanceof Interpolation
|
|
23465
|
+
? interpolationToExpression(expression, sourceSpan)
|
|
23466
|
+
: expression;
|
|
23467
|
+
return call(Identifiers.styleMap, [value], sourceSpan);
|
|
23603
23468
|
}
|
|
23604
23469
|
function classMap(expression, sourceSpan) {
|
|
23605
|
-
|
|
23470
|
+
const value = expression instanceof Interpolation
|
|
23471
|
+
? interpolationToExpression(expression, sourceSpan)
|
|
23472
|
+
: expression;
|
|
23473
|
+
return call(Identifiers.classMap, [value], sourceSpan);
|
|
23606
23474
|
}
|
|
23607
23475
|
const PIPE_BINDINGS = [
|
|
23608
23476
|
Identifiers.pipeBind1,
|
|
@@ -23630,35 +23498,6 @@ function i18nExp(expr, sourceSpan) {
|
|
|
23630
23498
|
function i18nApply(slot, sourceSpan) {
|
|
23631
23499
|
return call(Identifiers.i18nApply, [literal(slot)], sourceSpan);
|
|
23632
23500
|
}
|
|
23633
|
-
function propertyInterpolate(name, strings, expressions, sanitizer, sourceSpan) {
|
|
23634
|
-
const interpolationArgs = collateInterpolationArgs(strings, expressions);
|
|
23635
|
-
const extraArgs = [];
|
|
23636
|
-
if (sanitizer !== null) {
|
|
23637
|
-
extraArgs.push(sanitizer);
|
|
23638
|
-
}
|
|
23639
|
-
return callVariadicInstruction(PROPERTY_INTERPOLATE_CONFIG, [literal(name)], interpolationArgs, extraArgs, sourceSpan);
|
|
23640
|
-
}
|
|
23641
|
-
function attributeInterpolate(name, strings, expressions, sanitizer, namespace, sourceSpan) {
|
|
23642
|
-
const interpolationArgs = collateInterpolationArgs(strings, expressions);
|
|
23643
|
-
const value = callVariadicInstructionExpr(VALUE_INTERPOLATE_CONFIG, [], interpolationArgs, [], sourceSpan);
|
|
23644
|
-
return attribute(name, value, sanitizer, namespace);
|
|
23645
|
-
}
|
|
23646
|
-
function stylePropInterpolate(name, strings, expressions, unit, sourceSpan) {
|
|
23647
|
-
const interpolationArgs = collateInterpolationArgs(strings, expressions);
|
|
23648
|
-
const extraArgs = [];
|
|
23649
|
-
if (unit !== null) {
|
|
23650
|
-
extraArgs.push(literal(unit));
|
|
23651
|
-
}
|
|
23652
|
-
return callVariadicInstruction(STYLE_PROP_INTERPOLATE_CONFIG, [literal(name)], interpolationArgs, extraArgs, sourceSpan);
|
|
23653
|
-
}
|
|
23654
|
-
function styleMapInterpolate(strings, expressions, sourceSpan) {
|
|
23655
|
-
const interpolationArgs = collateInterpolationArgs(strings, expressions);
|
|
23656
|
-
return callVariadicInstruction(STYLE_MAP_INTERPOLATE_CONFIG, [], interpolationArgs, [], sourceSpan);
|
|
23657
|
-
}
|
|
23658
|
-
function classMapInterpolate(strings, expressions, sourceSpan) {
|
|
23659
|
-
const interpolationArgs = collateInterpolationArgs(strings, expressions);
|
|
23660
|
-
return callVariadicInstruction(CLASS_MAP_INTERPOLATE_CONFIG, [], interpolationArgs, [], sourceSpan);
|
|
23661
|
-
}
|
|
23662
23501
|
function domProperty(name, expression, sanitizer, sourceSpan) {
|
|
23663
23502
|
const args = [literal(name), expression];
|
|
23664
23503
|
if (sanitizer !== null) {
|
|
@@ -23696,6 +23535,10 @@ function collateInterpolationArgs(strings, expressions) {
|
|
|
23696
23535
|
}
|
|
23697
23536
|
return interpolationArgs;
|
|
23698
23537
|
}
|
|
23538
|
+
function interpolationToExpression(interpolation, sourceSpan) {
|
|
23539
|
+
const interpolationArgs = collateInterpolationArgs(interpolation.strings, interpolation.expressions);
|
|
23540
|
+
return callVariadicInstructionExpr(VALUE_INTERPOLATE_CONFIG, [], interpolationArgs, [], sourceSpan);
|
|
23541
|
+
}
|
|
23699
23542
|
function call(instruction, args, sourceSpan) {
|
|
23700
23543
|
const expr = importExpr(instruction).callFn(args, sourceSpan);
|
|
23701
23544
|
return createStatementOp(new ExpressionStatement(expr, sourceSpan));
|
|
@@ -23730,29 +23573,6 @@ const TEXT_INTERPOLATE_CONFIG = {
|
|
|
23730
23573
|
return (n - 1) / 2;
|
|
23731
23574
|
},
|
|
23732
23575
|
};
|
|
23733
|
-
/**
|
|
23734
|
-
* `InterpolationConfig` for the `propertyInterpolate` instruction.
|
|
23735
|
-
*/
|
|
23736
|
-
const PROPERTY_INTERPOLATE_CONFIG = {
|
|
23737
|
-
constant: [
|
|
23738
|
-
Identifiers.propertyInterpolate,
|
|
23739
|
-
Identifiers.propertyInterpolate1,
|
|
23740
|
-
Identifiers.propertyInterpolate2,
|
|
23741
|
-
Identifiers.propertyInterpolate3,
|
|
23742
|
-
Identifiers.propertyInterpolate4,
|
|
23743
|
-
Identifiers.propertyInterpolate5,
|
|
23744
|
-
Identifiers.propertyInterpolate6,
|
|
23745
|
-
Identifiers.propertyInterpolate7,
|
|
23746
|
-
Identifiers.propertyInterpolate8,
|
|
23747
|
-
],
|
|
23748
|
-
variable: Identifiers.propertyInterpolateV,
|
|
23749
|
-
mapping: (n) => {
|
|
23750
|
-
if (n % 2 === 0) {
|
|
23751
|
-
throw new Error(`Expected odd number of arguments`);
|
|
23752
|
-
}
|
|
23753
|
-
return (n - 1) / 2;
|
|
23754
|
-
},
|
|
23755
|
-
};
|
|
23756
23576
|
const VALUE_INTERPOLATE_CONFIG = {
|
|
23757
23577
|
constant: [
|
|
23758
23578
|
Identifiers.interpolate,
|
|
@@ -23773,75 +23593,6 @@ const VALUE_INTERPOLATE_CONFIG = {
|
|
|
23773
23593
|
return (n - 1) / 2;
|
|
23774
23594
|
},
|
|
23775
23595
|
};
|
|
23776
|
-
/**
|
|
23777
|
-
* `InterpolationConfig` for the `stylePropInterpolate` instruction.
|
|
23778
|
-
*/
|
|
23779
|
-
const STYLE_PROP_INTERPOLATE_CONFIG = {
|
|
23780
|
-
constant: [
|
|
23781
|
-
Identifiers.styleProp,
|
|
23782
|
-
Identifiers.stylePropInterpolate1,
|
|
23783
|
-
Identifiers.stylePropInterpolate2,
|
|
23784
|
-
Identifiers.stylePropInterpolate3,
|
|
23785
|
-
Identifiers.stylePropInterpolate4,
|
|
23786
|
-
Identifiers.stylePropInterpolate5,
|
|
23787
|
-
Identifiers.stylePropInterpolate6,
|
|
23788
|
-
Identifiers.stylePropInterpolate7,
|
|
23789
|
-
Identifiers.stylePropInterpolate8,
|
|
23790
|
-
],
|
|
23791
|
-
variable: Identifiers.stylePropInterpolateV,
|
|
23792
|
-
mapping: (n) => {
|
|
23793
|
-
if (n % 2 === 0) {
|
|
23794
|
-
throw new Error(`Expected odd number of arguments`);
|
|
23795
|
-
}
|
|
23796
|
-
return (n - 1) / 2;
|
|
23797
|
-
},
|
|
23798
|
-
};
|
|
23799
|
-
/**
|
|
23800
|
-
* `InterpolationConfig` for the `styleMapInterpolate` instruction.
|
|
23801
|
-
*/
|
|
23802
|
-
const STYLE_MAP_INTERPOLATE_CONFIG = {
|
|
23803
|
-
constant: [
|
|
23804
|
-
Identifiers.styleMap,
|
|
23805
|
-
Identifiers.styleMapInterpolate1,
|
|
23806
|
-
Identifiers.styleMapInterpolate2,
|
|
23807
|
-
Identifiers.styleMapInterpolate3,
|
|
23808
|
-
Identifiers.styleMapInterpolate4,
|
|
23809
|
-
Identifiers.styleMapInterpolate5,
|
|
23810
|
-
Identifiers.styleMapInterpolate6,
|
|
23811
|
-
Identifiers.styleMapInterpolate7,
|
|
23812
|
-
Identifiers.styleMapInterpolate8,
|
|
23813
|
-
],
|
|
23814
|
-
variable: Identifiers.styleMapInterpolateV,
|
|
23815
|
-
mapping: (n) => {
|
|
23816
|
-
if (n % 2 === 0) {
|
|
23817
|
-
throw new Error(`Expected odd number of arguments`);
|
|
23818
|
-
}
|
|
23819
|
-
return (n - 1) / 2;
|
|
23820
|
-
},
|
|
23821
|
-
};
|
|
23822
|
-
/**
|
|
23823
|
-
* `InterpolationConfig` for the `classMapInterpolate` instruction.
|
|
23824
|
-
*/
|
|
23825
|
-
const CLASS_MAP_INTERPOLATE_CONFIG = {
|
|
23826
|
-
constant: [
|
|
23827
|
-
Identifiers.classMap,
|
|
23828
|
-
Identifiers.classMapInterpolate1,
|
|
23829
|
-
Identifiers.classMapInterpolate2,
|
|
23830
|
-
Identifiers.classMapInterpolate3,
|
|
23831
|
-
Identifiers.classMapInterpolate4,
|
|
23832
|
-
Identifiers.classMapInterpolate5,
|
|
23833
|
-
Identifiers.classMapInterpolate6,
|
|
23834
|
-
Identifiers.classMapInterpolate7,
|
|
23835
|
-
Identifiers.classMapInterpolate8,
|
|
23836
|
-
],
|
|
23837
|
-
variable: Identifiers.classMapInterpolateV,
|
|
23838
|
-
mapping: (n) => {
|
|
23839
|
-
if (n % 2 === 0) {
|
|
23840
|
-
throw new Error(`Expected odd number of arguments`);
|
|
23841
|
-
}
|
|
23842
|
-
return (n - 1) / 2;
|
|
23843
|
-
},
|
|
23844
|
-
};
|
|
23845
23596
|
const PURE_FUNCTION_CONFIG = {
|
|
23846
23597
|
constant: [
|
|
23847
23598
|
Identifiers.pureFunction0,
|
|
@@ -24146,42 +23897,22 @@ function reifyUpdateOperations(_unit, ops) {
|
|
|
24146
23897
|
OpList.replace(op, advance(op.delta, op.sourceSpan));
|
|
24147
23898
|
break;
|
|
24148
23899
|
case OpKind.Property:
|
|
24149
|
-
|
|
24150
|
-
OpList.replace(op, propertyInterpolate(op.name, op.expression.strings, op.expression.expressions, op.sanitizer, op.sourceSpan));
|
|
24151
|
-
}
|
|
24152
|
-
else {
|
|
24153
|
-
OpList.replace(op, property(op.name, op.expression, op.sanitizer, op.sourceSpan));
|
|
24154
|
-
}
|
|
23900
|
+
OpList.replace(op, property(op.name, op.expression, op.sanitizer, op.sourceSpan));
|
|
24155
23901
|
break;
|
|
24156
23902
|
case OpKind.TwoWayProperty:
|
|
24157
23903
|
OpList.replace(op, twoWayProperty(op.name, op.expression, op.sanitizer, op.sourceSpan));
|
|
24158
23904
|
break;
|
|
24159
23905
|
case OpKind.StyleProp:
|
|
24160
|
-
|
|
24161
|
-
OpList.replace(op, stylePropInterpolate(op.name, op.expression.strings, op.expression.expressions, op.unit, op.sourceSpan));
|
|
24162
|
-
}
|
|
24163
|
-
else {
|
|
24164
|
-
OpList.replace(op, styleProp(op.name, op.expression, op.unit, op.sourceSpan));
|
|
24165
|
-
}
|
|
23906
|
+
OpList.replace(op, styleProp(op.name, op.expression, op.unit, op.sourceSpan));
|
|
24166
23907
|
break;
|
|
24167
23908
|
case OpKind.ClassProp:
|
|
24168
23909
|
OpList.replace(op, classProp(op.name, op.expression, op.sourceSpan));
|
|
24169
23910
|
break;
|
|
24170
23911
|
case OpKind.StyleMap:
|
|
24171
|
-
|
|
24172
|
-
OpList.replace(op, styleMapInterpolate(op.expression.strings, op.expression.expressions, op.sourceSpan));
|
|
24173
|
-
}
|
|
24174
|
-
else {
|
|
24175
|
-
OpList.replace(op, styleMap(op.expression, op.sourceSpan));
|
|
24176
|
-
}
|
|
23912
|
+
OpList.replace(op, styleMap(op.expression, op.sourceSpan));
|
|
24177
23913
|
break;
|
|
24178
23914
|
case OpKind.ClassMap:
|
|
24179
|
-
|
|
24180
|
-
OpList.replace(op, classMapInterpolate(op.expression.strings, op.expression.expressions, op.sourceSpan));
|
|
24181
|
-
}
|
|
24182
|
-
else {
|
|
24183
|
-
OpList.replace(op, classMap(op.expression, op.sourceSpan));
|
|
24184
|
-
}
|
|
23915
|
+
OpList.replace(op, classMap(op.expression, op.sourceSpan));
|
|
24185
23916
|
break;
|
|
24186
23917
|
case OpKind.I18nExpression:
|
|
24187
23918
|
OpList.replace(op, i18nExp(op.expression, op.sourceSpan));
|
|
@@ -24193,12 +23924,7 @@ function reifyUpdateOperations(_unit, ops) {
|
|
|
24193
23924
|
OpList.replace(op, textInterpolate(op.interpolation.strings, op.interpolation.expressions, op.sourceSpan));
|
|
24194
23925
|
break;
|
|
24195
23926
|
case OpKind.Attribute:
|
|
24196
|
-
|
|
24197
|
-
OpList.replace(op, attributeInterpolate(op.name, op.expression.strings, op.expression.expressions, op.sanitizer, op.namespace, op.sourceSpan));
|
|
24198
|
-
}
|
|
24199
|
-
else {
|
|
24200
|
-
OpList.replace(op, attribute(op.name, op.expression, op.sanitizer, op.namespace));
|
|
24201
|
-
}
|
|
23927
|
+
OpList.replace(op, attribute(op.name, op.expression, op.sanitizer, op.namespace, op.sourceSpan));
|
|
24202
23928
|
break;
|
|
24203
23929
|
case OpKind.DomProperty:
|
|
24204
23930
|
if (op.expression instanceof Interpolation) {
|
|
@@ -25696,8 +25422,6 @@ function countVariables(job) {
|
|
|
25696
25422
|
function varsUsedByOp(op) {
|
|
25697
25423
|
let slots;
|
|
25698
25424
|
switch (op.kind) {
|
|
25699
|
-
case OpKind.Property:
|
|
25700
|
-
case OpKind.DomProperty:
|
|
25701
25425
|
case OpKind.Attribute:
|
|
25702
25426
|
// All of these bindings use 1 variable slot, plus 1 slot for every interpolated expression,
|
|
25703
25427
|
// if any.
|
|
@@ -25706,6 +25430,15 @@ function varsUsedByOp(op) {
|
|
|
25706
25430
|
slots += op.expression.expressions.length;
|
|
25707
25431
|
}
|
|
25708
25432
|
return slots;
|
|
25433
|
+
case OpKind.Property:
|
|
25434
|
+
case OpKind.DomProperty:
|
|
25435
|
+
slots = 1;
|
|
25436
|
+
// We need to assign a slot even for singleton interpolations, because the
|
|
25437
|
+
// runtime needs to store both the raw value and the stringified one.
|
|
25438
|
+
if (op.expression instanceof Interpolation) {
|
|
25439
|
+
slots += op.expression.expressions.length;
|
|
25440
|
+
}
|
|
25441
|
+
return slots;
|
|
25709
25442
|
case OpKind.TwoWayProperty:
|
|
25710
25443
|
// Two-way properties can only have expressions so they only need one variable slot.
|
|
25711
25444
|
return 1;
|
|
@@ -33920,7 +33653,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
|
|
|
33920
33653
|
function compileDeclareClassMetadata(metadata) {
|
|
33921
33654
|
const definitionMap = new DefinitionMap();
|
|
33922
33655
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
|
|
33923
|
-
definitionMap.set('version', literal('20.0.0-rc.
|
|
33656
|
+
definitionMap.set('version', literal('20.0.0-rc.3'));
|
|
33924
33657
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
33925
33658
|
definitionMap.set('type', metadata.type);
|
|
33926
33659
|
definitionMap.set('decorators', metadata.decorators);
|
|
@@ -33938,7 +33671,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
|
|
|
33938
33671
|
callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? literal(null));
|
|
33939
33672
|
callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? literal(null));
|
|
33940
33673
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
|
|
33941
|
-
definitionMap.set('version', literal('20.0.0-rc.
|
|
33674
|
+
definitionMap.set('version', literal('20.0.0-rc.3'));
|
|
33942
33675
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
33943
33676
|
definitionMap.set('type', metadata.type);
|
|
33944
33677
|
definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
|
|
@@ -34033,7 +33766,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
34033
33766
|
const definitionMap = new DefinitionMap();
|
|
34034
33767
|
const minVersion = getMinimumVersionForPartialOutput(meta);
|
|
34035
33768
|
definitionMap.set('minVersion', literal(minVersion));
|
|
34036
|
-
definitionMap.set('version', literal('20.0.0-rc.
|
|
33769
|
+
definitionMap.set('version', literal('20.0.0-rc.3'));
|
|
34037
33770
|
// e.g. `type: MyDirective`
|
|
34038
33771
|
definitionMap.set('type', meta.type.value);
|
|
34039
33772
|
if (meta.isStandalone !== undefined) {
|
|
@@ -34449,7 +34182,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
|
|
|
34449
34182
|
function compileDeclareFactoryFunction(meta) {
|
|
34450
34183
|
const definitionMap = new DefinitionMap();
|
|
34451
34184
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
|
|
34452
|
-
definitionMap.set('version', literal('20.0.0-rc.
|
|
34185
|
+
definitionMap.set('version', literal('20.0.0-rc.3'));
|
|
34453
34186
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
34454
34187
|
definitionMap.set('type', meta.type.value);
|
|
34455
34188
|
definitionMap.set('deps', compileDependencies(meta.deps));
|
|
@@ -34484,7 +34217,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
34484
34217
|
function createInjectableDefinitionMap(meta) {
|
|
34485
34218
|
const definitionMap = new DefinitionMap();
|
|
34486
34219
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
|
|
34487
|
-
definitionMap.set('version', literal('20.0.0-rc.
|
|
34220
|
+
definitionMap.set('version', literal('20.0.0-rc.3'));
|
|
34488
34221
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
34489
34222
|
definitionMap.set('type', meta.type.value);
|
|
34490
34223
|
// Only generate providedIn property if it has a non-null value
|
|
@@ -34535,7 +34268,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
34535
34268
|
function createInjectorDefinitionMap(meta) {
|
|
34536
34269
|
const definitionMap = new DefinitionMap();
|
|
34537
34270
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
|
|
34538
|
-
definitionMap.set('version', literal('20.0.0-rc.
|
|
34271
|
+
definitionMap.set('version', literal('20.0.0-rc.3'));
|
|
34539
34272
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
34540
34273
|
definitionMap.set('type', meta.type.value);
|
|
34541
34274
|
definitionMap.set('providers', meta.providers);
|
|
@@ -34568,7 +34301,7 @@ function createNgModuleDefinitionMap(meta) {
|
|
|
34568
34301
|
throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
|
|
34569
34302
|
}
|
|
34570
34303
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
|
|
34571
|
-
definitionMap.set('version', literal('20.0.0-rc.
|
|
34304
|
+
definitionMap.set('version', literal('20.0.0-rc.3'));
|
|
34572
34305
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
34573
34306
|
definitionMap.set('type', meta.type.value);
|
|
34574
34307
|
// We only generate the keys in the metadata if the arrays contain values.
|
|
@@ -34619,7 +34352,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
34619
34352
|
function createPipeDefinitionMap(meta) {
|
|
34620
34353
|
const definitionMap = new DefinitionMap();
|
|
34621
34354
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
34622
|
-
definitionMap.set('version', literal('20.0.0-rc.
|
|
34355
|
+
definitionMap.set('version', literal('20.0.0-rc.3'));
|
|
34623
34356
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
34624
34357
|
// e.g. `type: MyPipe`
|
|
34625
34358
|
definitionMap.set('type', meta.type.value);
|
|
@@ -34775,7 +34508,7 @@ function compileHmrUpdateCallback(definitions, constantStatements, meta) {
|
|
|
34775
34508
|
* @description
|
|
34776
34509
|
* Entry point for all public APIs of the compiler package.
|
|
34777
34510
|
*/
|
|
34778
|
-
const VERSION = new Version('20.0.0-rc.
|
|
34511
|
+
const VERSION = new Version('20.0.0-rc.3');
|
|
34779
34512
|
|
|
34780
34513
|
//////////////////////////////////////
|
|
34781
34514
|
// THIS FILE HAS GLOBAL SIDE EFFECT //
|