@angular/compiler 14.0.0-next.0 → 14.0.0-next.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/src/compiler.mjs +2 -3
- package/esm2020/src/compiler_facade_interface.mjs +1 -1
- package/esm2020/src/compiler_util/expression_converter.mjs +38 -44
- package/esm2020/src/expression_parser/ast.mjs +1 -35
- package/esm2020/src/expression_parser/parser.mjs +78 -40
- package/esm2020/src/jit_compiler_facade.mjs +6 -3
- package/esm2020/src/ml_parser/lexer.mjs +2 -2
- package/esm2020/src/output/output_ast.mjs +1 -1
- package/esm2020/src/parse_util.mjs +2 -2
- package/esm2020/src/render3/partial/api.mjs +1 -1
- package/esm2020/src/render3/partial/class_metadata.mjs +1 -1
- package/esm2020/src/render3/partial/directive.mjs +1 -1
- package/esm2020/src/render3/partial/factory.mjs +1 -1
- package/esm2020/src/render3/partial/injectable.mjs +1 -1
- package/esm2020/src/render3/partial/injector.mjs +1 -1
- package/esm2020/src/render3/partial/ng_module.mjs +1 -1
- package/esm2020/src/render3/partial/pipe.mjs +1 -1
- package/esm2020/src/render3/r3_identifiers.mjs +3 -1
- package/esm2020/src/render3/r3_module_compiler.mjs +45 -8
- package/esm2020/src/render3/r3_pipe_compiler.mjs +4 -1
- package/esm2020/src/render3/r3_template_transform.mjs +9 -9
- package/esm2020/src/render3/view/api.mjs +1 -1
- package/esm2020/src/render3/view/compiler.mjs +44 -41
- package/esm2020/src/render3/view/i18n/get_msg_utils.mjs +2 -5
- package/esm2020/src/render3/view/i18n/meta.mjs +11 -6
- package/esm2020/src/render3/view/style_parser.mjs +2 -2
- package/esm2020/src/render3/view/styling_builder.mjs +3 -3
- package/esm2020/src/render3/view/template.mjs +100 -131
- package/esm2020/src/render3/view/util.mjs +94 -15
- package/esm2020/src/selector.mjs +3 -3
- package/esm2020/src/shadow_css.mjs +2 -2
- package/esm2020/src/template_parser/binding_parser.mjs +16 -16
- package/esm2020/src/version.mjs +1 -1
- package/fesm2015/compiler.mjs +798 -791
- package/fesm2015/compiler.mjs.map +1 -1
- package/fesm2015/testing.mjs +1 -1
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2020/compiler.mjs +794 -789
- package/fesm2020/compiler.mjs.map +1 -1
- package/fesm2020/testing.mjs +1 -1
- package/fesm2020/testing.mjs.map +1 -1
- package/package.json +10 -2
- package/src/compiler.d.ts +1 -2
- package/src/compiler_facade_interface.d.ts +4 -0
- package/src/compiler_util/expression_converter.d.ts +3 -4
- package/src/expression_parser/ast.d.ts +0 -25
- package/src/expression_parser/parser.d.ts +22 -6
- package/src/output/output_ast.d.ts +2 -1
- package/src/render3/partial/api.d.ts +10 -0
- package/src/render3/r3_identifiers.d.ts +2 -0
- package/src/render3/r3_module_compiler.d.ts +30 -4
- package/src/render3/r3_pipe_compiler.d.ts +4 -0
- package/src/render3/view/api.d.ts +4 -0
- package/src/render3/view/i18n/meta.d.ts +1 -1
- package/src/render3/view/template.d.ts +1 -4
- package/src/render3/view/util.d.ts +19 -2
- package/src/template_parser/binding_parser.d.ts +4 -3
- package/esm2020/src/identifiers.mjs +0 -92
- package/src/identifiers.d.ts +0 -44
package/fesm2015/compiler.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v14.0.0-next.
|
|
2
|
+
* @license Angular v14.0.0-next.11
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -224,11 +224,11 @@ class CssSelector {
|
|
|
224
224
|
const prefix = match[3 /* PREFIX */];
|
|
225
225
|
if (prefix === '#') {
|
|
226
226
|
// #hash
|
|
227
|
-
current.addAttribute('id', tag.
|
|
227
|
+
current.addAttribute('id', tag.slice(1));
|
|
228
228
|
}
|
|
229
229
|
else if (prefix === '.') {
|
|
230
230
|
// Class
|
|
231
|
-
current.addClassName(tag.
|
|
231
|
+
current.addClassName(tag.slice(1));
|
|
232
232
|
}
|
|
233
233
|
else {
|
|
234
234
|
// Element
|
|
@@ -2737,206 +2737,208 @@ function isLongStringLiteral(expr) {
|
|
|
2737
2737
|
* Use of this source code is governed by an MIT-style license that can be
|
|
2738
2738
|
* found in the LICENSE file at https://angular.io/license
|
|
2739
2739
|
*/
|
|
2740
|
-
const CORE
|
|
2741
|
-
class Identifiers
|
|
2740
|
+
const CORE = '@angular/core';
|
|
2741
|
+
class Identifiers {
|
|
2742
2742
|
}
|
|
2743
2743
|
/* Methods */
|
|
2744
|
-
Identifiers
|
|
2745
|
-
Identifiers
|
|
2746
|
-
Identifiers
|
|
2747
|
-
Identifiers
|
|
2744
|
+
Identifiers.NEW_METHOD = 'factory';
|
|
2745
|
+
Identifiers.TRANSFORM_METHOD = 'transform';
|
|
2746
|
+
Identifiers.PATCH_DEPS = 'patchedDeps';
|
|
2747
|
+
Identifiers.core = { name: null, moduleName: CORE };
|
|
2748
2748
|
/* Instructions */
|
|
2749
|
-
Identifiers
|
|
2750
|
-
Identifiers
|
|
2751
|
-
Identifiers
|
|
2752
|
-
Identifiers
|
|
2753
|
-
Identifiers
|
|
2754
|
-
Identifiers
|
|
2755
|
-
Identifiers
|
|
2756
|
-
Identifiers
|
|
2757
|
-
Identifiers
|
|
2758
|
-
Identifiers
|
|
2759
|
-
Identifiers
|
|
2760
|
-
Identifiers
|
|
2761
|
-
Identifiers
|
|
2762
|
-
Identifiers
|
|
2763
|
-
Identifiers
|
|
2764
|
-
Identifiers
|
|
2765
|
-
Identifiers
|
|
2766
|
-
Identifiers
|
|
2767
|
-
Identifiers
|
|
2768
|
-
Identifiers
|
|
2769
|
-
Identifiers
|
|
2770
|
-
Identifiers
|
|
2771
|
-
Identifiers
|
|
2772
|
-
Identifiers
|
|
2773
|
-
Identifiers
|
|
2774
|
-
Identifiers
|
|
2775
|
-
Identifiers
|
|
2776
|
-
Identifiers
|
|
2777
|
-
Identifiers
|
|
2778
|
-
Identifiers
|
|
2779
|
-
Identifiers
|
|
2780
|
-
Identifiers
|
|
2781
|
-
Identifiers
|
|
2782
|
-
Identifiers
|
|
2783
|
-
Identifiers
|
|
2784
|
-
Identifiers
|
|
2785
|
-
Identifiers
|
|
2786
|
-
Identifiers
|
|
2787
|
-
Identifiers
|
|
2788
|
-
Identifiers
|
|
2789
|
-
Identifiers
|
|
2790
|
-
Identifiers
|
|
2791
|
-
Identifiers
|
|
2792
|
-
Identifiers
|
|
2793
|
-
Identifiers
|
|
2794
|
-
Identifiers
|
|
2795
|
-
Identifiers
|
|
2796
|
-
Identifiers
|
|
2797
|
-
Identifiers
|
|
2798
|
-
Identifiers
|
|
2799
|
-
Identifiers
|
|
2800
|
-
Identifiers
|
|
2801
|
-
Identifiers
|
|
2802
|
-
Identifiers
|
|
2803
|
-
Identifiers
|
|
2804
|
-
Identifiers
|
|
2805
|
-
Identifiers
|
|
2806
|
-
Identifiers
|
|
2807
|
-
Identifiers
|
|
2808
|
-
Identifiers
|
|
2809
|
-
Identifiers
|
|
2810
|
-
Identifiers
|
|
2811
|
-
Identifiers
|
|
2812
|
-
Identifiers
|
|
2813
|
-
Identifiers
|
|
2814
|
-
Identifiers
|
|
2815
|
-
Identifiers
|
|
2816
|
-
Identifiers
|
|
2817
|
-
Identifiers
|
|
2818
|
-
Identifiers
|
|
2819
|
-
Identifiers
|
|
2820
|
-
Identifiers
|
|
2821
|
-
Identifiers
|
|
2822
|
-
Identifiers
|
|
2823
|
-
Identifiers
|
|
2824
|
-
Identifiers
|
|
2825
|
-
Identifiers
|
|
2826
|
-
Identifiers
|
|
2827
|
-
Identifiers
|
|
2828
|
-
Identifiers
|
|
2829
|
-
Identifiers
|
|
2830
|
-
Identifiers
|
|
2831
|
-
Identifiers
|
|
2832
|
-
Identifiers
|
|
2833
|
-
Identifiers
|
|
2834
|
-
Identifiers
|
|
2835
|
-
Identifiers
|
|
2836
|
-
Identifiers
|
|
2837
|
-
Identifiers
|
|
2838
|
-
Identifiers
|
|
2839
|
-
Identifiers
|
|
2840
|
-
Identifiers
|
|
2841
|
-
Identifiers
|
|
2842
|
-
Identifiers
|
|
2843
|
-
Identifiers
|
|
2844
|
-
Identifiers
|
|
2845
|
-
Identifiers
|
|
2846
|
-
Identifiers
|
|
2847
|
-
Identifiers
|
|
2848
|
-
Identifiers
|
|
2849
|
-
Identifiers
|
|
2850
|
-
Identifiers
|
|
2851
|
-
Identifiers
|
|
2852
|
-
Identifiers
|
|
2853
|
-
Identifiers
|
|
2854
|
-
Identifiers
|
|
2855
|
-
Identifiers
|
|
2856
|
-
Identifiers
|
|
2857
|
-
Identifiers
|
|
2858
|
-
Identifiers
|
|
2859
|
-
Identifiers
|
|
2860
|
-
Identifiers
|
|
2861
|
-
Identifiers
|
|
2862
|
-
Identifiers
|
|
2863
|
-
Identifiers
|
|
2864
|
-
Identifiers
|
|
2865
|
-
Identifiers
|
|
2866
|
-
Identifiers
|
|
2867
|
-
Identifiers
|
|
2868
|
-
Identifiers
|
|
2869
|
-
Identifiers
|
|
2870
|
-
Identifiers
|
|
2871
|
-
Identifiers
|
|
2872
|
-
Identifiers
|
|
2873
|
-
Identifiers
|
|
2874
|
-
Identifiers
|
|
2749
|
+
Identifiers.namespaceHTML = { name: 'ɵɵnamespaceHTML', moduleName: CORE };
|
|
2750
|
+
Identifiers.namespaceMathML = { name: 'ɵɵnamespaceMathML', moduleName: CORE };
|
|
2751
|
+
Identifiers.namespaceSVG = { name: 'ɵɵnamespaceSVG', moduleName: CORE };
|
|
2752
|
+
Identifiers.element = { name: 'ɵɵelement', moduleName: CORE };
|
|
2753
|
+
Identifiers.elementStart = { name: 'ɵɵelementStart', moduleName: CORE };
|
|
2754
|
+
Identifiers.elementEnd = { name: 'ɵɵelementEnd', moduleName: CORE };
|
|
2755
|
+
Identifiers.advance = { name: 'ɵɵadvance', moduleName: CORE };
|
|
2756
|
+
Identifiers.syntheticHostProperty = { name: 'ɵɵsyntheticHostProperty', moduleName: CORE };
|
|
2757
|
+
Identifiers.syntheticHostListener = { name: 'ɵɵsyntheticHostListener', moduleName: CORE };
|
|
2758
|
+
Identifiers.attribute = { name: 'ɵɵattribute', moduleName: CORE };
|
|
2759
|
+
Identifiers.attributeInterpolate1 = { name: 'ɵɵattributeInterpolate1', moduleName: CORE };
|
|
2760
|
+
Identifiers.attributeInterpolate2 = { name: 'ɵɵattributeInterpolate2', moduleName: CORE };
|
|
2761
|
+
Identifiers.attributeInterpolate3 = { name: 'ɵɵattributeInterpolate3', moduleName: CORE };
|
|
2762
|
+
Identifiers.attributeInterpolate4 = { name: 'ɵɵattributeInterpolate4', moduleName: CORE };
|
|
2763
|
+
Identifiers.attributeInterpolate5 = { name: 'ɵɵattributeInterpolate5', moduleName: CORE };
|
|
2764
|
+
Identifiers.attributeInterpolate6 = { name: 'ɵɵattributeInterpolate6', moduleName: CORE };
|
|
2765
|
+
Identifiers.attributeInterpolate7 = { name: 'ɵɵattributeInterpolate7', moduleName: CORE };
|
|
2766
|
+
Identifiers.attributeInterpolate8 = { name: 'ɵɵattributeInterpolate8', moduleName: CORE };
|
|
2767
|
+
Identifiers.attributeInterpolateV = { name: 'ɵɵattributeInterpolateV', moduleName: CORE };
|
|
2768
|
+
Identifiers.classProp = { name: 'ɵɵclassProp', moduleName: CORE };
|
|
2769
|
+
Identifiers.elementContainerStart = { name: 'ɵɵelementContainerStart', moduleName: CORE };
|
|
2770
|
+
Identifiers.elementContainerEnd = { name: 'ɵɵelementContainerEnd', moduleName: CORE };
|
|
2771
|
+
Identifiers.elementContainer = { name: 'ɵɵelementContainer', moduleName: CORE };
|
|
2772
|
+
Identifiers.styleMap = { name: 'ɵɵstyleMap', moduleName: CORE };
|
|
2773
|
+
Identifiers.styleMapInterpolate1 = { name: 'ɵɵstyleMapInterpolate1', moduleName: CORE };
|
|
2774
|
+
Identifiers.styleMapInterpolate2 = { name: 'ɵɵstyleMapInterpolate2', moduleName: CORE };
|
|
2775
|
+
Identifiers.styleMapInterpolate3 = { name: 'ɵɵstyleMapInterpolate3', moduleName: CORE };
|
|
2776
|
+
Identifiers.styleMapInterpolate4 = { name: 'ɵɵstyleMapInterpolate4', moduleName: CORE };
|
|
2777
|
+
Identifiers.styleMapInterpolate5 = { name: 'ɵɵstyleMapInterpolate5', moduleName: CORE };
|
|
2778
|
+
Identifiers.styleMapInterpolate6 = { name: 'ɵɵstyleMapInterpolate6', moduleName: CORE };
|
|
2779
|
+
Identifiers.styleMapInterpolate7 = { name: 'ɵɵstyleMapInterpolate7', moduleName: CORE };
|
|
2780
|
+
Identifiers.styleMapInterpolate8 = { name: 'ɵɵstyleMapInterpolate8', moduleName: CORE };
|
|
2781
|
+
Identifiers.styleMapInterpolateV = { name: 'ɵɵstyleMapInterpolateV', moduleName: CORE };
|
|
2782
|
+
Identifiers.classMap = { name: 'ɵɵclassMap', moduleName: CORE };
|
|
2783
|
+
Identifiers.classMapInterpolate1 = { name: 'ɵɵclassMapInterpolate1', moduleName: CORE };
|
|
2784
|
+
Identifiers.classMapInterpolate2 = { name: 'ɵɵclassMapInterpolate2', moduleName: CORE };
|
|
2785
|
+
Identifiers.classMapInterpolate3 = { name: 'ɵɵclassMapInterpolate3', moduleName: CORE };
|
|
2786
|
+
Identifiers.classMapInterpolate4 = { name: 'ɵɵclassMapInterpolate4', moduleName: CORE };
|
|
2787
|
+
Identifiers.classMapInterpolate5 = { name: 'ɵɵclassMapInterpolate5', moduleName: CORE };
|
|
2788
|
+
Identifiers.classMapInterpolate6 = { name: 'ɵɵclassMapInterpolate6', moduleName: CORE };
|
|
2789
|
+
Identifiers.classMapInterpolate7 = { name: 'ɵɵclassMapInterpolate7', moduleName: CORE };
|
|
2790
|
+
Identifiers.classMapInterpolate8 = { name: 'ɵɵclassMapInterpolate8', moduleName: CORE };
|
|
2791
|
+
Identifiers.classMapInterpolateV = { name: 'ɵɵclassMapInterpolateV', moduleName: CORE };
|
|
2792
|
+
Identifiers.styleProp = { name: 'ɵɵstyleProp', moduleName: CORE };
|
|
2793
|
+
Identifiers.stylePropInterpolate1 = { name: 'ɵɵstylePropInterpolate1', moduleName: CORE };
|
|
2794
|
+
Identifiers.stylePropInterpolate2 = { name: 'ɵɵstylePropInterpolate2', moduleName: CORE };
|
|
2795
|
+
Identifiers.stylePropInterpolate3 = { name: 'ɵɵstylePropInterpolate3', moduleName: CORE };
|
|
2796
|
+
Identifiers.stylePropInterpolate4 = { name: 'ɵɵstylePropInterpolate4', moduleName: CORE };
|
|
2797
|
+
Identifiers.stylePropInterpolate5 = { name: 'ɵɵstylePropInterpolate5', moduleName: CORE };
|
|
2798
|
+
Identifiers.stylePropInterpolate6 = { name: 'ɵɵstylePropInterpolate6', moduleName: CORE };
|
|
2799
|
+
Identifiers.stylePropInterpolate7 = { name: 'ɵɵstylePropInterpolate7', moduleName: CORE };
|
|
2800
|
+
Identifiers.stylePropInterpolate8 = { name: 'ɵɵstylePropInterpolate8', moduleName: CORE };
|
|
2801
|
+
Identifiers.stylePropInterpolateV = { name: 'ɵɵstylePropInterpolateV', moduleName: CORE };
|
|
2802
|
+
Identifiers.nextContext = { name: 'ɵɵnextContext', moduleName: CORE };
|
|
2803
|
+
Identifiers.resetView = { name: 'ɵɵresetView', moduleName: CORE };
|
|
2804
|
+
Identifiers.templateCreate = { name: 'ɵɵtemplate', moduleName: CORE };
|
|
2805
|
+
Identifiers.text = { name: 'ɵɵtext', moduleName: CORE };
|
|
2806
|
+
Identifiers.enableBindings = { name: 'ɵɵenableBindings', moduleName: CORE };
|
|
2807
|
+
Identifiers.disableBindings = { name: 'ɵɵdisableBindings', moduleName: CORE };
|
|
2808
|
+
Identifiers.getCurrentView = { name: 'ɵɵgetCurrentView', moduleName: CORE };
|
|
2809
|
+
Identifiers.textInterpolate = { name: 'ɵɵtextInterpolate', moduleName: CORE };
|
|
2810
|
+
Identifiers.textInterpolate1 = { name: 'ɵɵtextInterpolate1', moduleName: CORE };
|
|
2811
|
+
Identifiers.textInterpolate2 = { name: 'ɵɵtextInterpolate2', moduleName: CORE };
|
|
2812
|
+
Identifiers.textInterpolate3 = { name: 'ɵɵtextInterpolate3', moduleName: CORE };
|
|
2813
|
+
Identifiers.textInterpolate4 = { name: 'ɵɵtextInterpolate4', moduleName: CORE };
|
|
2814
|
+
Identifiers.textInterpolate5 = { name: 'ɵɵtextInterpolate5', moduleName: CORE };
|
|
2815
|
+
Identifiers.textInterpolate6 = { name: 'ɵɵtextInterpolate6', moduleName: CORE };
|
|
2816
|
+
Identifiers.textInterpolate7 = { name: 'ɵɵtextInterpolate7', moduleName: CORE };
|
|
2817
|
+
Identifiers.textInterpolate8 = { name: 'ɵɵtextInterpolate8', moduleName: CORE };
|
|
2818
|
+
Identifiers.textInterpolateV = { name: 'ɵɵtextInterpolateV', moduleName: CORE };
|
|
2819
|
+
Identifiers.restoreView = { name: 'ɵɵrestoreView', moduleName: CORE };
|
|
2820
|
+
Identifiers.pureFunction0 = { name: 'ɵɵpureFunction0', moduleName: CORE };
|
|
2821
|
+
Identifiers.pureFunction1 = { name: 'ɵɵpureFunction1', moduleName: CORE };
|
|
2822
|
+
Identifiers.pureFunction2 = { name: 'ɵɵpureFunction2', moduleName: CORE };
|
|
2823
|
+
Identifiers.pureFunction3 = { name: 'ɵɵpureFunction3', moduleName: CORE };
|
|
2824
|
+
Identifiers.pureFunction4 = { name: 'ɵɵpureFunction4', moduleName: CORE };
|
|
2825
|
+
Identifiers.pureFunction5 = { name: 'ɵɵpureFunction5', moduleName: CORE };
|
|
2826
|
+
Identifiers.pureFunction6 = { name: 'ɵɵpureFunction6', moduleName: CORE };
|
|
2827
|
+
Identifiers.pureFunction7 = { name: 'ɵɵpureFunction7', moduleName: CORE };
|
|
2828
|
+
Identifiers.pureFunction8 = { name: 'ɵɵpureFunction8', moduleName: CORE };
|
|
2829
|
+
Identifiers.pureFunctionV = { name: 'ɵɵpureFunctionV', moduleName: CORE };
|
|
2830
|
+
Identifiers.pipeBind1 = { name: 'ɵɵpipeBind1', moduleName: CORE };
|
|
2831
|
+
Identifiers.pipeBind2 = { name: 'ɵɵpipeBind2', moduleName: CORE };
|
|
2832
|
+
Identifiers.pipeBind3 = { name: 'ɵɵpipeBind3', moduleName: CORE };
|
|
2833
|
+
Identifiers.pipeBind4 = { name: 'ɵɵpipeBind4', moduleName: CORE };
|
|
2834
|
+
Identifiers.pipeBindV = { name: 'ɵɵpipeBindV', moduleName: CORE };
|
|
2835
|
+
Identifiers.hostProperty = { name: 'ɵɵhostProperty', moduleName: CORE };
|
|
2836
|
+
Identifiers.property = { name: 'ɵɵproperty', moduleName: CORE };
|
|
2837
|
+
Identifiers.propertyInterpolate = { name: 'ɵɵpropertyInterpolate', moduleName: CORE };
|
|
2838
|
+
Identifiers.propertyInterpolate1 = { name: 'ɵɵpropertyInterpolate1', moduleName: CORE };
|
|
2839
|
+
Identifiers.propertyInterpolate2 = { name: 'ɵɵpropertyInterpolate2', moduleName: CORE };
|
|
2840
|
+
Identifiers.propertyInterpolate3 = { name: 'ɵɵpropertyInterpolate3', moduleName: CORE };
|
|
2841
|
+
Identifiers.propertyInterpolate4 = { name: 'ɵɵpropertyInterpolate4', moduleName: CORE };
|
|
2842
|
+
Identifiers.propertyInterpolate5 = { name: 'ɵɵpropertyInterpolate5', moduleName: CORE };
|
|
2843
|
+
Identifiers.propertyInterpolate6 = { name: 'ɵɵpropertyInterpolate6', moduleName: CORE };
|
|
2844
|
+
Identifiers.propertyInterpolate7 = { name: 'ɵɵpropertyInterpolate7', moduleName: CORE };
|
|
2845
|
+
Identifiers.propertyInterpolate8 = { name: 'ɵɵpropertyInterpolate8', moduleName: CORE };
|
|
2846
|
+
Identifiers.propertyInterpolateV = { name: 'ɵɵpropertyInterpolateV', moduleName: CORE };
|
|
2847
|
+
Identifiers.i18n = { name: 'ɵɵi18n', moduleName: CORE };
|
|
2848
|
+
Identifiers.i18nAttributes = { name: 'ɵɵi18nAttributes', moduleName: CORE };
|
|
2849
|
+
Identifiers.i18nExp = { name: 'ɵɵi18nExp', moduleName: CORE };
|
|
2850
|
+
Identifiers.i18nStart = { name: 'ɵɵi18nStart', moduleName: CORE };
|
|
2851
|
+
Identifiers.i18nEnd = { name: 'ɵɵi18nEnd', moduleName: CORE };
|
|
2852
|
+
Identifiers.i18nApply = { name: 'ɵɵi18nApply', moduleName: CORE };
|
|
2853
|
+
Identifiers.i18nPostprocess = { name: 'ɵɵi18nPostprocess', moduleName: CORE };
|
|
2854
|
+
Identifiers.pipe = { name: 'ɵɵpipe', moduleName: CORE };
|
|
2855
|
+
Identifiers.projection = { name: 'ɵɵprojection', moduleName: CORE };
|
|
2856
|
+
Identifiers.projectionDef = { name: 'ɵɵprojectionDef', moduleName: CORE };
|
|
2857
|
+
Identifiers.reference = { name: 'ɵɵreference', moduleName: CORE };
|
|
2858
|
+
Identifiers.inject = { name: 'ɵɵinject', moduleName: CORE };
|
|
2859
|
+
Identifiers.injectAttribute = { name: 'ɵɵinjectAttribute', moduleName: CORE };
|
|
2860
|
+
Identifiers.directiveInject = { name: 'ɵɵdirectiveInject', moduleName: CORE };
|
|
2861
|
+
Identifiers.invalidFactory = { name: 'ɵɵinvalidFactory', moduleName: CORE };
|
|
2862
|
+
Identifiers.invalidFactoryDep = { name: 'ɵɵinvalidFactoryDep', moduleName: CORE };
|
|
2863
|
+
Identifiers.templateRefExtractor = { name: 'ɵɵtemplateRefExtractor', moduleName: CORE };
|
|
2864
|
+
Identifiers.forwardRef = { name: 'forwardRef', moduleName: CORE };
|
|
2865
|
+
Identifiers.resolveForwardRef = { name: 'resolveForwardRef', moduleName: CORE };
|
|
2866
|
+
Identifiers.ɵɵdefineInjectable = { name: 'ɵɵdefineInjectable', moduleName: CORE };
|
|
2867
|
+
Identifiers.declareInjectable = { name: 'ɵɵngDeclareInjectable', moduleName: CORE };
|
|
2868
|
+
Identifiers.InjectableDeclaration = { name: 'ɵɵInjectableDeclaration', moduleName: CORE };
|
|
2869
|
+
Identifiers.resolveWindow = { name: 'ɵɵresolveWindow', moduleName: CORE };
|
|
2870
|
+
Identifiers.resolveDocument = { name: 'ɵɵresolveDocument', moduleName: CORE };
|
|
2871
|
+
Identifiers.resolveBody = { name: 'ɵɵresolveBody', moduleName: CORE };
|
|
2872
|
+
Identifiers.defineComponent = { name: 'ɵɵdefineComponent', moduleName: CORE };
|
|
2873
|
+
Identifiers.declareComponent = { name: 'ɵɵngDeclareComponent', moduleName: CORE };
|
|
2874
|
+
Identifiers.setComponentScope = { name: 'ɵɵsetComponentScope', moduleName: CORE };
|
|
2875
|
+
Identifiers.ChangeDetectionStrategy = {
|
|
2875
2876
|
name: 'ChangeDetectionStrategy',
|
|
2876
|
-
moduleName: CORE
|
|
2877
|
+
moduleName: CORE,
|
|
2877
2878
|
};
|
|
2878
|
-
Identifiers
|
|
2879
|
+
Identifiers.ViewEncapsulation = {
|
|
2879
2880
|
name: 'ViewEncapsulation',
|
|
2880
|
-
moduleName: CORE
|
|
2881
|
+
moduleName: CORE,
|
|
2881
2882
|
};
|
|
2882
|
-
Identifiers
|
|
2883
|
+
Identifiers.ComponentDeclaration = {
|
|
2883
2884
|
name: 'ɵɵComponentDeclaration',
|
|
2884
|
-
moduleName: CORE
|
|
2885
|
+
moduleName: CORE,
|
|
2885
2886
|
};
|
|
2886
|
-
Identifiers
|
|
2887
|
+
Identifiers.FactoryDeclaration = {
|
|
2887
2888
|
name: 'ɵɵFactoryDeclaration',
|
|
2888
|
-
moduleName: CORE
|
|
2889
|
+
moduleName: CORE,
|
|
2889
2890
|
};
|
|
2890
|
-
Identifiers
|
|
2891
|
-
Identifiers
|
|
2892
|
-
Identifiers
|
|
2893
|
-
Identifiers
|
|
2894
|
-
Identifiers
|
|
2891
|
+
Identifiers.declareFactory = { name: 'ɵɵngDeclareFactory', moduleName: CORE };
|
|
2892
|
+
Identifiers.FactoryTarget = { name: 'ɵɵFactoryTarget', moduleName: CORE };
|
|
2893
|
+
Identifiers.defineDirective = { name: 'ɵɵdefineDirective', moduleName: CORE };
|
|
2894
|
+
Identifiers.declareDirective = { name: 'ɵɵngDeclareDirective', moduleName: CORE };
|
|
2895
|
+
Identifiers.DirectiveDeclaration = {
|
|
2895
2896
|
name: 'ɵɵDirectiveDeclaration',
|
|
2896
|
-
moduleName: CORE
|
|
2897
|
+
moduleName: CORE,
|
|
2897
2898
|
};
|
|
2898
|
-
Identifiers
|
|
2899
|
-
Identifiers
|
|
2900
|
-
Identifiers
|
|
2901
|
-
Identifiers
|
|
2902
|
-
Identifiers
|
|
2899
|
+
Identifiers.InjectorDef = { name: 'ɵɵInjectorDef', moduleName: CORE };
|
|
2900
|
+
Identifiers.InjectorDeclaration = { name: 'ɵɵInjectorDeclaration', moduleName: CORE };
|
|
2901
|
+
Identifiers.defineInjector = { name: 'ɵɵdefineInjector', moduleName: CORE };
|
|
2902
|
+
Identifiers.declareInjector = { name: 'ɵɵngDeclareInjector', moduleName: CORE };
|
|
2903
|
+
Identifiers.NgModuleDeclaration = {
|
|
2903
2904
|
name: 'ɵɵNgModuleDeclaration',
|
|
2904
|
-
moduleName: CORE
|
|
2905
|
+
moduleName: CORE,
|
|
2905
2906
|
};
|
|
2906
|
-
Identifiers
|
|
2907
|
+
Identifiers.ModuleWithProviders = {
|
|
2907
2908
|
name: 'ModuleWithProviders',
|
|
2908
|
-
moduleName: CORE
|
|
2909
|
+
moduleName: CORE,
|
|
2909
2910
|
};
|
|
2910
|
-
Identifiers
|
|
2911
|
-
Identifiers
|
|
2912
|
-
Identifiers
|
|
2913
|
-
Identifiers
|
|
2914
|
-
Identifiers
|
|
2915
|
-
Identifiers
|
|
2916
|
-
Identifiers
|
|
2917
|
-
Identifiers
|
|
2918
|
-
Identifiers
|
|
2919
|
-
Identifiers
|
|
2920
|
-
Identifiers
|
|
2921
|
-
Identifiers
|
|
2922
|
-
Identifiers
|
|
2923
|
-
Identifiers
|
|
2924
|
-
Identifiers
|
|
2925
|
-
Identifiers
|
|
2926
|
-
Identifiers
|
|
2927
|
-
Identifiers
|
|
2911
|
+
Identifiers.defineNgModule = { name: 'ɵɵdefineNgModule', moduleName: CORE };
|
|
2912
|
+
Identifiers.declareNgModule = { name: 'ɵɵngDeclareNgModule', moduleName: CORE };
|
|
2913
|
+
Identifiers.setNgModuleScope = { name: 'ɵɵsetNgModuleScope', moduleName: CORE };
|
|
2914
|
+
Identifiers.registerNgModuleType = { name: 'ɵɵregisterNgModuleType', moduleName: CORE };
|
|
2915
|
+
Identifiers.PipeDeclaration = { name: 'ɵɵPipeDeclaration', moduleName: CORE };
|
|
2916
|
+
Identifiers.definePipe = { name: 'ɵɵdefinePipe', moduleName: CORE };
|
|
2917
|
+
Identifiers.declarePipe = { name: 'ɵɵngDeclarePipe', moduleName: CORE };
|
|
2918
|
+
Identifiers.declareClassMetadata = { name: 'ɵɵngDeclareClassMetadata', moduleName: CORE };
|
|
2919
|
+
Identifiers.setClassMetadata = { name: 'ɵsetClassMetadata', moduleName: CORE };
|
|
2920
|
+
Identifiers.queryRefresh = { name: 'ɵɵqueryRefresh', moduleName: CORE };
|
|
2921
|
+
Identifiers.viewQuery = { name: 'ɵɵviewQuery', moduleName: CORE };
|
|
2922
|
+
Identifiers.loadQuery = { name: 'ɵɵloadQuery', moduleName: CORE };
|
|
2923
|
+
Identifiers.contentQuery = { name: 'ɵɵcontentQuery', moduleName: CORE };
|
|
2924
|
+
Identifiers.NgOnChangesFeature = { name: 'ɵɵNgOnChangesFeature', moduleName: CORE };
|
|
2925
|
+
Identifiers.InheritDefinitionFeature = { name: 'ɵɵInheritDefinitionFeature', moduleName: CORE };
|
|
2926
|
+
Identifiers.CopyDefinitionFeature = { name: 'ɵɵCopyDefinitionFeature', moduleName: CORE };
|
|
2927
|
+
Identifiers.ProvidersFeature = { name: 'ɵɵProvidersFeature', moduleName: CORE };
|
|
2928
|
+
Identifiers.listener = { name: 'ɵɵlistener', moduleName: CORE };
|
|
2929
|
+
Identifiers.getInheritedFactory = {
|
|
2928
2930
|
name: 'ɵɵgetInheritedFactory',
|
|
2929
|
-
moduleName: CORE
|
|
2931
|
+
moduleName: CORE,
|
|
2930
2932
|
};
|
|
2931
2933
|
// sanitization-related functions
|
|
2932
|
-
Identifiers
|
|
2933
|
-
Identifiers
|
|
2934
|
-
Identifiers
|
|
2935
|
-
Identifiers
|
|
2936
|
-
Identifiers
|
|
2937
|
-
Identifiers
|
|
2938
|
-
Identifiers
|
|
2939
|
-
Identifiers
|
|
2934
|
+
Identifiers.sanitizeHtml = { name: 'ɵɵsanitizeHtml', moduleName: CORE };
|
|
2935
|
+
Identifiers.sanitizeStyle = { name: 'ɵɵsanitizeStyle', moduleName: CORE };
|
|
2936
|
+
Identifiers.sanitizeResourceUrl = { name: 'ɵɵsanitizeResourceUrl', moduleName: CORE };
|
|
2937
|
+
Identifiers.sanitizeScript = { name: 'ɵɵsanitizeScript', moduleName: CORE };
|
|
2938
|
+
Identifiers.sanitizeUrl = { name: 'ɵɵsanitizeUrl', moduleName: CORE };
|
|
2939
|
+
Identifiers.sanitizeUrlOrResourceUrl = { name: 'ɵɵsanitizeUrlOrResourceUrl', moduleName: CORE };
|
|
2940
|
+
Identifiers.trustConstantHtml = { name: 'ɵɵtrustConstantHtml', moduleName: CORE };
|
|
2941
|
+
Identifiers.trustConstantResourceUrl = { name: 'ɵɵtrustConstantResourceUrl', moduleName: CORE };
|
|
2940
2942
|
|
|
2941
2943
|
/**
|
|
2942
2944
|
* @license
|
|
@@ -3678,7 +3680,7 @@ function convertFromMaybeForwardRefExpression({ expression, forwardRef }) {
|
|
|
3678
3680
|
* ```
|
|
3679
3681
|
*/
|
|
3680
3682
|
function generateForwardRef(expr) {
|
|
3681
|
-
return importExpr(Identifiers
|
|
3683
|
+
return importExpr(Identifiers.forwardRef).callFn([fn([], [new ReturnStatement(expr)])]);
|
|
3682
3684
|
}
|
|
3683
3685
|
|
|
3684
3686
|
var R3FactoryDelegateType;
|
|
@@ -3726,7 +3728,7 @@ function compileFactoryFunction(meta) {
|
|
|
3726
3728
|
const r = variable('r');
|
|
3727
3729
|
body.push(r.set(NULL_EXPR).toDeclStmt());
|
|
3728
3730
|
const ctorStmt = ctorExpr !== null ? r.set(ctorExpr).toStmt() :
|
|
3729
|
-
importExpr(Identifiers
|
|
3731
|
+
importExpr(Identifiers.invalidFactory).callFn([]).toStmt();
|
|
3730
3732
|
body.push(ifStmt(t, [ctorStmt], [r.set(nonCtorExpr).toStmt()]));
|
|
3731
3733
|
return r;
|
|
3732
3734
|
}
|
|
@@ -3749,11 +3751,11 @@ function compileFactoryFunction(meta) {
|
|
|
3749
3751
|
}
|
|
3750
3752
|
if (retExpr === null) {
|
|
3751
3753
|
// The expression cannot be formed so render an `ɵɵinvalidFactory()` call.
|
|
3752
|
-
body.push(importExpr(Identifiers
|
|
3754
|
+
body.push(importExpr(Identifiers.invalidFactory).callFn([]).toStmt());
|
|
3753
3755
|
}
|
|
3754
3756
|
else if (baseFactoryVar !== null) {
|
|
3755
3757
|
// This factory uses a base factory, so call `ɵɵgetInheritedFactory()` to compute it.
|
|
3756
|
-
const getInheritedFactoryCall = importExpr(Identifiers
|
|
3758
|
+
const getInheritedFactoryCall = importExpr(Identifiers.getInheritedFactory).callFn([meta.internalType]);
|
|
3757
3759
|
// Memoize the base factoryFn: `baseFactory || (baseFactory = ɵɵgetInheritedFactory(...))`
|
|
3758
3760
|
const baseFactory = new BinaryOperatorExpr(BinaryOperator.Or, baseFactoryVar, baseFactoryVar.set(getInheritedFactoryCall));
|
|
3759
3761
|
body.push(new ReturnStatement(baseFactory.callFn([typeForCtor])));
|
|
@@ -3778,7 +3780,7 @@ function compileFactoryFunction(meta) {
|
|
|
3778
3780
|
}
|
|
3779
3781
|
function createFactoryType(meta) {
|
|
3780
3782
|
const ctorDepsType = meta.deps !== null && meta.deps !== 'invalid' ? createCtorDepsType(meta.deps) : NONE_TYPE;
|
|
3781
|
-
return expressionType(importExpr(Identifiers
|
|
3783
|
+
return expressionType(importExpr(Identifiers.FactoryDeclaration, [typeWithParameters(meta.type.type, meta.typeArgumentCount), ctorDepsType]));
|
|
3782
3784
|
}
|
|
3783
3785
|
function injectDependencies(deps, target) {
|
|
3784
3786
|
return deps.map((dep, index) => compileInjectDependency(dep, target, index));
|
|
@@ -3786,7 +3788,7 @@ function injectDependencies(deps, target) {
|
|
|
3786
3788
|
function compileInjectDependency(dep, target, index) {
|
|
3787
3789
|
// Interpret the dependency according to its resolved type.
|
|
3788
3790
|
if (dep.token === null) {
|
|
3789
|
-
return importExpr(Identifiers
|
|
3791
|
+
return importExpr(Identifiers.invalidFactoryDep).callFn([literal(index)]);
|
|
3790
3792
|
}
|
|
3791
3793
|
else if (dep.attributeNameType === null) {
|
|
3792
3794
|
// Build up the injection flags according to the metadata.
|
|
@@ -3814,7 +3816,7 @@ function compileInjectDependency(dep, target, index) {
|
|
|
3814
3816
|
//
|
|
3815
3817
|
// The `dep.attributeTypeName` is only actually used (in `createCtorDepType()`) to generate
|
|
3816
3818
|
// typings.
|
|
3817
|
-
return importExpr(Identifiers
|
|
3819
|
+
return importExpr(Identifiers.injectAttribute).callFn([dep.token]);
|
|
3818
3820
|
}
|
|
3819
3821
|
}
|
|
3820
3822
|
function createCtorDepsType(deps) {
|
|
@@ -3866,11 +3868,11 @@ function getInjectFn(target) {
|
|
|
3866
3868
|
case FactoryTarget$1.Component:
|
|
3867
3869
|
case FactoryTarget$1.Directive:
|
|
3868
3870
|
case FactoryTarget$1.Pipe:
|
|
3869
|
-
return Identifiers
|
|
3871
|
+
return Identifiers.directiveInject;
|
|
3870
3872
|
case FactoryTarget$1.NgModule:
|
|
3871
3873
|
case FactoryTarget$1.Injectable:
|
|
3872
3874
|
default:
|
|
3873
|
-
return Identifiers
|
|
3875
|
+
return Identifiers.inject;
|
|
3874
3876
|
}
|
|
3875
3877
|
}
|
|
3876
3878
|
|
|
@@ -4876,6 +4878,65 @@ const IMPLICIT_REFERENCE = '$implicit';
|
|
|
4876
4878
|
const NON_BINDABLE_ATTR = 'ngNonBindable';
|
|
4877
4879
|
/** Name for the variable keeping track of the context returned by `ɵɵrestoreView`. */
|
|
4878
4880
|
const RESTORED_VIEW_CONTEXT_NAME = 'restoredCtx';
|
|
4881
|
+
/** Instructions that support chaining. */
|
|
4882
|
+
const CHAINABLE_INSTRUCTIONS = new Set([
|
|
4883
|
+
Identifiers.element,
|
|
4884
|
+
Identifiers.elementStart,
|
|
4885
|
+
Identifiers.elementEnd,
|
|
4886
|
+
Identifiers.elementContainer,
|
|
4887
|
+
Identifiers.elementContainerStart,
|
|
4888
|
+
Identifiers.elementContainerEnd,
|
|
4889
|
+
Identifiers.i18nExp,
|
|
4890
|
+
Identifiers.listener,
|
|
4891
|
+
Identifiers.classProp,
|
|
4892
|
+
Identifiers.syntheticHostListener,
|
|
4893
|
+
Identifiers.hostProperty,
|
|
4894
|
+
Identifiers.syntheticHostProperty,
|
|
4895
|
+
Identifiers.property,
|
|
4896
|
+
Identifiers.propertyInterpolate1,
|
|
4897
|
+
Identifiers.propertyInterpolate2,
|
|
4898
|
+
Identifiers.propertyInterpolate3,
|
|
4899
|
+
Identifiers.propertyInterpolate4,
|
|
4900
|
+
Identifiers.propertyInterpolate5,
|
|
4901
|
+
Identifiers.propertyInterpolate6,
|
|
4902
|
+
Identifiers.propertyInterpolate7,
|
|
4903
|
+
Identifiers.propertyInterpolate8,
|
|
4904
|
+
Identifiers.propertyInterpolateV,
|
|
4905
|
+
Identifiers.attribute,
|
|
4906
|
+
Identifiers.attributeInterpolate1,
|
|
4907
|
+
Identifiers.attributeInterpolate2,
|
|
4908
|
+
Identifiers.attributeInterpolate3,
|
|
4909
|
+
Identifiers.attributeInterpolate4,
|
|
4910
|
+
Identifiers.attributeInterpolate5,
|
|
4911
|
+
Identifiers.attributeInterpolate6,
|
|
4912
|
+
Identifiers.attributeInterpolate7,
|
|
4913
|
+
Identifiers.attributeInterpolate8,
|
|
4914
|
+
Identifiers.attributeInterpolateV,
|
|
4915
|
+
Identifiers.styleProp,
|
|
4916
|
+
Identifiers.stylePropInterpolate1,
|
|
4917
|
+
Identifiers.stylePropInterpolate2,
|
|
4918
|
+
Identifiers.stylePropInterpolate3,
|
|
4919
|
+
Identifiers.stylePropInterpolate4,
|
|
4920
|
+
Identifiers.stylePropInterpolate5,
|
|
4921
|
+
Identifiers.stylePropInterpolate6,
|
|
4922
|
+
Identifiers.stylePropInterpolate7,
|
|
4923
|
+
Identifiers.stylePropInterpolate8,
|
|
4924
|
+
Identifiers.stylePropInterpolateV,
|
|
4925
|
+
Identifiers.textInterpolate,
|
|
4926
|
+
Identifiers.textInterpolate1,
|
|
4927
|
+
Identifiers.textInterpolate2,
|
|
4928
|
+
Identifiers.textInterpolate3,
|
|
4929
|
+
Identifiers.textInterpolate4,
|
|
4930
|
+
Identifiers.textInterpolate5,
|
|
4931
|
+
Identifiers.textInterpolate6,
|
|
4932
|
+
Identifiers.textInterpolate7,
|
|
4933
|
+
Identifiers.textInterpolate8,
|
|
4934
|
+
Identifiers.textInterpolateV,
|
|
4935
|
+
]);
|
|
4936
|
+
/** Generates a call to a single instruction. */
|
|
4937
|
+
function invokeInstruction(span, reference, params) {
|
|
4938
|
+
return importExpr(reference, null, span).callFn(params, span);
|
|
4939
|
+
}
|
|
4879
4940
|
/**
|
|
4880
4941
|
* Creates an allocator for a temporary variable.
|
|
4881
4942
|
*
|
|
@@ -4966,7 +5027,7 @@ function getQueryPredicate(query, constantPool) {
|
|
|
4966
5027
|
case 2 /* Unwrapped */:
|
|
4967
5028
|
return query.predicate.expression;
|
|
4968
5029
|
case 1 /* Wrapped */:
|
|
4969
|
-
return importExpr(Identifiers
|
|
5030
|
+
return importExpr(Identifiers.resolveForwardRef).callFn([query.predicate.expression]);
|
|
4970
5031
|
}
|
|
4971
5032
|
}
|
|
4972
5033
|
}
|
|
@@ -5017,20 +5078,6 @@ function getAttrsForDirectiveMatching(elOrTpl) {
|
|
|
5017
5078
|
}
|
|
5018
5079
|
return attributesMap;
|
|
5019
5080
|
}
|
|
5020
|
-
/** Returns a call expression to a chained instruction, e.g. `property(params[0])(params[1])`. */
|
|
5021
|
-
function chainedInstruction(reference, calls, span) {
|
|
5022
|
-
let expression = importExpr(reference, null, span);
|
|
5023
|
-
if (calls.length > 0) {
|
|
5024
|
-
for (let i = 0; i < calls.length; i++) {
|
|
5025
|
-
expression = expression.callFn(calls[i], span);
|
|
5026
|
-
}
|
|
5027
|
-
}
|
|
5028
|
-
else {
|
|
5029
|
-
// Add a blank invocation, in case the `calls` array is empty.
|
|
5030
|
-
expression = expression.callFn([], span);
|
|
5031
|
-
}
|
|
5032
|
-
return expression;
|
|
5033
|
-
}
|
|
5034
5081
|
/**
|
|
5035
5082
|
* Gets the number of arguments expected to be passed to a generated instruction in the case of
|
|
5036
5083
|
* interpolation instructions.
|
|
@@ -5048,6 +5095,40 @@ function getInterpolationArgsLength(interpolation) {
|
|
|
5048
5095
|
return expressions.length + strings.length;
|
|
5049
5096
|
}
|
|
5050
5097
|
}
|
|
5098
|
+
/**
|
|
5099
|
+
* Generates the final instruction call statements based on the passed in configuration.
|
|
5100
|
+
* Will try to chain instructions as much as possible, if chaining is supported.
|
|
5101
|
+
*/
|
|
5102
|
+
function getInstructionStatements(instructions) {
|
|
5103
|
+
var _a;
|
|
5104
|
+
const statements = [];
|
|
5105
|
+
let pendingExpression = null;
|
|
5106
|
+
let pendingExpressionType = null;
|
|
5107
|
+
for (const current of instructions) {
|
|
5108
|
+
const resolvedParams = (_a = (typeof current.paramsOrFn === 'function' ? current.paramsOrFn() : current.paramsOrFn)) !== null && _a !== void 0 ? _a : [];
|
|
5109
|
+
const params = Array.isArray(resolvedParams) ? resolvedParams : [resolvedParams];
|
|
5110
|
+
// If the current instruction is the same as the previous one
|
|
5111
|
+
// and it can be chained, add another call to the chain.
|
|
5112
|
+
if (pendingExpressionType === current.reference &&
|
|
5113
|
+
CHAINABLE_INSTRUCTIONS.has(pendingExpressionType)) {
|
|
5114
|
+
// We'll always have a pending expression when there's a pending expression type.
|
|
5115
|
+
pendingExpression = pendingExpression.callFn(params, pendingExpression.sourceSpan);
|
|
5116
|
+
}
|
|
5117
|
+
else {
|
|
5118
|
+
if (pendingExpression !== null) {
|
|
5119
|
+
statements.push(pendingExpression.toStmt());
|
|
5120
|
+
}
|
|
5121
|
+
pendingExpression = invokeInstruction(current.span, current.reference, params);
|
|
5122
|
+
pendingExpressionType = current.reference;
|
|
5123
|
+
}
|
|
5124
|
+
}
|
|
5125
|
+
// Since the current instruction adds the previous one to the statements,
|
|
5126
|
+
// we may be left with the final one at the end that is still pending.
|
|
5127
|
+
if (pendingExpression !== null) {
|
|
5128
|
+
statements.push(pendingExpression.toStmt());
|
|
5129
|
+
}
|
|
5130
|
+
return statements;
|
|
5131
|
+
}
|
|
5051
5132
|
|
|
5052
5133
|
/**
|
|
5053
5134
|
* @license
|
|
@@ -5111,7 +5192,7 @@ function compileInjectable(meta, resolveForwardRefs) {
|
|
|
5111
5192
|
}
|
|
5112
5193
|
else if (meta.useExisting !== undefined) {
|
|
5113
5194
|
// useExisting is an `inject` call on the existing token.
|
|
5114
|
-
result = compileFactoryFunction(Object.assign(Object.assign({}, factoryMeta), { expression: importExpr(Identifiers
|
|
5195
|
+
result = compileFactoryFunction(Object.assign(Object.assign({}, factoryMeta), { expression: importExpr(Identifiers.inject).callFn([meta.useExisting.expression]) }));
|
|
5115
5196
|
}
|
|
5116
5197
|
else {
|
|
5117
5198
|
result = {
|
|
@@ -5127,7 +5208,7 @@ function compileInjectable(meta, resolveForwardRefs) {
|
|
|
5127
5208
|
if (meta.providedIn.expression.value !== null) {
|
|
5128
5209
|
injectableProps.set('providedIn', convertFromMaybeForwardRefExpression(meta.providedIn));
|
|
5129
5210
|
}
|
|
5130
|
-
const expression = importExpr(Identifiers
|
|
5211
|
+
const expression = importExpr(Identifiers.ɵɵdefineInjectable)
|
|
5131
5212
|
.callFn([injectableProps.toLiteralMap()], undefined, true);
|
|
5132
5213
|
return {
|
|
5133
5214
|
expression,
|
|
@@ -5136,7 +5217,7 @@ function compileInjectable(meta, resolveForwardRefs) {
|
|
|
5136
5217
|
};
|
|
5137
5218
|
}
|
|
5138
5219
|
function createInjectableType(meta) {
|
|
5139
|
-
return new ExpressionType(importExpr(Identifiers
|
|
5220
|
+
return new ExpressionType(importExpr(Identifiers.InjectableDeclaration, [typeWithParameters(meta.type.type, meta.typeArgumentCount)]));
|
|
5140
5221
|
}
|
|
5141
5222
|
function delegateToFactory(type, internalType, unwrapForwardRefs) {
|
|
5142
5223
|
if (type.node === internalType.node) {
|
|
@@ -5159,7 +5240,7 @@ function delegateToFactory(type, internalType, unwrapForwardRefs) {
|
|
|
5159
5240
|
// ```
|
|
5160
5241
|
// factory: function(t) { return core.resolveForwardRef(type).ɵfac(t); }
|
|
5161
5242
|
// ```
|
|
5162
|
-
const unwrappedType = importExpr(Identifiers
|
|
5243
|
+
const unwrappedType = importExpr(Identifiers.resolveForwardRef).callFn([internalType]);
|
|
5163
5244
|
return createFactoryFunction(unwrappedType);
|
|
5164
5245
|
}
|
|
5165
5246
|
function createFactoryFunction(type) {
|
|
@@ -5337,7 +5418,7 @@ class ParseLocation {
|
|
|
5337
5418
|
const ch = source.charCodeAt(offset);
|
|
5338
5419
|
if (ch == $LF) {
|
|
5339
5420
|
line--;
|
|
5340
|
-
const priorLine = source.
|
|
5421
|
+
const priorLine = source.substring(0, offset - 1).lastIndexOf(String.fromCharCode($LF));
|
|
5341
5422
|
col = priorLine > 0 ? offset - priorLine : offset;
|
|
5342
5423
|
}
|
|
5343
5424
|
else {
|
|
@@ -5848,12 +5929,12 @@ function compileInjector(meta) {
|
|
|
5848
5929
|
if (meta.imports.length > 0) {
|
|
5849
5930
|
definitionMap.set('imports', literalArr(meta.imports));
|
|
5850
5931
|
}
|
|
5851
|
-
const expression = importExpr(Identifiers
|
|
5932
|
+
const expression = importExpr(Identifiers.defineInjector).callFn([definitionMap.toLiteralMap()], undefined, true);
|
|
5852
5933
|
const type = createInjectorType(meta);
|
|
5853
5934
|
return { expression, type, statements: [] };
|
|
5854
5935
|
}
|
|
5855
5936
|
function createInjectorType(meta) {
|
|
5856
|
-
return new ExpressionType(importExpr(Identifiers
|
|
5937
|
+
return new ExpressionType(importExpr(Identifiers.InjectorDeclaration, [new ExpressionType(meta.type.type)]));
|
|
5857
5938
|
}
|
|
5858
5939
|
|
|
5859
5940
|
/**
|
|
@@ -5892,20 +5973,49 @@ class R3JitReflector {
|
|
|
5892
5973
|
* Use of this source code is governed by an MIT-style license that can be
|
|
5893
5974
|
* found in the LICENSE file at https://angular.io/license
|
|
5894
5975
|
*/
|
|
5976
|
+
/**
|
|
5977
|
+
* How the selector scope of an NgModule (its declarations, imports, and exports) should be emitted
|
|
5978
|
+
* as a part of the NgModule definition.
|
|
5979
|
+
*/
|
|
5980
|
+
var R3SelectorScopeMode;
|
|
5981
|
+
(function (R3SelectorScopeMode) {
|
|
5982
|
+
/**
|
|
5983
|
+
* Emit the declarations inline into the module definition.
|
|
5984
|
+
*
|
|
5985
|
+
* This option is useful in certain contexts where it's known that JIT support is required. The
|
|
5986
|
+
* tradeoff here is that this emit style prevents directives and pipes from being tree-shaken if
|
|
5987
|
+
* they are unused, but the NgModule is used.
|
|
5988
|
+
*/
|
|
5989
|
+
R3SelectorScopeMode[R3SelectorScopeMode["Inline"] = 0] = "Inline";
|
|
5990
|
+
/**
|
|
5991
|
+
* Emit the declarations using a side effectful function call, `ɵɵsetNgModuleScope`, that is
|
|
5992
|
+
* guarded with the `ngJitMode` flag.
|
|
5993
|
+
*
|
|
5994
|
+
* This form of emit supports JIT and can be optimized away if the `ngJitMode` flag is set to
|
|
5995
|
+
* false, which allows unused directives and pipes to be tree-shaken.
|
|
5996
|
+
*/
|
|
5997
|
+
R3SelectorScopeMode[R3SelectorScopeMode["SideEffect"] = 1] = "SideEffect";
|
|
5998
|
+
/**
|
|
5999
|
+
* Don't generate selector scopes at all.
|
|
6000
|
+
*
|
|
6001
|
+
* This is useful for contexts where JIT support is known to be unnecessary.
|
|
6002
|
+
*/
|
|
6003
|
+
R3SelectorScopeMode[R3SelectorScopeMode["Omit"] = 2] = "Omit";
|
|
6004
|
+
})(R3SelectorScopeMode || (R3SelectorScopeMode = {}));
|
|
5895
6005
|
/**
|
|
5896
6006
|
* Construct an `R3NgModuleDef` for the given `R3NgModuleMetadata`.
|
|
5897
6007
|
*/
|
|
5898
6008
|
function compileNgModule(meta) {
|
|
5899
|
-
const { internalType, bootstrap, declarations, imports, exports, schemas, containsForwardDecls,
|
|
6009
|
+
const { adjacentType, internalType, bootstrap, declarations, imports, exports, schemas, containsForwardDecls, selectorScopeMode, id } = meta;
|
|
5900
6010
|
const statements = [];
|
|
5901
6011
|
const definitionMap = new DefinitionMap();
|
|
5902
6012
|
definitionMap.set('type', internalType);
|
|
5903
6013
|
if (bootstrap.length > 0) {
|
|
5904
6014
|
definitionMap.set('bootstrap', refsToArray(bootstrap, containsForwardDecls));
|
|
5905
6015
|
}
|
|
5906
|
-
|
|
5907
|
-
|
|
5908
|
-
|
|
6016
|
+
if (selectorScopeMode === R3SelectorScopeMode.Inline) {
|
|
6017
|
+
// If requested to emit scope information inline, pass the `declarations`, `imports` and
|
|
6018
|
+
// `exports` to the `ɵɵdefineNgModule()` call directly.
|
|
5909
6019
|
if (declarations.length > 0) {
|
|
5910
6020
|
definitionMap.set('declarations', refsToArray(declarations, containsForwardDecls));
|
|
5911
6021
|
}
|
|
@@ -5916,21 +6026,29 @@ function compileNgModule(meta) {
|
|
|
5916
6026
|
definitionMap.set('exports', refsToArray(exports, containsForwardDecls));
|
|
5917
6027
|
}
|
|
5918
6028
|
}
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
|
|
6029
|
+
else if (selectorScopeMode === R3SelectorScopeMode.SideEffect) {
|
|
6030
|
+
// In this mode, scope information is not passed into `ɵɵdefineNgModule` as it
|
|
6031
|
+
// would prevent tree-shaking of the declarations, imports and exports references. Instead, it's
|
|
6032
|
+
// patched onto the NgModule definition with a `ɵɵsetNgModuleScope` call that's guarded by the
|
|
6033
|
+
// `ngJitMode` flag.
|
|
5922
6034
|
const setNgModuleScopeCall = generateSetNgModuleScopeCall(meta);
|
|
5923
6035
|
if (setNgModuleScopeCall !== null) {
|
|
5924
6036
|
statements.push(setNgModuleScopeCall);
|
|
5925
6037
|
}
|
|
5926
6038
|
}
|
|
6039
|
+
else {
|
|
6040
|
+
// Selector scope emit was not requested, so skip it.
|
|
6041
|
+
}
|
|
5927
6042
|
if (schemas !== null && schemas.length > 0) {
|
|
5928
6043
|
definitionMap.set('schemas', literalArr(schemas.map(ref => ref.value)));
|
|
5929
6044
|
}
|
|
5930
6045
|
if (id !== null) {
|
|
5931
6046
|
definitionMap.set('id', id);
|
|
6047
|
+
// Generate a side-effectful call to register this NgModule by its id, as per the semantics of
|
|
6048
|
+
// NgModule ids.
|
|
6049
|
+
statements.push(importExpr(Identifiers.registerNgModuleType).callFn([adjacentType, id]).toStmt());
|
|
5932
6050
|
}
|
|
5933
|
-
const expression = importExpr(Identifiers
|
|
6051
|
+
const expression = importExpr(Identifiers.defineNgModule).callFn([definitionMap.toLiteralMap()], undefined, true);
|
|
5934
6052
|
const type = createNgModuleType(meta);
|
|
5935
6053
|
return { expression, type, statements };
|
|
5936
6054
|
}
|
|
@@ -5959,10 +6077,10 @@ function compileNgModuleDeclarationExpression(meta) {
|
|
|
5959
6077
|
if (meta.id !== undefined) {
|
|
5960
6078
|
definitionMap.set('id', new WrappedNodeExpr(meta.id));
|
|
5961
6079
|
}
|
|
5962
|
-
return importExpr(Identifiers
|
|
6080
|
+
return importExpr(Identifiers.defineNgModule).callFn([definitionMap.toLiteralMap()]);
|
|
5963
6081
|
}
|
|
5964
6082
|
function createNgModuleType({ type: moduleType, declarations, imports, exports }) {
|
|
5965
|
-
return new ExpressionType(importExpr(Identifiers
|
|
6083
|
+
return new ExpressionType(importExpr(Identifiers.NgModuleDeclaration, [
|
|
5966
6084
|
new ExpressionType(moduleType.type), tupleTypeOf(declarations), tupleTypeOf(imports),
|
|
5967
6085
|
tupleTypeOf(exports)
|
|
5968
6086
|
]));
|
|
@@ -5990,7 +6108,7 @@ function generateSetNgModuleScopeCall(meta) {
|
|
|
5990
6108
|
}
|
|
5991
6109
|
// setNgModuleScope(...)
|
|
5992
6110
|
const fnCall = new InvokeFunctionExpr(
|
|
5993
|
-
/* fn */ importExpr(Identifiers
|
|
6111
|
+
/* fn */ importExpr(Identifiers.setNgModuleScope),
|
|
5994
6112
|
/* args */ [moduleType, scopeMap.toLiteralMap()]);
|
|
5995
6113
|
// (ngJitMode guard) && setNgModuleScope(...)
|
|
5996
6114
|
const guardedCall = jitOnlyGuardedExpression(fnCall);
|
|
@@ -6024,12 +6142,15 @@ function compilePipeFromMetadata(metadata) {
|
|
|
6024
6142
|
definitionMapValues.push({ key: 'type', value: metadata.type.value, quoted: false });
|
|
6025
6143
|
// e.g. `pure: true`
|
|
6026
6144
|
definitionMapValues.push({ key: 'pure', value: literal(metadata.pure), quoted: false });
|
|
6027
|
-
|
|
6145
|
+
if (metadata.isStandalone) {
|
|
6146
|
+
definitionMapValues.push({ key: 'standalone', value: literal(true), quoted: false });
|
|
6147
|
+
}
|
|
6148
|
+
const expression = importExpr(Identifiers.definePipe).callFn([literalMap(definitionMapValues)], undefined, true);
|
|
6028
6149
|
const type = createPipeType(metadata);
|
|
6029
6150
|
return { expression, type, statements: [] };
|
|
6030
6151
|
}
|
|
6031
6152
|
function createPipeType(metadata) {
|
|
6032
|
-
return new ExpressionType(importExpr(Identifiers
|
|
6153
|
+
return new ExpressionType(importExpr(Identifiers.PipeDeclaration, [
|
|
6033
6154
|
typeWithParameters(metadata.type.type, metadata.typeArgumentCount),
|
|
6034
6155
|
new ExpressionType(new LiteralExpr(metadata.pipeName)),
|
|
6035
6156
|
]));
|
|
@@ -6078,33 +6199,6 @@ class ASTWithName extends AST {
|
|
|
6078
6199
|
this.nameSpan = nameSpan;
|
|
6079
6200
|
}
|
|
6080
6201
|
}
|
|
6081
|
-
/**
|
|
6082
|
-
* Represents a quoted expression of the form:
|
|
6083
|
-
*
|
|
6084
|
-
* quote = prefix `:` uninterpretedExpression
|
|
6085
|
-
* prefix = identifier
|
|
6086
|
-
* uninterpretedExpression = arbitrary string
|
|
6087
|
-
*
|
|
6088
|
-
* A quoted expression is meant to be pre-processed by an AST transformer that
|
|
6089
|
-
* converts it into another AST that no longer contains quoted expressions.
|
|
6090
|
-
* It is meant to allow third-party developers to extend Angular template
|
|
6091
|
-
* expression language. The `uninterpretedExpression` part of the quote is
|
|
6092
|
-
* therefore not interpreted by the Angular's own expression parser.
|
|
6093
|
-
*/
|
|
6094
|
-
class Quote extends AST {
|
|
6095
|
-
constructor(span, sourceSpan, prefix, uninterpretedExpression, location) {
|
|
6096
|
-
super(span, sourceSpan);
|
|
6097
|
-
this.prefix = prefix;
|
|
6098
|
-
this.uninterpretedExpression = uninterpretedExpression;
|
|
6099
|
-
this.location = location;
|
|
6100
|
-
}
|
|
6101
|
-
visit(visitor, context = null) {
|
|
6102
|
-
return visitor.visitQuote(this, context);
|
|
6103
|
-
}
|
|
6104
|
-
toString() {
|
|
6105
|
-
return 'Quote';
|
|
6106
|
-
}
|
|
6107
|
-
}
|
|
6108
6202
|
class EmptyExpr extends AST {
|
|
6109
6203
|
visit(visitor, context = null) {
|
|
6110
6204
|
// do nothing
|
|
@@ -6485,7 +6579,6 @@ class RecursiveAstVisitor {
|
|
|
6485
6579
|
this.visit(ast.receiver, context);
|
|
6486
6580
|
this.visitAll(ast.args, context);
|
|
6487
6581
|
}
|
|
6488
|
-
visitQuote(ast, context) { }
|
|
6489
6582
|
// This is not part of the AstVisitor interface, just a helper method
|
|
6490
6583
|
visitAll(asts, context) {
|
|
6491
6584
|
for (const ast of asts) {
|
|
@@ -6568,9 +6661,6 @@ class AstTransformer {
|
|
|
6568
6661
|
visitChain(ast, context) {
|
|
6569
6662
|
return new Chain(ast.span, ast.sourceSpan, this.visitAll(ast.expressions));
|
|
6570
6663
|
}
|
|
6571
|
-
visitQuote(ast, context) {
|
|
6572
|
-
return new Quote(ast.span, ast.sourceSpan, ast.prefix, ast.uninterpretedExpression, ast.location);
|
|
6573
|
-
}
|
|
6574
6664
|
visitSafeKeyedRead(ast, context) {
|
|
6575
6665
|
return new SafeKeyedRead(ast.span, ast.sourceSpan, ast.receiver.visit(this), ast.key.visit(this));
|
|
6576
6666
|
}
|
|
@@ -6733,9 +6823,6 @@ class AstMemoryEfficientTransformer {
|
|
|
6733
6823
|
}
|
|
6734
6824
|
return ast;
|
|
6735
6825
|
}
|
|
6736
|
-
visitQuote(ast, context) {
|
|
6737
|
-
return ast;
|
|
6738
|
-
}
|
|
6739
6826
|
visitSafeKeyedRead(ast, context) {
|
|
6740
6827
|
const obj = ast.receiver.visit(this);
|
|
6741
6828
|
const key = ast.key.visit(this);
|
|
@@ -6802,98 +6889,6 @@ class BoundElementProperty {
|
|
|
6802
6889
|
}
|
|
6803
6890
|
}
|
|
6804
6891
|
|
|
6805
|
-
/**
|
|
6806
|
-
* @license
|
|
6807
|
-
* Copyright Google LLC All Rights Reserved.
|
|
6808
|
-
*
|
|
6809
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6810
|
-
* found in the LICENSE file at https://angular.io/license
|
|
6811
|
-
*/
|
|
6812
|
-
const CORE = '@angular/core';
|
|
6813
|
-
class Identifiers {
|
|
6814
|
-
}
|
|
6815
|
-
Identifiers.ANALYZE_FOR_ENTRY_COMPONENTS = {
|
|
6816
|
-
name: 'ANALYZE_FOR_ENTRY_COMPONENTS',
|
|
6817
|
-
moduleName: CORE,
|
|
6818
|
-
};
|
|
6819
|
-
Identifiers.ElementRef = { name: 'ElementRef', moduleName: CORE };
|
|
6820
|
-
Identifiers.NgModuleRef = { name: 'NgModuleRef', moduleName: CORE };
|
|
6821
|
-
Identifiers.ViewContainerRef = { name: 'ViewContainerRef', moduleName: CORE };
|
|
6822
|
-
Identifiers.ChangeDetectorRef = {
|
|
6823
|
-
name: 'ChangeDetectorRef',
|
|
6824
|
-
moduleName: CORE,
|
|
6825
|
-
};
|
|
6826
|
-
Identifiers.QueryList = { name: 'QueryList', moduleName: CORE };
|
|
6827
|
-
Identifiers.TemplateRef = { name: 'TemplateRef', moduleName: CORE };
|
|
6828
|
-
Identifiers.Renderer2 = { name: 'Renderer2', moduleName: CORE };
|
|
6829
|
-
Identifiers.CodegenComponentFactoryResolver = {
|
|
6830
|
-
name: 'ɵCodegenComponentFactoryResolver',
|
|
6831
|
-
moduleName: CORE,
|
|
6832
|
-
};
|
|
6833
|
-
Identifiers.ComponentFactoryResolver = {
|
|
6834
|
-
name: 'ComponentFactoryResolver',
|
|
6835
|
-
moduleName: CORE,
|
|
6836
|
-
};
|
|
6837
|
-
Identifiers.ComponentFactory = { name: 'ComponentFactory', moduleName: CORE };
|
|
6838
|
-
Identifiers.ComponentRef = { name: 'ComponentRef', moduleName: CORE };
|
|
6839
|
-
Identifiers.NgModuleFactory = { name: 'NgModuleFactory', moduleName: CORE };
|
|
6840
|
-
Identifiers.createModuleFactory = {
|
|
6841
|
-
name: 'ɵcmf',
|
|
6842
|
-
moduleName: CORE,
|
|
6843
|
-
};
|
|
6844
|
-
Identifiers.moduleDef = {
|
|
6845
|
-
name: 'ɵmod',
|
|
6846
|
-
moduleName: CORE,
|
|
6847
|
-
};
|
|
6848
|
-
Identifiers.moduleProviderDef = {
|
|
6849
|
-
name: 'ɵmpd',
|
|
6850
|
-
moduleName: CORE,
|
|
6851
|
-
};
|
|
6852
|
-
Identifiers.RegisterModuleFactoryFn = {
|
|
6853
|
-
name: 'ɵregisterModuleFactory',
|
|
6854
|
-
moduleName: CORE,
|
|
6855
|
-
};
|
|
6856
|
-
Identifiers.inject = { name: 'ɵɵinject', moduleName: CORE };
|
|
6857
|
-
Identifiers.directiveInject = { name: 'ɵɵdirectiveInject', moduleName: CORE };
|
|
6858
|
-
Identifiers.INJECTOR = { name: 'INJECTOR', moduleName: CORE };
|
|
6859
|
-
Identifiers.Injector = { name: 'Injector', moduleName: CORE };
|
|
6860
|
-
Identifiers.ViewEncapsulation = {
|
|
6861
|
-
name: 'ViewEncapsulation',
|
|
6862
|
-
moduleName: CORE,
|
|
6863
|
-
};
|
|
6864
|
-
Identifiers.ChangeDetectionStrategy = {
|
|
6865
|
-
name: 'ChangeDetectionStrategy',
|
|
6866
|
-
moduleName: CORE,
|
|
6867
|
-
};
|
|
6868
|
-
Identifiers.SecurityContext = {
|
|
6869
|
-
name: 'SecurityContext',
|
|
6870
|
-
moduleName: CORE,
|
|
6871
|
-
};
|
|
6872
|
-
Identifiers.LOCALE_ID = { name: 'LOCALE_ID', moduleName: CORE };
|
|
6873
|
-
Identifiers.TRANSLATIONS_FORMAT = {
|
|
6874
|
-
name: 'TRANSLATIONS_FORMAT',
|
|
6875
|
-
moduleName: CORE,
|
|
6876
|
-
};
|
|
6877
|
-
Identifiers.inlineInterpolate = {
|
|
6878
|
-
name: 'ɵinlineInterpolate',
|
|
6879
|
-
moduleName: CORE,
|
|
6880
|
-
};
|
|
6881
|
-
Identifiers.interpolate = { name: 'ɵinterpolate', moduleName: CORE };
|
|
6882
|
-
Identifiers.EMPTY_ARRAY = { name: 'ɵEMPTY_ARRAY', moduleName: CORE };
|
|
6883
|
-
Identifiers.EMPTY_MAP = { name: 'ɵEMPTY_MAP', moduleName: CORE };
|
|
6884
|
-
Identifiers.Renderer = { name: 'Renderer', moduleName: CORE };
|
|
6885
|
-
// type only
|
|
6886
|
-
Identifiers.RendererType2 = {
|
|
6887
|
-
name: 'RendererType2',
|
|
6888
|
-
moduleName: CORE,
|
|
6889
|
-
};
|
|
6890
|
-
// type only
|
|
6891
|
-
Identifiers.ViewDefinition = {
|
|
6892
|
-
name: 'ɵViewDefinition',
|
|
6893
|
-
moduleName: CORE,
|
|
6894
|
-
};
|
|
6895
|
-
Identifiers.createComponentFactory = { name: 'ɵccf', moduleName: CORE };
|
|
6896
|
-
|
|
6897
6892
|
/**
|
|
6898
6893
|
* @license
|
|
6899
6894
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -6908,7 +6903,7 @@ EventHandlerVars.event = variable('$event');
|
|
|
6908
6903
|
* Converts the given expression AST into an executable output AST, assuming the expression is
|
|
6909
6904
|
* used in an action binding (e.g. an event handler).
|
|
6910
6905
|
*/
|
|
6911
|
-
function convertActionBinding(localResolver, implicitReceiver, action, bindingId,
|
|
6906
|
+
function convertActionBinding(localResolver, implicitReceiver, action, bindingId, baseSourceSpan, implicitReceiverAccesses, globals) {
|
|
6912
6907
|
if (!localResolver) {
|
|
6913
6908
|
localResolver = new DefaultLocalResolver(globals);
|
|
6914
6909
|
}
|
|
@@ -6932,7 +6927,7 @@ function convertActionBinding(localResolver, implicitReceiver, action, bindingId
|
|
|
6932
6927
|
throw new Error(`Illegal State: Actions are not allowed to contain pipes. Pipe: ${name}`);
|
|
6933
6928
|
}
|
|
6934
6929
|
}, action);
|
|
6935
|
-
const visitor = new _AstToIrVisitor(localResolver, implicitReceiver, bindingId,
|
|
6930
|
+
const visitor = new _AstToIrVisitor(localResolver, implicitReceiver, bindingId, /* supportsInterpolation */ false, baseSourceSpan, implicitReceiverAccesses);
|
|
6936
6931
|
const actionStmts = [];
|
|
6937
6932
|
flattenStatements(actionWithoutBuiltins.visit(visitor, _Mode.Statement), actionStmts);
|
|
6938
6933
|
prependTemporaryDecls(visitor.temporaryCount, bindingId, actionStmts);
|
|
@@ -6963,11 +6958,11 @@ class ConvertPropertyBindingResult {
|
|
|
6963
6958
|
* is used in property binding. The expression has to be preprocessed via
|
|
6964
6959
|
* `convertPropertyBindingBuiltins`.
|
|
6965
6960
|
*/
|
|
6966
|
-
function convertPropertyBinding(localResolver, implicitReceiver, expressionWithoutBuiltins, bindingId
|
|
6961
|
+
function convertPropertyBinding(localResolver, implicitReceiver, expressionWithoutBuiltins, bindingId) {
|
|
6967
6962
|
if (!localResolver) {
|
|
6968
6963
|
localResolver = new DefaultLocalResolver();
|
|
6969
6964
|
}
|
|
6970
|
-
const visitor = new _AstToIrVisitor(localResolver, implicitReceiver, bindingId,
|
|
6965
|
+
const visitor = new _AstToIrVisitor(localResolver, implicitReceiver, bindingId, /* supportsInterpolation */ false);
|
|
6971
6966
|
const outputExpr = expressionWithoutBuiltins.visit(visitor, _Mode.Expression);
|
|
6972
6967
|
const stmts = getStatementsFromVisitor(visitor, bindingId);
|
|
6973
6968
|
if (visitor.usesImplicitReceiver) {
|
|
@@ -6992,28 +6987,13 @@ function convertPropertyBinding(localResolver, implicitReceiver, expressionWitho
|
|
|
6992
6987
|
* `o.importExpr(R3.propertyInterpolate).callFn(result)`
|
|
6993
6988
|
*/
|
|
6994
6989
|
function convertUpdateArguments(localResolver, contextVariableExpression, expressionWithArgumentsToExtract, bindingId) {
|
|
6995
|
-
const visitor = new _AstToIrVisitor(localResolver, contextVariableExpression, bindingId,
|
|
6996
|
-
const outputExpr =
|
|
6990
|
+
const visitor = new _AstToIrVisitor(localResolver, contextVariableExpression, bindingId, /* supportsInterpolation */ true);
|
|
6991
|
+
const outputExpr = visitor.visitInterpolation(expressionWithArgumentsToExtract, _Mode.Expression);
|
|
6997
6992
|
if (visitor.usesImplicitReceiver) {
|
|
6998
6993
|
localResolver.notifyImplicitReceiverUse();
|
|
6999
6994
|
}
|
|
7000
6995
|
const stmts = getStatementsFromVisitor(visitor, bindingId);
|
|
7001
|
-
|
|
7002
|
-
let args = outputExpr.args.slice(1);
|
|
7003
|
-
if (expressionWithArgumentsToExtract instanceof Interpolation) {
|
|
7004
|
-
// If we're dealing with an interpolation of 1 value with an empty prefix and suffix, reduce the
|
|
7005
|
-
// args returned to just the value, because we're going to pass it to a special instruction.
|
|
7006
|
-
const strings = expressionWithArgumentsToExtract.strings;
|
|
7007
|
-
if (args.length === 3 && strings[0] === '' && strings[1] === '') {
|
|
7008
|
-
// Single argument interpolate instructions.
|
|
7009
|
-
args = [args[1]];
|
|
7010
|
-
}
|
|
7011
|
-
else if (args.length >= 19) {
|
|
7012
|
-
// 19 or more arguments must be passed to the `interpolateV`-style instructions, which accept
|
|
7013
|
-
// an array of arguments
|
|
7014
|
-
args = [literalArr(args)];
|
|
7015
|
-
}
|
|
7016
|
-
}
|
|
6996
|
+
const args = outputExpr.args;
|
|
7017
6997
|
return { stmts, args };
|
|
7018
6998
|
}
|
|
7019
6999
|
function getStatementsFromVisitor(visitor, bindingId) {
|
|
@@ -7080,11 +7060,11 @@ class _BuiltinAstConverter extends AstTransformer {
|
|
|
7080
7060
|
}
|
|
7081
7061
|
}
|
|
7082
7062
|
class _AstToIrVisitor {
|
|
7083
|
-
constructor(_localResolver, _implicitReceiver, bindingId,
|
|
7063
|
+
constructor(_localResolver, _implicitReceiver, bindingId, supportsInterpolation, baseSourceSpan, implicitReceiverAccesses) {
|
|
7084
7064
|
this._localResolver = _localResolver;
|
|
7085
7065
|
this._implicitReceiver = _implicitReceiver;
|
|
7086
7066
|
this.bindingId = bindingId;
|
|
7087
|
-
this.
|
|
7067
|
+
this.supportsInterpolation = supportsInterpolation;
|
|
7088
7068
|
this.baseSourceSpan = baseSourceSpan;
|
|
7089
7069
|
this.implicitReceiverAccesses = implicitReceiverAccesses;
|
|
7090
7070
|
this._nodeMap = new Map();
|
|
@@ -7182,21 +7162,29 @@ class _AstToIrVisitor {
|
|
|
7182
7162
|
return this.visitImplicitReceiver(ast, mode);
|
|
7183
7163
|
}
|
|
7184
7164
|
visitInterpolation(ast, mode) {
|
|
7165
|
+
if (!this.supportsInterpolation) {
|
|
7166
|
+
throw new Error('Unexpected interpolation');
|
|
7167
|
+
}
|
|
7185
7168
|
ensureExpressionMode(mode, ast);
|
|
7186
|
-
|
|
7169
|
+
let args = [];
|
|
7187
7170
|
for (let i = 0; i < ast.strings.length - 1; i++) {
|
|
7188
7171
|
args.push(literal(ast.strings[i]));
|
|
7189
7172
|
args.push(this._visit(ast.expressions[i], _Mode.Expression));
|
|
7190
7173
|
}
|
|
7191
7174
|
args.push(literal(ast.strings[ast.strings.length - 1]));
|
|
7192
|
-
|
|
7193
|
-
|
|
7175
|
+
// If we're dealing with an interpolation of 1 value with an empty prefix and suffix, reduce the
|
|
7176
|
+
// args returned to just the value, because we're going to pass it to a special instruction.
|
|
7177
|
+
const strings = ast.strings;
|
|
7178
|
+
if (strings.length === 2 && strings[0] === '' && strings[1] === '') {
|
|
7179
|
+
// Single argument interpolate instructions.
|
|
7180
|
+
args = [args[1]];
|
|
7194
7181
|
}
|
|
7195
|
-
|
|
7196
|
-
|
|
7197
|
-
|
|
7198
|
-
|
|
7199
|
-
|
|
7182
|
+
else if (ast.expressions.length >= 9) {
|
|
7183
|
+
// 9 or more arguments must be passed to the `interpolateV`-style instructions, which accept
|
|
7184
|
+
// an array of arguments
|
|
7185
|
+
args = [literalArr(args)];
|
|
7186
|
+
}
|
|
7187
|
+
return new InterpolationExpression(args);
|
|
7200
7188
|
}
|
|
7201
7189
|
visitKeyedRead(ast, mode) {
|
|
7202
7190
|
const leftMostSafe = this.leftMostSafeNode(ast);
|
|
@@ -7308,10 +7296,6 @@ class _AstToIrVisitor {
|
|
|
7308
7296
|
visitAll(asts, mode) {
|
|
7309
7297
|
return asts.map(ast => this._visit(ast, mode));
|
|
7310
7298
|
}
|
|
7311
|
-
visitQuote(ast, mode) {
|
|
7312
|
-
throw new Error(`Quotes are not supported for evaluation!
|
|
7313
|
-
Statement: ${ast.uninterpretedExpression} located at ${ast.location}`);
|
|
7314
|
-
}
|
|
7315
7299
|
visitCall(ast, mode) {
|
|
7316
7300
|
const leftMostSafe = this.leftMostSafeNode(ast);
|
|
7317
7301
|
if (leftMostSafe) {
|
|
@@ -7497,9 +7481,6 @@ class _AstToIrVisitor {
|
|
|
7497
7481
|
visitPropertyWrite(ast) {
|
|
7498
7482
|
return null;
|
|
7499
7483
|
},
|
|
7500
|
-
visitQuote(ast) {
|
|
7501
|
-
return null;
|
|
7502
|
-
},
|
|
7503
7484
|
visitSafePropertyRead(ast) {
|
|
7504
7485
|
return visit(this, ast.receiver) || ast;
|
|
7505
7486
|
},
|
|
@@ -7576,9 +7557,6 @@ class _AstToIrVisitor {
|
|
|
7576
7557
|
visitPropertyWrite(ast) {
|
|
7577
7558
|
return false;
|
|
7578
7559
|
},
|
|
7579
|
-
visitQuote(ast) {
|
|
7580
|
-
return false;
|
|
7581
|
-
},
|
|
7582
7560
|
visitSafePropertyRead(ast) {
|
|
7583
7561
|
return false;
|
|
7584
7562
|
},
|
|
@@ -7635,6 +7613,18 @@ function flattenStatements(arg, output) {
|
|
|
7635
7613
|
output.push(arg);
|
|
7636
7614
|
}
|
|
7637
7615
|
}
|
|
7616
|
+
function unsupported() {
|
|
7617
|
+
throw new Error('Unsupported operation');
|
|
7618
|
+
}
|
|
7619
|
+
class InterpolationExpression extends Expression {
|
|
7620
|
+
constructor(args) {
|
|
7621
|
+
super(null, null);
|
|
7622
|
+
this.args = args;
|
|
7623
|
+
this.isConstant = unsupported;
|
|
7624
|
+
this.isEquivalent = unsupported;
|
|
7625
|
+
this.visitExpression = unsupported;
|
|
7626
|
+
}
|
|
7627
|
+
}
|
|
7638
7628
|
class DefaultLocalResolver {
|
|
7639
7629
|
constructor(globals) {
|
|
7640
7630
|
this.globals = globals;
|
|
@@ -8009,7 +7999,7 @@ class ShadowCss {
|
|
|
8009
7999
|
this._scopeSelector(rule.selector, scopeSelector, hostSelector, this.strictStyling);
|
|
8010
8000
|
}
|
|
8011
8001
|
else if (rule.selector.startsWith('@media') || rule.selector.startsWith('@supports') ||
|
|
8012
|
-
rule.selector.startsWith('@document')) {
|
|
8002
|
+
rule.selector.startsWith('@document') || rule.selector.startsWith('@layer')) {
|
|
8013
8003
|
content = this._scopeSelectors(rule.content, scopeSelector, hostSelector);
|
|
8014
8004
|
}
|
|
8015
8005
|
else if (rule.selector.startsWith('@font-face') || rule.selector.startsWith('@page')) {
|
|
@@ -8472,7 +8462,7 @@ function parse(value) {
|
|
|
8472
8462
|
}
|
|
8473
8463
|
}
|
|
8474
8464
|
if (currentProp && valueStart) {
|
|
8475
|
-
const styleVal = value.
|
|
8465
|
+
const styleVal = value.slice(valueStart).trim();
|
|
8476
8466
|
styles.push(currentProp, valueHasQuotes ? stripUnnecessaryQuotes(styleVal) : styleVal);
|
|
8477
8467
|
}
|
|
8478
8468
|
return styles;
|
|
@@ -8650,7 +8640,7 @@ class StylingBuilder {
|
|
|
8650
8640
|
const isClass = !isStyle && (name === 'class' || prefix === 'class.' || prefix === 'class!');
|
|
8651
8641
|
if (isStyle || isClass) {
|
|
8652
8642
|
const isMapBased = name.charAt(5) !== '.'; // style.prop or class.prop makes this a no
|
|
8653
|
-
const property = name.
|
|
8643
|
+
const property = name.slice(isMapBased ? 5 : 6); // the dot explains why there's a +1
|
|
8654
8644
|
if (isStyle) {
|
|
8655
8645
|
binding = this.registerStyleInput(property, isMapBased, expression, sourceSpan);
|
|
8656
8646
|
}
|
|
@@ -8803,7 +8793,7 @@ class StylingBuilder {
|
|
|
8803
8793
|
getStyleMapInterpolationExpression(mapValue);
|
|
8804
8794
|
}
|
|
8805
8795
|
else {
|
|
8806
|
-
reference = isClassBased ? Identifiers
|
|
8796
|
+
reference = isClassBased ? Identifiers.classMap : Identifiers.styleMap;
|
|
8807
8797
|
}
|
|
8808
8798
|
return {
|
|
8809
8799
|
reference,
|
|
@@ -8877,13 +8867,13 @@ class StylingBuilder {
|
|
|
8877
8867
|
}
|
|
8878
8868
|
_buildClassInputs(valueConverter) {
|
|
8879
8869
|
if (this._singleClassInputs) {
|
|
8880
|
-
return this._buildSingleInputs(Identifiers
|
|
8870
|
+
return this._buildSingleInputs(Identifiers.classProp, this._singleClassInputs, valueConverter, null, true);
|
|
8881
8871
|
}
|
|
8882
8872
|
return [];
|
|
8883
8873
|
}
|
|
8884
8874
|
_buildStyleInputs(valueConverter) {
|
|
8885
8875
|
if (this._singleStyleInputs) {
|
|
8886
|
-
return this._buildSingleInputs(Identifiers
|
|
8876
|
+
return this._buildSingleInputs(Identifiers.styleProp, this._singleStyleInputs, valueConverter, getStylePropInterpolationExpression, false);
|
|
8887
8877
|
}
|
|
8888
8878
|
return [];
|
|
8889
8879
|
}
|
|
@@ -8924,7 +8914,7 @@ function parseProperty(name) {
|
|
|
8924
8914
|
let property = name;
|
|
8925
8915
|
const unitIndex = name.lastIndexOf('.');
|
|
8926
8916
|
if (unitIndex > 0) {
|
|
8927
|
-
suffix = name.
|
|
8917
|
+
suffix = name.slice(unitIndex + 1);
|
|
8928
8918
|
property = name.substring(0, unitIndex);
|
|
8929
8919
|
}
|
|
8930
8920
|
return { property, suffix, hasOverrideFlag };
|
|
@@ -8936,25 +8926,25 @@ function parseProperty(name) {
|
|
|
8936
8926
|
function getClassMapInterpolationExpression(interpolation) {
|
|
8937
8927
|
switch (getInterpolationArgsLength(interpolation)) {
|
|
8938
8928
|
case 1:
|
|
8939
|
-
return Identifiers
|
|
8929
|
+
return Identifiers.classMap;
|
|
8940
8930
|
case 3:
|
|
8941
|
-
return Identifiers
|
|
8931
|
+
return Identifiers.classMapInterpolate1;
|
|
8942
8932
|
case 5:
|
|
8943
|
-
return Identifiers
|
|
8933
|
+
return Identifiers.classMapInterpolate2;
|
|
8944
8934
|
case 7:
|
|
8945
|
-
return Identifiers
|
|
8935
|
+
return Identifiers.classMapInterpolate3;
|
|
8946
8936
|
case 9:
|
|
8947
|
-
return Identifiers
|
|
8937
|
+
return Identifiers.classMapInterpolate4;
|
|
8948
8938
|
case 11:
|
|
8949
|
-
return Identifiers
|
|
8939
|
+
return Identifiers.classMapInterpolate5;
|
|
8950
8940
|
case 13:
|
|
8951
|
-
return Identifiers
|
|
8941
|
+
return Identifiers.classMapInterpolate6;
|
|
8952
8942
|
case 15:
|
|
8953
|
-
return Identifiers
|
|
8943
|
+
return Identifiers.classMapInterpolate7;
|
|
8954
8944
|
case 17:
|
|
8955
|
-
return Identifiers
|
|
8945
|
+
return Identifiers.classMapInterpolate8;
|
|
8956
8946
|
default:
|
|
8957
|
-
return Identifiers
|
|
8947
|
+
return Identifiers.classMapInterpolateV;
|
|
8958
8948
|
}
|
|
8959
8949
|
}
|
|
8960
8950
|
/**
|
|
@@ -8964,25 +8954,25 @@ function getClassMapInterpolationExpression(interpolation) {
|
|
|
8964
8954
|
function getStyleMapInterpolationExpression(interpolation) {
|
|
8965
8955
|
switch (getInterpolationArgsLength(interpolation)) {
|
|
8966
8956
|
case 1:
|
|
8967
|
-
return Identifiers
|
|
8957
|
+
return Identifiers.styleMap;
|
|
8968
8958
|
case 3:
|
|
8969
|
-
return Identifiers
|
|
8959
|
+
return Identifiers.styleMapInterpolate1;
|
|
8970
8960
|
case 5:
|
|
8971
|
-
return Identifiers
|
|
8961
|
+
return Identifiers.styleMapInterpolate2;
|
|
8972
8962
|
case 7:
|
|
8973
|
-
return Identifiers
|
|
8963
|
+
return Identifiers.styleMapInterpolate3;
|
|
8974
8964
|
case 9:
|
|
8975
|
-
return Identifiers
|
|
8965
|
+
return Identifiers.styleMapInterpolate4;
|
|
8976
8966
|
case 11:
|
|
8977
|
-
return Identifiers
|
|
8967
|
+
return Identifiers.styleMapInterpolate5;
|
|
8978
8968
|
case 13:
|
|
8979
|
-
return Identifiers
|
|
8969
|
+
return Identifiers.styleMapInterpolate6;
|
|
8980
8970
|
case 15:
|
|
8981
|
-
return Identifiers
|
|
8971
|
+
return Identifiers.styleMapInterpolate7;
|
|
8982
8972
|
case 17:
|
|
8983
|
-
return Identifiers
|
|
8973
|
+
return Identifiers.styleMapInterpolate8;
|
|
8984
8974
|
default:
|
|
8985
|
-
return Identifiers
|
|
8975
|
+
return Identifiers.styleMapInterpolateV;
|
|
8986
8976
|
}
|
|
8987
8977
|
}
|
|
8988
8978
|
/**
|
|
@@ -8992,25 +8982,25 @@ function getStyleMapInterpolationExpression(interpolation) {
|
|
|
8992
8982
|
function getStylePropInterpolationExpression(interpolation) {
|
|
8993
8983
|
switch (getInterpolationArgsLength(interpolation)) {
|
|
8994
8984
|
case 1:
|
|
8995
|
-
return Identifiers
|
|
8985
|
+
return Identifiers.styleProp;
|
|
8996
8986
|
case 3:
|
|
8997
|
-
return Identifiers
|
|
8987
|
+
return Identifiers.stylePropInterpolate1;
|
|
8998
8988
|
case 5:
|
|
8999
|
-
return Identifiers
|
|
8989
|
+
return Identifiers.stylePropInterpolate2;
|
|
9000
8990
|
case 7:
|
|
9001
|
-
return Identifiers
|
|
8991
|
+
return Identifiers.stylePropInterpolate3;
|
|
9002
8992
|
case 9:
|
|
9003
|
-
return Identifiers
|
|
8993
|
+
return Identifiers.stylePropInterpolate4;
|
|
9004
8994
|
case 11:
|
|
9005
|
-
return Identifiers
|
|
8995
|
+
return Identifiers.stylePropInterpolate5;
|
|
9006
8996
|
case 13:
|
|
9007
|
-
return Identifiers
|
|
8997
|
+
return Identifiers.stylePropInterpolate6;
|
|
9008
8998
|
case 15:
|
|
9009
|
-
return Identifiers
|
|
8999
|
+
return Identifiers.stylePropInterpolate7;
|
|
9010
9000
|
case 17:
|
|
9011
|
-
return Identifiers
|
|
9001
|
+
return Identifiers.stylePropInterpolate8;
|
|
9012
9002
|
default:
|
|
9013
|
-
return Identifiers
|
|
9003
|
+
return Identifiers.stylePropInterpolateV;
|
|
9014
9004
|
}
|
|
9015
9005
|
}
|
|
9016
9006
|
/**
|
|
@@ -9471,11 +9461,15 @@ class Parser$1 {
|
|
|
9471
9461
|
this._lexer = _lexer;
|
|
9472
9462
|
this.errors = [];
|
|
9473
9463
|
}
|
|
9474
|
-
parseAction(input, location, absoluteOffset, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
|
|
9464
|
+
parseAction(input, isAssignmentEvent, location, absoluteOffset, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
|
|
9475
9465
|
this._checkNoInterpolation(input, location, interpolationConfig);
|
|
9476
9466
|
const sourceToLex = this._stripComments(input);
|
|
9477
9467
|
const tokens = this._lexer.tokenize(sourceToLex);
|
|
9478
|
-
|
|
9468
|
+
let flags = 1 /* Action */;
|
|
9469
|
+
if (isAssignmentEvent) {
|
|
9470
|
+
flags |= 2 /* AssignmentEvent */;
|
|
9471
|
+
}
|
|
9472
|
+
const ast = new _ParseAST(input, location, absoluteOffset, tokens, flags, this.errors, 0).parseChain();
|
|
9479
9473
|
return new ASTWithSource(ast, input, location, absoluteOffset, this.errors);
|
|
9480
9474
|
}
|
|
9481
9475
|
parseBinding(input, location, absoluteOffset, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
|
|
@@ -9499,31 +9493,12 @@ class Parser$1 {
|
|
|
9499
9493
|
this.errors.push(new ParserError(message, input, errLocation, ctxLocation));
|
|
9500
9494
|
}
|
|
9501
9495
|
_parseBindingAst(input, location, absoluteOffset, interpolationConfig) {
|
|
9502
|
-
// Quotes expressions use 3rd-party expression language. We don't want to use
|
|
9503
|
-
// our lexer or parser for that, so we check for that ahead of time.
|
|
9504
|
-
const quote = this._parseQuote(input, location, absoluteOffset);
|
|
9505
|
-
if (quote != null) {
|
|
9506
|
-
return quote;
|
|
9507
|
-
}
|
|
9508
9496
|
this._checkNoInterpolation(input, location, interpolationConfig);
|
|
9509
9497
|
const sourceToLex = this._stripComments(input);
|
|
9510
9498
|
const tokens = this._lexer.tokenize(sourceToLex);
|
|
9511
|
-
return new _ParseAST(input, location, absoluteOffset, tokens,
|
|
9499
|
+
return new _ParseAST(input, location, absoluteOffset, tokens, 0 /* None */, this.errors, 0)
|
|
9512
9500
|
.parseChain();
|
|
9513
9501
|
}
|
|
9514
|
-
_parseQuote(input, location, absoluteOffset) {
|
|
9515
|
-
if (input == null)
|
|
9516
|
-
return null;
|
|
9517
|
-
const prefixSeparatorIndex = input.indexOf(':');
|
|
9518
|
-
if (prefixSeparatorIndex == -1)
|
|
9519
|
-
return null;
|
|
9520
|
-
const prefix = input.substring(0, prefixSeparatorIndex).trim();
|
|
9521
|
-
if (!isIdentifier(prefix))
|
|
9522
|
-
return null;
|
|
9523
|
-
const uninterpretedExpression = input.substring(prefixSeparatorIndex + 1);
|
|
9524
|
-
const span = new ParseSpan(0, input.length);
|
|
9525
|
-
return new Quote(span, span.toAbsolute(absoluteOffset), prefix, uninterpretedExpression, location);
|
|
9526
|
-
}
|
|
9527
9502
|
/**
|
|
9528
9503
|
* Parse microsyntax template expression and return a list of bindings or
|
|
9529
9504
|
* parsing errors in case the given expression is invalid.
|
|
@@ -9552,14 +9527,14 @@ class Parser$1 {
|
|
|
9552
9527
|
*/
|
|
9553
9528
|
parseTemplateBindings(templateKey, templateValue, templateUrl, absoluteKeyOffset, absoluteValueOffset) {
|
|
9554
9529
|
const tokens = this._lexer.tokenize(templateValue);
|
|
9555
|
-
const parser = new _ParseAST(templateValue, templateUrl, absoluteValueOffset, tokens,
|
|
9530
|
+
const parser = new _ParseAST(templateValue, templateUrl, absoluteValueOffset, tokens, 0 /* None */, this.errors, 0 /* relative offset */);
|
|
9556
9531
|
return parser.parseTemplateBindings({
|
|
9557
9532
|
source: templateKey,
|
|
9558
9533
|
span: new AbsoluteSourceSpan(absoluteKeyOffset, absoluteKeyOffset + templateKey.length),
|
|
9559
9534
|
});
|
|
9560
9535
|
}
|
|
9561
|
-
parseInterpolation(input, location, absoluteOffset, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
|
|
9562
|
-
const { strings, expressions, offsets } = this.splitInterpolation(input, location, interpolationConfig);
|
|
9536
|
+
parseInterpolation(input, location, absoluteOffset, interpolatedTokens, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
|
|
9537
|
+
const { strings, expressions, offsets } = this.splitInterpolation(input, location, interpolatedTokens, interpolationConfig);
|
|
9563
9538
|
if (expressions.length === 0)
|
|
9564
9539
|
return null;
|
|
9565
9540
|
const expressionNodes = [];
|
|
@@ -9567,7 +9542,7 @@ class Parser$1 {
|
|
|
9567
9542
|
const expressionText = expressions[i].text;
|
|
9568
9543
|
const sourceToLex = this._stripComments(expressionText);
|
|
9569
9544
|
const tokens = this._lexer.tokenize(sourceToLex);
|
|
9570
|
-
const ast = new _ParseAST(input, location, absoluteOffset, tokens,
|
|
9545
|
+
const ast = new _ParseAST(input, location, absoluteOffset, tokens, 0 /* None */, this.errors, offsets[i])
|
|
9571
9546
|
.parseChain();
|
|
9572
9547
|
expressionNodes.push(ast);
|
|
9573
9548
|
}
|
|
@@ -9581,8 +9556,7 @@ class Parser$1 {
|
|
|
9581
9556
|
parseInterpolationExpression(expression, location, absoluteOffset) {
|
|
9582
9557
|
const sourceToLex = this._stripComments(expression);
|
|
9583
9558
|
const tokens = this._lexer.tokenize(sourceToLex);
|
|
9584
|
-
const ast = new _ParseAST(expression, location, absoluteOffset, tokens,
|
|
9585
|
-
/* parseAction */ false, this.errors, 0)
|
|
9559
|
+
const ast = new _ParseAST(expression, location, absoluteOffset, tokens, 0 /* None */, this.errors, 0)
|
|
9586
9560
|
.parseChain();
|
|
9587
9561
|
const strings = ['', '']; // The prefix and suffix strings are both empty
|
|
9588
9562
|
return this.createInterpolationAst(strings, [ast], expression, location, absoluteOffset);
|
|
@@ -9599,10 +9573,12 @@ class Parser$1 {
|
|
|
9599
9573
|
* `SplitInterpolation` with splits that look like
|
|
9600
9574
|
* <raw text> <expression> <raw text> ... <raw text> <expression> <raw text>
|
|
9601
9575
|
*/
|
|
9602
|
-
splitInterpolation(input, location, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
|
|
9576
|
+
splitInterpolation(input, location, interpolatedTokens, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
|
|
9577
|
+
var _a;
|
|
9603
9578
|
const strings = [];
|
|
9604
9579
|
const expressions = [];
|
|
9605
9580
|
const offsets = [];
|
|
9581
|
+
const inputToTemplateIndexMap = interpolatedTokens ? getIndexMapForOriginalTemplate(interpolatedTokens) : null;
|
|
9606
9582
|
let i = 0;
|
|
9607
9583
|
let atInterpolation = false;
|
|
9608
9584
|
let extendLastString = false;
|
|
@@ -9637,7 +9613,9 @@ class Parser$1 {
|
|
|
9637
9613
|
this._reportError('Blank expressions are not allowed in interpolated strings', input, `at column ${i} in`, location);
|
|
9638
9614
|
}
|
|
9639
9615
|
expressions.push({ text, start: fullStart, end: fullEnd });
|
|
9640
|
-
|
|
9616
|
+
const startInOriginalTemplate = (_a = inputToTemplateIndexMap === null || inputToTemplateIndexMap === void 0 ? void 0 : inputToTemplateIndexMap.get(fullStart)) !== null && _a !== void 0 ? _a : fullStart;
|
|
9617
|
+
const offset = startInOriginalTemplate + interpStart.length;
|
|
9618
|
+
offsets.push(offset);
|
|
9641
9619
|
i = fullEnd;
|
|
9642
9620
|
atInterpolation = false;
|
|
9643
9621
|
}
|
|
@@ -9753,12 +9731,12 @@ var ParseContextFlags;
|
|
|
9753
9731
|
ParseContextFlags[ParseContextFlags["Writable"] = 1] = "Writable";
|
|
9754
9732
|
})(ParseContextFlags || (ParseContextFlags = {}));
|
|
9755
9733
|
class _ParseAST {
|
|
9756
|
-
constructor(input, location, absoluteOffset, tokens,
|
|
9734
|
+
constructor(input, location, absoluteOffset, tokens, parseFlags, errors, offset) {
|
|
9757
9735
|
this.input = input;
|
|
9758
9736
|
this.location = location;
|
|
9759
9737
|
this.absoluteOffset = absoluteOffset;
|
|
9760
9738
|
this.tokens = tokens;
|
|
9761
|
-
this.
|
|
9739
|
+
this.parseFlags = parseFlags;
|
|
9762
9740
|
this.errors = errors;
|
|
9763
9741
|
this.offset = offset;
|
|
9764
9742
|
this.rparensExpected = 0;
|
|
@@ -9935,7 +9913,7 @@ class _ParseAST {
|
|
|
9935
9913
|
const expr = this.parsePipe();
|
|
9936
9914
|
exprs.push(expr);
|
|
9937
9915
|
if (this.consumeOptionalCharacter($SEMICOLON)) {
|
|
9938
|
-
if (!this.
|
|
9916
|
+
if (!(this.parseFlags & 1 /* Action */)) {
|
|
9939
9917
|
this.error('Binding expression cannot contain chained expression');
|
|
9940
9918
|
}
|
|
9941
9919
|
while (this.consumeOptionalCharacter($SEMICOLON)) {
|
|
@@ -9959,7 +9937,7 @@ class _ParseAST {
|
|
|
9959
9937
|
const start = this.inputIndex;
|
|
9960
9938
|
let result = this.parseExpression();
|
|
9961
9939
|
if (this.consumeOptionalOperator('|')) {
|
|
9962
|
-
if (this.
|
|
9940
|
+
if (this.parseFlags & 1 /* Action */) {
|
|
9963
9941
|
this.error('Cannot have a pipe in an action expression');
|
|
9964
9942
|
}
|
|
9965
9943
|
do {
|
|
@@ -10302,7 +10280,7 @@ class _ParseAST {
|
|
|
10302
10280
|
const nameSpan = this.sourceSpan(nameStart);
|
|
10303
10281
|
let receiver;
|
|
10304
10282
|
if (isSafe) {
|
|
10305
|
-
if (this.
|
|
10283
|
+
if (this.consumeOptionalAssignment()) {
|
|
10306
10284
|
this.error('The \'?.\' operator cannot be used in the assignment');
|
|
10307
10285
|
receiver = new EmptyExpr(this.span(start), this.sourceSpan(start));
|
|
10308
10286
|
}
|
|
@@ -10311,8 +10289,8 @@ class _ParseAST {
|
|
|
10311
10289
|
}
|
|
10312
10290
|
}
|
|
10313
10291
|
else {
|
|
10314
|
-
if (this.
|
|
10315
|
-
if (!this.
|
|
10292
|
+
if (this.consumeOptionalAssignment()) {
|
|
10293
|
+
if (!(this.parseFlags & 1 /* Action */)) {
|
|
10316
10294
|
this.error('Bindings cannot contain assignments');
|
|
10317
10295
|
return new EmptyExpr(this.span(start), this.sourceSpan(start));
|
|
10318
10296
|
}
|
|
@@ -10338,6 +10316,22 @@ class _ParseAST {
|
|
|
10338
10316
|
return isSafe ? new SafeCall(span, sourceSpan, receiver, args, argumentSpan) :
|
|
10339
10317
|
new Call(span, sourceSpan, receiver, args, argumentSpan);
|
|
10340
10318
|
}
|
|
10319
|
+
consumeOptionalAssignment() {
|
|
10320
|
+
// When parsing assignment events (originating from two-way-binding aka banana-in-a-box syntax),
|
|
10321
|
+
// it is valid for the primary expression to be terminated by the non-null operator. This
|
|
10322
|
+
// primary expression is substituted as LHS of the assignment operator to achieve
|
|
10323
|
+
// two-way-binding, such that the LHS could be the non-null operator. The grammar doesn't
|
|
10324
|
+
// naturally allow for this syntax, so assignment events are parsed specially.
|
|
10325
|
+
if ((this.parseFlags & 2 /* AssignmentEvent */) && this.next.isOperator('!') &&
|
|
10326
|
+
this.peek(1).isOperator('=')) {
|
|
10327
|
+
// First skip over the ! operator.
|
|
10328
|
+
this.advance();
|
|
10329
|
+
// Then skip over the = operator, to fully consume the optional assignment operator.
|
|
10330
|
+
this.advance();
|
|
10331
|
+
return true;
|
|
10332
|
+
}
|
|
10333
|
+
return this.consumeOptionalOperator('=');
|
|
10334
|
+
}
|
|
10341
10335
|
parseCallArguments() {
|
|
10342
10336
|
if (this.next.isCharacter($RPAREN))
|
|
10343
10337
|
return [];
|
|
@@ -10630,6 +10624,41 @@ class SimpleExpressionChecker extends RecursiveAstVisitor {
|
|
|
10630
10624
|
this.errors.push('pipes');
|
|
10631
10625
|
}
|
|
10632
10626
|
}
|
|
10627
|
+
/**
|
|
10628
|
+
* Computes the real offset in the original template for indexes in an interpolation.
|
|
10629
|
+
*
|
|
10630
|
+
* Because templates can have encoded HTML entities and the input passed to the parser at this stage
|
|
10631
|
+
* of the compiler is the _decoded_ value, we need to compute the real offset using the original
|
|
10632
|
+
* encoded values in the interpolated tokens. Note that this is only a special case handling for
|
|
10633
|
+
* `MlParserTokenType.ENCODED_ENTITY` token types. All other interpolated tokens are expected to
|
|
10634
|
+
* have parts which exactly match the input string for parsing the interpolation.
|
|
10635
|
+
*
|
|
10636
|
+
* @param interpolatedTokens The tokens for the interpolated value.
|
|
10637
|
+
*
|
|
10638
|
+
* @returns A map of index locations in the decoded template to indexes in the original template
|
|
10639
|
+
*/
|
|
10640
|
+
function getIndexMapForOriginalTemplate(interpolatedTokens) {
|
|
10641
|
+
let offsetMap = new Map();
|
|
10642
|
+
let consumedInOriginalTemplate = 0;
|
|
10643
|
+
let consumedInInput = 0;
|
|
10644
|
+
let tokenIndex = 0;
|
|
10645
|
+
while (tokenIndex < interpolatedTokens.length) {
|
|
10646
|
+
const currentToken = interpolatedTokens[tokenIndex];
|
|
10647
|
+
if (currentToken.type === 9 /* ENCODED_ENTITY */) {
|
|
10648
|
+
const [decoded, encoded] = currentToken.parts;
|
|
10649
|
+
consumedInOriginalTemplate += encoded.length;
|
|
10650
|
+
consumedInInput += decoded.length;
|
|
10651
|
+
}
|
|
10652
|
+
else {
|
|
10653
|
+
const lengthOfParts = currentToken.parts.reduce((sum, current) => sum + current.length, 0);
|
|
10654
|
+
consumedInInput += lengthOfParts;
|
|
10655
|
+
consumedInOriginalTemplate += lengthOfParts;
|
|
10656
|
+
}
|
|
10657
|
+
offsetMap.set(consumedInInput, consumedInOriginalTemplate);
|
|
10658
|
+
tokenIndex++;
|
|
10659
|
+
}
|
|
10660
|
+
return offsetMap;
|
|
10661
|
+
}
|
|
10633
10662
|
|
|
10634
10663
|
/**
|
|
10635
10664
|
* @license
|
|
@@ -13871,7 +13900,7 @@ class EscapedCharacterCursor extends PlainCharacterCursor {
|
|
|
13871
13900
|
}
|
|
13872
13901
|
}
|
|
13873
13902
|
decodeHexDigits(start, length) {
|
|
13874
|
-
const hex = this.input.
|
|
13903
|
+
const hex = this.input.slice(start.internalState.offset, start.internalState.offset + length);
|
|
13875
13904
|
const charCode = parseInt(hex, 16);
|
|
13876
13905
|
if (!isNaN(charCode)) {
|
|
13877
13906
|
return charCode;
|
|
@@ -15028,7 +15057,7 @@ class BindingParser {
|
|
|
15028
15057
|
// Regardless, neither of these values are used in Ivy but are only here to satisfy the
|
|
15029
15058
|
// function signature. This should likely be refactored in the future so that `sourceSpan`
|
|
15030
15059
|
// isn't being used inaccurately.
|
|
15031
|
-
this.parseEvent(propName, expression, sourceSpan, sourceSpan, [], targetEvents, sourceSpan);
|
|
15060
|
+
this.parseEvent(propName, expression, /* isAssignmentEvent */ false, sourceSpan, sourceSpan, [], targetEvents, sourceSpan);
|
|
15032
15061
|
}
|
|
15033
15062
|
else {
|
|
15034
15063
|
this._reportError(`Value of the host listener "${propName}" needs to be a string representing an expression but got "${expression}" (${typeof expression})`, sourceSpan);
|
|
@@ -15036,11 +15065,11 @@ class BindingParser {
|
|
|
15036
15065
|
}
|
|
15037
15066
|
return targetEvents;
|
|
15038
15067
|
}
|
|
15039
|
-
parseInterpolation(value, sourceSpan) {
|
|
15068
|
+
parseInterpolation(value, sourceSpan, interpolatedTokens) {
|
|
15040
15069
|
const sourceInfo = sourceSpan.start.toString();
|
|
15041
15070
|
const absoluteOffset = sourceSpan.fullStart.offset;
|
|
15042
15071
|
try {
|
|
15043
|
-
const ast = this._exprParser.parseInterpolation(value, sourceInfo, absoluteOffset, this._interpolationConfig);
|
|
15072
|
+
const ast = this._exprParser.parseInterpolation(value, sourceInfo, absoluteOffset, interpolatedTokens, this._interpolationConfig);
|
|
15044
15073
|
if (ast)
|
|
15045
15074
|
this._reportExpressionParserErrors(ast.errors, sourceSpan);
|
|
15046
15075
|
return ast;
|
|
@@ -15177,8 +15206,8 @@ class BindingParser {
|
|
|
15177
15206
|
this._parsePropertyAst(name, this._parseBinding(expression, isHost, valueSpan || sourceSpan, absoluteOffset), sourceSpan, keySpan, valueSpan, targetMatchableAttrs, targetProps);
|
|
15178
15207
|
}
|
|
15179
15208
|
}
|
|
15180
|
-
parsePropertyInterpolation(name, value, sourceSpan, valueSpan, targetMatchableAttrs, targetProps, keySpan) {
|
|
15181
|
-
const expr = this.parseInterpolation(value, valueSpan || sourceSpan);
|
|
15209
|
+
parsePropertyInterpolation(name, value, sourceSpan, valueSpan, targetMatchableAttrs, targetProps, keySpan, interpolatedTokens) {
|
|
15210
|
+
const expr = this.parseInterpolation(value, valueSpan || sourceSpan, interpolatedTokens);
|
|
15182
15211
|
if (expr) {
|
|
15183
15212
|
this._parsePropertyAst(name, expr, sourceSpan, keySpan, valueSpan, targetMatchableAttrs, targetProps);
|
|
15184
15213
|
return true;
|
|
@@ -15265,30 +15294,30 @@ class BindingParser {
|
|
|
15265
15294
|
return new BoundElementProperty(boundPropertyName, bindingType, securityContexts[0], boundProp.expression, unit, boundProp.sourceSpan, boundProp.keySpan, boundProp.valueSpan);
|
|
15266
15295
|
}
|
|
15267
15296
|
// TODO: keySpan should be required but was made optional to avoid changing VE parser.
|
|
15268
|
-
parseEvent(name, expression, sourceSpan, handlerSpan, targetMatchableAttrs, targetEvents, keySpan) {
|
|
15297
|
+
parseEvent(name, expression, isAssignmentEvent, sourceSpan, handlerSpan, targetMatchableAttrs, targetEvents, keySpan) {
|
|
15269
15298
|
if (name.length === 0) {
|
|
15270
15299
|
this._reportError(`Event name is missing in binding`, sourceSpan);
|
|
15271
15300
|
}
|
|
15272
15301
|
if (isAnimationLabel(name)) {
|
|
15273
|
-
name = name.
|
|
15302
|
+
name = name.slice(1);
|
|
15274
15303
|
if (keySpan !== undefined) {
|
|
15275
15304
|
keySpan = moveParseSourceSpan(keySpan, new AbsoluteSourceSpan(keySpan.start.offset + 1, keySpan.end.offset));
|
|
15276
15305
|
}
|
|
15277
|
-
this._parseAnimationEvent(name, expression, sourceSpan, handlerSpan, targetEvents, keySpan);
|
|
15306
|
+
this._parseAnimationEvent(name, expression, isAssignmentEvent, sourceSpan, handlerSpan, targetEvents, keySpan);
|
|
15278
15307
|
}
|
|
15279
15308
|
else {
|
|
15280
|
-
this._parseRegularEvent(name, expression, sourceSpan, handlerSpan, targetMatchableAttrs, targetEvents, keySpan);
|
|
15309
|
+
this._parseRegularEvent(name, expression, isAssignmentEvent, sourceSpan, handlerSpan, targetMatchableAttrs, targetEvents, keySpan);
|
|
15281
15310
|
}
|
|
15282
15311
|
}
|
|
15283
15312
|
calcPossibleSecurityContexts(selector, propName, isAttribute) {
|
|
15284
15313
|
const prop = this._schemaRegistry.getMappedPropName(propName);
|
|
15285
15314
|
return calcPossibleSecurityContexts(this._schemaRegistry, selector, prop, isAttribute);
|
|
15286
15315
|
}
|
|
15287
|
-
_parseAnimationEvent(name, expression, sourceSpan, handlerSpan, targetEvents, keySpan) {
|
|
15316
|
+
_parseAnimationEvent(name, expression, isAssignmentEvent, sourceSpan, handlerSpan, targetEvents, keySpan) {
|
|
15288
15317
|
const matches = splitAtPeriod(name, [name, '']);
|
|
15289
15318
|
const eventName = matches[0];
|
|
15290
15319
|
const phase = matches[1].toLowerCase();
|
|
15291
|
-
const ast = this._parseAction(expression, handlerSpan);
|
|
15320
|
+
const ast = this._parseAction(expression, isAssignmentEvent, handlerSpan);
|
|
15292
15321
|
targetEvents.push(new ParsedEvent(eventName, phase, 1 /* Animation */, ast, sourceSpan, handlerSpan, keySpan));
|
|
15293
15322
|
if (eventName.length === 0) {
|
|
15294
15323
|
this._reportError(`Animation event name is missing in binding`, sourceSpan);
|
|
@@ -15302,20 +15331,20 @@ class BindingParser {
|
|
|
15302
15331
|
this._reportError(`The animation trigger output event (@${eventName}) is missing its phase value name (start or done are currently supported)`, sourceSpan);
|
|
15303
15332
|
}
|
|
15304
15333
|
}
|
|
15305
|
-
_parseRegularEvent(name, expression, sourceSpan, handlerSpan, targetMatchableAttrs, targetEvents, keySpan) {
|
|
15334
|
+
_parseRegularEvent(name, expression, isAssignmentEvent, sourceSpan, handlerSpan, targetMatchableAttrs, targetEvents, keySpan) {
|
|
15306
15335
|
// long format: 'target: eventName'
|
|
15307
15336
|
const [target, eventName] = splitAtColon(name, [null, name]);
|
|
15308
|
-
const ast = this._parseAction(expression, handlerSpan);
|
|
15337
|
+
const ast = this._parseAction(expression, isAssignmentEvent, handlerSpan);
|
|
15309
15338
|
targetMatchableAttrs.push([name, ast.source]);
|
|
15310
15339
|
targetEvents.push(new ParsedEvent(eventName, target, 0 /* Regular */, ast, sourceSpan, handlerSpan, keySpan));
|
|
15311
15340
|
// Don't detect directives for event names for now,
|
|
15312
15341
|
// so don't add the event name to the matchableAttrs
|
|
15313
15342
|
}
|
|
15314
|
-
_parseAction(value, sourceSpan) {
|
|
15343
|
+
_parseAction(value, isAssignmentEvent, sourceSpan) {
|
|
15315
15344
|
const sourceInfo = (sourceSpan && sourceSpan.start || '(unknown').toString();
|
|
15316
15345
|
const absoluteOffset = (sourceSpan && sourceSpan.start) ? sourceSpan.start.offset : 0;
|
|
15317
15346
|
try {
|
|
15318
|
-
const ast = this._exprParser.parseAction(value, sourceInfo, absoluteOffset, this._interpolationConfig);
|
|
15347
|
+
const ast = this._exprParser.parseAction(value, isAssignmentEvent, sourceInfo, absoluteOffset, this._interpolationConfig);
|
|
15319
15348
|
if (ast) {
|
|
15320
15349
|
this._reportExpressionParserErrors(ast.errors, sourceSpan);
|
|
15321
15350
|
}
|
|
@@ -15675,7 +15704,7 @@ class HtmlAstToIvyAst {
|
|
|
15675
15704
|
return new TextAttribute(attribute.name, attribute.value, attribute.sourceSpan, attribute.keySpan, attribute.valueSpan, attribute.i18n);
|
|
15676
15705
|
}
|
|
15677
15706
|
visitText(text) {
|
|
15678
|
-
return this._visitTextWithInterpolation(text.value, text.sourceSpan, text.i18n);
|
|
15707
|
+
return this._visitTextWithInterpolation(text.value, text.sourceSpan, text.tokens, text.i18n);
|
|
15679
15708
|
}
|
|
15680
15709
|
visitExpansion(expansion) {
|
|
15681
15710
|
if (!expansion.i18n) {
|
|
@@ -15705,7 +15734,7 @@ class HtmlAstToIvyAst {
|
|
|
15705
15734
|
vars[formattedKey] = new BoundText(ast, value.sourceSpan);
|
|
15706
15735
|
}
|
|
15707
15736
|
else {
|
|
15708
|
-
placeholders[key] = this._visitTextWithInterpolation(value.text, value.sourceSpan);
|
|
15737
|
+
placeholders[key] = this._visitTextWithInterpolation(value.text, value.sourceSpan, null);
|
|
15709
15738
|
}
|
|
15710
15739
|
});
|
|
15711
15740
|
return new Icu$1(vars, placeholders, expansion.sourceSpan, message);
|
|
@@ -15739,6 +15768,7 @@ class HtmlAstToIvyAst {
|
|
|
15739
15768
|
return { bound, literal };
|
|
15740
15769
|
}
|
|
15741
15770
|
parseAttribute(isTemplateElement, attribute, matchableAttributes, parsedProperties, boundEvents, variables, references) {
|
|
15771
|
+
var _a;
|
|
15742
15772
|
const name = normalizeAttributeName(attribute.name);
|
|
15743
15773
|
const value = attribute.value;
|
|
15744
15774
|
const srcSpan = attribute.sourceSpan;
|
|
@@ -15777,7 +15807,7 @@ class HtmlAstToIvyAst {
|
|
|
15777
15807
|
const events = [];
|
|
15778
15808
|
const identifier = bindParts[IDENT_KW_IDX];
|
|
15779
15809
|
const keySpan = createKeySpan(srcSpan, bindParts[KW_ON_IDX], identifier);
|
|
15780
|
-
this.bindingParser.parseEvent(identifier, value, srcSpan, attribute.valueSpan || srcSpan, matchableAttributes, events, keySpan);
|
|
15810
|
+
this.bindingParser.parseEvent(identifier, value, /* isAssignmentEvent */ false, srcSpan, attribute.valueSpan || srcSpan, matchableAttributes, events, keySpan);
|
|
15781
15811
|
addEvents(events, boundEvents);
|
|
15782
15812
|
}
|
|
15783
15813
|
else if (bindParts[KW_BINDON_IDX]) {
|
|
@@ -15821,19 +15851,19 @@ class HtmlAstToIvyAst {
|
|
|
15821
15851
|
}
|
|
15822
15852
|
else {
|
|
15823
15853
|
const events = [];
|
|
15824
|
-
this.bindingParser.parseEvent(identifier, value, srcSpan, attribute.valueSpan || srcSpan, matchableAttributes, events, keySpan);
|
|
15854
|
+
this.bindingParser.parseEvent(identifier, value, /* isAssignmentEvent */ false, srcSpan, attribute.valueSpan || srcSpan, matchableAttributes, events, keySpan);
|
|
15825
15855
|
addEvents(events, boundEvents);
|
|
15826
15856
|
}
|
|
15827
15857
|
return true;
|
|
15828
15858
|
}
|
|
15829
15859
|
// No explicit binding found.
|
|
15830
15860
|
const keySpan = createKeySpan(srcSpan, '' /* prefix */, name);
|
|
15831
|
-
const hasBinding = this.bindingParser.parsePropertyInterpolation(name, value, srcSpan, attribute.valueSpan, matchableAttributes, parsedProperties, keySpan);
|
|
15861
|
+
const hasBinding = this.bindingParser.parsePropertyInterpolation(name, value, srcSpan, attribute.valueSpan, matchableAttributes, parsedProperties, keySpan, (_a = attribute.valueTokens) !== null && _a !== void 0 ? _a : null);
|
|
15832
15862
|
return hasBinding;
|
|
15833
15863
|
}
|
|
15834
|
-
_visitTextWithInterpolation(value, sourceSpan, i18n) {
|
|
15864
|
+
_visitTextWithInterpolation(value, sourceSpan, interpolatedTokens, i18n) {
|
|
15835
15865
|
const valueNoNgsp = replaceNgsp(value);
|
|
15836
|
-
const expr = this.bindingParser.parseInterpolation(valueNoNgsp, sourceSpan);
|
|
15866
|
+
const expr = this.bindingParser.parseInterpolation(valueNoNgsp, sourceSpan, interpolatedTokens);
|
|
15837
15867
|
return expr ? new BoundText(expr, sourceSpan, i18n) : new Text$3(valueNoNgsp, sourceSpan);
|
|
15838
15868
|
}
|
|
15839
15869
|
parseVariable(identifier, value, sourceSpan, keySpan, valueSpan, variables) {
|
|
@@ -15859,7 +15889,7 @@ class HtmlAstToIvyAst {
|
|
|
15859
15889
|
}
|
|
15860
15890
|
parseAssignmentEvent(name, expression, sourceSpan, valueSpan, targetMatchableAttrs, boundEvents, keySpan) {
|
|
15861
15891
|
const events = [];
|
|
15862
|
-
this.bindingParser.parseEvent(`${name}Change`, `${expression}=$event`, sourceSpan, valueSpan || sourceSpan, targetMatchableAttrs, events, keySpan);
|
|
15892
|
+
this.bindingParser.parseEvent(`${name}Change`, `${expression} =$event`, /* isAssignmentEvent */ true, sourceSpan, valueSpan || sourceSpan, targetMatchableAttrs, events, keySpan);
|
|
15863
15893
|
addEvents(events, boundEvents);
|
|
15864
15894
|
}
|
|
15865
15895
|
reportError(message, sourceSpan, level = ParseErrorLevel.ERROR) {
|
|
@@ -16648,7 +16678,8 @@ class I18nMetaVisitor {
|
|
|
16648
16678
|
*/
|
|
16649
16679
|
_parseMetadata(meta) {
|
|
16650
16680
|
return typeof meta === 'string' ? parseI18nMeta(meta) :
|
|
16651
|
-
meta instanceof Message ? meta :
|
|
16681
|
+
meta instanceof Message ? meta :
|
|
16682
|
+
{};
|
|
16652
16683
|
}
|
|
16653
16684
|
/**
|
|
16654
16685
|
* Generate (or restore) message id if not specified already.
|
|
@@ -16673,9 +16704,9 @@ class I18nMetaVisitor {
|
|
|
16673
16704
|
// `packages/compiler/src/render3/view/template.ts`).
|
|
16674
16705
|
// In that case we want to reuse the legacy message generated in the 1st pass (see
|
|
16675
16706
|
// `setI18nRefs()`).
|
|
16676
|
-
const previousMessage = meta instanceof Message ?
|
|
16677
|
-
meta :
|
|
16678
|
-
|
|
16707
|
+
const previousMessage = meta instanceof Message ? meta :
|
|
16708
|
+
meta instanceof IcuPlaceholder ? meta.previousMessage :
|
|
16709
|
+
undefined;
|
|
16679
16710
|
message.legacyIds = previousMessage ? previousMessage.legacyIds : [];
|
|
16680
16711
|
}
|
|
16681
16712
|
}
|
|
@@ -16720,10 +16751,14 @@ function i18nMetaToJSDoc(meta) {
|
|
|
16720
16751
|
if (meta.description) {
|
|
16721
16752
|
tags.push({ tagName: "desc" /* Desc */, text: meta.description });
|
|
16722
16753
|
}
|
|
16754
|
+
else {
|
|
16755
|
+
// Suppress the JSCompiler warning that a `@desc` was not given for this message.
|
|
16756
|
+
tags.push({ tagName: "suppress" /* Suppress */, text: '{msgDescriptions}' });
|
|
16757
|
+
}
|
|
16723
16758
|
if (meta.meaning) {
|
|
16724
16759
|
tags.push({ tagName: "meaning" /* Meaning */, text: meta.meaning });
|
|
16725
16760
|
}
|
|
16726
|
-
return
|
|
16761
|
+
return jsDocComment(tags);
|
|
16727
16762
|
}
|
|
16728
16763
|
|
|
16729
16764
|
/** Closure uses `goog.getMsg(message)` to lookup translations */
|
|
@@ -16741,10 +16776,7 @@ function createGoogleGetMsgStatements(variable$1, message, closureVar, params) {
|
|
|
16741
16776
|
// const MSG_... = goog.getMsg(..);
|
|
16742
16777
|
// I18N_X = MSG_...;
|
|
16743
16778
|
const googGetMsgStmt = closureVar.set(variable(GOOG_GET_MSG).callFn(args)).toConstDecl();
|
|
16744
|
-
|
|
16745
|
-
if (metaComment !== null) {
|
|
16746
|
-
googGetMsgStmt.addLeadingComment(metaComment);
|
|
16747
|
-
}
|
|
16779
|
+
googGetMsgStmt.addLeadingComment(i18nMetaToJSDoc(message));
|
|
16748
16780
|
const i18nAssignmentStmt = new ExpressionStatement(variable$1.set(closureVar));
|
|
16749
16781
|
return [googGetMsgStmt, i18nAssignmentStmt];
|
|
16750
16782
|
}
|
|
@@ -16906,7 +16938,7 @@ const NG_PROJECT_AS_ATTR_NAME = 'ngProjectAs';
|
|
|
16906
16938
|
// Global symbols available only inside event bindings.
|
|
16907
16939
|
const EVENT_BINDING_SCOPE_GLOBALS = new Set(['$event']);
|
|
16908
16940
|
// List of supported global targets for event listeners
|
|
16909
|
-
const GLOBAL_TARGET_RESOLVERS = new Map([['window', Identifiers
|
|
16941
|
+
const GLOBAL_TARGET_RESOLVERS = new Map([['window', Identifiers.resolveWindow], ['document', Identifiers.resolveDocument], ['body', Identifiers.resolveBody]]);
|
|
16910
16942
|
const LEADING_TRIVIA_CHARS = [' ', '\n', '\r', '\t'];
|
|
16911
16943
|
// if (rf & flags) { .. }
|
|
16912
16944
|
function renderFlagCheckIfStmt(flags, statements) {
|
|
@@ -16923,15 +16955,29 @@ function prepareEventListenerParameters(eventAst, handlerName = null, scope = nu
|
|
|
16923
16955
|
const implicitReceiverExpr = (scope === null || scope.bindingLevel === 0) ?
|
|
16924
16956
|
variable(CONTEXT_NAME) :
|
|
16925
16957
|
scope.getOrCreateSharedContextVar(0);
|
|
16926
|
-
const bindingStatements = convertActionBinding(scope, implicitReceiverExpr, handler, 'b',
|
|
16958
|
+
const bindingStatements = convertActionBinding(scope, implicitReceiverExpr, handler, 'b', eventAst.handlerSpan, implicitReceiverAccesses, EVENT_BINDING_SCOPE_GLOBALS);
|
|
16927
16959
|
const statements = [];
|
|
16928
|
-
|
|
16960
|
+
const variableDeclarations = scope === null || scope === void 0 ? void 0 : scope.variableDeclarations();
|
|
16961
|
+
const restoreViewStatement = scope === null || scope === void 0 ? void 0 : scope.restoreViewStatement();
|
|
16962
|
+
if (variableDeclarations) {
|
|
16929
16963
|
// `variableDeclarations` needs to run first, because
|
|
16930
16964
|
// `restoreViewStatement` depends on the result.
|
|
16931
|
-
statements.push(...
|
|
16932
|
-
statements.unshift(...scope.restoreViewStatement());
|
|
16965
|
+
statements.push(...variableDeclarations);
|
|
16933
16966
|
}
|
|
16934
16967
|
statements.push(...bindingStatements);
|
|
16968
|
+
if (restoreViewStatement) {
|
|
16969
|
+
statements.unshift(restoreViewStatement);
|
|
16970
|
+
// If there's a `restoreView` call, we need to reset the view at the end of the listener
|
|
16971
|
+
// in order to avoid a leak. If there's a `return` statement already, we wrap it in the
|
|
16972
|
+
// call, e.g. `return resetView(ctx.foo())`. Otherwise we add the call as the last statement.
|
|
16973
|
+
const lastStatement = statements[statements.length - 1];
|
|
16974
|
+
if (lastStatement instanceof ReturnStatement) {
|
|
16975
|
+
statements[statements.length - 1] = new ReturnStatement(invokeInstruction(lastStatement.value.sourceSpan, Identifiers.resetView, [lastStatement.value]));
|
|
16976
|
+
}
|
|
16977
|
+
else {
|
|
16978
|
+
statements.push(new ExpressionStatement(invokeInstruction(null, Identifiers.resetView, [])));
|
|
16979
|
+
}
|
|
16980
|
+
}
|
|
16935
16981
|
const eventName = type === 1 /* Animation */ ? prepareSyntheticListenerName(name, phase) : name;
|
|
16936
16982
|
const fnName = handlerName && sanitizeIdentifier(handlerName);
|
|
16937
16983
|
const fnArgs = [];
|
|
@@ -17018,12 +17064,12 @@ class TemplateDefinitionBuilder {
|
|
|
17018
17064
|
this.fileBasedI18nSuffix = relativeContextFilePath.replace(/[^A-Za-z0-9]/g, '_') + '_';
|
|
17019
17065
|
this._valueConverter = new ValueConverter(constantPool, () => this.allocateDataSlot(), (numSlots) => this.allocatePureFunctionSlots(numSlots), (name, localName, slot, value) => {
|
|
17020
17066
|
this._bindingScope.set(this.level, localName, value);
|
|
17021
|
-
this.creationInstruction(null, Identifiers
|
|
17067
|
+
this.creationInstruction(null, Identifiers.pipe, [literal(slot), literal(name)]);
|
|
17022
17068
|
});
|
|
17023
17069
|
}
|
|
17024
17070
|
buildTemplateFunction(nodes, variables, ngContentSelectorsOffset = 0, i18n) {
|
|
17025
17071
|
this._ngContentSelectorsOffset = ngContentSelectorsOffset;
|
|
17026
|
-
if (this._namespace !== Identifiers
|
|
17072
|
+
if (this._namespace !== Identifiers.namespaceHTML) {
|
|
17027
17073
|
this.creationInstruction(null, this._namespace);
|
|
17028
17074
|
}
|
|
17029
17075
|
// Create variable bindings
|
|
@@ -17069,15 +17115,15 @@ class TemplateDefinitionBuilder {
|
|
|
17069
17115
|
// Since we accumulate ngContent selectors while processing template elements,
|
|
17070
17116
|
// we *prepend* `projectionDef` to creation instructions block, to put it before
|
|
17071
17117
|
// any `projection` instructions
|
|
17072
|
-
this.creationInstruction(null, Identifiers
|
|
17118
|
+
this.creationInstruction(null, Identifiers.projectionDef, parameters, /* prepend */ true);
|
|
17073
17119
|
}
|
|
17074
17120
|
if (initI18nContext) {
|
|
17075
17121
|
this.i18nEnd(null, selfClosingI18nInstruction);
|
|
17076
17122
|
}
|
|
17077
17123
|
// Generate all the creation mode instructions (e.g. resolve bindings in listeners)
|
|
17078
|
-
const creationStatements = this._creationCodeFns
|
|
17124
|
+
const creationStatements = getInstructionStatements(this._creationCodeFns);
|
|
17079
17125
|
// Generate all the update mode instructions (e.g. resolve property or text bindings)
|
|
17080
|
-
const updateStatements = this._updateCodeFns
|
|
17126
|
+
const updateStatements = getInstructionStatements(this._updateCodeFns);
|
|
17081
17127
|
// Variable declaration must occur after binding resolution so we can generate context
|
|
17082
17128
|
// instructions that build on each other.
|
|
17083
17129
|
// e.g. const b = nextContext().$implicit(); const b = nextContext();
|
|
@@ -17230,7 +17276,7 @@ class TemplateDefinitionBuilder {
|
|
|
17230
17276
|
if (Object.keys(icuMapping).length) {
|
|
17231
17277
|
args.push(mapLiteral(icuMapping, true));
|
|
17232
17278
|
}
|
|
17233
|
-
return
|
|
17279
|
+
return invokeInstruction(null, Identifiers.i18nPostprocess, args);
|
|
17234
17280
|
};
|
|
17235
17281
|
}
|
|
17236
17282
|
this.i18nTranslate(meta, params, context.ref, transformFn);
|
|
@@ -17249,7 +17295,7 @@ class TemplateDefinitionBuilder {
|
|
|
17249
17295
|
// into i18nStart call for top level i18n context
|
|
17250
17296
|
params.push(literal(id));
|
|
17251
17297
|
}
|
|
17252
|
-
this.creationInstruction(span, selfClosing ? Identifiers
|
|
17298
|
+
this.creationInstruction(span, selfClosing ? Identifiers.i18n : Identifiers.i18nStart, params);
|
|
17253
17299
|
}
|
|
17254
17300
|
i18nEnd(span = null, selfClosing) {
|
|
17255
17301
|
if (!this.i18n) {
|
|
@@ -17265,25 +17311,22 @@ class TemplateDefinitionBuilder {
|
|
|
17265
17311
|
// setup accumulated bindings
|
|
17266
17312
|
const { index, bindings } = this.i18n;
|
|
17267
17313
|
if (bindings.size) {
|
|
17268
|
-
const
|
|
17269
|
-
|
|
17270
|
-
|
|
17271
|
-
|
|
17272
|
-
|
|
17273
|
-
|
|
17274
|
-
|
|
17275
|
-
this.updateInstructionChainWithAdvance(this.getConstCount() - 1, Identifiers$1.i18nExp, chainBindings);
|
|
17276
|
-
this.updateInstruction(span, Identifiers$1.i18nApply, [literal(index)]);
|
|
17314
|
+
for (const binding of bindings) {
|
|
17315
|
+
// for i18n block, advance to the most recent element index (by taking the current number of
|
|
17316
|
+
// elements and subtracting one) before invoking `i18nExp` instructions, to make sure the
|
|
17317
|
+
// necessary lifecycle hooks of components/directives are properly flushed.
|
|
17318
|
+
this.updateInstructionWithAdvance(this.getConstCount() - 1, span, Identifiers.i18nExp, () => this.convertPropertyBinding(binding));
|
|
17319
|
+
}
|
|
17320
|
+
this.updateInstruction(span, Identifiers.i18nApply, [literal(index)]);
|
|
17277
17321
|
}
|
|
17278
17322
|
if (!selfClosing) {
|
|
17279
|
-
this.creationInstruction(span, Identifiers
|
|
17323
|
+
this.creationInstruction(span, Identifiers.i18nEnd);
|
|
17280
17324
|
}
|
|
17281
17325
|
this.i18n = null; // reset local i18n context
|
|
17282
17326
|
}
|
|
17283
17327
|
i18nAttributesInstruction(nodeIndex, attrs, sourceSpan) {
|
|
17284
17328
|
let hasBindings = false;
|
|
17285
17329
|
const i18nAttrArgs = [];
|
|
17286
|
-
const bindings = [];
|
|
17287
17330
|
attrs.forEach(attr => {
|
|
17288
17331
|
const message = attr.i18n;
|
|
17289
17332
|
const converted = attr.value.visit(this._valueConverter);
|
|
@@ -17294,33 +17337,27 @@ class TemplateDefinitionBuilder {
|
|
|
17294
17337
|
i18nAttrArgs.push(literal(attr.name), this.i18nTranslate(message, params));
|
|
17295
17338
|
converted.expressions.forEach(expression => {
|
|
17296
17339
|
hasBindings = true;
|
|
17297
|
-
|
|
17298
|
-
sourceSpan,
|
|
17299
|
-
value: () => this.convertPropertyBinding(expression),
|
|
17300
|
-
});
|
|
17340
|
+
this.updateInstructionWithAdvance(nodeIndex, sourceSpan, Identifiers.i18nExp, () => this.convertPropertyBinding(expression));
|
|
17301
17341
|
});
|
|
17302
17342
|
}
|
|
17303
17343
|
});
|
|
17304
|
-
if (bindings.length > 0) {
|
|
17305
|
-
this.updateInstructionChainWithAdvance(nodeIndex, Identifiers$1.i18nExp, bindings);
|
|
17306
|
-
}
|
|
17307
17344
|
if (i18nAttrArgs.length > 0) {
|
|
17308
17345
|
const index = literal(this.allocateDataSlot());
|
|
17309
17346
|
const constIndex = this.addToConsts(literalArr(i18nAttrArgs));
|
|
17310
|
-
this.creationInstruction(sourceSpan, Identifiers
|
|
17347
|
+
this.creationInstruction(sourceSpan, Identifiers.i18nAttributes, [index, constIndex]);
|
|
17311
17348
|
if (hasBindings) {
|
|
17312
|
-
this.updateInstruction(sourceSpan, Identifiers
|
|
17349
|
+
this.updateInstruction(sourceSpan, Identifiers.i18nApply, [index]);
|
|
17313
17350
|
}
|
|
17314
17351
|
}
|
|
17315
17352
|
}
|
|
17316
17353
|
getNamespaceInstruction(namespaceKey) {
|
|
17317
17354
|
switch (namespaceKey) {
|
|
17318
17355
|
case 'math':
|
|
17319
|
-
return Identifiers
|
|
17356
|
+
return Identifiers.namespaceMathML;
|
|
17320
17357
|
case 'svg':
|
|
17321
|
-
return Identifiers
|
|
17358
|
+
return Identifiers.namespaceSVG;
|
|
17322
17359
|
default:
|
|
17323
|
-
return Identifiers
|
|
17360
|
+
return Identifiers.namespaceHTML;
|
|
17324
17361
|
}
|
|
17325
17362
|
}
|
|
17326
17363
|
addNamespaceInstruction(nsInstruction, element) {
|
|
@@ -17347,7 +17384,7 @@ class TemplateDefinitionBuilder {
|
|
|
17347
17384
|
else if (projectionSlotIdx !== 0) {
|
|
17348
17385
|
parameters.push(literal(projectionSlotIdx));
|
|
17349
17386
|
}
|
|
17350
|
-
this.creationInstruction(ngContent.sourceSpan, Identifiers
|
|
17387
|
+
this.creationInstruction(ngContent.sourceSpan, Identifiers.projection, parameters);
|
|
17351
17388
|
if (this.i18n) {
|
|
17352
17389
|
this.i18n.appendProjection(ngContent.i18n, slot);
|
|
17353
17390
|
}
|
|
@@ -17420,23 +17457,21 @@ class TemplateDefinitionBuilder {
|
|
|
17420
17457
|
element.outputs.length === 0 && boundI18nAttrs.length === 0 && !hasChildren;
|
|
17421
17458
|
const createSelfClosingI18nInstruction = !createSelfClosingInstruction && hasTextChildrenOnly(element.children);
|
|
17422
17459
|
if (createSelfClosingInstruction) {
|
|
17423
|
-
this.creationInstruction(element.sourceSpan, isNgContainer$1 ? Identifiers
|
|
17460
|
+
this.creationInstruction(element.sourceSpan, isNgContainer$1 ? Identifiers.elementContainer : Identifiers.element, trimTrailingNulls(parameters));
|
|
17424
17461
|
}
|
|
17425
17462
|
else {
|
|
17426
|
-
this.creationInstruction(element.startSourceSpan, isNgContainer$1 ? Identifiers
|
|
17463
|
+
this.creationInstruction(element.startSourceSpan, isNgContainer$1 ? Identifiers.elementContainerStart : Identifiers.elementStart, trimTrailingNulls(parameters));
|
|
17427
17464
|
if (isNonBindableMode) {
|
|
17428
|
-
this.creationInstruction(element.startSourceSpan, Identifiers
|
|
17465
|
+
this.creationInstruction(element.startSourceSpan, Identifiers.disableBindings);
|
|
17429
17466
|
}
|
|
17430
17467
|
if (boundI18nAttrs.length > 0) {
|
|
17431
17468
|
this.i18nAttributesInstruction(elementIndex, boundI18nAttrs, (_a = element.startSourceSpan) !== null && _a !== void 0 ? _a : element.sourceSpan);
|
|
17432
17469
|
}
|
|
17433
17470
|
// Generate Listeners (outputs)
|
|
17434
17471
|
if (element.outputs.length > 0) {
|
|
17435
|
-
const
|
|
17436
|
-
|
|
17437
|
-
|
|
17438
|
-
}));
|
|
17439
|
-
this.creationInstructionChain(Identifiers$1.listener, listeners);
|
|
17472
|
+
for (const outputAst of element.outputs) {
|
|
17473
|
+
this.creationInstruction(outputAst.sourceSpan, Identifiers.listener, this.prepareListenerParameter(element.name, outputAst, elementIndex));
|
|
17474
|
+
}
|
|
17440
17475
|
}
|
|
17441
17476
|
// Note: it's important to keep i18n/i18nStart instructions after i18nAttributes and
|
|
17442
17477
|
// listeners, to make sure i18nAttributes instruction targets current element at runtime.
|
|
@@ -17477,9 +17512,8 @@ class TemplateDefinitionBuilder {
|
|
|
17477
17512
|
const hasValue = value instanceof LiteralPrimitive ? !!value.value : true;
|
|
17478
17513
|
this.allocateBindingSlots(value);
|
|
17479
17514
|
propertyBindings.push({
|
|
17480
|
-
|
|
17481
|
-
|
|
17482
|
-
value: () => hasValue ? this.convertPropertyBinding(value) : emptyValueBindInstruction
|
|
17515
|
+
span: input.sourceSpan,
|
|
17516
|
+
paramsOrFn: getBindingFunctionParams(() => hasValue ? this.convertPropertyBinding(value) : emptyValueBindInstruction, prepareSyntheticPropertyName(input.name))
|
|
17483
17517
|
});
|
|
17484
17518
|
}
|
|
17485
17519
|
else {
|
|
@@ -17516,10 +17550,8 @@ class TemplateDefinitionBuilder {
|
|
|
17516
17550
|
// [prop]="value"
|
|
17517
17551
|
// Collect all the properties so that we can chain into a single function at the end.
|
|
17518
17552
|
propertyBindings.push({
|
|
17519
|
-
|
|
17520
|
-
|
|
17521
|
-
value: () => this.convertPropertyBinding(value),
|
|
17522
|
-
params
|
|
17553
|
+
span: input.sourceSpan,
|
|
17554
|
+
paramsOrFn: getBindingFunctionParams(() => this.convertPropertyBinding(value), attrName, params)
|
|
17523
17555
|
});
|
|
17524
17556
|
}
|
|
17525
17557
|
}
|
|
@@ -17533,16 +17565,14 @@ class TemplateDefinitionBuilder {
|
|
|
17533
17565
|
// [attr.name]="value" or attr.name="{{value}}"
|
|
17534
17566
|
// Collect the attribute bindings so that they can be chained at the end.
|
|
17535
17567
|
attributeBindings.push({
|
|
17536
|
-
|
|
17537
|
-
|
|
17538
|
-
value: () => this.convertPropertyBinding(boundValue),
|
|
17539
|
-
params
|
|
17568
|
+
span: input.sourceSpan,
|
|
17569
|
+
paramsOrFn: getBindingFunctionParams(() => this.convertPropertyBinding(boundValue), attrName, params)
|
|
17540
17570
|
});
|
|
17541
17571
|
}
|
|
17542
17572
|
}
|
|
17543
17573
|
else {
|
|
17544
17574
|
// class prop
|
|
17545
|
-
this.updateInstructionWithAdvance(elementIndex, input.sourceSpan, Identifiers
|
|
17575
|
+
this.updateInstructionWithAdvance(elementIndex, input.sourceSpan, Identifiers.classProp, () => {
|
|
17546
17576
|
return [
|
|
17547
17577
|
literal(elementIndex), literal(attrName), this.convertPropertyBinding(value),
|
|
17548
17578
|
...params
|
|
@@ -17552,11 +17582,11 @@ class TemplateDefinitionBuilder {
|
|
|
17552
17582
|
}
|
|
17553
17583
|
}
|
|
17554
17584
|
});
|
|
17555
|
-
|
|
17556
|
-
this.
|
|
17585
|
+
for (const propertyBinding of propertyBindings) {
|
|
17586
|
+
this.updateInstructionWithAdvance(elementIndex, propertyBinding.span, Identifiers.property, propertyBinding.paramsOrFn);
|
|
17557
17587
|
}
|
|
17558
|
-
|
|
17559
|
-
this.
|
|
17588
|
+
for (const attributeBinding of attributeBindings) {
|
|
17589
|
+
this.updateInstructionWithAdvance(elementIndex, attributeBinding.span, Identifiers.attribute, attributeBinding.paramsOrFn);
|
|
17560
17590
|
}
|
|
17561
17591
|
// Traverse element child nodes
|
|
17562
17592
|
visitAll$1(this, element.children);
|
|
@@ -17570,9 +17600,9 @@ class TemplateDefinitionBuilder {
|
|
|
17570
17600
|
this.i18nEnd(span, createSelfClosingI18nInstruction);
|
|
17571
17601
|
}
|
|
17572
17602
|
if (isNonBindableMode) {
|
|
17573
|
-
this.creationInstruction(span, Identifiers
|
|
17603
|
+
this.creationInstruction(span, Identifiers.enableBindings);
|
|
17574
17604
|
}
|
|
17575
|
-
this.creationInstruction(span, isNgContainer$1 ? Identifiers
|
|
17605
|
+
this.creationInstruction(span, isNgContainer$1 ? Identifiers.elementContainerEnd : Identifiers.elementEnd);
|
|
17576
17606
|
}
|
|
17577
17607
|
}
|
|
17578
17608
|
visitTemplate(template) {
|
|
@@ -17599,7 +17629,7 @@ class TemplateDefinitionBuilder {
|
|
|
17599
17629
|
if (template.references && template.references.length) {
|
|
17600
17630
|
const refs = this.prepareRefsArray(template.references);
|
|
17601
17631
|
parameters.push(this.addToConsts(refs));
|
|
17602
|
-
parameters.push(importExpr(Identifiers
|
|
17632
|
+
parameters.push(importExpr(Identifiers.templateRefExtractor));
|
|
17603
17633
|
}
|
|
17604
17634
|
// Create the template function
|
|
17605
17635
|
const templateVisitor = new TemplateDefinitionBuilder(this.constantPool, this._bindingScope, this.level + 1, contextName, this.i18n, templateIndex, templateName, this._namespace, this.fileBasedI18nSuffix, this.i18nUseExternalIds, this._constants);
|
|
@@ -17615,7 +17645,7 @@ class TemplateDefinitionBuilder {
|
|
|
17615
17645
|
}
|
|
17616
17646
|
});
|
|
17617
17647
|
// e.g. template(1, MyComp_Template_1)
|
|
17618
|
-
this.creationInstruction(template.sourceSpan, Identifiers
|
|
17648
|
+
this.creationInstruction(template.sourceSpan, Identifiers.templateCreate, () => {
|
|
17619
17649
|
parameters.splice(2, 0, literal(templateVisitor.getConstCount()), literal(templateVisitor.getVarCount()));
|
|
17620
17650
|
return trimTrailingNulls(parameters);
|
|
17621
17651
|
});
|
|
@@ -17636,12 +17666,8 @@ class TemplateDefinitionBuilder {
|
|
|
17636
17666
|
this.templatePropertyBindings(templateIndex, inputs);
|
|
17637
17667
|
}
|
|
17638
17668
|
// Generate listeners for directive output
|
|
17639
|
-
|
|
17640
|
-
|
|
17641
|
-
sourceSpan: outputAst.sourceSpan,
|
|
17642
|
-
params: this.prepareListenerParameter('ng_template', outputAst, templateIndex)
|
|
17643
|
-
}));
|
|
17644
|
-
this.creationInstructionChain(Identifiers$1.listener, listeners);
|
|
17669
|
+
for (const outputAst of template.outputs) {
|
|
17670
|
+
this.creationInstruction(outputAst.sourceSpan, Identifiers.listener, this.prepareListenerParameter('ng_template', outputAst, templateIndex));
|
|
17645
17671
|
}
|
|
17646
17672
|
}
|
|
17647
17673
|
}
|
|
@@ -17656,7 +17682,7 @@ class TemplateDefinitionBuilder {
|
|
|
17656
17682
|
return;
|
|
17657
17683
|
}
|
|
17658
17684
|
const nodeIndex = this.allocateDataSlot();
|
|
17659
|
-
this.creationInstruction(text.sourceSpan, Identifiers
|
|
17685
|
+
this.creationInstruction(text.sourceSpan, Identifiers.text, [literal(nodeIndex)]);
|
|
17660
17686
|
const value = text.value.visit(this._valueConverter);
|
|
17661
17687
|
this.allocateBindingSlots(value);
|
|
17662
17688
|
if (value instanceof Interpolation) {
|
|
@@ -17671,7 +17697,7 @@ class TemplateDefinitionBuilder {
|
|
|
17671
17697
|
// block, we exclude this text element from instructions set,
|
|
17672
17698
|
// since it will be captured in i18n content and processed at runtime
|
|
17673
17699
|
if (!this.i18n) {
|
|
17674
|
-
this.creationInstruction(text.sourceSpan, Identifiers
|
|
17700
|
+
this.creationInstruction(text.sourceSpan, Identifiers.text, [literal(this.allocateDataSlot()), literal(text.value)]);
|
|
17675
17701
|
}
|
|
17676
17702
|
}
|
|
17677
17703
|
visitIcu(icu) {
|
|
@@ -17696,7 +17722,7 @@ class TemplateDefinitionBuilder {
|
|
|
17696
17722
|
const transformFn = (raw) => {
|
|
17697
17723
|
const params = Object.assign(Object.assign({}, vars), placeholders);
|
|
17698
17724
|
const formatted = i18nFormatPlaceholderNames(params, /* useCamelCase */ false);
|
|
17699
|
-
return
|
|
17725
|
+
return invokeInstruction(null, Identifiers.i18nPostprocess, [raw, mapLiteral(formatted, true)]);
|
|
17700
17726
|
};
|
|
17701
17727
|
// in case the whole i18n message is a single ICU - we do not need to
|
|
17702
17728
|
// create a separate top-level translation, we can use the root ref instead
|
|
@@ -17738,32 +17764,33 @@ class TemplateDefinitionBuilder {
|
|
|
17738
17764
|
}
|
|
17739
17765
|
templatePropertyBindings(templateIndex, attrs) {
|
|
17740
17766
|
const propertyBindings = [];
|
|
17741
|
-
|
|
17742
|
-
if (input instanceof BoundAttribute) {
|
|
17743
|
-
|
|
17744
|
-
if (value !== undefined) {
|
|
17745
|
-
this.allocateBindingSlots(value);
|
|
17746
|
-
if (value instanceof Interpolation) {
|
|
17747
|
-
// Params typically contain attribute namespace and value sanitizer, which is applicable
|
|
17748
|
-
// for regular HTML elements, but not applicable for <ng-template> (since props act as
|
|
17749
|
-
// inputs to directives), so keep params array empty.
|
|
17750
|
-
const params = [];
|
|
17751
|
-
// prop="{{value}}" case
|
|
17752
|
-
this.interpolatedUpdateInstruction(getPropertyInterpolationExpression(value), templateIndex, input.name, input, value, params);
|
|
17753
|
-
}
|
|
17754
|
-
else {
|
|
17755
|
-
// [prop]="value" case
|
|
17756
|
-
propertyBindings.push({
|
|
17757
|
-
name: input.name,
|
|
17758
|
-
sourceSpan: input.sourceSpan,
|
|
17759
|
-
value: () => this.convertPropertyBinding(value)
|
|
17760
|
-
});
|
|
17761
|
-
}
|
|
17762
|
-
}
|
|
17767
|
+
for (const input of attrs) {
|
|
17768
|
+
if (!(input instanceof BoundAttribute)) {
|
|
17769
|
+
continue;
|
|
17763
17770
|
}
|
|
17764
|
-
|
|
17765
|
-
|
|
17766
|
-
|
|
17771
|
+
const value = input.value.visit(this._valueConverter);
|
|
17772
|
+
if (value === undefined) {
|
|
17773
|
+
continue;
|
|
17774
|
+
}
|
|
17775
|
+
this.allocateBindingSlots(value);
|
|
17776
|
+
if (value instanceof Interpolation) {
|
|
17777
|
+
// Params typically contain attribute namespace and value sanitizer, which is applicable
|
|
17778
|
+
// for regular HTML elements, but not applicable for <ng-template> (since props act as
|
|
17779
|
+
// inputs to directives), so keep params array empty.
|
|
17780
|
+
const params = [];
|
|
17781
|
+
// prop="{{value}}" case
|
|
17782
|
+
this.interpolatedUpdateInstruction(getPropertyInterpolationExpression(value), templateIndex, input.name, input, value, params);
|
|
17783
|
+
}
|
|
17784
|
+
else {
|
|
17785
|
+
// [prop]="value" case
|
|
17786
|
+
propertyBindings.push({
|
|
17787
|
+
span: input.sourceSpan,
|
|
17788
|
+
paramsOrFn: getBindingFunctionParams(() => this.convertPropertyBinding(value), input.name)
|
|
17789
|
+
});
|
|
17790
|
+
}
|
|
17791
|
+
}
|
|
17792
|
+
for (const propertyBinding of propertyBindings) {
|
|
17793
|
+
this.updateInstructionWithAdvance(templateIndex, propertyBinding.span, Identifiers.property, propertyBinding.paramsOrFn);
|
|
17767
17794
|
}
|
|
17768
17795
|
}
|
|
17769
17796
|
// Bindings must only be resolved after all local refs have been visited, so all
|
|
@@ -17771,39 +17798,23 @@ class TemplateDefinitionBuilder {
|
|
|
17771
17798
|
// Otherwise, we wouldn't be able to support local refs that are defined after their
|
|
17772
17799
|
// bindings. e.g. {{ foo }} <div #foo></div>
|
|
17773
17800
|
instructionFn(fns, span, reference, paramsOrFn, prepend = false) {
|
|
17774
|
-
fns[prepend ? 'unshift' : 'push'](
|
|
17775
|
-
const params = Array.isArray(paramsOrFn) ? paramsOrFn : paramsOrFn();
|
|
17776
|
-
return instruction(span, reference, params).toStmt();
|
|
17777
|
-
});
|
|
17801
|
+
fns[prepend ? 'unshift' : 'push']({ span, reference, paramsOrFn });
|
|
17778
17802
|
}
|
|
17779
17803
|
processStylingUpdateInstruction(elementIndex, instruction) {
|
|
17780
17804
|
let allocateBindingSlots = 0;
|
|
17781
17805
|
if (instruction) {
|
|
17782
|
-
const calls
|
|
17783
|
-
instruction.calls.forEach(call => {
|
|
17806
|
+
for (const call of instruction.calls) {
|
|
17784
17807
|
allocateBindingSlots += call.allocateBindingSlots;
|
|
17785
|
-
|
|
17786
|
-
|
|
17787
|
-
value
|
|
17788
|
-
|
|
17789
|
-
this.getUpdateInstructionArguments(value) :
|
|
17790
|
-
this.convertPropertyBinding(value));
|
|
17791
|
-
}
|
|
17792
|
-
});
|
|
17793
|
-
});
|
|
17794
|
-
this.updateInstructionChainWithAdvance(elementIndex, instruction.reference, calls);
|
|
17808
|
+
this.updateInstructionWithAdvance(elementIndex, call.sourceSpan, instruction.reference, () => call.params(value => (call.supportsInterpolation && value instanceof Interpolation) ?
|
|
17809
|
+
this.getUpdateInstructionArguments(value) :
|
|
17810
|
+
this.convertPropertyBinding(value)));
|
|
17811
|
+
}
|
|
17795
17812
|
}
|
|
17796
17813
|
return allocateBindingSlots;
|
|
17797
17814
|
}
|
|
17798
17815
|
creationInstruction(span, reference, paramsOrFn, prepend) {
|
|
17799
17816
|
this.instructionFn(this._creationCodeFns, span, reference, paramsOrFn || [], prepend);
|
|
17800
17817
|
}
|
|
17801
|
-
creationInstructionChain(reference, calls) {
|
|
17802
|
-
const span = calls.length ? calls[0].sourceSpan : null;
|
|
17803
|
-
this._creationCodeFns.push(() => {
|
|
17804
|
-
return chainedInstruction(reference, calls.map(call => call.params()), span).toStmt();
|
|
17805
|
-
});
|
|
17806
|
-
}
|
|
17807
17818
|
updateInstructionWithAdvance(nodeIndex, span, reference, paramsOrFn) {
|
|
17808
17819
|
this.addAdvanceInstructionIfNecessary(nodeIndex, span);
|
|
17809
17820
|
this.updateInstruction(span, reference, paramsOrFn);
|
|
@@ -17811,35 +17822,13 @@ class TemplateDefinitionBuilder {
|
|
|
17811
17822
|
updateInstruction(span, reference, paramsOrFn) {
|
|
17812
17823
|
this.instructionFn(this._updateCodeFns, span, reference, paramsOrFn || []);
|
|
17813
17824
|
}
|
|
17814
|
-
updateInstructionChain(reference, bindings) {
|
|
17815
|
-
const span = bindings.length ? bindings[0].sourceSpan : null;
|
|
17816
|
-
this._updateCodeFns.push(() => {
|
|
17817
|
-
const calls = bindings.map(property => {
|
|
17818
|
-
const value = property.value();
|
|
17819
|
-
const fnParams = Array.isArray(value) ? value : [value];
|
|
17820
|
-
if (property.params) {
|
|
17821
|
-
fnParams.push(...property.params);
|
|
17822
|
-
}
|
|
17823
|
-
if (property.name) {
|
|
17824
|
-
// We want the property name to always be the first function parameter.
|
|
17825
|
-
fnParams.unshift(literal(property.name));
|
|
17826
|
-
}
|
|
17827
|
-
return fnParams;
|
|
17828
|
-
});
|
|
17829
|
-
return chainedInstruction(reference, calls, span).toStmt();
|
|
17830
|
-
});
|
|
17831
|
-
}
|
|
17832
|
-
updateInstructionChainWithAdvance(nodeIndex, reference, bindings) {
|
|
17833
|
-
this.addAdvanceInstructionIfNecessary(nodeIndex, bindings.length ? bindings[0].sourceSpan : null);
|
|
17834
|
-
this.updateInstructionChain(reference, bindings);
|
|
17835
|
-
}
|
|
17836
17825
|
addAdvanceInstructionIfNecessary(nodeIndex, span) {
|
|
17837
17826
|
if (nodeIndex !== this._currentIndex) {
|
|
17838
17827
|
const delta = nodeIndex - this._currentIndex;
|
|
17839
17828
|
if (delta < 1) {
|
|
17840
17829
|
throw new Error('advance instruction can only go forwards');
|
|
17841
17830
|
}
|
|
17842
|
-
this.instructionFn(this._updateCodeFns, span, Identifiers
|
|
17831
|
+
this.instructionFn(this._updateCodeFns, span, Identifiers.advance, [literal(delta)]);
|
|
17843
17832
|
this._currentIndex = nodeIndex;
|
|
17844
17833
|
}
|
|
17845
17834
|
}
|
|
@@ -17864,7 +17853,7 @@ class TemplateDefinitionBuilder {
|
|
|
17864
17853
|
this._bindingScope.getOrCreateSharedContextVar(0);
|
|
17865
17854
|
}
|
|
17866
17855
|
convertPropertyBinding(value) {
|
|
17867
|
-
const convertedPropertyBinding = convertPropertyBinding(this, this.getImplicitReceiverExpr(), value, this.bindingContext()
|
|
17856
|
+
const convertedPropertyBinding = convertPropertyBinding(this, this.getImplicitReceiverExpr(), value, this.bindingContext());
|
|
17868
17857
|
const valExpr = convertedPropertyBinding.currValExpr;
|
|
17869
17858
|
this._tempVariables.push(...convertedPropertyBinding.stmts);
|
|
17870
17859
|
return valExpr;
|
|
@@ -18021,7 +18010,7 @@ class TemplateDefinitionBuilder {
|
|
|
18021
18010
|
// e.g. nextContext(2);
|
|
18022
18011
|
const nextContextStmt = relativeLevel > 0 ? [generateNextContextExpr(relativeLevel).toStmt()] : [];
|
|
18023
18012
|
// e.g. const $foo$ = reference(1);
|
|
18024
|
-
const refExpr = lhs.set(importExpr(Identifiers
|
|
18013
|
+
const refExpr = lhs.set(importExpr(Identifiers.reference).callFn([literal(slot)]));
|
|
18025
18014
|
return nextContextStmt.concat(refExpr.toConstDecl());
|
|
18026
18015
|
}, true);
|
|
18027
18016
|
return [reference.name, reference.value];
|
|
@@ -18099,31 +18088,28 @@ class ValueConverter extends AstMemoryEfficientTransformer {
|
|
|
18099
18088
|
}
|
|
18100
18089
|
}
|
|
18101
18090
|
// Pipes always have at least one parameter, the value they operate on
|
|
18102
|
-
const pipeBindingIdentifiers = [Identifiers
|
|
18091
|
+
const pipeBindingIdentifiers = [Identifiers.pipeBind1, Identifiers.pipeBind2, Identifiers.pipeBind3, Identifiers.pipeBind4];
|
|
18103
18092
|
function pipeBindingCallInfo(args) {
|
|
18104
18093
|
const identifier = pipeBindingIdentifiers[args.length];
|
|
18105
18094
|
return {
|
|
18106
|
-
identifier: identifier || Identifiers
|
|
18095
|
+
identifier: identifier || Identifiers.pipeBindV,
|
|
18107
18096
|
isVarLength: !identifier,
|
|
18108
18097
|
};
|
|
18109
18098
|
}
|
|
18110
18099
|
const pureFunctionIdentifiers = [
|
|
18111
|
-
Identifiers
|
|
18112
|
-
Identifiers
|
|
18100
|
+
Identifiers.pureFunction0, Identifiers.pureFunction1, Identifiers.pureFunction2, Identifiers.pureFunction3, Identifiers.pureFunction4,
|
|
18101
|
+
Identifiers.pureFunction5, Identifiers.pureFunction6, Identifiers.pureFunction7, Identifiers.pureFunction8
|
|
18113
18102
|
];
|
|
18114
18103
|
function pureFunctionCallInfo(args) {
|
|
18115
18104
|
const identifier = pureFunctionIdentifiers[args.length];
|
|
18116
18105
|
return {
|
|
18117
|
-
identifier: identifier || Identifiers
|
|
18106
|
+
identifier: identifier || Identifiers.pureFunctionV,
|
|
18118
18107
|
isVarLength: !identifier,
|
|
18119
18108
|
};
|
|
18120
18109
|
}
|
|
18121
|
-
function instruction(span, reference, params) {
|
|
18122
|
-
return importExpr(reference, null, span).callFn(params, span);
|
|
18123
|
-
}
|
|
18124
18110
|
// e.g. x(2);
|
|
18125
18111
|
function generateNextContextExpr(relativeLevelDiff) {
|
|
18126
|
-
return importExpr(Identifiers
|
|
18112
|
+
return importExpr(Identifiers.nextContext)
|
|
18127
18113
|
.callFn(relativeLevelDiff > 1 ? [literal(relativeLevelDiff)] : []);
|
|
18128
18114
|
}
|
|
18129
18115
|
function getLiteralFactory(constantPool, literal$1, allocateSlots) {
|
|
@@ -18323,21 +18309,22 @@ class BindingScope {
|
|
|
18323
18309
|
}
|
|
18324
18310
|
}
|
|
18325
18311
|
restoreViewStatement() {
|
|
18326
|
-
const statements = [];
|
|
18327
18312
|
if (this.restoreViewVariable) {
|
|
18328
|
-
const restoreCall =
|
|
18313
|
+
const restoreCall = invokeInstruction(null, Identifiers.restoreView, [this.restoreViewVariable]);
|
|
18329
18314
|
// Either `const restoredCtx = restoreView($state$);` or `restoreView($state$);`
|
|
18330
18315
|
// depending on whether it is being used.
|
|
18331
|
-
|
|
18316
|
+
return this.usesRestoredViewContext ?
|
|
18332
18317
|
variable(RESTORED_VIEW_CONTEXT_NAME).set(restoreCall).toConstDecl() :
|
|
18333
|
-
restoreCall.toStmt()
|
|
18318
|
+
restoreCall.toStmt();
|
|
18334
18319
|
}
|
|
18335
|
-
return
|
|
18320
|
+
return null;
|
|
18336
18321
|
}
|
|
18337
18322
|
viewSnapshotStatements() {
|
|
18338
18323
|
// const $state$ = getCurrentView();
|
|
18339
18324
|
return this.restoreViewVariable ?
|
|
18340
|
-
[
|
|
18325
|
+
[
|
|
18326
|
+
this.restoreViewVariable.set(invokeInstruction(null, Identifiers.getCurrentView, [])).toConstDecl()
|
|
18327
|
+
] :
|
|
18341
18328
|
[];
|
|
18342
18329
|
}
|
|
18343
18330
|
isListenerScope() {
|
|
@@ -18405,25 +18392,25 @@ function getNgProjectAsLiteral(attribute) {
|
|
|
18405
18392
|
function getPropertyInterpolationExpression(interpolation) {
|
|
18406
18393
|
switch (getInterpolationArgsLength(interpolation)) {
|
|
18407
18394
|
case 1:
|
|
18408
|
-
return Identifiers
|
|
18395
|
+
return Identifiers.propertyInterpolate;
|
|
18409
18396
|
case 3:
|
|
18410
|
-
return Identifiers
|
|
18397
|
+
return Identifiers.propertyInterpolate1;
|
|
18411
18398
|
case 5:
|
|
18412
|
-
return Identifiers
|
|
18399
|
+
return Identifiers.propertyInterpolate2;
|
|
18413
18400
|
case 7:
|
|
18414
|
-
return Identifiers
|
|
18401
|
+
return Identifiers.propertyInterpolate3;
|
|
18415
18402
|
case 9:
|
|
18416
|
-
return Identifiers
|
|
18403
|
+
return Identifiers.propertyInterpolate4;
|
|
18417
18404
|
case 11:
|
|
18418
|
-
return Identifiers
|
|
18405
|
+
return Identifiers.propertyInterpolate5;
|
|
18419
18406
|
case 13:
|
|
18420
|
-
return Identifiers
|
|
18407
|
+
return Identifiers.propertyInterpolate6;
|
|
18421
18408
|
case 15:
|
|
18422
|
-
return Identifiers
|
|
18409
|
+
return Identifiers.propertyInterpolate7;
|
|
18423
18410
|
case 17:
|
|
18424
|
-
return Identifiers
|
|
18411
|
+
return Identifiers.propertyInterpolate8;
|
|
18425
18412
|
default:
|
|
18426
|
-
return Identifiers
|
|
18413
|
+
return Identifiers.propertyInterpolateV;
|
|
18427
18414
|
}
|
|
18428
18415
|
}
|
|
18429
18416
|
/**
|
|
@@ -18433,23 +18420,23 @@ function getPropertyInterpolationExpression(interpolation) {
|
|
|
18433
18420
|
function getAttributeInterpolationExpression(interpolation) {
|
|
18434
18421
|
switch (getInterpolationArgsLength(interpolation)) {
|
|
18435
18422
|
case 3:
|
|
18436
|
-
return Identifiers
|
|
18423
|
+
return Identifiers.attributeInterpolate1;
|
|
18437
18424
|
case 5:
|
|
18438
|
-
return Identifiers
|
|
18425
|
+
return Identifiers.attributeInterpolate2;
|
|
18439
18426
|
case 7:
|
|
18440
|
-
return Identifiers
|
|
18427
|
+
return Identifiers.attributeInterpolate3;
|
|
18441
18428
|
case 9:
|
|
18442
|
-
return Identifiers
|
|
18429
|
+
return Identifiers.attributeInterpolate4;
|
|
18443
18430
|
case 11:
|
|
18444
|
-
return Identifiers
|
|
18431
|
+
return Identifiers.attributeInterpolate5;
|
|
18445
18432
|
case 13:
|
|
18446
|
-
return Identifiers
|
|
18433
|
+
return Identifiers.attributeInterpolate6;
|
|
18447
18434
|
case 15:
|
|
18448
|
-
return Identifiers
|
|
18435
|
+
return Identifiers.attributeInterpolate7;
|
|
18449
18436
|
case 17:
|
|
18450
|
-
return Identifiers
|
|
18437
|
+
return Identifiers.attributeInterpolate8;
|
|
18451
18438
|
default:
|
|
18452
|
-
return Identifiers
|
|
18439
|
+
return Identifiers.attributeInterpolateV;
|
|
18453
18440
|
}
|
|
18454
18441
|
}
|
|
18455
18442
|
/**
|
|
@@ -18459,25 +18446,25 @@ function getAttributeInterpolationExpression(interpolation) {
|
|
|
18459
18446
|
function getTextInterpolationExpression(interpolation) {
|
|
18460
18447
|
switch (getInterpolationArgsLength(interpolation)) {
|
|
18461
18448
|
case 1:
|
|
18462
|
-
return Identifiers
|
|
18449
|
+
return Identifiers.textInterpolate;
|
|
18463
18450
|
case 3:
|
|
18464
|
-
return Identifiers
|
|
18451
|
+
return Identifiers.textInterpolate1;
|
|
18465
18452
|
case 5:
|
|
18466
|
-
return Identifiers
|
|
18453
|
+
return Identifiers.textInterpolate2;
|
|
18467
18454
|
case 7:
|
|
18468
|
-
return Identifiers
|
|
18455
|
+
return Identifiers.textInterpolate3;
|
|
18469
18456
|
case 9:
|
|
18470
|
-
return Identifiers
|
|
18457
|
+
return Identifiers.textInterpolate4;
|
|
18471
18458
|
case 11:
|
|
18472
|
-
return Identifiers
|
|
18459
|
+
return Identifiers.textInterpolate5;
|
|
18473
18460
|
case 13:
|
|
18474
|
-
return Identifiers
|
|
18461
|
+
return Identifiers.textInterpolate6;
|
|
18475
18462
|
case 15:
|
|
18476
|
-
return Identifiers
|
|
18463
|
+
return Identifiers.textInterpolate7;
|
|
18477
18464
|
case 17:
|
|
18478
|
-
return Identifiers
|
|
18465
|
+
return Identifiers.textInterpolate8;
|
|
18479
18466
|
default:
|
|
18480
|
-
return Identifiers
|
|
18467
|
+
return Identifiers.textInterpolateV;
|
|
18481
18468
|
}
|
|
18482
18469
|
}
|
|
18483
18470
|
/**
|
|
@@ -18568,18 +18555,18 @@ function makeBindingParser(interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
|
|
|
18568
18555
|
function resolveSanitizationFn(context, isAttribute) {
|
|
18569
18556
|
switch (context) {
|
|
18570
18557
|
case SecurityContext.HTML:
|
|
18571
|
-
return importExpr(Identifiers
|
|
18558
|
+
return importExpr(Identifiers.sanitizeHtml);
|
|
18572
18559
|
case SecurityContext.SCRIPT:
|
|
18573
|
-
return importExpr(Identifiers
|
|
18560
|
+
return importExpr(Identifiers.sanitizeScript);
|
|
18574
18561
|
case SecurityContext.STYLE:
|
|
18575
18562
|
// the compiler does not fill in an instruction for [style.prop?] binding
|
|
18576
18563
|
// values because the style algorithm knows internally what props are subject
|
|
18577
18564
|
// to sanitization (only [attr.style] values are explicitly sanitized)
|
|
18578
|
-
return isAttribute ? importExpr(Identifiers
|
|
18565
|
+
return isAttribute ? importExpr(Identifiers.sanitizeStyle) : null;
|
|
18579
18566
|
case SecurityContext.URL:
|
|
18580
|
-
return importExpr(Identifiers
|
|
18567
|
+
return importExpr(Identifiers.sanitizeUrl);
|
|
18581
18568
|
case SecurityContext.RESOURCE_URL:
|
|
18582
|
-
return importExpr(Identifiers
|
|
18569
|
+
return importExpr(Identifiers.sanitizeResourceUrl);
|
|
18583
18570
|
default:
|
|
18584
18571
|
return null;
|
|
18585
18572
|
}
|
|
@@ -18589,10 +18576,10 @@ function trustedConstAttribute(tagName, attr) {
|
|
|
18589
18576
|
if (isTrustedTypesSink(tagName, attr.name)) {
|
|
18590
18577
|
switch (elementRegistry.securityContext(tagName, attr.name, /* isAttribute */ true)) {
|
|
18591
18578
|
case SecurityContext.HTML:
|
|
18592
|
-
return taggedTemplate(importExpr(Identifiers
|
|
18579
|
+
return taggedTemplate(importExpr(Identifiers.trustConstantHtml), new TemplateLiteral([new TemplateLiteralElement(attr.value)], []), undefined, attr.valueSpan);
|
|
18593
18580
|
// NB: no SecurityContext.SCRIPT here, as the corresponding tags are stripped by the compiler.
|
|
18594
18581
|
case SecurityContext.RESOURCE_URL:
|
|
18595
|
-
return taggedTemplate(importExpr(Identifiers
|
|
18582
|
+
return taggedTemplate(importExpr(Identifiers.trustConstantResourceUrl), new TemplateLiteral([new TemplateLiteralElement(attr.value)], []), undefined, attr.valueSpan);
|
|
18596
18583
|
default:
|
|
18597
18584
|
return value;
|
|
18598
18585
|
}
|
|
@@ -18610,6 +18597,20 @@ function isTextNode(node) {
|
|
|
18610
18597
|
function hasTextChildrenOnly(children) {
|
|
18611
18598
|
return children.every(isTextNode);
|
|
18612
18599
|
}
|
|
18600
|
+
function getBindingFunctionParams(deferredParams, name, eagerParams) {
|
|
18601
|
+
return () => {
|
|
18602
|
+
const value = deferredParams();
|
|
18603
|
+
const fnParams = Array.isArray(value) ? value : [value];
|
|
18604
|
+
if (eagerParams) {
|
|
18605
|
+
fnParams.push(...eagerParams);
|
|
18606
|
+
}
|
|
18607
|
+
if (name) {
|
|
18608
|
+
// We want the property name to always be the first function parameter.
|
|
18609
|
+
fnParams.unshift(literal(name));
|
|
18610
|
+
}
|
|
18611
|
+
return fnParams;
|
|
18612
|
+
};
|
|
18613
|
+
}
|
|
18613
18614
|
/** Name of the global variable that is used to determine if we use Closure translations or not */
|
|
18614
18615
|
const NG_I18N_CLOSURE_MODE = 'ngI18nClosureMode';
|
|
18615
18616
|
/**
|
|
@@ -18706,6 +18707,9 @@ function baseDirectiveFields(meta, constantPool, bindingParser) {
|
|
|
18706
18707
|
if (meta.exportAs !== null) {
|
|
18707
18708
|
definitionMap.set('exportAs', literalArr(meta.exportAs.map(e => literal(e))));
|
|
18708
18709
|
}
|
|
18710
|
+
if (meta.isStandalone) {
|
|
18711
|
+
definitionMap.set('standalone', literal(true));
|
|
18712
|
+
}
|
|
18709
18713
|
return definitionMap;
|
|
18710
18714
|
}
|
|
18711
18715
|
/**
|
|
@@ -18721,16 +18725,16 @@ function addFeatures(definitionMap, meta) {
|
|
|
18721
18725
|
if (viewProviders) {
|
|
18722
18726
|
args.push(viewProviders);
|
|
18723
18727
|
}
|
|
18724
|
-
features.push(importExpr(Identifiers
|
|
18728
|
+
features.push(importExpr(Identifiers.ProvidersFeature).callFn(args));
|
|
18725
18729
|
}
|
|
18726
18730
|
if (meta.usesInheritance) {
|
|
18727
|
-
features.push(importExpr(Identifiers
|
|
18731
|
+
features.push(importExpr(Identifiers.InheritDefinitionFeature));
|
|
18728
18732
|
}
|
|
18729
18733
|
if (meta.fullInheritance) {
|
|
18730
|
-
features.push(importExpr(Identifiers
|
|
18734
|
+
features.push(importExpr(Identifiers.CopyDefinitionFeature));
|
|
18731
18735
|
}
|
|
18732
18736
|
if (meta.lifecycle.usesOnChanges) {
|
|
18733
|
-
features.push(importExpr(Identifiers
|
|
18737
|
+
features.push(importExpr(Identifiers.NgOnChangesFeature));
|
|
18734
18738
|
}
|
|
18735
18739
|
if (features.length) {
|
|
18736
18740
|
definitionMap.set('features', literalArr(features));
|
|
@@ -18742,7 +18746,7 @@ function addFeatures(definitionMap, meta) {
|
|
|
18742
18746
|
function compileDirectiveFromMetadata(meta, constantPool, bindingParser) {
|
|
18743
18747
|
const definitionMap = baseDirectiveFields(meta, constantPool, bindingParser);
|
|
18744
18748
|
addFeatures(definitionMap, meta);
|
|
18745
|
-
const expression = importExpr(Identifiers
|
|
18749
|
+
const expression = importExpr(Identifiers.defineDirective).callFn([definitionMap.toLiteralMap()], undefined, true);
|
|
18746
18750
|
const type = createDirectiveType(meta);
|
|
18747
18751
|
return { expression, type, statements: [] };
|
|
18748
18752
|
}
|
|
@@ -18768,7 +18772,7 @@ function compileComponentFromMetadata(meta, constantPool, bindingParser) {
|
|
|
18768
18772
|
const templateName = templateTypeName ? `${templateTypeName}_Template` : null;
|
|
18769
18773
|
const changeDetection = meta.changeDetection;
|
|
18770
18774
|
const template = meta.template;
|
|
18771
|
-
const templateBuilder = new TemplateDefinitionBuilder(constantPool, BindingScope.createRootScope(), 0, templateTypeName, null, null, templateName, Identifiers
|
|
18775
|
+
const templateBuilder = new TemplateDefinitionBuilder(constantPool, BindingScope.createRootScope(), 0, templateTypeName, null, null, templateName, Identifiers.namespaceHTML, meta.relativeContextFilePath, meta.i18nUseExternalIds);
|
|
18772
18776
|
const templateFunctionExpression = templateBuilder.buildTemplateFunction(template.nodes, []);
|
|
18773
18777
|
// We need to provide this so that dynamically generated components know what
|
|
18774
18778
|
// projected content blocks to pass through to the component when it is instantiated.
|
|
@@ -18834,7 +18838,7 @@ function compileComponentFromMetadata(meta, constantPool, bindingParser) {
|
|
|
18834
18838
|
if (changeDetection != null && changeDetection !== ChangeDetectionStrategy.Default) {
|
|
18835
18839
|
definitionMap.set('changeDetection', literal(changeDetection));
|
|
18836
18840
|
}
|
|
18837
|
-
const expression = importExpr(Identifiers
|
|
18841
|
+
const expression = importExpr(Identifiers.defineComponent).callFn([definitionMap.toLiteralMap()], undefined, true);
|
|
18838
18842
|
const type = createComponentType(meta);
|
|
18839
18843
|
return { expression, type, statements: [] };
|
|
18840
18844
|
}
|
|
@@ -18845,7 +18849,7 @@ function compileComponentFromMetadata(meta, constantPool, bindingParser) {
|
|
|
18845
18849
|
function createComponentType(meta) {
|
|
18846
18850
|
const typeParams = createDirectiveTypeParams(meta);
|
|
18847
18851
|
typeParams.push(stringArrayAsType(meta.template.ngContentSelectors));
|
|
18848
|
-
return expressionType(importExpr(Identifiers
|
|
18852
|
+
return expressionType(importExpr(Identifiers.ComponentDeclaration, typeParams));
|
|
18849
18853
|
}
|
|
18850
18854
|
/**
|
|
18851
18855
|
* Compiles the array literal of declarations into an expression according to the provided emit
|
|
@@ -18861,7 +18865,7 @@ function compileDeclarationList(list, mode) {
|
|
|
18861
18865
|
return fn([], [new ReturnStatement(list)]);
|
|
18862
18866
|
case 2 /* ClosureResolved */:
|
|
18863
18867
|
// directives: function () { return [MyDir].map(ng.resolveForwardRef); }
|
|
18864
|
-
const resolvedList = list.prop('map').callFn([importExpr(Identifiers
|
|
18868
|
+
const resolvedList = list.prop('map').callFn([importExpr(Identifiers.resolveForwardRef)]);
|
|
18865
18869
|
return fn([], [new ReturnStatement(resolvedList)]);
|
|
18866
18870
|
}
|
|
18867
18871
|
}
|
|
@@ -18896,13 +18900,13 @@ function createContentQueriesFunction(queries, constantPool, name) {
|
|
|
18896
18900
|
const tempAllocator = temporaryAllocator(updateStatements, TEMPORARY_NAME);
|
|
18897
18901
|
for (const query of queries) {
|
|
18898
18902
|
// creation, e.g. r3.contentQuery(dirIndex, somePredicate, true, null);
|
|
18899
|
-
createStatements.push(importExpr(Identifiers
|
|
18903
|
+
createStatements.push(importExpr(Identifiers.contentQuery)
|
|
18900
18904
|
.callFn([variable('dirIndex'), ...prepareQueryParams(query, constantPool)])
|
|
18901
18905
|
.toStmt());
|
|
18902
18906
|
// update, e.g. (r3.queryRefresh(tmp = r3.loadQuery()) && (ctx.someDir = tmp));
|
|
18903
18907
|
const temporary = tempAllocator();
|
|
18904
|
-
const getQueryList = importExpr(Identifiers
|
|
18905
|
-
const refresh = importExpr(Identifiers
|
|
18908
|
+
const getQueryList = importExpr(Identifiers.loadQuery).callFn([]);
|
|
18909
|
+
const refresh = importExpr(Identifiers.queryRefresh).callFn([temporary.set(getQueryList)]);
|
|
18906
18910
|
const updateDirective = variable(CONTEXT_NAME)
|
|
18907
18911
|
.prop(query.propertyName)
|
|
18908
18912
|
.set(query.first ? temporary.prop('first') : temporary);
|
|
@@ -18954,7 +18958,7 @@ function createDirectiveTypeParams(meta) {
|
|
|
18954
18958
|
*/
|
|
18955
18959
|
function createDirectiveType(meta) {
|
|
18956
18960
|
const typeParams = createDirectiveTypeParams(meta);
|
|
18957
|
-
return expressionType(importExpr(Identifiers
|
|
18961
|
+
return expressionType(importExpr(Identifiers.DirectiveDeclaration, typeParams));
|
|
18958
18962
|
}
|
|
18959
18963
|
// Define and update any view queries
|
|
18960
18964
|
function createViewQueriesFunction(viewQueries, constantPool, name) {
|
|
@@ -18963,12 +18967,12 @@ function createViewQueriesFunction(viewQueries, constantPool, name) {
|
|
|
18963
18967
|
const tempAllocator = temporaryAllocator(updateStatements, TEMPORARY_NAME);
|
|
18964
18968
|
viewQueries.forEach((query) => {
|
|
18965
18969
|
// creation, e.g. r3.viewQuery(somePredicate, true);
|
|
18966
|
-
const queryDefinition = importExpr(Identifiers
|
|
18970
|
+
const queryDefinition = importExpr(Identifiers.viewQuery).callFn(prepareQueryParams(query, constantPool));
|
|
18967
18971
|
createStatements.push(queryDefinition.toStmt());
|
|
18968
18972
|
// update, e.g. (r3.queryRefresh(tmp = r3.loadQuery()) && (ctx.someDir = tmp));
|
|
18969
18973
|
const temporary = tempAllocator();
|
|
18970
|
-
const getQueryList = importExpr(Identifiers
|
|
18971
|
-
const refresh = importExpr(Identifiers
|
|
18974
|
+
const getQueryList = importExpr(Identifiers.loadQuery).callFn([]);
|
|
18975
|
+
const refresh = importExpr(Identifiers.queryRefresh).callFn([temporary.set(getQueryList)]);
|
|
18972
18976
|
const updateDirective = variable(CONTEXT_NAME)
|
|
18973
18977
|
.prop(query.propertyName)
|
|
18974
18978
|
.set(query.first ? temporary.prop('first') : temporary);
|
|
@@ -18991,14 +18995,14 @@ function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindin
|
|
|
18991
18995
|
if (classAttr !== undefined) {
|
|
18992
18996
|
styleBuilder.registerClassAttr(classAttr);
|
|
18993
18997
|
}
|
|
18994
|
-
const
|
|
18995
|
-
const
|
|
18998
|
+
const createInstructions = [];
|
|
18999
|
+
const updateInstructions = [];
|
|
19000
|
+
const updateVariables = [];
|
|
18996
19001
|
const hostBindingSourceSpan = typeSourceSpan;
|
|
18997
19002
|
// Calculate host event bindings
|
|
18998
19003
|
const eventBindings = bindingParser.createDirectiveHostEventAsts(hostBindingsMetadata.listeners, hostBindingSourceSpan);
|
|
18999
19004
|
if (eventBindings && eventBindings.length) {
|
|
19000
|
-
|
|
19001
|
-
createStatements.push(...listeners);
|
|
19005
|
+
createInstructions.push(...createHostListeners(eventBindings, name));
|
|
19002
19006
|
}
|
|
19003
19007
|
// Calculate the host property bindings
|
|
19004
19008
|
const bindings = bindingParser.createBoundHostProperties(hostBindingsMetadata.properties, hostBindingSourceSpan);
|
|
@@ -19034,7 +19038,7 @@ function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindin
|
|
|
19034
19038
|
const propertyBindings = [];
|
|
19035
19039
|
const attributeBindings = [];
|
|
19036
19040
|
const syntheticHostBindings = [];
|
|
19037
|
-
|
|
19041
|
+
for (const binding of allOtherBindings) {
|
|
19038
19042
|
// resolve literal arrays and literal objects
|
|
19039
19043
|
const value = binding.expression.visit(getValueConverter());
|
|
19040
19044
|
const bindingExpr = bindingFn(bindingContext, value);
|
|
@@ -19050,7 +19054,7 @@ function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindin
|
|
|
19050
19054
|
// of different security contexts. In this case we use special sanitization function and
|
|
19051
19055
|
// select the actual sanitizer at runtime based on a tag name that is provided while
|
|
19052
19056
|
// invoking sanitization function.
|
|
19053
|
-
sanitizerFn = importExpr(Identifiers
|
|
19057
|
+
sanitizerFn = importExpr(Identifiers.sanitizeUrlOrResourceUrl);
|
|
19054
19058
|
}
|
|
19055
19059
|
else {
|
|
19056
19060
|
sanitizerFn = resolveSanitizationFn(securityContexts[0], isAttribute);
|
|
@@ -19060,28 +19064,28 @@ function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindin
|
|
|
19060
19064
|
if (sanitizerFn) {
|
|
19061
19065
|
instructionParams.push(sanitizerFn);
|
|
19062
19066
|
}
|
|
19063
|
-
|
|
19064
|
-
if (instruction === Identifiers
|
|
19067
|
+
updateVariables.push(...bindingExpr.stmts);
|
|
19068
|
+
if (instruction === Identifiers.hostProperty) {
|
|
19065
19069
|
propertyBindings.push(instructionParams);
|
|
19066
19070
|
}
|
|
19067
|
-
else if (instruction === Identifiers
|
|
19071
|
+
else if (instruction === Identifiers.attribute) {
|
|
19068
19072
|
attributeBindings.push(instructionParams);
|
|
19069
19073
|
}
|
|
19070
|
-
else if (instruction === Identifiers
|
|
19074
|
+
else if (instruction === Identifiers.syntheticHostProperty) {
|
|
19071
19075
|
syntheticHostBindings.push(instructionParams);
|
|
19072
19076
|
}
|
|
19073
19077
|
else {
|
|
19074
|
-
|
|
19078
|
+
updateInstructions.push({ reference: instruction, paramsOrFn: instructionParams, span: null });
|
|
19075
19079
|
}
|
|
19076
|
-
});
|
|
19077
|
-
if (propertyBindings.length > 0) {
|
|
19078
|
-
updateStatements.push(chainedInstruction(Identifiers$1.hostProperty, propertyBindings).toStmt());
|
|
19079
19080
|
}
|
|
19080
|
-
|
|
19081
|
-
|
|
19081
|
+
for (const bindingParams of propertyBindings) {
|
|
19082
|
+
updateInstructions.push({ reference: Identifiers.hostProperty, paramsOrFn: bindingParams, span: null });
|
|
19082
19083
|
}
|
|
19083
|
-
|
|
19084
|
-
|
|
19084
|
+
for (const bindingParams of attributeBindings) {
|
|
19085
|
+
updateInstructions.push({ reference: Identifiers.attribute, paramsOrFn: bindingParams, span: null });
|
|
19086
|
+
}
|
|
19087
|
+
for (const bindingParams of syntheticHostBindings) {
|
|
19088
|
+
updateInstructions.push({ reference: Identifiers.syntheticHostProperty, paramsOrFn: bindingParams, span: null });
|
|
19085
19089
|
}
|
|
19086
19090
|
// since we're dealing with directives/components and both have hostBinding
|
|
19087
19091
|
// functions, we need to generate a special hostAttrs instruction that deals
|
|
@@ -19097,37 +19101,37 @@ function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindin
|
|
|
19097
19101
|
// the update block of a component/directive templateFn/hostBindingsFn so that the bindings
|
|
19098
19102
|
// are evaluated and updated for the element.
|
|
19099
19103
|
styleBuilder.buildUpdateLevelInstructions(getValueConverter()).forEach(instruction => {
|
|
19100
|
-
|
|
19101
|
-
|
|
19102
|
-
|
|
19103
|
-
|
|
19104
|
-
|
|
19105
|
-
|
|
19106
|
-
|
|
19107
|
-
|
|
19104
|
+
for (const call of instruction.calls) {
|
|
19105
|
+
// we subtract a value of `1` here because the binding slot was already allocated
|
|
19106
|
+
// at the top of this method when all the input bindings were counted.
|
|
19107
|
+
totalHostVarsCount +=
|
|
19108
|
+
Math.max(call.allocateBindingSlots - MIN_STYLING_BINDING_SLOTS_REQUIRED, 0);
|
|
19109
|
+
updateInstructions.push({
|
|
19110
|
+
reference: instruction.reference,
|
|
19111
|
+
paramsOrFn: convertStylingCall(call, bindingContext, bindingFn),
|
|
19112
|
+
span: null
|
|
19108
19113
|
});
|
|
19109
|
-
updateStatements.push(chainedInstruction(instruction.reference, calls).toStmt());
|
|
19110
19114
|
}
|
|
19111
19115
|
});
|
|
19112
19116
|
}
|
|
19113
19117
|
if (totalHostVarsCount) {
|
|
19114
19118
|
definitionMap.set('hostVars', literal(totalHostVarsCount));
|
|
19115
19119
|
}
|
|
19116
|
-
if (
|
|
19120
|
+
if (createInstructions.length > 0 || updateInstructions.length > 0) {
|
|
19117
19121
|
const hostBindingsFnName = name ? `${name}_HostBindings` : null;
|
|
19118
19122
|
const statements = [];
|
|
19119
|
-
if (
|
|
19120
|
-
statements.push(renderFlagCheckIfStmt(1 /* Create */,
|
|
19123
|
+
if (createInstructions.length > 0) {
|
|
19124
|
+
statements.push(renderFlagCheckIfStmt(1 /* Create */, getInstructionStatements(createInstructions)));
|
|
19121
19125
|
}
|
|
19122
|
-
if (
|
|
19123
|
-
statements.push(renderFlagCheckIfStmt(2 /* Update */,
|
|
19126
|
+
if (updateInstructions.length > 0) {
|
|
19127
|
+
statements.push(renderFlagCheckIfStmt(2 /* Update */, updateVariables.concat(getInstructionStatements(updateInstructions))));
|
|
19124
19128
|
}
|
|
19125
19129
|
return fn([new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, null)], statements, INFERRED_TYPE, null, hostBindingsFnName);
|
|
19126
19130
|
}
|
|
19127
19131
|
return null;
|
|
19128
19132
|
}
|
|
19129
19133
|
function bindingFn(implicit, value) {
|
|
19130
|
-
return convertPropertyBinding(null, implicit, value, 'b'
|
|
19134
|
+
return convertPropertyBinding(null, implicit, value, 'b');
|
|
19131
19135
|
}
|
|
19132
19136
|
function convertStylingCall(call, bindingContext, bindingFn) {
|
|
19133
19137
|
return call.params(value => bindingFn(bindingContext, value).currValExpr);
|
|
@@ -19139,7 +19143,7 @@ function getBindingNameAndInstruction(binding) {
|
|
|
19139
19143
|
const attrMatches = bindingName.match(ATTR_REGEX);
|
|
19140
19144
|
if (attrMatches) {
|
|
19141
19145
|
bindingName = attrMatches[1];
|
|
19142
|
-
instruction = Identifiers
|
|
19146
|
+
instruction = Identifiers.attribute;
|
|
19143
19147
|
}
|
|
19144
19148
|
else {
|
|
19145
19149
|
if (binding.isAnimation) {
|
|
@@ -19147,19 +19151,19 @@ function getBindingNameAndInstruction(binding) {
|
|
|
19147
19151
|
// host bindings that have a synthetic property (e.g. @foo) should always be rendered
|
|
19148
19152
|
// in the context of the component and not the parent. Therefore there is a special
|
|
19149
19153
|
// compatibility instruction available for this purpose.
|
|
19150
|
-
instruction = Identifiers
|
|
19154
|
+
instruction = Identifiers.syntheticHostProperty;
|
|
19151
19155
|
}
|
|
19152
19156
|
else {
|
|
19153
|
-
instruction = Identifiers
|
|
19157
|
+
instruction = Identifiers.hostProperty;
|
|
19154
19158
|
}
|
|
19155
19159
|
}
|
|
19156
19160
|
return { bindingName, instruction, isAttribute: !!attrMatches };
|
|
19157
19161
|
}
|
|
19158
19162
|
function createHostListeners(eventBindings, name) {
|
|
19159
|
-
const
|
|
19160
|
-
const
|
|
19163
|
+
const listenerParams = [];
|
|
19164
|
+
const syntheticListenerParams = [];
|
|
19161
19165
|
const instructions = [];
|
|
19162
|
-
|
|
19166
|
+
for (const binding of eventBindings) {
|
|
19163
19167
|
let bindingName = binding.name && sanitizeIdentifier(binding.name);
|
|
19164
19168
|
const bindingFnName = binding.type === 1 /* Animation */ ?
|
|
19165
19169
|
prepareSyntheticListenerFunctionName(bindingName, binding.targetOrPhase) :
|
|
@@ -19167,17 +19171,17 @@ function createHostListeners(eventBindings, name) {
|
|
|
19167
19171
|
const handlerName = name && bindingName ? `${name}_${bindingFnName}_HostBindingHandler` : null;
|
|
19168
19172
|
const params = prepareEventListenerParameters(BoundEvent.fromParsedEvent(binding), handlerName);
|
|
19169
19173
|
if (binding.type == 1 /* Animation */) {
|
|
19170
|
-
|
|
19174
|
+
syntheticListenerParams.push(params);
|
|
19171
19175
|
}
|
|
19172
19176
|
else {
|
|
19173
|
-
|
|
19177
|
+
listenerParams.push(params);
|
|
19174
19178
|
}
|
|
19175
|
-
});
|
|
19176
|
-
if (syntheticListeners.length > 0) {
|
|
19177
|
-
instructions.push(chainedInstruction(Identifiers$1.syntheticHostListener, syntheticListeners).toStmt());
|
|
19178
19179
|
}
|
|
19179
|
-
|
|
19180
|
-
instructions.push(
|
|
19180
|
+
for (const params of syntheticListenerParams) {
|
|
19181
|
+
instructions.push({ reference: Identifiers.syntheticHostListener, paramsOrFn: params, span: null });
|
|
19182
|
+
}
|
|
19183
|
+
for (const params of listenerParams) {
|
|
19184
|
+
instructions.push({ reference: Identifiers.listener, paramsOrFn: params, span: null });
|
|
19181
19185
|
}
|
|
19182
19186
|
return instructions;
|
|
19183
19187
|
}
|
|
@@ -19298,6 +19302,7 @@ class CompilerFacadeImpl {
|
|
|
19298
19302
|
deps: null,
|
|
19299
19303
|
pipeName: facade.pipeName,
|
|
19300
19304
|
pure: facade.pure,
|
|
19305
|
+
isStandalone: facade.isStandalone,
|
|
19301
19306
|
};
|
|
19302
19307
|
const res = compilePipeFromMetadata(metadata);
|
|
19303
19308
|
return this.jitExpression(res.expression, angularCoreEnv, sourceMapUrl, []);
|
|
@@ -19366,7 +19371,7 @@ class CompilerFacadeImpl {
|
|
|
19366
19371
|
declarations: facade.declarations.map(wrapReference),
|
|
19367
19372
|
imports: facade.imports.map(wrapReference),
|
|
19368
19373
|
exports: facade.exports.map(wrapReference),
|
|
19369
|
-
|
|
19374
|
+
selectorScopeMode: R3SelectorScopeMode.Inline,
|
|
19370
19375
|
containsForwardDecls: false,
|
|
19371
19376
|
schemas: facade.schemas ? facade.schemas.map(wrapReference) : null,
|
|
19372
19377
|
id: facade.id ? new WrappedNodeExpr(facade.id) : null,
|
|
@@ -19508,7 +19513,7 @@ function convertDirectiveFacadeToMetadata(facade) {
|
|
|
19508
19513
|
return Object.assign(Object.assign({}, facade), { typeArgumentCount: 0, typeSourceSpan: facade.typeSourceSpan, type: wrapReference(facade.type), internalType: new WrappedNodeExpr(facade.type), deps: null, host: extractHostBindings(facade.propMetadata, facade.typeSourceSpan, facade.host), inputs: Object.assign(Object.assign({}, inputsFromMetadata), inputsFromType), outputs: Object.assign(Object.assign({}, outputsFromMetadata), outputsFromType), queries: facade.queries.map(convertToR3QueryMetadata), providers: facade.providers != null ? new WrappedNodeExpr(facade.providers) : null, viewQueries: facade.viewQueries.map(convertToR3QueryMetadata), fullInheritance: false });
|
|
19509
19514
|
}
|
|
19510
19515
|
function convertDeclareDirectiveFacadeToMetadata(declaration, typeSourceSpan) {
|
|
19511
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
19516
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
19512
19517
|
return {
|
|
19513
19518
|
name: declaration.type.name,
|
|
19514
19519
|
type: wrapReference(declaration.type),
|
|
@@ -19528,6 +19533,7 @@ function convertDeclareDirectiveFacadeToMetadata(declaration, typeSourceSpan) {
|
|
|
19528
19533
|
deps: null,
|
|
19529
19534
|
typeArgumentCount: 0,
|
|
19530
19535
|
fullInheritance: false,
|
|
19536
|
+
isStandalone: (_j = declaration.isStandalone) !== null && _j !== void 0 ? _j : false,
|
|
19531
19537
|
};
|
|
19532
19538
|
}
|
|
19533
19539
|
function convertHostDeclarationToMetadata(host = {}) {
|
|
@@ -19691,7 +19697,7 @@ function parseInputOutputs(values) {
|
|
|
19691
19697
|
}, {});
|
|
19692
19698
|
}
|
|
19693
19699
|
function convertDeclarePipeFacadeToMetadata(declaration) {
|
|
19694
|
-
var _a;
|
|
19700
|
+
var _a, _b;
|
|
19695
19701
|
return {
|
|
19696
19702
|
name: declaration.type.name,
|
|
19697
19703
|
type: wrapReference(declaration.type),
|
|
@@ -19700,6 +19706,7 @@ function convertDeclarePipeFacadeToMetadata(declaration) {
|
|
|
19700
19706
|
pipeName: declaration.name,
|
|
19701
19707
|
deps: null,
|
|
19702
19708
|
pure: (_a = declaration.pure) !== null && _a !== void 0 ? _a : true,
|
|
19709
|
+
isStandalone: (_b = declaration.isStandalone) !== null && _b !== void 0 ? _b : false,
|
|
19703
19710
|
};
|
|
19704
19711
|
}
|
|
19705
19712
|
function convertDeclareInjectorFacadeToMetadata(declaration) {
|
|
@@ -19726,7 +19733,7 @@ function publishFacade(global) {
|
|
|
19726
19733
|
* Use of this source code is governed by an MIT-style license that can be
|
|
19727
19734
|
* found in the LICENSE file at https://angular.io/license
|
|
19728
19735
|
*/
|
|
19729
|
-
const VERSION = new Version('14.0.0-next.
|
|
19736
|
+
const VERSION = new Version('14.0.0-next.11');
|
|
19730
19737
|
|
|
19731
19738
|
/**
|
|
19732
19739
|
* @license
|
|
@@ -21725,7 +21732,7 @@ function compileClassMetadata(metadata) {
|
|
|
21725
21732
|
var _a, _b;
|
|
21726
21733
|
// Generate an ngDevMode guarded call to setClassMetadata with the class identifier and its
|
|
21727
21734
|
// metadata.
|
|
21728
|
-
const fnCall = importExpr(Identifiers
|
|
21735
|
+
const fnCall = importExpr(Identifiers.setClassMetadata).callFn([
|
|
21729
21736
|
metadata.type,
|
|
21730
21737
|
metadata.decorators,
|
|
21731
21738
|
(_a = metadata.ctorParameters) !== null && _a !== void 0 ? _a : literal(null),
|
|
@@ -21753,13 +21760,13 @@ const MINIMUM_PARTIAL_LINKER_VERSION$6 = '12.0.0';
|
|
|
21753
21760
|
function compileDeclareClassMetadata(metadata) {
|
|
21754
21761
|
const definitionMap = new DefinitionMap();
|
|
21755
21762
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$6));
|
|
21756
|
-
definitionMap.set('version', literal('14.0.0-next.
|
|
21757
|
-
definitionMap.set('ngImport', importExpr(Identifiers
|
|
21763
|
+
definitionMap.set('version', literal('14.0.0-next.11'));
|
|
21764
|
+
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
21758
21765
|
definitionMap.set('type', metadata.type);
|
|
21759
21766
|
definitionMap.set('decorators', metadata.decorators);
|
|
21760
21767
|
definitionMap.set('ctorParameters', metadata.ctorParameters);
|
|
21761
21768
|
definitionMap.set('propDecorators', metadata.propDecorators);
|
|
21762
|
-
return importExpr(Identifiers
|
|
21769
|
+
return importExpr(Identifiers.declareClassMetadata).callFn([definitionMap.toLiteralMap()]);
|
|
21763
21770
|
}
|
|
21764
21771
|
|
|
21765
21772
|
/**
|
|
@@ -21859,7 +21866,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$5 = '12.0.0';
|
|
|
21859
21866
|
*/
|
|
21860
21867
|
function compileDeclareDirectiveFromMetadata(meta) {
|
|
21861
21868
|
const definitionMap = createDirectiveDefinitionMap(meta);
|
|
21862
|
-
const expression = importExpr(Identifiers
|
|
21869
|
+
const expression = importExpr(Identifiers.declareDirective).callFn([definitionMap.toLiteralMap()]);
|
|
21863
21870
|
const type = createDirectiveType(meta);
|
|
21864
21871
|
return { expression, type, statements: [] };
|
|
21865
21872
|
}
|
|
@@ -21870,7 +21877,7 @@ function compileDeclareDirectiveFromMetadata(meta) {
|
|
|
21870
21877
|
function createDirectiveDefinitionMap(meta) {
|
|
21871
21878
|
const definitionMap = new DefinitionMap();
|
|
21872
21879
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
|
|
21873
|
-
definitionMap.set('version', literal('14.0.0-next.
|
|
21880
|
+
definitionMap.set('version', literal('14.0.0-next.11'));
|
|
21874
21881
|
// e.g. `type: MyDirective`
|
|
21875
21882
|
definitionMap.set('type', meta.internalType);
|
|
21876
21883
|
// e.g. `selector: 'some-dir'`
|
|
@@ -21896,7 +21903,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
21896
21903
|
if (meta.lifecycle.usesOnChanges) {
|
|
21897
21904
|
definitionMap.set('usesOnChanges', literal(true));
|
|
21898
21905
|
}
|
|
21899
|
-
definitionMap.set('ngImport', importExpr(Identifiers
|
|
21906
|
+
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
21900
21907
|
return definitionMap;
|
|
21901
21908
|
}
|
|
21902
21909
|
/**
|
|
@@ -21963,7 +21970,7 @@ function compileHostMetadata(meta) {
|
|
|
21963
21970
|
*/
|
|
21964
21971
|
function compileDeclareComponentFromMetadata(meta, template, additionalTemplateInfo) {
|
|
21965
21972
|
const definitionMap = createComponentDefinitionMap(meta, template, additionalTemplateInfo);
|
|
21966
|
-
const expression = importExpr(Identifiers
|
|
21973
|
+
const expression = importExpr(Identifiers.declareComponent).callFn([definitionMap.toLiteralMap()]);
|
|
21967
21974
|
const type = createComponentType(meta);
|
|
21968
21975
|
return { expression, type, statements: [] };
|
|
21969
21976
|
}
|
|
@@ -21983,11 +21990,11 @@ function createComponentDefinitionMap(meta, template, templateInfo) {
|
|
|
21983
21990
|
definitionMap.set('viewProviders', meta.viewProviders);
|
|
21984
21991
|
definitionMap.set('animations', meta.animations);
|
|
21985
21992
|
if (meta.changeDetection !== undefined) {
|
|
21986
|
-
definitionMap.set('changeDetection', importExpr(Identifiers
|
|
21993
|
+
definitionMap.set('changeDetection', importExpr(Identifiers.ChangeDetectionStrategy)
|
|
21987
21994
|
.prop(ChangeDetectionStrategy[meta.changeDetection]));
|
|
21988
21995
|
}
|
|
21989
21996
|
if (meta.encapsulation !== ViewEncapsulation.Emulated) {
|
|
21990
|
-
definitionMap.set('encapsulation', importExpr(Identifiers
|
|
21997
|
+
definitionMap.set('encapsulation', importExpr(Identifiers.ViewEncapsulation).prop(ViewEncapsulation[meta.encapsulation]));
|
|
21991
21998
|
}
|
|
21992
21999
|
if (meta.interpolation !== DEFAULT_INTERPOLATION_CONFIG) {
|
|
21993
22000
|
definitionMap.set('interpolation', literalArr([literal(meta.interpolation.start), literal(meta.interpolation.end)]));
|
|
@@ -22091,13 +22098,13 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
|
|
|
22091
22098
|
function compileDeclareFactoryFunction(meta) {
|
|
22092
22099
|
const definitionMap = new DefinitionMap();
|
|
22093
22100
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
|
|
22094
|
-
definitionMap.set('version', literal('14.0.0-next.
|
|
22095
|
-
definitionMap.set('ngImport', importExpr(Identifiers
|
|
22101
|
+
definitionMap.set('version', literal('14.0.0-next.11'));
|
|
22102
|
+
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22096
22103
|
definitionMap.set('type', meta.internalType);
|
|
22097
22104
|
definitionMap.set('deps', compileDependencies(meta.deps));
|
|
22098
|
-
definitionMap.set('target', importExpr(Identifiers
|
|
22105
|
+
definitionMap.set('target', importExpr(Identifiers.FactoryTarget).prop(FactoryTarget$1[meta.target]));
|
|
22099
22106
|
return {
|
|
22100
|
-
expression: importExpr(Identifiers
|
|
22107
|
+
expression: importExpr(Identifiers.declareFactory).callFn([definitionMap.toLiteralMap()]),
|
|
22101
22108
|
statements: [],
|
|
22102
22109
|
type: createFactoryType(meta),
|
|
22103
22110
|
};
|
|
@@ -22123,7 +22130,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$3 = '12.0.0';
|
|
|
22123
22130
|
*/
|
|
22124
22131
|
function compileDeclareInjectableFromMetadata(meta) {
|
|
22125
22132
|
const definitionMap = createInjectableDefinitionMap(meta);
|
|
22126
|
-
const expression = importExpr(Identifiers
|
|
22133
|
+
const expression = importExpr(Identifiers.declareInjectable).callFn([definitionMap.toLiteralMap()]);
|
|
22127
22134
|
const type = createInjectableType(meta);
|
|
22128
22135
|
return { expression, type, statements: [] };
|
|
22129
22136
|
}
|
|
@@ -22133,8 +22140,8 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
22133
22140
|
function createInjectableDefinitionMap(meta) {
|
|
22134
22141
|
const definitionMap = new DefinitionMap();
|
|
22135
22142
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
|
|
22136
|
-
definitionMap.set('version', literal('14.0.0-next.
|
|
22137
|
-
definitionMap.set('ngImport', importExpr(Identifiers
|
|
22143
|
+
definitionMap.set('version', literal('14.0.0-next.11'));
|
|
22144
|
+
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22138
22145
|
definitionMap.set('type', meta.internalType);
|
|
22139
22146
|
// Only generate providedIn property if it has a non-null value
|
|
22140
22147
|
if (meta.providedIn !== undefined) {
|
|
@@ -22181,7 +22188,7 @@ function createInjectableDefinitionMap(meta) {
|
|
|
22181
22188
|
const MINIMUM_PARTIAL_LINKER_VERSION$2 = '12.0.0';
|
|
22182
22189
|
function compileDeclareInjectorFromMetadata(meta) {
|
|
22183
22190
|
const definitionMap = createInjectorDefinitionMap(meta);
|
|
22184
|
-
const expression = importExpr(Identifiers
|
|
22191
|
+
const expression = importExpr(Identifiers.declareInjector).callFn([definitionMap.toLiteralMap()]);
|
|
22185
22192
|
const type = createInjectorType(meta);
|
|
22186
22193
|
return { expression, type, statements: [] };
|
|
22187
22194
|
}
|
|
@@ -22191,8 +22198,8 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
22191
22198
|
function createInjectorDefinitionMap(meta) {
|
|
22192
22199
|
const definitionMap = new DefinitionMap();
|
|
22193
22200
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
|
|
22194
|
-
definitionMap.set('version', literal('14.0.0-next.
|
|
22195
|
-
definitionMap.set('ngImport', importExpr(Identifiers
|
|
22201
|
+
definitionMap.set('version', literal('14.0.0-next.11'));
|
|
22202
|
+
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22196
22203
|
definitionMap.set('type', meta.internalType);
|
|
22197
22204
|
definitionMap.set('providers', meta.providers);
|
|
22198
22205
|
if (meta.imports.length > 0) {
|
|
@@ -22218,7 +22225,7 @@ function createInjectorDefinitionMap(meta) {
|
|
|
22218
22225
|
const MINIMUM_PARTIAL_LINKER_VERSION$1 = '12.0.0';
|
|
22219
22226
|
function compileDeclareNgModuleFromMetadata(meta) {
|
|
22220
22227
|
const definitionMap = createNgModuleDefinitionMap(meta);
|
|
22221
|
-
const expression = importExpr(Identifiers
|
|
22228
|
+
const expression = importExpr(Identifiers.declareNgModule).callFn([definitionMap.toLiteralMap()]);
|
|
22222
22229
|
const type = createNgModuleType(meta);
|
|
22223
22230
|
return { expression, type, statements: [] };
|
|
22224
22231
|
}
|
|
@@ -22228,8 +22235,8 @@ function compileDeclareNgModuleFromMetadata(meta) {
|
|
|
22228
22235
|
function createNgModuleDefinitionMap(meta) {
|
|
22229
22236
|
const definitionMap = new DefinitionMap();
|
|
22230
22237
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
|
|
22231
|
-
definitionMap.set('version', literal('14.0.0-next.
|
|
22232
|
-
definitionMap.set('ngImport', importExpr(Identifiers
|
|
22238
|
+
definitionMap.set('version', literal('14.0.0-next.11'));
|
|
22239
|
+
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22233
22240
|
definitionMap.set('type', meta.internalType);
|
|
22234
22241
|
// We only generate the keys in the metadata if the arrays contain values.
|
|
22235
22242
|
// We must wrap the arrays inside a function if any of the values are a forward reference to a
|
|
@@ -22276,7 +22283,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION = '12.0.0';
|
|
|
22276
22283
|
*/
|
|
22277
22284
|
function compileDeclarePipeFromMetadata(meta) {
|
|
22278
22285
|
const definitionMap = createPipeDefinitionMap(meta);
|
|
22279
|
-
const expression = importExpr(Identifiers
|
|
22286
|
+
const expression = importExpr(Identifiers.declarePipe).callFn([definitionMap.toLiteralMap()]);
|
|
22280
22287
|
const type = createPipeType(meta);
|
|
22281
22288
|
return { expression, type, statements: [] };
|
|
22282
22289
|
}
|
|
@@ -22286,8 +22293,8 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
22286
22293
|
function createPipeDefinitionMap(meta) {
|
|
22287
22294
|
const definitionMap = new DefinitionMap();
|
|
22288
22295
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
22289
|
-
definitionMap.set('version', literal('14.0.0-next.
|
|
22290
|
-
definitionMap.set('ngImport', importExpr(Identifiers
|
|
22296
|
+
definitionMap.set('version', literal('14.0.0-next.11'));
|
|
22297
|
+
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22291
22298
|
// e.g. `type: MyPipe`
|
|
22292
22299
|
definitionMap.set('type', meta.internalType);
|
|
22293
22300
|
// e.g. `name: "myPipe"`
|
|
@@ -22336,5 +22343,5 @@ publishFacade(_global);
|
|
|
22336
22343
|
* found in the LICENSE file at https://angular.io/license
|
|
22337
22344
|
*/
|
|
22338
22345
|
|
|
22339
|
-
export { AST, ASTWithName, ASTWithSource, AbsoluteSourceSpan, ArrayType, AstMemoryEfficientTransformer, AstTransformer, Attribute, Binary, BinaryOperator, BinaryOperatorExpr, BindingPipe, BoundElementProperty, BuiltinType, BuiltinTypeName, CUSTOM_ELEMENTS_SCHEMA, Call, Chain, ChangeDetectionStrategy, CommaExpr, Comment, CompilerConfig, Conditional, ConditionalExpr, ConstantPool, CssSelector, DEFAULT_INTERPOLATION_CONFIG, DYNAMIC_TYPE, DeclareFunctionStmt, DeclareVarStmt, DomElementSchemaRegistry, EOF, Element, ElementSchemaRegistry, EmitterVisitorContext, EmptyExpr, Expansion, ExpansionCase, Expression, ExpressionBinding, ExpressionStatement, ExpressionType, ExternalExpr, ExternalReference, FactoryTarget$1 as FactoryTarget, FunctionExpr, HtmlParser, HtmlTagDefinition, I18NHtmlParser,
|
|
22346
|
+
export { AST, ASTWithName, ASTWithSource, AbsoluteSourceSpan, ArrayType, AstMemoryEfficientTransformer, AstTransformer, Attribute, Binary, BinaryOperator, BinaryOperatorExpr, BindingPipe, BoundElementProperty, BuiltinType, BuiltinTypeName, CUSTOM_ELEMENTS_SCHEMA, Call, Chain, ChangeDetectionStrategy, CommaExpr, Comment, CompilerConfig, Conditional, ConditionalExpr, ConstantPool, CssSelector, DEFAULT_INTERPOLATION_CONFIG, DYNAMIC_TYPE, DeclareFunctionStmt, DeclareVarStmt, DomElementSchemaRegistry, EOF, Element, ElementSchemaRegistry, EmitterVisitorContext, EmptyExpr, Expansion, ExpansionCase, Expression, ExpressionBinding, ExpressionStatement, ExpressionType, ExternalExpr, ExternalReference, FactoryTarget$1 as FactoryTarget, FunctionExpr, HtmlParser, HtmlTagDefinition, I18NHtmlParser, IfStmt, ImplicitReceiver, InstantiateExpr, Interpolation, InterpolationConfig, InvokeFunctionExpr, JSDocComment, JitEvaluator, KeyedRead, KeyedWrite, LeadingComment, Lexer, LiteralArray, LiteralArrayExpr, LiteralExpr, LiteralMap, LiteralMapExpr, LiteralPrimitive, LocalizedString, MapType, MessageBundle, NONE_TYPE, NO_ERRORS_SCHEMA, NodeWithI18n, NonNullAssert, NotExpr, ParseError, ParseErrorLevel, ParseLocation, ParseSourceFile, ParseSourceSpan, ParseSpan, ParseTreeResult, ParsedEvent, ParsedProperty, ParsedPropertyType, ParsedVariable, Parser$1 as Parser, ParserError, PrefixNot, PropertyRead, PropertyWrite, R3BoundTarget, Identifiers as R3Identifiers, R3SelectorScopeMode, R3TargetBinder, ReadKeyExpr, ReadPropExpr, ReadVarExpr, RecursiveAstVisitor, RecursiveVisitor, ResourceLoader, ReturnStatement, STRING_TYPE, SafeCall, SafeKeyedRead, SafePropertyRead, SelectorContext, SelectorListContext, SelectorMatcher, Serializer, SplitInterpolation, Statement, StmtModifier, TagContentType, TaggedTemplateExpr, TemplateBindingParseResult, TemplateLiteral, TemplateLiteralElement, Text, ThisReceiver, BoundAttribute as TmplAstBoundAttribute, BoundEvent as TmplAstBoundEvent, BoundText as TmplAstBoundText, Content as TmplAstContent, Element$1 as TmplAstElement, Icu$1 as TmplAstIcu, RecursiveVisitor$1 as TmplAstRecursiveVisitor, Reference as TmplAstReference, Template as TmplAstTemplate, Text$3 as TmplAstText, TextAttribute as TmplAstTextAttribute, Variable as TmplAstVariable, Token, TokenType, TreeError, Type, TypeModifier, TypeofExpr, Unary, UnaryOperator, UnaryOperatorExpr, VERSION, VariableBinding, Version, ViewEncapsulation, WrappedNodeExpr, WriteKeyExpr, WritePropExpr, WriteVarExpr, Xliff, Xliff2, Xmb, XmlParser, Xtb, _ParseAST, compileClassMetadata, compileComponentFromMetadata, compileDeclareClassMetadata, compileDeclareComponentFromMetadata, compileDeclareDirectiveFromMetadata, compileDeclareFactoryFunction, compileDeclareInjectableFromMetadata, compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileDeclarePipeFromMetadata, compileDirectiveFromMetadata, compileFactoryFunction, compileInjectable, compileInjector, compileNgModule, compilePipeFromMetadata, computeMsgId, core, createInjectableType, createMayBeForwardRefExpression, devOnlyGuardedExpression, emitDistinctChangesOnlyDefaultValue, getHtmlTagDefinition, getNsPrefix, getSafePropertyAccessString, identifierName, isIdentifier, isNgContainer, isNgContent, isNgTemplate, jsDocComment, leadingComment, literalMap, makeBindingParser, mergeNsAndName, output_ast as outputAst, parseHostBindings, parseTemplate, preserveWhitespacesDefault, publishFacade, r3JitTypeSourceSpan, sanitizeIdentifier, splitNsName, verifyHostBindings, visitAll };
|
|
22340
22347
|
//# sourceMappingURL=compiler.mjs.map
|