@angular/compiler 13.2.0 → 14.0.0-next.2
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 +1 -2
- 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 +36 -36
- package/esm2020/src/jit_compiler_facade.mjs +4 -1
- package/esm2020/src/output/output_ast.mjs +1 -1
- 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_pipe_compiler.mjs +1 -1
- package/esm2020/src/render3/r3_template_transform.mjs +4 -4
- package/esm2020/src/render3/view/api.mjs +1 -1
- package/esm2020/src/render3/view/compiler.mjs +2 -2
- 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/template.mjs +3 -3
- package/esm2020/src/template_parser/binding_parser.mjs +11 -11
- package/esm2020/src/version.mjs +1 -1
- package/fesm2015/compiler.mjs +472 -598
- package/fesm2015/compiler.mjs.map +1 -1
- package/fesm2015/testing.mjs +1 -1
- package/fesm2020/compiler.mjs +470 -596
- package/fesm2020/compiler.mjs.map +1 -1
- package/fesm2020/testing.mjs +1 -1
- package/package.json +1 -1
- package/src/compiler.d.ts +0 -1
- 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 +19 -4
- package/src/output/output_ast.d.ts +2 -1
- package/src/render3/partial/api.d.ts +10 -0
- 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/template_parser/binding_parser.d.ts +1 -1
- 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
|
|
2
|
+
* @license Angular v14.0.0-next.2
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -2737,206 +2737,206 @@ 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.templateCreate = { name: 'ɵɵtemplate', moduleName: CORE };
|
|
2804
|
+
Identifiers.text = { name: 'ɵɵtext', moduleName: CORE };
|
|
2805
|
+
Identifiers.enableBindings = { name: 'ɵɵenableBindings', moduleName: CORE };
|
|
2806
|
+
Identifiers.disableBindings = { name: 'ɵɵdisableBindings', moduleName: CORE };
|
|
2807
|
+
Identifiers.getCurrentView = { name: 'ɵɵgetCurrentView', moduleName: CORE };
|
|
2808
|
+
Identifiers.textInterpolate = { name: 'ɵɵtextInterpolate', moduleName: CORE };
|
|
2809
|
+
Identifiers.textInterpolate1 = { name: 'ɵɵtextInterpolate1', moduleName: CORE };
|
|
2810
|
+
Identifiers.textInterpolate2 = { name: 'ɵɵtextInterpolate2', moduleName: CORE };
|
|
2811
|
+
Identifiers.textInterpolate3 = { name: 'ɵɵtextInterpolate3', moduleName: CORE };
|
|
2812
|
+
Identifiers.textInterpolate4 = { name: 'ɵɵtextInterpolate4', moduleName: CORE };
|
|
2813
|
+
Identifiers.textInterpolate5 = { name: 'ɵɵtextInterpolate5', moduleName: CORE };
|
|
2814
|
+
Identifiers.textInterpolate6 = { name: 'ɵɵtextInterpolate6', moduleName: CORE };
|
|
2815
|
+
Identifiers.textInterpolate7 = { name: 'ɵɵtextInterpolate7', moduleName: CORE };
|
|
2816
|
+
Identifiers.textInterpolate8 = { name: 'ɵɵtextInterpolate8', moduleName: CORE };
|
|
2817
|
+
Identifiers.textInterpolateV = { name: 'ɵɵtextInterpolateV', moduleName: CORE };
|
|
2818
|
+
Identifiers.restoreView = { name: 'ɵɵrestoreView', moduleName: CORE };
|
|
2819
|
+
Identifiers.pureFunction0 = { name: 'ɵɵpureFunction0', moduleName: CORE };
|
|
2820
|
+
Identifiers.pureFunction1 = { name: 'ɵɵpureFunction1', moduleName: CORE };
|
|
2821
|
+
Identifiers.pureFunction2 = { name: 'ɵɵpureFunction2', moduleName: CORE };
|
|
2822
|
+
Identifiers.pureFunction3 = { name: 'ɵɵpureFunction3', moduleName: CORE };
|
|
2823
|
+
Identifiers.pureFunction4 = { name: 'ɵɵpureFunction4', moduleName: CORE };
|
|
2824
|
+
Identifiers.pureFunction5 = { name: 'ɵɵpureFunction5', moduleName: CORE };
|
|
2825
|
+
Identifiers.pureFunction6 = { name: 'ɵɵpureFunction6', moduleName: CORE };
|
|
2826
|
+
Identifiers.pureFunction7 = { name: 'ɵɵpureFunction7', moduleName: CORE };
|
|
2827
|
+
Identifiers.pureFunction8 = { name: 'ɵɵpureFunction8', moduleName: CORE };
|
|
2828
|
+
Identifiers.pureFunctionV = { name: 'ɵɵpureFunctionV', moduleName: CORE };
|
|
2829
|
+
Identifiers.pipeBind1 = { name: 'ɵɵpipeBind1', moduleName: CORE };
|
|
2830
|
+
Identifiers.pipeBind2 = { name: 'ɵɵpipeBind2', moduleName: CORE };
|
|
2831
|
+
Identifiers.pipeBind3 = { name: 'ɵɵpipeBind3', moduleName: CORE };
|
|
2832
|
+
Identifiers.pipeBind4 = { name: 'ɵɵpipeBind4', moduleName: CORE };
|
|
2833
|
+
Identifiers.pipeBindV = { name: 'ɵɵpipeBindV', moduleName: CORE };
|
|
2834
|
+
Identifiers.hostProperty = { name: 'ɵɵhostProperty', moduleName: CORE };
|
|
2835
|
+
Identifiers.property = { name: 'ɵɵproperty', moduleName: CORE };
|
|
2836
|
+
Identifiers.propertyInterpolate = { name: 'ɵɵpropertyInterpolate', moduleName: CORE };
|
|
2837
|
+
Identifiers.propertyInterpolate1 = { name: 'ɵɵpropertyInterpolate1', moduleName: CORE };
|
|
2838
|
+
Identifiers.propertyInterpolate2 = { name: 'ɵɵpropertyInterpolate2', moduleName: CORE };
|
|
2839
|
+
Identifiers.propertyInterpolate3 = { name: 'ɵɵpropertyInterpolate3', moduleName: CORE };
|
|
2840
|
+
Identifiers.propertyInterpolate4 = { name: 'ɵɵpropertyInterpolate4', moduleName: CORE };
|
|
2841
|
+
Identifiers.propertyInterpolate5 = { name: 'ɵɵpropertyInterpolate5', moduleName: CORE };
|
|
2842
|
+
Identifiers.propertyInterpolate6 = { name: 'ɵɵpropertyInterpolate6', moduleName: CORE };
|
|
2843
|
+
Identifiers.propertyInterpolate7 = { name: 'ɵɵpropertyInterpolate7', moduleName: CORE };
|
|
2844
|
+
Identifiers.propertyInterpolate8 = { name: 'ɵɵpropertyInterpolate8', moduleName: CORE };
|
|
2845
|
+
Identifiers.propertyInterpolateV = { name: 'ɵɵpropertyInterpolateV', moduleName: CORE };
|
|
2846
|
+
Identifiers.i18n = { name: 'ɵɵi18n', moduleName: CORE };
|
|
2847
|
+
Identifiers.i18nAttributes = { name: 'ɵɵi18nAttributes', moduleName: CORE };
|
|
2848
|
+
Identifiers.i18nExp = { name: 'ɵɵi18nExp', moduleName: CORE };
|
|
2849
|
+
Identifiers.i18nStart = { name: 'ɵɵi18nStart', moduleName: CORE };
|
|
2850
|
+
Identifiers.i18nEnd = { name: 'ɵɵi18nEnd', moduleName: CORE };
|
|
2851
|
+
Identifiers.i18nApply = { name: 'ɵɵi18nApply', moduleName: CORE };
|
|
2852
|
+
Identifiers.i18nPostprocess = { name: 'ɵɵi18nPostprocess', moduleName: CORE };
|
|
2853
|
+
Identifiers.pipe = { name: 'ɵɵpipe', moduleName: CORE };
|
|
2854
|
+
Identifiers.projection = { name: 'ɵɵprojection', moduleName: CORE };
|
|
2855
|
+
Identifiers.projectionDef = { name: 'ɵɵprojectionDef', moduleName: CORE };
|
|
2856
|
+
Identifiers.reference = { name: 'ɵɵreference', moduleName: CORE };
|
|
2857
|
+
Identifiers.inject = { name: 'ɵɵinject', moduleName: CORE };
|
|
2858
|
+
Identifiers.injectAttribute = { name: 'ɵɵinjectAttribute', moduleName: CORE };
|
|
2859
|
+
Identifiers.directiveInject = { name: 'ɵɵdirectiveInject', moduleName: CORE };
|
|
2860
|
+
Identifiers.invalidFactory = { name: 'ɵɵinvalidFactory', moduleName: CORE };
|
|
2861
|
+
Identifiers.invalidFactoryDep = { name: 'ɵɵinvalidFactoryDep', moduleName: CORE };
|
|
2862
|
+
Identifiers.templateRefExtractor = { name: 'ɵɵtemplateRefExtractor', moduleName: CORE };
|
|
2863
|
+
Identifiers.forwardRef = { name: 'forwardRef', moduleName: CORE };
|
|
2864
|
+
Identifiers.resolveForwardRef = { name: 'resolveForwardRef', moduleName: CORE };
|
|
2865
|
+
Identifiers.ɵɵdefineInjectable = { name: 'ɵɵdefineInjectable', moduleName: CORE };
|
|
2866
|
+
Identifiers.declareInjectable = { name: 'ɵɵngDeclareInjectable', moduleName: CORE };
|
|
2867
|
+
Identifiers.InjectableDeclaration = { name: 'ɵɵInjectableDeclaration', moduleName: CORE };
|
|
2868
|
+
Identifiers.resolveWindow = { name: 'ɵɵresolveWindow', moduleName: CORE };
|
|
2869
|
+
Identifiers.resolveDocument = { name: 'ɵɵresolveDocument', moduleName: CORE };
|
|
2870
|
+
Identifiers.resolveBody = { name: 'ɵɵresolveBody', moduleName: CORE };
|
|
2871
|
+
Identifiers.defineComponent = { name: 'ɵɵdefineComponent', moduleName: CORE };
|
|
2872
|
+
Identifiers.declareComponent = { name: 'ɵɵngDeclareComponent', moduleName: CORE };
|
|
2873
|
+
Identifiers.setComponentScope = { name: 'ɵɵsetComponentScope', moduleName: CORE };
|
|
2874
|
+
Identifiers.ChangeDetectionStrategy = {
|
|
2875
2875
|
name: 'ChangeDetectionStrategy',
|
|
2876
|
-
moduleName: CORE
|
|
2876
|
+
moduleName: CORE,
|
|
2877
2877
|
};
|
|
2878
|
-
Identifiers
|
|
2878
|
+
Identifiers.ViewEncapsulation = {
|
|
2879
2879
|
name: 'ViewEncapsulation',
|
|
2880
|
-
moduleName: CORE
|
|
2880
|
+
moduleName: CORE,
|
|
2881
2881
|
};
|
|
2882
|
-
Identifiers
|
|
2882
|
+
Identifiers.ComponentDeclaration = {
|
|
2883
2883
|
name: 'ɵɵComponentDeclaration',
|
|
2884
|
-
moduleName: CORE
|
|
2884
|
+
moduleName: CORE,
|
|
2885
2885
|
};
|
|
2886
|
-
Identifiers
|
|
2886
|
+
Identifiers.FactoryDeclaration = {
|
|
2887
2887
|
name: 'ɵɵFactoryDeclaration',
|
|
2888
|
-
moduleName: CORE
|
|
2888
|
+
moduleName: CORE,
|
|
2889
2889
|
};
|
|
2890
|
-
Identifiers
|
|
2891
|
-
Identifiers
|
|
2892
|
-
Identifiers
|
|
2893
|
-
Identifiers
|
|
2894
|
-
Identifiers
|
|
2890
|
+
Identifiers.declareFactory = { name: 'ɵɵngDeclareFactory', moduleName: CORE };
|
|
2891
|
+
Identifiers.FactoryTarget = { name: 'ɵɵFactoryTarget', moduleName: CORE };
|
|
2892
|
+
Identifiers.defineDirective = { name: 'ɵɵdefineDirective', moduleName: CORE };
|
|
2893
|
+
Identifiers.declareDirective = { name: 'ɵɵngDeclareDirective', moduleName: CORE };
|
|
2894
|
+
Identifiers.DirectiveDeclaration = {
|
|
2895
2895
|
name: 'ɵɵDirectiveDeclaration',
|
|
2896
|
-
moduleName: CORE
|
|
2896
|
+
moduleName: CORE,
|
|
2897
2897
|
};
|
|
2898
|
-
Identifiers
|
|
2899
|
-
Identifiers
|
|
2900
|
-
Identifiers
|
|
2901
|
-
Identifiers
|
|
2902
|
-
Identifiers
|
|
2898
|
+
Identifiers.InjectorDef = { name: 'ɵɵInjectorDef', moduleName: CORE };
|
|
2899
|
+
Identifiers.InjectorDeclaration = { name: 'ɵɵInjectorDeclaration', moduleName: CORE };
|
|
2900
|
+
Identifiers.defineInjector = { name: 'ɵɵdefineInjector', moduleName: CORE };
|
|
2901
|
+
Identifiers.declareInjector = { name: 'ɵɵngDeclareInjector', moduleName: CORE };
|
|
2902
|
+
Identifiers.NgModuleDeclaration = {
|
|
2903
2903
|
name: 'ɵɵNgModuleDeclaration',
|
|
2904
|
-
moduleName: CORE
|
|
2904
|
+
moduleName: CORE,
|
|
2905
2905
|
};
|
|
2906
|
-
Identifiers
|
|
2906
|
+
Identifiers.ModuleWithProviders = {
|
|
2907
2907
|
name: 'ModuleWithProviders',
|
|
2908
|
-
moduleName: CORE
|
|
2908
|
+
moduleName: CORE,
|
|
2909
2909
|
};
|
|
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
|
|
2910
|
+
Identifiers.defineNgModule = { name: 'ɵɵdefineNgModule', moduleName: CORE };
|
|
2911
|
+
Identifiers.declareNgModule = { name: 'ɵɵngDeclareNgModule', moduleName: CORE };
|
|
2912
|
+
Identifiers.setNgModuleScope = { name: 'ɵɵsetNgModuleScope', moduleName: CORE };
|
|
2913
|
+
Identifiers.PipeDeclaration = { name: 'ɵɵPipeDeclaration', moduleName: CORE };
|
|
2914
|
+
Identifiers.definePipe = { name: 'ɵɵdefinePipe', moduleName: CORE };
|
|
2915
|
+
Identifiers.declarePipe = { name: 'ɵɵngDeclarePipe', moduleName: CORE };
|
|
2916
|
+
Identifiers.declareClassMetadata = { name: 'ɵɵngDeclareClassMetadata', moduleName: CORE };
|
|
2917
|
+
Identifiers.setClassMetadata = { name: 'ɵsetClassMetadata', moduleName: CORE };
|
|
2918
|
+
Identifiers.queryRefresh = { name: 'ɵɵqueryRefresh', moduleName: CORE };
|
|
2919
|
+
Identifiers.viewQuery = { name: 'ɵɵviewQuery', moduleName: CORE };
|
|
2920
|
+
Identifiers.loadQuery = { name: 'ɵɵloadQuery', moduleName: CORE };
|
|
2921
|
+
Identifiers.contentQuery = { name: 'ɵɵcontentQuery', moduleName: CORE };
|
|
2922
|
+
Identifiers.NgOnChangesFeature = { name: 'ɵɵNgOnChangesFeature', moduleName: CORE };
|
|
2923
|
+
Identifiers.InheritDefinitionFeature = { name: 'ɵɵInheritDefinitionFeature', moduleName: CORE };
|
|
2924
|
+
Identifiers.CopyDefinitionFeature = { name: 'ɵɵCopyDefinitionFeature', moduleName: CORE };
|
|
2925
|
+
Identifiers.ProvidersFeature = { name: 'ɵɵProvidersFeature', moduleName: CORE };
|
|
2926
|
+
Identifiers.listener = { name: 'ɵɵlistener', moduleName: CORE };
|
|
2927
|
+
Identifiers.getInheritedFactory = {
|
|
2928
2928
|
name: 'ɵɵgetInheritedFactory',
|
|
2929
|
-
moduleName: CORE
|
|
2929
|
+
moduleName: CORE,
|
|
2930
2930
|
};
|
|
2931
2931
|
// sanitization-related functions
|
|
2932
|
-
Identifiers
|
|
2933
|
-
Identifiers
|
|
2934
|
-
Identifiers
|
|
2935
|
-
Identifiers
|
|
2936
|
-
Identifiers
|
|
2937
|
-
Identifiers
|
|
2938
|
-
Identifiers
|
|
2939
|
-
Identifiers
|
|
2932
|
+
Identifiers.sanitizeHtml = { name: 'ɵɵsanitizeHtml', moduleName: CORE };
|
|
2933
|
+
Identifiers.sanitizeStyle = { name: 'ɵɵsanitizeStyle', moduleName: CORE };
|
|
2934
|
+
Identifiers.sanitizeResourceUrl = { name: 'ɵɵsanitizeResourceUrl', moduleName: CORE };
|
|
2935
|
+
Identifiers.sanitizeScript = { name: 'ɵɵsanitizeScript', moduleName: CORE };
|
|
2936
|
+
Identifiers.sanitizeUrl = { name: 'ɵɵsanitizeUrl', moduleName: CORE };
|
|
2937
|
+
Identifiers.sanitizeUrlOrResourceUrl = { name: 'ɵɵsanitizeUrlOrResourceUrl', moduleName: CORE };
|
|
2938
|
+
Identifiers.trustConstantHtml = { name: 'ɵɵtrustConstantHtml', moduleName: CORE };
|
|
2939
|
+
Identifiers.trustConstantResourceUrl = { name: 'ɵɵtrustConstantResourceUrl', moduleName: CORE };
|
|
2940
2940
|
|
|
2941
2941
|
/**
|
|
2942
2942
|
* @license
|
|
@@ -3678,7 +3678,7 @@ function convertFromMaybeForwardRefExpression({ expression, forwardRef }) {
|
|
|
3678
3678
|
* ```
|
|
3679
3679
|
*/
|
|
3680
3680
|
function generateForwardRef(expr) {
|
|
3681
|
-
return importExpr(Identifiers
|
|
3681
|
+
return importExpr(Identifiers.forwardRef).callFn([fn([], [new ReturnStatement(expr)])]);
|
|
3682
3682
|
}
|
|
3683
3683
|
|
|
3684
3684
|
var R3FactoryDelegateType;
|
|
@@ -3726,7 +3726,7 @@ function compileFactoryFunction(meta) {
|
|
|
3726
3726
|
const r = variable('r');
|
|
3727
3727
|
body.push(r.set(NULL_EXPR).toDeclStmt());
|
|
3728
3728
|
const ctorStmt = ctorExpr !== null ? r.set(ctorExpr).toStmt() :
|
|
3729
|
-
importExpr(Identifiers
|
|
3729
|
+
importExpr(Identifiers.invalidFactory).callFn([]).toStmt();
|
|
3730
3730
|
body.push(ifStmt(t, [ctorStmt], [r.set(nonCtorExpr).toStmt()]));
|
|
3731
3731
|
return r;
|
|
3732
3732
|
}
|
|
@@ -3749,11 +3749,11 @@ function compileFactoryFunction(meta) {
|
|
|
3749
3749
|
}
|
|
3750
3750
|
if (retExpr === null) {
|
|
3751
3751
|
// The expression cannot be formed so render an `ɵɵinvalidFactory()` call.
|
|
3752
|
-
body.push(importExpr(Identifiers
|
|
3752
|
+
body.push(importExpr(Identifiers.invalidFactory).callFn([]).toStmt());
|
|
3753
3753
|
}
|
|
3754
3754
|
else if (baseFactoryVar !== null) {
|
|
3755
3755
|
// This factory uses a base factory, so call `ɵɵgetInheritedFactory()` to compute it.
|
|
3756
|
-
const getInheritedFactoryCall = importExpr(Identifiers
|
|
3756
|
+
const getInheritedFactoryCall = importExpr(Identifiers.getInheritedFactory).callFn([meta.internalType]);
|
|
3757
3757
|
// Memoize the base factoryFn: `baseFactory || (baseFactory = ɵɵgetInheritedFactory(...))`
|
|
3758
3758
|
const baseFactory = new BinaryOperatorExpr(BinaryOperator.Or, baseFactoryVar, baseFactoryVar.set(getInheritedFactoryCall));
|
|
3759
3759
|
body.push(new ReturnStatement(baseFactory.callFn([typeForCtor])));
|
|
@@ -3778,7 +3778,7 @@ function compileFactoryFunction(meta) {
|
|
|
3778
3778
|
}
|
|
3779
3779
|
function createFactoryType(meta) {
|
|
3780
3780
|
const ctorDepsType = meta.deps !== null && meta.deps !== 'invalid' ? createCtorDepsType(meta.deps) : NONE_TYPE;
|
|
3781
|
-
return expressionType(importExpr(Identifiers
|
|
3781
|
+
return expressionType(importExpr(Identifiers.FactoryDeclaration, [typeWithParameters(meta.type.type, meta.typeArgumentCount), ctorDepsType]));
|
|
3782
3782
|
}
|
|
3783
3783
|
function injectDependencies(deps, target) {
|
|
3784
3784
|
return deps.map((dep, index) => compileInjectDependency(dep, target, index));
|
|
@@ -3786,7 +3786,7 @@ function injectDependencies(deps, target) {
|
|
|
3786
3786
|
function compileInjectDependency(dep, target, index) {
|
|
3787
3787
|
// Interpret the dependency according to its resolved type.
|
|
3788
3788
|
if (dep.token === null) {
|
|
3789
|
-
return importExpr(Identifiers
|
|
3789
|
+
return importExpr(Identifiers.invalidFactoryDep).callFn([literal(index)]);
|
|
3790
3790
|
}
|
|
3791
3791
|
else if (dep.attributeNameType === null) {
|
|
3792
3792
|
// Build up the injection flags according to the metadata.
|
|
@@ -3814,7 +3814,7 @@ function compileInjectDependency(dep, target, index) {
|
|
|
3814
3814
|
//
|
|
3815
3815
|
// The `dep.attributeTypeName` is only actually used (in `createCtorDepType()`) to generate
|
|
3816
3816
|
// typings.
|
|
3817
|
-
return importExpr(Identifiers
|
|
3817
|
+
return importExpr(Identifiers.injectAttribute).callFn([dep.token]);
|
|
3818
3818
|
}
|
|
3819
3819
|
}
|
|
3820
3820
|
function createCtorDepsType(deps) {
|
|
@@ -3866,11 +3866,11 @@ function getInjectFn(target) {
|
|
|
3866
3866
|
case FactoryTarget$1.Component:
|
|
3867
3867
|
case FactoryTarget$1.Directive:
|
|
3868
3868
|
case FactoryTarget$1.Pipe:
|
|
3869
|
-
return Identifiers
|
|
3869
|
+
return Identifiers.directiveInject;
|
|
3870
3870
|
case FactoryTarget$1.NgModule:
|
|
3871
3871
|
case FactoryTarget$1.Injectable:
|
|
3872
3872
|
default:
|
|
3873
|
-
return Identifiers
|
|
3873
|
+
return Identifiers.inject;
|
|
3874
3874
|
}
|
|
3875
3875
|
}
|
|
3876
3876
|
|
|
@@ -4966,7 +4966,7 @@ function getQueryPredicate(query, constantPool) {
|
|
|
4966
4966
|
case 2 /* Unwrapped */:
|
|
4967
4967
|
return query.predicate.expression;
|
|
4968
4968
|
case 1 /* Wrapped */:
|
|
4969
|
-
return importExpr(Identifiers
|
|
4969
|
+
return importExpr(Identifiers.resolveForwardRef).callFn([query.predicate.expression]);
|
|
4970
4970
|
}
|
|
4971
4971
|
}
|
|
4972
4972
|
}
|
|
@@ -5111,7 +5111,7 @@ function compileInjectable(meta, resolveForwardRefs) {
|
|
|
5111
5111
|
}
|
|
5112
5112
|
else if (meta.useExisting !== undefined) {
|
|
5113
5113
|
// useExisting is an `inject` call on the existing token.
|
|
5114
|
-
result = compileFactoryFunction(Object.assign(Object.assign({}, factoryMeta), { expression: importExpr(Identifiers
|
|
5114
|
+
result = compileFactoryFunction(Object.assign(Object.assign({}, factoryMeta), { expression: importExpr(Identifiers.inject).callFn([meta.useExisting.expression]) }));
|
|
5115
5115
|
}
|
|
5116
5116
|
else {
|
|
5117
5117
|
result = {
|
|
@@ -5127,7 +5127,7 @@ function compileInjectable(meta, resolveForwardRefs) {
|
|
|
5127
5127
|
if (meta.providedIn.expression.value !== null) {
|
|
5128
5128
|
injectableProps.set('providedIn', convertFromMaybeForwardRefExpression(meta.providedIn));
|
|
5129
5129
|
}
|
|
5130
|
-
const expression = importExpr(Identifiers
|
|
5130
|
+
const expression = importExpr(Identifiers.ɵɵdefineInjectable)
|
|
5131
5131
|
.callFn([injectableProps.toLiteralMap()], undefined, true);
|
|
5132
5132
|
return {
|
|
5133
5133
|
expression,
|
|
@@ -5136,7 +5136,7 @@ function compileInjectable(meta, resolveForwardRefs) {
|
|
|
5136
5136
|
};
|
|
5137
5137
|
}
|
|
5138
5138
|
function createInjectableType(meta) {
|
|
5139
|
-
return new ExpressionType(importExpr(Identifiers
|
|
5139
|
+
return new ExpressionType(importExpr(Identifiers.InjectableDeclaration, [typeWithParameters(meta.type.type, meta.typeArgumentCount)]));
|
|
5140
5140
|
}
|
|
5141
5141
|
function delegateToFactory(type, internalType, unwrapForwardRefs) {
|
|
5142
5142
|
if (type.node === internalType.node) {
|
|
@@ -5159,7 +5159,7 @@ function delegateToFactory(type, internalType, unwrapForwardRefs) {
|
|
|
5159
5159
|
// ```
|
|
5160
5160
|
// factory: function(t) { return core.resolveForwardRef(type).ɵfac(t); }
|
|
5161
5161
|
// ```
|
|
5162
|
-
const unwrappedType = importExpr(Identifiers
|
|
5162
|
+
const unwrappedType = importExpr(Identifiers.resolveForwardRef).callFn([internalType]);
|
|
5163
5163
|
return createFactoryFunction(unwrappedType);
|
|
5164
5164
|
}
|
|
5165
5165
|
function createFactoryFunction(type) {
|
|
@@ -5848,12 +5848,12 @@ function compileInjector(meta) {
|
|
|
5848
5848
|
if (meta.imports.length > 0) {
|
|
5849
5849
|
definitionMap.set('imports', literalArr(meta.imports));
|
|
5850
5850
|
}
|
|
5851
|
-
const expression = importExpr(Identifiers
|
|
5851
|
+
const expression = importExpr(Identifiers.defineInjector).callFn([definitionMap.toLiteralMap()], undefined, true);
|
|
5852
5852
|
const type = createInjectorType(meta);
|
|
5853
5853
|
return { expression, type, statements: [] };
|
|
5854
5854
|
}
|
|
5855
5855
|
function createInjectorType(meta) {
|
|
5856
|
-
return new ExpressionType(importExpr(Identifiers
|
|
5856
|
+
return new ExpressionType(importExpr(Identifiers.InjectorDeclaration, [new ExpressionType(meta.type.type)]));
|
|
5857
5857
|
}
|
|
5858
5858
|
|
|
5859
5859
|
/**
|
|
@@ -5930,7 +5930,7 @@ function compileNgModule(meta) {
|
|
|
5930
5930
|
if (id !== null) {
|
|
5931
5931
|
definitionMap.set('id', id);
|
|
5932
5932
|
}
|
|
5933
|
-
const expression = importExpr(Identifiers
|
|
5933
|
+
const expression = importExpr(Identifiers.defineNgModule).callFn([definitionMap.toLiteralMap()], undefined, true);
|
|
5934
5934
|
const type = createNgModuleType(meta);
|
|
5935
5935
|
return { expression, type, statements };
|
|
5936
5936
|
}
|
|
@@ -5959,10 +5959,10 @@ function compileNgModuleDeclarationExpression(meta) {
|
|
|
5959
5959
|
if (meta.id !== undefined) {
|
|
5960
5960
|
definitionMap.set('id', new WrappedNodeExpr(meta.id));
|
|
5961
5961
|
}
|
|
5962
|
-
return importExpr(Identifiers
|
|
5962
|
+
return importExpr(Identifiers.defineNgModule).callFn([definitionMap.toLiteralMap()]);
|
|
5963
5963
|
}
|
|
5964
5964
|
function createNgModuleType({ type: moduleType, declarations, imports, exports }) {
|
|
5965
|
-
return new ExpressionType(importExpr(Identifiers
|
|
5965
|
+
return new ExpressionType(importExpr(Identifiers.NgModuleDeclaration, [
|
|
5966
5966
|
new ExpressionType(moduleType.type), tupleTypeOf(declarations), tupleTypeOf(imports),
|
|
5967
5967
|
tupleTypeOf(exports)
|
|
5968
5968
|
]));
|
|
@@ -5990,7 +5990,7 @@ function generateSetNgModuleScopeCall(meta) {
|
|
|
5990
5990
|
}
|
|
5991
5991
|
// setNgModuleScope(...)
|
|
5992
5992
|
const fnCall = new InvokeFunctionExpr(
|
|
5993
|
-
/* fn */ importExpr(Identifiers
|
|
5993
|
+
/* fn */ importExpr(Identifiers.setNgModuleScope),
|
|
5994
5994
|
/* args */ [moduleType, scopeMap.toLiteralMap()]);
|
|
5995
5995
|
// (ngJitMode guard) && setNgModuleScope(...)
|
|
5996
5996
|
const guardedCall = jitOnlyGuardedExpression(fnCall);
|
|
@@ -6024,12 +6024,12 @@ function compilePipeFromMetadata(metadata) {
|
|
|
6024
6024
|
definitionMapValues.push({ key: 'type', value: metadata.type.value, quoted: false });
|
|
6025
6025
|
// e.g. `pure: true`
|
|
6026
6026
|
definitionMapValues.push({ key: 'pure', value: literal(metadata.pure), quoted: false });
|
|
6027
|
-
const expression = importExpr(Identifiers
|
|
6027
|
+
const expression = importExpr(Identifiers.definePipe).callFn([literalMap(definitionMapValues)], undefined, true);
|
|
6028
6028
|
const type = createPipeType(metadata);
|
|
6029
6029
|
return { expression, type, statements: [] };
|
|
6030
6030
|
}
|
|
6031
6031
|
function createPipeType(metadata) {
|
|
6032
|
-
return new ExpressionType(importExpr(Identifiers
|
|
6032
|
+
return new ExpressionType(importExpr(Identifiers.PipeDeclaration, [
|
|
6033
6033
|
typeWithParameters(metadata.type.type, metadata.typeArgumentCount),
|
|
6034
6034
|
new ExpressionType(new LiteralExpr(metadata.pipeName)),
|
|
6035
6035
|
]));
|
|
@@ -6078,33 +6078,6 @@ class ASTWithName extends AST {
|
|
|
6078
6078
|
this.nameSpan = nameSpan;
|
|
6079
6079
|
}
|
|
6080
6080
|
}
|
|
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
6081
|
class EmptyExpr extends AST {
|
|
6109
6082
|
visit(visitor, context = null) {
|
|
6110
6083
|
// do nothing
|
|
@@ -6485,7 +6458,6 @@ class RecursiveAstVisitor {
|
|
|
6485
6458
|
this.visit(ast.receiver, context);
|
|
6486
6459
|
this.visitAll(ast.args, context);
|
|
6487
6460
|
}
|
|
6488
|
-
visitQuote(ast, context) { }
|
|
6489
6461
|
// This is not part of the AstVisitor interface, just a helper method
|
|
6490
6462
|
visitAll(asts, context) {
|
|
6491
6463
|
for (const ast of asts) {
|
|
@@ -6568,9 +6540,6 @@ class AstTransformer {
|
|
|
6568
6540
|
visitChain(ast, context) {
|
|
6569
6541
|
return new Chain(ast.span, ast.sourceSpan, this.visitAll(ast.expressions));
|
|
6570
6542
|
}
|
|
6571
|
-
visitQuote(ast, context) {
|
|
6572
|
-
return new Quote(ast.span, ast.sourceSpan, ast.prefix, ast.uninterpretedExpression, ast.location);
|
|
6573
|
-
}
|
|
6574
6543
|
visitSafeKeyedRead(ast, context) {
|
|
6575
6544
|
return new SafeKeyedRead(ast.span, ast.sourceSpan, ast.receiver.visit(this), ast.key.visit(this));
|
|
6576
6545
|
}
|
|
@@ -6733,9 +6702,6 @@ class AstMemoryEfficientTransformer {
|
|
|
6733
6702
|
}
|
|
6734
6703
|
return ast;
|
|
6735
6704
|
}
|
|
6736
|
-
visitQuote(ast, context) {
|
|
6737
|
-
return ast;
|
|
6738
|
-
}
|
|
6739
6705
|
visitSafeKeyedRead(ast, context) {
|
|
6740
6706
|
const obj = ast.receiver.visit(this);
|
|
6741
6707
|
const key = ast.key.visit(this);
|
|
@@ -6802,98 +6768,6 @@ class BoundElementProperty {
|
|
|
6802
6768
|
}
|
|
6803
6769
|
}
|
|
6804
6770
|
|
|
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
6771
|
/**
|
|
6898
6772
|
* @license
|
|
6899
6773
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -6908,7 +6782,7 @@ EventHandlerVars.event = variable('$event');
|
|
|
6908
6782
|
* Converts the given expression AST into an executable output AST, assuming the expression is
|
|
6909
6783
|
* used in an action binding (e.g. an event handler).
|
|
6910
6784
|
*/
|
|
6911
|
-
function convertActionBinding(localResolver, implicitReceiver, action, bindingId,
|
|
6785
|
+
function convertActionBinding(localResolver, implicitReceiver, action, bindingId, baseSourceSpan, implicitReceiverAccesses, globals) {
|
|
6912
6786
|
if (!localResolver) {
|
|
6913
6787
|
localResolver = new DefaultLocalResolver(globals);
|
|
6914
6788
|
}
|
|
@@ -6932,7 +6806,7 @@ function convertActionBinding(localResolver, implicitReceiver, action, bindingId
|
|
|
6932
6806
|
throw new Error(`Illegal State: Actions are not allowed to contain pipes. Pipe: ${name}`);
|
|
6933
6807
|
}
|
|
6934
6808
|
}, action);
|
|
6935
|
-
const visitor = new _AstToIrVisitor(localResolver, implicitReceiver, bindingId,
|
|
6809
|
+
const visitor = new _AstToIrVisitor(localResolver, implicitReceiver, bindingId, /* supportsInterpolation */ false, baseSourceSpan, implicitReceiverAccesses);
|
|
6936
6810
|
const actionStmts = [];
|
|
6937
6811
|
flattenStatements(actionWithoutBuiltins.visit(visitor, _Mode.Statement), actionStmts);
|
|
6938
6812
|
prependTemporaryDecls(visitor.temporaryCount, bindingId, actionStmts);
|
|
@@ -6963,11 +6837,11 @@ class ConvertPropertyBindingResult {
|
|
|
6963
6837
|
* is used in property binding. The expression has to be preprocessed via
|
|
6964
6838
|
* `convertPropertyBindingBuiltins`.
|
|
6965
6839
|
*/
|
|
6966
|
-
function convertPropertyBinding(localResolver, implicitReceiver, expressionWithoutBuiltins, bindingId
|
|
6840
|
+
function convertPropertyBinding(localResolver, implicitReceiver, expressionWithoutBuiltins, bindingId) {
|
|
6967
6841
|
if (!localResolver) {
|
|
6968
6842
|
localResolver = new DefaultLocalResolver();
|
|
6969
6843
|
}
|
|
6970
|
-
const visitor = new _AstToIrVisitor(localResolver, implicitReceiver, bindingId,
|
|
6844
|
+
const visitor = new _AstToIrVisitor(localResolver, implicitReceiver, bindingId, /* supportsInterpolation */ false);
|
|
6971
6845
|
const outputExpr = expressionWithoutBuiltins.visit(visitor, _Mode.Expression);
|
|
6972
6846
|
const stmts = getStatementsFromVisitor(visitor, bindingId);
|
|
6973
6847
|
if (visitor.usesImplicitReceiver) {
|
|
@@ -6992,28 +6866,13 @@ function convertPropertyBinding(localResolver, implicitReceiver, expressionWitho
|
|
|
6992
6866
|
* `o.importExpr(R3.propertyInterpolate).callFn(result)`
|
|
6993
6867
|
*/
|
|
6994
6868
|
function convertUpdateArguments(localResolver, contextVariableExpression, expressionWithArgumentsToExtract, bindingId) {
|
|
6995
|
-
const visitor = new _AstToIrVisitor(localResolver, contextVariableExpression, bindingId,
|
|
6996
|
-
const outputExpr =
|
|
6869
|
+
const visitor = new _AstToIrVisitor(localResolver, contextVariableExpression, bindingId, /* supportsInterpolation */ true);
|
|
6870
|
+
const outputExpr = visitor.visitInterpolation(expressionWithArgumentsToExtract, _Mode.Expression);
|
|
6997
6871
|
if (visitor.usesImplicitReceiver) {
|
|
6998
6872
|
localResolver.notifyImplicitReceiverUse();
|
|
6999
6873
|
}
|
|
7000
6874
|
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
|
-
}
|
|
6875
|
+
const args = outputExpr.args;
|
|
7017
6876
|
return { stmts, args };
|
|
7018
6877
|
}
|
|
7019
6878
|
function getStatementsFromVisitor(visitor, bindingId) {
|
|
@@ -7080,11 +6939,11 @@ class _BuiltinAstConverter extends AstTransformer {
|
|
|
7080
6939
|
}
|
|
7081
6940
|
}
|
|
7082
6941
|
class _AstToIrVisitor {
|
|
7083
|
-
constructor(_localResolver, _implicitReceiver, bindingId,
|
|
6942
|
+
constructor(_localResolver, _implicitReceiver, bindingId, supportsInterpolation, baseSourceSpan, implicitReceiverAccesses) {
|
|
7084
6943
|
this._localResolver = _localResolver;
|
|
7085
6944
|
this._implicitReceiver = _implicitReceiver;
|
|
7086
6945
|
this.bindingId = bindingId;
|
|
7087
|
-
this.
|
|
6946
|
+
this.supportsInterpolation = supportsInterpolation;
|
|
7088
6947
|
this.baseSourceSpan = baseSourceSpan;
|
|
7089
6948
|
this.implicitReceiverAccesses = implicitReceiverAccesses;
|
|
7090
6949
|
this._nodeMap = new Map();
|
|
@@ -7182,21 +7041,29 @@ class _AstToIrVisitor {
|
|
|
7182
7041
|
return this.visitImplicitReceiver(ast, mode);
|
|
7183
7042
|
}
|
|
7184
7043
|
visitInterpolation(ast, mode) {
|
|
7044
|
+
if (!this.supportsInterpolation) {
|
|
7045
|
+
throw new Error('Unexpected interpolation');
|
|
7046
|
+
}
|
|
7185
7047
|
ensureExpressionMode(mode, ast);
|
|
7186
|
-
|
|
7048
|
+
let args = [];
|
|
7187
7049
|
for (let i = 0; i < ast.strings.length - 1; i++) {
|
|
7188
7050
|
args.push(literal(ast.strings[i]));
|
|
7189
7051
|
args.push(this._visit(ast.expressions[i], _Mode.Expression));
|
|
7190
7052
|
}
|
|
7191
7053
|
args.push(literal(ast.strings[ast.strings.length - 1]));
|
|
7192
|
-
|
|
7193
|
-
|
|
7054
|
+
// If we're dealing with an interpolation of 1 value with an empty prefix and suffix, reduce the
|
|
7055
|
+
// args returned to just the value, because we're going to pass it to a special instruction.
|
|
7056
|
+
const strings = ast.strings;
|
|
7057
|
+
if (strings.length === 2 && strings[0] === '' && strings[1] === '') {
|
|
7058
|
+
// Single argument interpolate instructions.
|
|
7059
|
+
args = [args[1]];
|
|
7060
|
+
}
|
|
7061
|
+
else if (ast.expressions.length >= 9) {
|
|
7062
|
+
// 9 or more arguments must be passed to the `interpolateV`-style instructions, which accept
|
|
7063
|
+
// an array of arguments
|
|
7064
|
+
args = [literalArr(args)];
|
|
7194
7065
|
}
|
|
7195
|
-
return
|
|
7196
|
-
importExpr(Identifiers.inlineInterpolate).callFn(args) :
|
|
7197
|
-
importExpr(Identifiers.interpolate).callFn([
|
|
7198
|
-
args[0], literalArr(args.slice(1), undefined, this.convertSourceSpan(ast.span))
|
|
7199
|
-
]);
|
|
7066
|
+
return new InterpolationExpression(args);
|
|
7200
7067
|
}
|
|
7201
7068
|
visitKeyedRead(ast, mode) {
|
|
7202
7069
|
const leftMostSafe = this.leftMostSafeNode(ast);
|
|
@@ -7308,10 +7175,6 @@ class _AstToIrVisitor {
|
|
|
7308
7175
|
visitAll(asts, mode) {
|
|
7309
7176
|
return asts.map(ast => this._visit(ast, mode));
|
|
7310
7177
|
}
|
|
7311
|
-
visitQuote(ast, mode) {
|
|
7312
|
-
throw new Error(`Quotes are not supported for evaluation!
|
|
7313
|
-
Statement: ${ast.uninterpretedExpression} located at ${ast.location}`);
|
|
7314
|
-
}
|
|
7315
7178
|
visitCall(ast, mode) {
|
|
7316
7179
|
const leftMostSafe = this.leftMostSafeNode(ast);
|
|
7317
7180
|
if (leftMostSafe) {
|
|
@@ -7497,9 +7360,6 @@ class _AstToIrVisitor {
|
|
|
7497
7360
|
visitPropertyWrite(ast) {
|
|
7498
7361
|
return null;
|
|
7499
7362
|
},
|
|
7500
|
-
visitQuote(ast) {
|
|
7501
|
-
return null;
|
|
7502
|
-
},
|
|
7503
7363
|
visitSafePropertyRead(ast) {
|
|
7504
7364
|
return visit(this, ast.receiver) || ast;
|
|
7505
7365
|
},
|
|
@@ -7576,9 +7436,6 @@ class _AstToIrVisitor {
|
|
|
7576
7436
|
visitPropertyWrite(ast) {
|
|
7577
7437
|
return false;
|
|
7578
7438
|
},
|
|
7579
|
-
visitQuote(ast) {
|
|
7580
|
-
return false;
|
|
7581
|
-
},
|
|
7582
7439
|
visitSafePropertyRead(ast) {
|
|
7583
7440
|
return false;
|
|
7584
7441
|
},
|
|
@@ -7635,6 +7492,18 @@ function flattenStatements(arg, output) {
|
|
|
7635
7492
|
output.push(arg);
|
|
7636
7493
|
}
|
|
7637
7494
|
}
|
|
7495
|
+
function unsupported() {
|
|
7496
|
+
throw new Error('Unsupported operation');
|
|
7497
|
+
}
|
|
7498
|
+
class InterpolationExpression extends Expression {
|
|
7499
|
+
constructor(args) {
|
|
7500
|
+
super(null, null);
|
|
7501
|
+
this.args = args;
|
|
7502
|
+
this.isConstant = unsupported;
|
|
7503
|
+
this.isEquivalent = unsupported;
|
|
7504
|
+
this.visitExpression = unsupported;
|
|
7505
|
+
}
|
|
7506
|
+
}
|
|
7638
7507
|
class DefaultLocalResolver {
|
|
7639
7508
|
constructor(globals) {
|
|
7640
7509
|
this.globals = globals;
|
|
@@ -8803,7 +8672,7 @@ class StylingBuilder {
|
|
|
8803
8672
|
getStyleMapInterpolationExpression(mapValue);
|
|
8804
8673
|
}
|
|
8805
8674
|
else {
|
|
8806
|
-
reference = isClassBased ? Identifiers
|
|
8675
|
+
reference = isClassBased ? Identifiers.classMap : Identifiers.styleMap;
|
|
8807
8676
|
}
|
|
8808
8677
|
return {
|
|
8809
8678
|
reference,
|
|
@@ -8877,13 +8746,13 @@ class StylingBuilder {
|
|
|
8877
8746
|
}
|
|
8878
8747
|
_buildClassInputs(valueConverter) {
|
|
8879
8748
|
if (this._singleClassInputs) {
|
|
8880
|
-
return this._buildSingleInputs(Identifiers
|
|
8749
|
+
return this._buildSingleInputs(Identifiers.classProp, this._singleClassInputs, valueConverter, null, true);
|
|
8881
8750
|
}
|
|
8882
8751
|
return [];
|
|
8883
8752
|
}
|
|
8884
8753
|
_buildStyleInputs(valueConverter) {
|
|
8885
8754
|
if (this._singleStyleInputs) {
|
|
8886
|
-
return this._buildSingleInputs(Identifiers
|
|
8755
|
+
return this._buildSingleInputs(Identifiers.styleProp, this._singleStyleInputs, valueConverter, getStylePropInterpolationExpression, false);
|
|
8887
8756
|
}
|
|
8888
8757
|
return [];
|
|
8889
8758
|
}
|
|
@@ -8936,25 +8805,25 @@ function parseProperty(name) {
|
|
|
8936
8805
|
function getClassMapInterpolationExpression(interpolation) {
|
|
8937
8806
|
switch (getInterpolationArgsLength(interpolation)) {
|
|
8938
8807
|
case 1:
|
|
8939
|
-
return Identifiers
|
|
8808
|
+
return Identifiers.classMap;
|
|
8940
8809
|
case 3:
|
|
8941
|
-
return Identifiers
|
|
8810
|
+
return Identifiers.classMapInterpolate1;
|
|
8942
8811
|
case 5:
|
|
8943
|
-
return Identifiers
|
|
8812
|
+
return Identifiers.classMapInterpolate2;
|
|
8944
8813
|
case 7:
|
|
8945
|
-
return Identifiers
|
|
8814
|
+
return Identifiers.classMapInterpolate3;
|
|
8946
8815
|
case 9:
|
|
8947
|
-
return Identifiers
|
|
8816
|
+
return Identifiers.classMapInterpolate4;
|
|
8948
8817
|
case 11:
|
|
8949
|
-
return Identifiers
|
|
8818
|
+
return Identifiers.classMapInterpolate5;
|
|
8950
8819
|
case 13:
|
|
8951
|
-
return Identifiers
|
|
8820
|
+
return Identifiers.classMapInterpolate6;
|
|
8952
8821
|
case 15:
|
|
8953
|
-
return Identifiers
|
|
8822
|
+
return Identifiers.classMapInterpolate7;
|
|
8954
8823
|
case 17:
|
|
8955
|
-
return Identifiers
|
|
8824
|
+
return Identifiers.classMapInterpolate8;
|
|
8956
8825
|
default:
|
|
8957
|
-
return Identifiers
|
|
8826
|
+
return Identifiers.classMapInterpolateV;
|
|
8958
8827
|
}
|
|
8959
8828
|
}
|
|
8960
8829
|
/**
|
|
@@ -8964,25 +8833,25 @@ function getClassMapInterpolationExpression(interpolation) {
|
|
|
8964
8833
|
function getStyleMapInterpolationExpression(interpolation) {
|
|
8965
8834
|
switch (getInterpolationArgsLength(interpolation)) {
|
|
8966
8835
|
case 1:
|
|
8967
|
-
return Identifiers
|
|
8836
|
+
return Identifiers.styleMap;
|
|
8968
8837
|
case 3:
|
|
8969
|
-
return Identifiers
|
|
8838
|
+
return Identifiers.styleMapInterpolate1;
|
|
8970
8839
|
case 5:
|
|
8971
|
-
return Identifiers
|
|
8840
|
+
return Identifiers.styleMapInterpolate2;
|
|
8972
8841
|
case 7:
|
|
8973
|
-
return Identifiers
|
|
8842
|
+
return Identifiers.styleMapInterpolate3;
|
|
8974
8843
|
case 9:
|
|
8975
|
-
return Identifiers
|
|
8844
|
+
return Identifiers.styleMapInterpolate4;
|
|
8976
8845
|
case 11:
|
|
8977
|
-
return Identifiers
|
|
8846
|
+
return Identifiers.styleMapInterpolate5;
|
|
8978
8847
|
case 13:
|
|
8979
|
-
return Identifiers
|
|
8848
|
+
return Identifiers.styleMapInterpolate6;
|
|
8980
8849
|
case 15:
|
|
8981
|
-
return Identifiers
|
|
8850
|
+
return Identifiers.styleMapInterpolate7;
|
|
8982
8851
|
case 17:
|
|
8983
|
-
return Identifiers
|
|
8852
|
+
return Identifiers.styleMapInterpolate8;
|
|
8984
8853
|
default:
|
|
8985
|
-
return Identifiers
|
|
8854
|
+
return Identifiers.styleMapInterpolateV;
|
|
8986
8855
|
}
|
|
8987
8856
|
}
|
|
8988
8857
|
/**
|
|
@@ -8992,25 +8861,25 @@ function getStyleMapInterpolationExpression(interpolation) {
|
|
|
8992
8861
|
function getStylePropInterpolationExpression(interpolation) {
|
|
8993
8862
|
switch (getInterpolationArgsLength(interpolation)) {
|
|
8994
8863
|
case 1:
|
|
8995
|
-
return Identifiers
|
|
8864
|
+
return Identifiers.styleProp;
|
|
8996
8865
|
case 3:
|
|
8997
|
-
return Identifiers
|
|
8866
|
+
return Identifiers.stylePropInterpolate1;
|
|
8998
8867
|
case 5:
|
|
8999
|
-
return Identifiers
|
|
8868
|
+
return Identifiers.stylePropInterpolate2;
|
|
9000
8869
|
case 7:
|
|
9001
|
-
return Identifiers
|
|
8870
|
+
return Identifiers.stylePropInterpolate3;
|
|
9002
8871
|
case 9:
|
|
9003
|
-
return Identifiers
|
|
8872
|
+
return Identifiers.stylePropInterpolate4;
|
|
9004
8873
|
case 11:
|
|
9005
|
-
return Identifiers
|
|
8874
|
+
return Identifiers.stylePropInterpolate5;
|
|
9006
8875
|
case 13:
|
|
9007
|
-
return Identifiers
|
|
8876
|
+
return Identifiers.stylePropInterpolate6;
|
|
9008
8877
|
case 15:
|
|
9009
|
-
return Identifiers
|
|
8878
|
+
return Identifiers.stylePropInterpolate7;
|
|
9010
8879
|
case 17:
|
|
9011
|
-
return Identifiers
|
|
8880
|
+
return Identifiers.stylePropInterpolate8;
|
|
9012
8881
|
default:
|
|
9013
|
-
return Identifiers
|
|
8882
|
+
return Identifiers.stylePropInterpolateV;
|
|
9014
8883
|
}
|
|
9015
8884
|
}
|
|
9016
8885
|
/**
|
|
@@ -9471,11 +9340,15 @@ class Parser$1 {
|
|
|
9471
9340
|
this._lexer = _lexer;
|
|
9472
9341
|
this.errors = [];
|
|
9473
9342
|
}
|
|
9474
|
-
parseAction(input, location, absoluteOffset, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
|
|
9343
|
+
parseAction(input, isAssignmentEvent, location, absoluteOffset, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
|
|
9475
9344
|
this._checkNoInterpolation(input, location, interpolationConfig);
|
|
9476
9345
|
const sourceToLex = this._stripComments(input);
|
|
9477
9346
|
const tokens = this._lexer.tokenize(sourceToLex);
|
|
9478
|
-
|
|
9347
|
+
let flags = 1 /* Action */;
|
|
9348
|
+
if (isAssignmentEvent) {
|
|
9349
|
+
flags |= 2 /* AssignmentEvent */;
|
|
9350
|
+
}
|
|
9351
|
+
const ast = new _ParseAST(input, location, absoluteOffset, tokens, flags, this.errors, 0).parseChain();
|
|
9479
9352
|
return new ASTWithSource(ast, input, location, absoluteOffset, this.errors);
|
|
9480
9353
|
}
|
|
9481
9354
|
parseBinding(input, location, absoluteOffset, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
|
|
@@ -9499,31 +9372,12 @@ class Parser$1 {
|
|
|
9499
9372
|
this.errors.push(new ParserError(message, input, errLocation, ctxLocation));
|
|
9500
9373
|
}
|
|
9501
9374
|
_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
9375
|
this._checkNoInterpolation(input, location, interpolationConfig);
|
|
9509
9376
|
const sourceToLex = this._stripComments(input);
|
|
9510
9377
|
const tokens = this._lexer.tokenize(sourceToLex);
|
|
9511
|
-
return new _ParseAST(input, location, absoluteOffset, tokens,
|
|
9378
|
+
return new _ParseAST(input, location, absoluteOffset, tokens, 0 /* None */, this.errors, 0)
|
|
9512
9379
|
.parseChain();
|
|
9513
9380
|
}
|
|
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
9381
|
/**
|
|
9528
9382
|
* Parse microsyntax template expression and return a list of bindings or
|
|
9529
9383
|
* parsing errors in case the given expression is invalid.
|
|
@@ -9552,7 +9406,7 @@ class Parser$1 {
|
|
|
9552
9406
|
*/
|
|
9553
9407
|
parseTemplateBindings(templateKey, templateValue, templateUrl, absoluteKeyOffset, absoluteValueOffset) {
|
|
9554
9408
|
const tokens = this._lexer.tokenize(templateValue);
|
|
9555
|
-
const parser = new _ParseAST(templateValue, templateUrl, absoluteValueOffset, tokens,
|
|
9409
|
+
const parser = new _ParseAST(templateValue, templateUrl, absoluteValueOffset, tokens, 0 /* None */, this.errors, 0 /* relative offset */);
|
|
9556
9410
|
return parser.parseTemplateBindings({
|
|
9557
9411
|
source: templateKey,
|
|
9558
9412
|
span: new AbsoluteSourceSpan(absoluteKeyOffset, absoluteKeyOffset + templateKey.length),
|
|
@@ -9567,7 +9421,7 @@ class Parser$1 {
|
|
|
9567
9421
|
const expressionText = expressions[i].text;
|
|
9568
9422
|
const sourceToLex = this._stripComments(expressionText);
|
|
9569
9423
|
const tokens = this._lexer.tokenize(sourceToLex);
|
|
9570
|
-
const ast = new _ParseAST(input, location, absoluteOffset, tokens,
|
|
9424
|
+
const ast = new _ParseAST(input, location, absoluteOffset, tokens, 0 /* None */, this.errors, offsets[i])
|
|
9571
9425
|
.parseChain();
|
|
9572
9426
|
expressionNodes.push(ast);
|
|
9573
9427
|
}
|
|
@@ -9581,8 +9435,7 @@ class Parser$1 {
|
|
|
9581
9435
|
parseInterpolationExpression(expression, location, absoluteOffset) {
|
|
9582
9436
|
const sourceToLex = this._stripComments(expression);
|
|
9583
9437
|
const tokens = this._lexer.tokenize(sourceToLex);
|
|
9584
|
-
const ast = new _ParseAST(expression, location, absoluteOffset, tokens,
|
|
9585
|
-
/* parseAction */ false, this.errors, 0)
|
|
9438
|
+
const ast = new _ParseAST(expression, location, absoluteOffset, tokens, 0 /* None */, this.errors, 0)
|
|
9586
9439
|
.parseChain();
|
|
9587
9440
|
const strings = ['', '']; // The prefix and suffix strings are both empty
|
|
9588
9441
|
return this.createInterpolationAst(strings, [ast], expression, location, absoluteOffset);
|
|
@@ -9753,12 +9606,12 @@ var ParseContextFlags;
|
|
|
9753
9606
|
ParseContextFlags[ParseContextFlags["Writable"] = 1] = "Writable";
|
|
9754
9607
|
})(ParseContextFlags || (ParseContextFlags = {}));
|
|
9755
9608
|
class _ParseAST {
|
|
9756
|
-
constructor(input, location, absoluteOffset, tokens,
|
|
9609
|
+
constructor(input, location, absoluteOffset, tokens, parseFlags, errors, offset) {
|
|
9757
9610
|
this.input = input;
|
|
9758
9611
|
this.location = location;
|
|
9759
9612
|
this.absoluteOffset = absoluteOffset;
|
|
9760
9613
|
this.tokens = tokens;
|
|
9761
|
-
this.
|
|
9614
|
+
this.parseFlags = parseFlags;
|
|
9762
9615
|
this.errors = errors;
|
|
9763
9616
|
this.offset = offset;
|
|
9764
9617
|
this.rparensExpected = 0;
|
|
@@ -9935,7 +9788,7 @@ class _ParseAST {
|
|
|
9935
9788
|
const expr = this.parsePipe();
|
|
9936
9789
|
exprs.push(expr);
|
|
9937
9790
|
if (this.consumeOptionalCharacter($SEMICOLON)) {
|
|
9938
|
-
if (!this.
|
|
9791
|
+
if (!(this.parseFlags & 1 /* Action */)) {
|
|
9939
9792
|
this.error('Binding expression cannot contain chained expression');
|
|
9940
9793
|
}
|
|
9941
9794
|
while (this.consumeOptionalCharacter($SEMICOLON)) {
|
|
@@ -9959,7 +9812,7 @@ class _ParseAST {
|
|
|
9959
9812
|
const start = this.inputIndex;
|
|
9960
9813
|
let result = this.parseExpression();
|
|
9961
9814
|
if (this.consumeOptionalOperator('|')) {
|
|
9962
|
-
if (this.
|
|
9815
|
+
if (this.parseFlags & 1 /* Action */) {
|
|
9963
9816
|
this.error('Cannot have a pipe in an action expression');
|
|
9964
9817
|
}
|
|
9965
9818
|
do {
|
|
@@ -10302,7 +10155,7 @@ class _ParseAST {
|
|
|
10302
10155
|
const nameSpan = this.sourceSpan(nameStart);
|
|
10303
10156
|
let receiver;
|
|
10304
10157
|
if (isSafe) {
|
|
10305
|
-
if (this.
|
|
10158
|
+
if (this.consumeOptionalAssignment()) {
|
|
10306
10159
|
this.error('The \'?.\' operator cannot be used in the assignment');
|
|
10307
10160
|
receiver = new EmptyExpr(this.span(start), this.sourceSpan(start));
|
|
10308
10161
|
}
|
|
@@ -10311,8 +10164,8 @@ class _ParseAST {
|
|
|
10311
10164
|
}
|
|
10312
10165
|
}
|
|
10313
10166
|
else {
|
|
10314
|
-
if (this.
|
|
10315
|
-
if (!this.
|
|
10167
|
+
if (this.consumeOptionalAssignment()) {
|
|
10168
|
+
if (!(this.parseFlags & 1 /* Action */)) {
|
|
10316
10169
|
this.error('Bindings cannot contain assignments');
|
|
10317
10170
|
return new EmptyExpr(this.span(start), this.sourceSpan(start));
|
|
10318
10171
|
}
|
|
@@ -10338,6 +10191,22 @@ class _ParseAST {
|
|
|
10338
10191
|
return isSafe ? new SafeCall(span, sourceSpan, receiver, args, argumentSpan) :
|
|
10339
10192
|
new Call(span, sourceSpan, receiver, args, argumentSpan);
|
|
10340
10193
|
}
|
|
10194
|
+
consumeOptionalAssignment() {
|
|
10195
|
+
// When parsing assignment events (originating from two-way-binding aka banana-in-a-box syntax),
|
|
10196
|
+
// it is valid for the primary expression to be terminated by the non-null operator. This
|
|
10197
|
+
// primary expression is substituted as LHS of the assignment operator to achieve
|
|
10198
|
+
// two-way-binding, such that the LHS could be the non-null operator. The grammar doesn't
|
|
10199
|
+
// naturally allow for this syntax, so assignment events are parsed specially.
|
|
10200
|
+
if ((this.parseFlags & 2 /* AssignmentEvent */) && this.next.isOperator('!') &&
|
|
10201
|
+
this.peek(1).isOperator('=')) {
|
|
10202
|
+
// First skip over the ! operator.
|
|
10203
|
+
this.advance();
|
|
10204
|
+
// Then skip over the = operator, to fully consume the optional assignment operator.
|
|
10205
|
+
this.advance();
|
|
10206
|
+
return true;
|
|
10207
|
+
}
|
|
10208
|
+
return this.consumeOptionalOperator('=');
|
|
10209
|
+
}
|
|
10341
10210
|
parseCallArguments() {
|
|
10342
10211
|
if (this.next.isCharacter($RPAREN))
|
|
10343
10212
|
return [];
|
|
@@ -15028,7 +14897,7 @@ class BindingParser {
|
|
|
15028
14897
|
// Regardless, neither of these values are used in Ivy but are only here to satisfy the
|
|
15029
14898
|
// function signature. This should likely be refactored in the future so that `sourceSpan`
|
|
15030
14899
|
// isn't being used inaccurately.
|
|
15031
|
-
this.parseEvent(propName, expression, sourceSpan, sourceSpan, [], targetEvents, sourceSpan);
|
|
14900
|
+
this.parseEvent(propName, expression, /* isAssignmentEvent */ false, sourceSpan, sourceSpan, [], targetEvents, sourceSpan);
|
|
15032
14901
|
}
|
|
15033
14902
|
else {
|
|
15034
14903
|
this._reportError(`Value of the host listener "${propName}" needs to be a string representing an expression but got "${expression}" (${typeof expression})`, sourceSpan);
|
|
@@ -15265,7 +15134,7 @@ class BindingParser {
|
|
|
15265
15134
|
return new BoundElementProperty(boundPropertyName, bindingType, securityContexts[0], boundProp.expression, unit, boundProp.sourceSpan, boundProp.keySpan, boundProp.valueSpan);
|
|
15266
15135
|
}
|
|
15267
15136
|
// TODO: keySpan should be required but was made optional to avoid changing VE parser.
|
|
15268
|
-
parseEvent(name, expression, sourceSpan, handlerSpan, targetMatchableAttrs, targetEvents, keySpan) {
|
|
15137
|
+
parseEvent(name, expression, isAssignmentEvent, sourceSpan, handlerSpan, targetMatchableAttrs, targetEvents, keySpan) {
|
|
15269
15138
|
if (name.length === 0) {
|
|
15270
15139
|
this._reportError(`Event name is missing in binding`, sourceSpan);
|
|
15271
15140
|
}
|
|
@@ -15274,21 +15143,21 @@ class BindingParser {
|
|
|
15274
15143
|
if (keySpan !== undefined) {
|
|
15275
15144
|
keySpan = moveParseSourceSpan(keySpan, new AbsoluteSourceSpan(keySpan.start.offset + 1, keySpan.end.offset));
|
|
15276
15145
|
}
|
|
15277
|
-
this._parseAnimationEvent(name, expression, sourceSpan, handlerSpan, targetEvents, keySpan);
|
|
15146
|
+
this._parseAnimationEvent(name, expression, isAssignmentEvent, sourceSpan, handlerSpan, targetEvents, keySpan);
|
|
15278
15147
|
}
|
|
15279
15148
|
else {
|
|
15280
|
-
this._parseRegularEvent(name, expression, sourceSpan, handlerSpan, targetMatchableAttrs, targetEvents, keySpan);
|
|
15149
|
+
this._parseRegularEvent(name, expression, isAssignmentEvent, sourceSpan, handlerSpan, targetMatchableAttrs, targetEvents, keySpan);
|
|
15281
15150
|
}
|
|
15282
15151
|
}
|
|
15283
15152
|
calcPossibleSecurityContexts(selector, propName, isAttribute) {
|
|
15284
15153
|
const prop = this._schemaRegistry.getMappedPropName(propName);
|
|
15285
15154
|
return calcPossibleSecurityContexts(this._schemaRegistry, selector, prop, isAttribute);
|
|
15286
15155
|
}
|
|
15287
|
-
_parseAnimationEvent(name, expression, sourceSpan, handlerSpan, targetEvents, keySpan) {
|
|
15156
|
+
_parseAnimationEvent(name, expression, isAssignmentEvent, sourceSpan, handlerSpan, targetEvents, keySpan) {
|
|
15288
15157
|
const matches = splitAtPeriod(name, [name, '']);
|
|
15289
15158
|
const eventName = matches[0];
|
|
15290
15159
|
const phase = matches[1].toLowerCase();
|
|
15291
|
-
const ast = this._parseAction(expression, handlerSpan);
|
|
15160
|
+
const ast = this._parseAction(expression, isAssignmentEvent, handlerSpan);
|
|
15292
15161
|
targetEvents.push(new ParsedEvent(eventName, phase, 1 /* Animation */, ast, sourceSpan, handlerSpan, keySpan));
|
|
15293
15162
|
if (eventName.length === 0) {
|
|
15294
15163
|
this._reportError(`Animation event name is missing in binding`, sourceSpan);
|
|
@@ -15302,20 +15171,20 @@ class BindingParser {
|
|
|
15302
15171
|
this._reportError(`The animation trigger output event (@${eventName}) is missing its phase value name (start or done are currently supported)`, sourceSpan);
|
|
15303
15172
|
}
|
|
15304
15173
|
}
|
|
15305
|
-
_parseRegularEvent(name, expression, sourceSpan, handlerSpan, targetMatchableAttrs, targetEvents, keySpan) {
|
|
15174
|
+
_parseRegularEvent(name, expression, isAssignmentEvent, sourceSpan, handlerSpan, targetMatchableAttrs, targetEvents, keySpan) {
|
|
15306
15175
|
// long format: 'target: eventName'
|
|
15307
15176
|
const [target, eventName] = splitAtColon(name, [null, name]);
|
|
15308
|
-
const ast = this._parseAction(expression, handlerSpan);
|
|
15177
|
+
const ast = this._parseAction(expression, isAssignmentEvent, handlerSpan);
|
|
15309
15178
|
targetMatchableAttrs.push([name, ast.source]);
|
|
15310
15179
|
targetEvents.push(new ParsedEvent(eventName, target, 0 /* Regular */, ast, sourceSpan, handlerSpan, keySpan));
|
|
15311
15180
|
// Don't detect directives for event names for now,
|
|
15312
15181
|
// so don't add the event name to the matchableAttrs
|
|
15313
15182
|
}
|
|
15314
|
-
_parseAction(value, sourceSpan) {
|
|
15183
|
+
_parseAction(value, isAssignmentEvent, sourceSpan) {
|
|
15315
15184
|
const sourceInfo = (sourceSpan && sourceSpan.start || '(unknown').toString();
|
|
15316
15185
|
const absoluteOffset = (sourceSpan && sourceSpan.start) ? sourceSpan.start.offset : 0;
|
|
15317
15186
|
try {
|
|
15318
|
-
const ast = this._exprParser.parseAction(value, sourceInfo, absoluteOffset, this._interpolationConfig);
|
|
15187
|
+
const ast = this._exprParser.parseAction(value, isAssignmentEvent, sourceInfo, absoluteOffset, this._interpolationConfig);
|
|
15319
15188
|
if (ast) {
|
|
15320
15189
|
this._reportExpressionParserErrors(ast.errors, sourceSpan);
|
|
15321
15190
|
}
|
|
@@ -15777,7 +15646,7 @@ class HtmlAstToIvyAst {
|
|
|
15777
15646
|
const events = [];
|
|
15778
15647
|
const identifier = bindParts[IDENT_KW_IDX];
|
|
15779
15648
|
const keySpan = createKeySpan(srcSpan, bindParts[KW_ON_IDX], identifier);
|
|
15780
|
-
this.bindingParser.parseEvent(identifier, value, srcSpan, attribute.valueSpan || srcSpan, matchableAttributes, events, keySpan);
|
|
15649
|
+
this.bindingParser.parseEvent(identifier, value, /* isAssignmentEvent */ false, srcSpan, attribute.valueSpan || srcSpan, matchableAttributes, events, keySpan);
|
|
15781
15650
|
addEvents(events, boundEvents);
|
|
15782
15651
|
}
|
|
15783
15652
|
else if (bindParts[KW_BINDON_IDX]) {
|
|
@@ -15821,7 +15690,7 @@ class HtmlAstToIvyAst {
|
|
|
15821
15690
|
}
|
|
15822
15691
|
else {
|
|
15823
15692
|
const events = [];
|
|
15824
|
-
this.bindingParser.parseEvent(identifier, value, srcSpan, attribute.valueSpan || srcSpan, matchableAttributes, events, keySpan);
|
|
15693
|
+
this.bindingParser.parseEvent(identifier, value, /* isAssignmentEvent */ false, srcSpan, attribute.valueSpan || srcSpan, matchableAttributes, events, keySpan);
|
|
15825
15694
|
addEvents(events, boundEvents);
|
|
15826
15695
|
}
|
|
15827
15696
|
return true;
|
|
@@ -15859,7 +15728,7 @@ class HtmlAstToIvyAst {
|
|
|
15859
15728
|
}
|
|
15860
15729
|
parseAssignmentEvent(name, expression, sourceSpan, valueSpan, targetMatchableAttrs, boundEvents, keySpan) {
|
|
15861
15730
|
const events = [];
|
|
15862
|
-
this.bindingParser.parseEvent(`${name}Change`, `${expression}=$event`, sourceSpan, valueSpan || sourceSpan, targetMatchableAttrs, events, keySpan);
|
|
15731
|
+
this.bindingParser.parseEvent(`${name}Change`, `${expression} =$event`, /* isAssignmentEvent */ true, sourceSpan, valueSpan || sourceSpan, targetMatchableAttrs, events, keySpan);
|
|
15863
15732
|
addEvents(events, boundEvents);
|
|
15864
15733
|
}
|
|
15865
15734
|
reportError(message, sourceSpan, level = ParseErrorLevel.ERROR) {
|
|
@@ -16648,7 +16517,8 @@ class I18nMetaVisitor {
|
|
|
16648
16517
|
*/
|
|
16649
16518
|
_parseMetadata(meta) {
|
|
16650
16519
|
return typeof meta === 'string' ? parseI18nMeta(meta) :
|
|
16651
|
-
meta instanceof Message ? meta :
|
|
16520
|
+
meta instanceof Message ? meta :
|
|
16521
|
+
{};
|
|
16652
16522
|
}
|
|
16653
16523
|
/**
|
|
16654
16524
|
* Generate (or restore) message id if not specified already.
|
|
@@ -16673,9 +16543,9 @@ class I18nMetaVisitor {
|
|
|
16673
16543
|
// `packages/compiler/src/render3/view/template.ts`).
|
|
16674
16544
|
// In that case we want to reuse the legacy message generated in the 1st pass (see
|
|
16675
16545
|
// `setI18nRefs()`).
|
|
16676
|
-
const previousMessage = meta instanceof Message ?
|
|
16677
|
-
meta :
|
|
16678
|
-
|
|
16546
|
+
const previousMessage = meta instanceof Message ? meta :
|
|
16547
|
+
meta instanceof IcuPlaceholder ? meta.previousMessage :
|
|
16548
|
+
undefined;
|
|
16679
16549
|
message.legacyIds = previousMessage ? previousMessage.legacyIds : [];
|
|
16680
16550
|
}
|
|
16681
16551
|
}
|
|
@@ -16720,10 +16590,14 @@ function i18nMetaToJSDoc(meta) {
|
|
|
16720
16590
|
if (meta.description) {
|
|
16721
16591
|
tags.push({ tagName: "desc" /* Desc */, text: meta.description });
|
|
16722
16592
|
}
|
|
16593
|
+
else {
|
|
16594
|
+
// Suppress the JSCompiler warning that a `@desc` was not given for this message.
|
|
16595
|
+
tags.push({ tagName: "suppress" /* Suppress */, text: '{msgDescriptions}' });
|
|
16596
|
+
}
|
|
16723
16597
|
if (meta.meaning) {
|
|
16724
16598
|
tags.push({ tagName: "meaning" /* Meaning */, text: meta.meaning });
|
|
16725
16599
|
}
|
|
16726
|
-
return
|
|
16600
|
+
return jsDocComment(tags);
|
|
16727
16601
|
}
|
|
16728
16602
|
|
|
16729
16603
|
/** Closure uses `goog.getMsg(message)` to lookup translations */
|
|
@@ -16741,10 +16615,7 @@ function createGoogleGetMsgStatements(variable$1, message, closureVar, params) {
|
|
|
16741
16615
|
// const MSG_... = goog.getMsg(..);
|
|
16742
16616
|
// I18N_X = MSG_...;
|
|
16743
16617
|
const googGetMsgStmt = closureVar.set(variable(GOOG_GET_MSG).callFn(args)).toConstDecl();
|
|
16744
|
-
|
|
16745
|
-
if (metaComment !== null) {
|
|
16746
|
-
googGetMsgStmt.addLeadingComment(metaComment);
|
|
16747
|
-
}
|
|
16618
|
+
googGetMsgStmt.addLeadingComment(i18nMetaToJSDoc(message));
|
|
16748
16619
|
const i18nAssignmentStmt = new ExpressionStatement(variable$1.set(closureVar));
|
|
16749
16620
|
return [googGetMsgStmt, i18nAssignmentStmt];
|
|
16750
16621
|
}
|
|
@@ -16906,7 +16777,7 @@ const NG_PROJECT_AS_ATTR_NAME = 'ngProjectAs';
|
|
|
16906
16777
|
// Global symbols available only inside event bindings.
|
|
16907
16778
|
const EVENT_BINDING_SCOPE_GLOBALS = new Set(['$event']);
|
|
16908
16779
|
// List of supported global targets for event listeners
|
|
16909
|
-
const GLOBAL_TARGET_RESOLVERS = new Map([['window', Identifiers
|
|
16780
|
+
const GLOBAL_TARGET_RESOLVERS = new Map([['window', Identifiers.resolveWindow], ['document', Identifiers.resolveDocument], ['body', Identifiers.resolveBody]]);
|
|
16910
16781
|
const LEADING_TRIVIA_CHARS = [' ', '\n', '\r', '\t'];
|
|
16911
16782
|
// if (rf & flags) { .. }
|
|
16912
16783
|
function renderFlagCheckIfStmt(flags, statements) {
|
|
@@ -16923,7 +16794,7 @@ function prepareEventListenerParameters(eventAst, handlerName = null, scope = nu
|
|
|
16923
16794
|
const implicitReceiverExpr = (scope === null || scope.bindingLevel === 0) ?
|
|
16924
16795
|
variable(CONTEXT_NAME) :
|
|
16925
16796
|
scope.getOrCreateSharedContextVar(0);
|
|
16926
|
-
const bindingStatements = convertActionBinding(scope, implicitReceiverExpr, handler, 'b',
|
|
16797
|
+
const bindingStatements = convertActionBinding(scope, implicitReceiverExpr, handler, 'b', eventAst.handlerSpan, implicitReceiverAccesses, EVENT_BINDING_SCOPE_GLOBALS);
|
|
16927
16798
|
const statements = [];
|
|
16928
16799
|
if (scope) {
|
|
16929
16800
|
// `variableDeclarations` needs to run first, because
|
|
@@ -17018,12 +16889,12 @@ class TemplateDefinitionBuilder {
|
|
|
17018
16889
|
this.fileBasedI18nSuffix = relativeContextFilePath.replace(/[^A-Za-z0-9]/g, '_') + '_';
|
|
17019
16890
|
this._valueConverter = new ValueConverter(constantPool, () => this.allocateDataSlot(), (numSlots) => this.allocatePureFunctionSlots(numSlots), (name, localName, slot, value) => {
|
|
17020
16891
|
this._bindingScope.set(this.level, localName, value);
|
|
17021
|
-
this.creationInstruction(null, Identifiers
|
|
16892
|
+
this.creationInstruction(null, Identifiers.pipe, [literal(slot), literal(name)]);
|
|
17022
16893
|
});
|
|
17023
16894
|
}
|
|
17024
16895
|
buildTemplateFunction(nodes, variables, ngContentSelectorsOffset = 0, i18n) {
|
|
17025
16896
|
this._ngContentSelectorsOffset = ngContentSelectorsOffset;
|
|
17026
|
-
if (this._namespace !== Identifiers
|
|
16897
|
+
if (this._namespace !== Identifiers.namespaceHTML) {
|
|
17027
16898
|
this.creationInstruction(null, this._namespace);
|
|
17028
16899
|
}
|
|
17029
16900
|
// Create variable bindings
|
|
@@ -17069,7 +16940,7 @@ class TemplateDefinitionBuilder {
|
|
|
17069
16940
|
// Since we accumulate ngContent selectors while processing template elements,
|
|
17070
16941
|
// we *prepend* `projectionDef` to creation instructions block, to put it before
|
|
17071
16942
|
// any `projection` instructions
|
|
17072
|
-
this.creationInstruction(null, Identifiers
|
|
16943
|
+
this.creationInstruction(null, Identifiers.projectionDef, parameters, /* prepend */ true);
|
|
17073
16944
|
}
|
|
17074
16945
|
if (initI18nContext) {
|
|
17075
16946
|
this.i18nEnd(null, selfClosingI18nInstruction);
|
|
@@ -17230,7 +17101,7 @@ class TemplateDefinitionBuilder {
|
|
|
17230
17101
|
if (Object.keys(icuMapping).length) {
|
|
17231
17102
|
args.push(mapLiteral(icuMapping, true));
|
|
17232
17103
|
}
|
|
17233
|
-
return instruction(null, Identifiers
|
|
17104
|
+
return instruction(null, Identifiers.i18nPostprocess, args);
|
|
17234
17105
|
};
|
|
17235
17106
|
}
|
|
17236
17107
|
this.i18nTranslate(meta, params, context.ref, transformFn);
|
|
@@ -17249,7 +17120,7 @@ class TemplateDefinitionBuilder {
|
|
|
17249
17120
|
// into i18nStart call for top level i18n context
|
|
17250
17121
|
params.push(literal(id));
|
|
17251
17122
|
}
|
|
17252
|
-
this.creationInstruction(span, selfClosing ? Identifiers
|
|
17123
|
+
this.creationInstruction(span, selfClosing ? Identifiers.i18n : Identifiers.i18nStart, params);
|
|
17253
17124
|
}
|
|
17254
17125
|
i18nEnd(span = null, selfClosing) {
|
|
17255
17126
|
if (!this.i18n) {
|
|
@@ -17272,11 +17143,11 @@ class TemplateDefinitionBuilder {
|
|
|
17272
17143
|
// for i18n block, advance to the most recent element index (by taking the current number of
|
|
17273
17144
|
// elements and subtracting one) before invoking `i18nExp` instructions, to make sure the
|
|
17274
17145
|
// necessary lifecycle hooks of components/directives are properly flushed.
|
|
17275
|
-
this.updateInstructionChainWithAdvance(this.getConstCount() - 1, Identifiers
|
|
17276
|
-
this.updateInstruction(span, Identifiers
|
|
17146
|
+
this.updateInstructionChainWithAdvance(this.getConstCount() - 1, Identifiers.i18nExp, chainBindings);
|
|
17147
|
+
this.updateInstruction(span, Identifiers.i18nApply, [literal(index)]);
|
|
17277
17148
|
}
|
|
17278
17149
|
if (!selfClosing) {
|
|
17279
|
-
this.creationInstruction(span, Identifiers
|
|
17150
|
+
this.creationInstruction(span, Identifiers.i18nEnd);
|
|
17280
17151
|
}
|
|
17281
17152
|
this.i18n = null; // reset local i18n context
|
|
17282
17153
|
}
|
|
@@ -17302,25 +17173,25 @@ class TemplateDefinitionBuilder {
|
|
|
17302
17173
|
}
|
|
17303
17174
|
});
|
|
17304
17175
|
if (bindings.length > 0) {
|
|
17305
|
-
this.updateInstructionChainWithAdvance(nodeIndex, Identifiers
|
|
17176
|
+
this.updateInstructionChainWithAdvance(nodeIndex, Identifiers.i18nExp, bindings);
|
|
17306
17177
|
}
|
|
17307
17178
|
if (i18nAttrArgs.length > 0) {
|
|
17308
17179
|
const index = literal(this.allocateDataSlot());
|
|
17309
17180
|
const constIndex = this.addToConsts(literalArr(i18nAttrArgs));
|
|
17310
|
-
this.creationInstruction(sourceSpan, Identifiers
|
|
17181
|
+
this.creationInstruction(sourceSpan, Identifiers.i18nAttributes, [index, constIndex]);
|
|
17311
17182
|
if (hasBindings) {
|
|
17312
|
-
this.updateInstruction(sourceSpan, Identifiers
|
|
17183
|
+
this.updateInstruction(sourceSpan, Identifiers.i18nApply, [index]);
|
|
17313
17184
|
}
|
|
17314
17185
|
}
|
|
17315
17186
|
}
|
|
17316
17187
|
getNamespaceInstruction(namespaceKey) {
|
|
17317
17188
|
switch (namespaceKey) {
|
|
17318
17189
|
case 'math':
|
|
17319
|
-
return Identifiers
|
|
17190
|
+
return Identifiers.namespaceMathML;
|
|
17320
17191
|
case 'svg':
|
|
17321
|
-
return Identifiers
|
|
17192
|
+
return Identifiers.namespaceSVG;
|
|
17322
17193
|
default:
|
|
17323
|
-
return Identifiers
|
|
17194
|
+
return Identifiers.namespaceHTML;
|
|
17324
17195
|
}
|
|
17325
17196
|
}
|
|
17326
17197
|
addNamespaceInstruction(nsInstruction, element) {
|
|
@@ -17347,7 +17218,7 @@ class TemplateDefinitionBuilder {
|
|
|
17347
17218
|
else if (projectionSlotIdx !== 0) {
|
|
17348
17219
|
parameters.push(literal(projectionSlotIdx));
|
|
17349
17220
|
}
|
|
17350
|
-
this.creationInstruction(ngContent.sourceSpan, Identifiers
|
|
17221
|
+
this.creationInstruction(ngContent.sourceSpan, Identifiers.projection, parameters);
|
|
17351
17222
|
if (this.i18n) {
|
|
17352
17223
|
this.i18n.appendProjection(ngContent.i18n, slot);
|
|
17353
17224
|
}
|
|
@@ -17420,12 +17291,12 @@ class TemplateDefinitionBuilder {
|
|
|
17420
17291
|
element.outputs.length === 0 && boundI18nAttrs.length === 0 && !hasChildren;
|
|
17421
17292
|
const createSelfClosingI18nInstruction = !createSelfClosingInstruction && hasTextChildrenOnly(element.children);
|
|
17422
17293
|
if (createSelfClosingInstruction) {
|
|
17423
|
-
this.creationInstruction(element.sourceSpan, isNgContainer$1 ? Identifiers
|
|
17294
|
+
this.creationInstruction(element.sourceSpan, isNgContainer$1 ? Identifiers.elementContainer : Identifiers.element, trimTrailingNulls(parameters));
|
|
17424
17295
|
}
|
|
17425
17296
|
else {
|
|
17426
|
-
this.creationInstruction(element.startSourceSpan, isNgContainer$1 ? Identifiers
|
|
17297
|
+
this.creationInstruction(element.startSourceSpan, isNgContainer$1 ? Identifiers.elementContainerStart : Identifiers.elementStart, trimTrailingNulls(parameters));
|
|
17427
17298
|
if (isNonBindableMode) {
|
|
17428
|
-
this.creationInstruction(element.startSourceSpan, Identifiers
|
|
17299
|
+
this.creationInstruction(element.startSourceSpan, Identifiers.disableBindings);
|
|
17429
17300
|
}
|
|
17430
17301
|
if (boundI18nAttrs.length > 0) {
|
|
17431
17302
|
this.i18nAttributesInstruction(elementIndex, boundI18nAttrs, (_a = element.startSourceSpan) !== null && _a !== void 0 ? _a : element.sourceSpan);
|
|
@@ -17436,7 +17307,7 @@ class TemplateDefinitionBuilder {
|
|
|
17436
17307
|
sourceSpan: outputAst.sourceSpan,
|
|
17437
17308
|
params: this.prepareListenerParameter(element.name, outputAst, elementIndex)
|
|
17438
17309
|
}));
|
|
17439
|
-
this.creationInstructionChain(Identifiers
|
|
17310
|
+
this.creationInstructionChain(Identifiers.listener, listeners);
|
|
17440
17311
|
}
|
|
17441
17312
|
// Note: it's important to keep i18n/i18nStart instructions after i18nAttributes and
|
|
17442
17313
|
// listeners, to make sure i18nAttributes instruction targets current element at runtime.
|
|
@@ -17542,7 +17413,7 @@ class TemplateDefinitionBuilder {
|
|
|
17542
17413
|
}
|
|
17543
17414
|
else {
|
|
17544
17415
|
// class prop
|
|
17545
|
-
this.updateInstructionWithAdvance(elementIndex, input.sourceSpan, Identifiers
|
|
17416
|
+
this.updateInstructionWithAdvance(elementIndex, input.sourceSpan, Identifiers.classProp, () => {
|
|
17546
17417
|
return [
|
|
17547
17418
|
literal(elementIndex), literal(attrName), this.convertPropertyBinding(value),
|
|
17548
17419
|
...params
|
|
@@ -17553,10 +17424,10 @@ class TemplateDefinitionBuilder {
|
|
|
17553
17424
|
}
|
|
17554
17425
|
});
|
|
17555
17426
|
if (propertyBindings.length > 0) {
|
|
17556
|
-
this.updateInstructionChainWithAdvance(elementIndex, Identifiers
|
|
17427
|
+
this.updateInstructionChainWithAdvance(elementIndex, Identifiers.property, propertyBindings);
|
|
17557
17428
|
}
|
|
17558
17429
|
if (attributeBindings.length > 0) {
|
|
17559
|
-
this.updateInstructionChainWithAdvance(elementIndex, Identifiers
|
|
17430
|
+
this.updateInstructionChainWithAdvance(elementIndex, Identifiers.attribute, attributeBindings);
|
|
17560
17431
|
}
|
|
17561
17432
|
// Traverse element child nodes
|
|
17562
17433
|
visitAll$1(this, element.children);
|
|
@@ -17570,9 +17441,9 @@ class TemplateDefinitionBuilder {
|
|
|
17570
17441
|
this.i18nEnd(span, createSelfClosingI18nInstruction);
|
|
17571
17442
|
}
|
|
17572
17443
|
if (isNonBindableMode) {
|
|
17573
|
-
this.creationInstruction(span, Identifiers
|
|
17444
|
+
this.creationInstruction(span, Identifiers.enableBindings);
|
|
17574
17445
|
}
|
|
17575
|
-
this.creationInstruction(span, isNgContainer$1 ? Identifiers
|
|
17446
|
+
this.creationInstruction(span, isNgContainer$1 ? Identifiers.elementContainerEnd : Identifiers.elementEnd);
|
|
17576
17447
|
}
|
|
17577
17448
|
}
|
|
17578
17449
|
visitTemplate(template) {
|
|
@@ -17599,7 +17470,7 @@ class TemplateDefinitionBuilder {
|
|
|
17599
17470
|
if (template.references && template.references.length) {
|
|
17600
17471
|
const refs = this.prepareRefsArray(template.references);
|
|
17601
17472
|
parameters.push(this.addToConsts(refs));
|
|
17602
|
-
parameters.push(importExpr(Identifiers
|
|
17473
|
+
parameters.push(importExpr(Identifiers.templateRefExtractor));
|
|
17603
17474
|
}
|
|
17604
17475
|
// Create the template function
|
|
17605
17476
|
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 +17486,7 @@ class TemplateDefinitionBuilder {
|
|
|
17615
17486
|
}
|
|
17616
17487
|
});
|
|
17617
17488
|
// e.g. template(1, MyComp_Template_1)
|
|
17618
|
-
this.creationInstruction(template.sourceSpan, Identifiers
|
|
17489
|
+
this.creationInstruction(template.sourceSpan, Identifiers.templateCreate, () => {
|
|
17619
17490
|
parameters.splice(2, 0, literal(templateVisitor.getConstCount()), literal(templateVisitor.getVarCount()));
|
|
17620
17491
|
return trimTrailingNulls(parameters);
|
|
17621
17492
|
});
|
|
@@ -17641,7 +17512,7 @@ class TemplateDefinitionBuilder {
|
|
|
17641
17512
|
sourceSpan: outputAst.sourceSpan,
|
|
17642
17513
|
params: this.prepareListenerParameter('ng_template', outputAst, templateIndex)
|
|
17643
17514
|
}));
|
|
17644
|
-
this.creationInstructionChain(Identifiers
|
|
17515
|
+
this.creationInstructionChain(Identifiers.listener, listeners);
|
|
17645
17516
|
}
|
|
17646
17517
|
}
|
|
17647
17518
|
}
|
|
@@ -17656,7 +17527,7 @@ class TemplateDefinitionBuilder {
|
|
|
17656
17527
|
return;
|
|
17657
17528
|
}
|
|
17658
17529
|
const nodeIndex = this.allocateDataSlot();
|
|
17659
|
-
this.creationInstruction(text.sourceSpan, Identifiers
|
|
17530
|
+
this.creationInstruction(text.sourceSpan, Identifiers.text, [literal(nodeIndex)]);
|
|
17660
17531
|
const value = text.value.visit(this._valueConverter);
|
|
17661
17532
|
this.allocateBindingSlots(value);
|
|
17662
17533
|
if (value instanceof Interpolation) {
|
|
@@ -17671,7 +17542,7 @@ class TemplateDefinitionBuilder {
|
|
|
17671
17542
|
// block, we exclude this text element from instructions set,
|
|
17672
17543
|
// since it will be captured in i18n content and processed at runtime
|
|
17673
17544
|
if (!this.i18n) {
|
|
17674
|
-
this.creationInstruction(text.sourceSpan, Identifiers
|
|
17545
|
+
this.creationInstruction(text.sourceSpan, Identifiers.text, [literal(this.allocateDataSlot()), literal(text.value)]);
|
|
17675
17546
|
}
|
|
17676
17547
|
}
|
|
17677
17548
|
visitIcu(icu) {
|
|
@@ -17696,7 +17567,7 @@ class TemplateDefinitionBuilder {
|
|
|
17696
17567
|
const transformFn = (raw) => {
|
|
17697
17568
|
const params = Object.assign(Object.assign({}, vars), placeholders);
|
|
17698
17569
|
const formatted = i18nFormatPlaceholderNames(params, /* useCamelCase */ false);
|
|
17699
|
-
return instruction(null, Identifiers
|
|
17570
|
+
return instruction(null, Identifiers.i18nPostprocess, [raw, mapLiteral(formatted, true)]);
|
|
17700
17571
|
};
|
|
17701
17572
|
// in case the whole i18n message is a single ICU - we do not need to
|
|
17702
17573
|
// create a separate top-level translation, we can use the root ref instead
|
|
@@ -17763,7 +17634,7 @@ class TemplateDefinitionBuilder {
|
|
|
17763
17634
|
}
|
|
17764
17635
|
});
|
|
17765
17636
|
if (propertyBindings.length > 0) {
|
|
17766
|
-
this.updateInstructionChainWithAdvance(templateIndex, Identifiers
|
|
17637
|
+
this.updateInstructionChainWithAdvance(templateIndex, Identifiers.property, propertyBindings);
|
|
17767
17638
|
}
|
|
17768
17639
|
}
|
|
17769
17640
|
// Bindings must only be resolved after all local refs have been visited, so all
|
|
@@ -17839,7 +17710,7 @@ class TemplateDefinitionBuilder {
|
|
|
17839
17710
|
if (delta < 1) {
|
|
17840
17711
|
throw new Error('advance instruction can only go forwards');
|
|
17841
17712
|
}
|
|
17842
|
-
this.instructionFn(this._updateCodeFns, span, Identifiers
|
|
17713
|
+
this.instructionFn(this._updateCodeFns, span, Identifiers.advance, [literal(delta)]);
|
|
17843
17714
|
this._currentIndex = nodeIndex;
|
|
17844
17715
|
}
|
|
17845
17716
|
}
|
|
@@ -17864,7 +17735,7 @@ class TemplateDefinitionBuilder {
|
|
|
17864
17735
|
this._bindingScope.getOrCreateSharedContextVar(0);
|
|
17865
17736
|
}
|
|
17866
17737
|
convertPropertyBinding(value) {
|
|
17867
|
-
const convertedPropertyBinding = convertPropertyBinding(this, this.getImplicitReceiverExpr(), value, this.bindingContext()
|
|
17738
|
+
const convertedPropertyBinding = convertPropertyBinding(this, this.getImplicitReceiverExpr(), value, this.bindingContext());
|
|
17868
17739
|
const valExpr = convertedPropertyBinding.currValExpr;
|
|
17869
17740
|
this._tempVariables.push(...convertedPropertyBinding.stmts);
|
|
17870
17741
|
return valExpr;
|
|
@@ -18021,7 +17892,7 @@ class TemplateDefinitionBuilder {
|
|
|
18021
17892
|
// e.g. nextContext(2);
|
|
18022
17893
|
const nextContextStmt = relativeLevel > 0 ? [generateNextContextExpr(relativeLevel).toStmt()] : [];
|
|
18023
17894
|
// e.g. const $foo$ = reference(1);
|
|
18024
|
-
const refExpr = lhs.set(importExpr(Identifiers
|
|
17895
|
+
const refExpr = lhs.set(importExpr(Identifiers.reference).callFn([literal(slot)]));
|
|
18025
17896
|
return nextContextStmt.concat(refExpr.toConstDecl());
|
|
18026
17897
|
}, true);
|
|
18027
17898
|
return [reference.name, reference.value];
|
|
@@ -18099,22 +17970,22 @@ class ValueConverter extends AstMemoryEfficientTransformer {
|
|
|
18099
17970
|
}
|
|
18100
17971
|
}
|
|
18101
17972
|
// Pipes always have at least one parameter, the value they operate on
|
|
18102
|
-
const pipeBindingIdentifiers = [Identifiers
|
|
17973
|
+
const pipeBindingIdentifiers = [Identifiers.pipeBind1, Identifiers.pipeBind2, Identifiers.pipeBind3, Identifiers.pipeBind4];
|
|
18103
17974
|
function pipeBindingCallInfo(args) {
|
|
18104
17975
|
const identifier = pipeBindingIdentifiers[args.length];
|
|
18105
17976
|
return {
|
|
18106
|
-
identifier: identifier || Identifiers
|
|
17977
|
+
identifier: identifier || Identifiers.pipeBindV,
|
|
18107
17978
|
isVarLength: !identifier,
|
|
18108
17979
|
};
|
|
18109
17980
|
}
|
|
18110
17981
|
const pureFunctionIdentifiers = [
|
|
18111
|
-
Identifiers
|
|
18112
|
-
Identifiers
|
|
17982
|
+
Identifiers.pureFunction0, Identifiers.pureFunction1, Identifiers.pureFunction2, Identifiers.pureFunction3, Identifiers.pureFunction4,
|
|
17983
|
+
Identifiers.pureFunction5, Identifiers.pureFunction6, Identifiers.pureFunction7, Identifiers.pureFunction8
|
|
18113
17984
|
];
|
|
18114
17985
|
function pureFunctionCallInfo(args) {
|
|
18115
17986
|
const identifier = pureFunctionIdentifiers[args.length];
|
|
18116
17987
|
return {
|
|
18117
|
-
identifier: identifier || Identifiers
|
|
17988
|
+
identifier: identifier || Identifiers.pureFunctionV,
|
|
18118
17989
|
isVarLength: !identifier,
|
|
18119
17990
|
};
|
|
18120
17991
|
}
|
|
@@ -18123,7 +17994,7 @@ function instruction(span, reference, params) {
|
|
|
18123
17994
|
}
|
|
18124
17995
|
// e.g. x(2);
|
|
18125
17996
|
function generateNextContextExpr(relativeLevelDiff) {
|
|
18126
|
-
return importExpr(Identifiers
|
|
17997
|
+
return importExpr(Identifiers.nextContext)
|
|
18127
17998
|
.callFn(relativeLevelDiff > 1 ? [literal(relativeLevelDiff)] : []);
|
|
18128
17999
|
}
|
|
18129
18000
|
function getLiteralFactory(constantPool, literal$1, allocateSlots) {
|
|
@@ -18325,7 +18196,7 @@ class BindingScope {
|
|
|
18325
18196
|
restoreViewStatement() {
|
|
18326
18197
|
const statements = [];
|
|
18327
18198
|
if (this.restoreViewVariable) {
|
|
18328
|
-
const restoreCall = instruction(null, Identifiers
|
|
18199
|
+
const restoreCall = instruction(null, Identifiers.restoreView, [this.restoreViewVariable]);
|
|
18329
18200
|
// Either `const restoredCtx = restoreView($state$);` or `restoreView($state$);`
|
|
18330
18201
|
// depending on whether it is being used.
|
|
18331
18202
|
statements.push(this.usesRestoredViewContext ?
|
|
@@ -18337,7 +18208,7 @@ class BindingScope {
|
|
|
18337
18208
|
viewSnapshotStatements() {
|
|
18338
18209
|
// const $state$ = getCurrentView();
|
|
18339
18210
|
return this.restoreViewVariable ?
|
|
18340
|
-
[this.restoreViewVariable.set(instruction(null, Identifiers
|
|
18211
|
+
[this.restoreViewVariable.set(instruction(null, Identifiers.getCurrentView, [])).toConstDecl()] :
|
|
18341
18212
|
[];
|
|
18342
18213
|
}
|
|
18343
18214
|
isListenerScope() {
|
|
@@ -18405,25 +18276,25 @@ function getNgProjectAsLiteral(attribute) {
|
|
|
18405
18276
|
function getPropertyInterpolationExpression(interpolation) {
|
|
18406
18277
|
switch (getInterpolationArgsLength(interpolation)) {
|
|
18407
18278
|
case 1:
|
|
18408
|
-
return Identifiers
|
|
18279
|
+
return Identifiers.propertyInterpolate;
|
|
18409
18280
|
case 3:
|
|
18410
|
-
return Identifiers
|
|
18281
|
+
return Identifiers.propertyInterpolate1;
|
|
18411
18282
|
case 5:
|
|
18412
|
-
return Identifiers
|
|
18283
|
+
return Identifiers.propertyInterpolate2;
|
|
18413
18284
|
case 7:
|
|
18414
|
-
return Identifiers
|
|
18285
|
+
return Identifiers.propertyInterpolate3;
|
|
18415
18286
|
case 9:
|
|
18416
|
-
return Identifiers
|
|
18287
|
+
return Identifiers.propertyInterpolate4;
|
|
18417
18288
|
case 11:
|
|
18418
|
-
return Identifiers
|
|
18289
|
+
return Identifiers.propertyInterpolate5;
|
|
18419
18290
|
case 13:
|
|
18420
|
-
return Identifiers
|
|
18291
|
+
return Identifiers.propertyInterpolate6;
|
|
18421
18292
|
case 15:
|
|
18422
|
-
return Identifiers
|
|
18293
|
+
return Identifiers.propertyInterpolate7;
|
|
18423
18294
|
case 17:
|
|
18424
|
-
return Identifiers
|
|
18295
|
+
return Identifiers.propertyInterpolate8;
|
|
18425
18296
|
default:
|
|
18426
|
-
return Identifiers
|
|
18297
|
+
return Identifiers.propertyInterpolateV;
|
|
18427
18298
|
}
|
|
18428
18299
|
}
|
|
18429
18300
|
/**
|
|
@@ -18433,23 +18304,23 @@ function getPropertyInterpolationExpression(interpolation) {
|
|
|
18433
18304
|
function getAttributeInterpolationExpression(interpolation) {
|
|
18434
18305
|
switch (getInterpolationArgsLength(interpolation)) {
|
|
18435
18306
|
case 3:
|
|
18436
|
-
return Identifiers
|
|
18307
|
+
return Identifiers.attributeInterpolate1;
|
|
18437
18308
|
case 5:
|
|
18438
|
-
return Identifiers
|
|
18309
|
+
return Identifiers.attributeInterpolate2;
|
|
18439
18310
|
case 7:
|
|
18440
|
-
return Identifiers
|
|
18311
|
+
return Identifiers.attributeInterpolate3;
|
|
18441
18312
|
case 9:
|
|
18442
|
-
return Identifiers
|
|
18313
|
+
return Identifiers.attributeInterpolate4;
|
|
18443
18314
|
case 11:
|
|
18444
|
-
return Identifiers
|
|
18315
|
+
return Identifiers.attributeInterpolate5;
|
|
18445
18316
|
case 13:
|
|
18446
|
-
return Identifiers
|
|
18317
|
+
return Identifiers.attributeInterpolate6;
|
|
18447
18318
|
case 15:
|
|
18448
|
-
return Identifiers
|
|
18319
|
+
return Identifiers.attributeInterpolate7;
|
|
18449
18320
|
case 17:
|
|
18450
|
-
return Identifiers
|
|
18321
|
+
return Identifiers.attributeInterpolate8;
|
|
18451
18322
|
default:
|
|
18452
|
-
return Identifiers
|
|
18323
|
+
return Identifiers.attributeInterpolateV;
|
|
18453
18324
|
}
|
|
18454
18325
|
}
|
|
18455
18326
|
/**
|
|
@@ -18459,25 +18330,25 @@ function getAttributeInterpolationExpression(interpolation) {
|
|
|
18459
18330
|
function getTextInterpolationExpression(interpolation) {
|
|
18460
18331
|
switch (getInterpolationArgsLength(interpolation)) {
|
|
18461
18332
|
case 1:
|
|
18462
|
-
return Identifiers
|
|
18333
|
+
return Identifiers.textInterpolate;
|
|
18463
18334
|
case 3:
|
|
18464
|
-
return Identifiers
|
|
18335
|
+
return Identifiers.textInterpolate1;
|
|
18465
18336
|
case 5:
|
|
18466
|
-
return Identifiers
|
|
18337
|
+
return Identifiers.textInterpolate2;
|
|
18467
18338
|
case 7:
|
|
18468
|
-
return Identifiers
|
|
18339
|
+
return Identifiers.textInterpolate3;
|
|
18469
18340
|
case 9:
|
|
18470
|
-
return Identifiers
|
|
18341
|
+
return Identifiers.textInterpolate4;
|
|
18471
18342
|
case 11:
|
|
18472
|
-
return Identifiers
|
|
18343
|
+
return Identifiers.textInterpolate5;
|
|
18473
18344
|
case 13:
|
|
18474
|
-
return Identifiers
|
|
18345
|
+
return Identifiers.textInterpolate6;
|
|
18475
18346
|
case 15:
|
|
18476
|
-
return Identifiers
|
|
18347
|
+
return Identifiers.textInterpolate7;
|
|
18477
18348
|
case 17:
|
|
18478
|
-
return Identifiers
|
|
18349
|
+
return Identifiers.textInterpolate8;
|
|
18479
18350
|
default:
|
|
18480
|
-
return Identifiers
|
|
18351
|
+
return Identifiers.textInterpolateV;
|
|
18481
18352
|
}
|
|
18482
18353
|
}
|
|
18483
18354
|
/**
|
|
@@ -18568,18 +18439,18 @@ function makeBindingParser(interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
|
|
|
18568
18439
|
function resolveSanitizationFn(context, isAttribute) {
|
|
18569
18440
|
switch (context) {
|
|
18570
18441
|
case SecurityContext.HTML:
|
|
18571
|
-
return importExpr(Identifiers
|
|
18442
|
+
return importExpr(Identifiers.sanitizeHtml);
|
|
18572
18443
|
case SecurityContext.SCRIPT:
|
|
18573
|
-
return importExpr(Identifiers
|
|
18444
|
+
return importExpr(Identifiers.sanitizeScript);
|
|
18574
18445
|
case SecurityContext.STYLE:
|
|
18575
18446
|
// the compiler does not fill in an instruction for [style.prop?] binding
|
|
18576
18447
|
// values because the style algorithm knows internally what props are subject
|
|
18577
18448
|
// to sanitization (only [attr.style] values are explicitly sanitized)
|
|
18578
|
-
return isAttribute ? importExpr(Identifiers
|
|
18449
|
+
return isAttribute ? importExpr(Identifiers.sanitizeStyle) : null;
|
|
18579
18450
|
case SecurityContext.URL:
|
|
18580
|
-
return importExpr(Identifiers
|
|
18451
|
+
return importExpr(Identifiers.sanitizeUrl);
|
|
18581
18452
|
case SecurityContext.RESOURCE_URL:
|
|
18582
|
-
return importExpr(Identifiers
|
|
18453
|
+
return importExpr(Identifiers.sanitizeResourceUrl);
|
|
18583
18454
|
default:
|
|
18584
18455
|
return null;
|
|
18585
18456
|
}
|
|
@@ -18589,10 +18460,10 @@ function trustedConstAttribute(tagName, attr) {
|
|
|
18589
18460
|
if (isTrustedTypesSink(tagName, attr.name)) {
|
|
18590
18461
|
switch (elementRegistry.securityContext(tagName, attr.name, /* isAttribute */ true)) {
|
|
18591
18462
|
case SecurityContext.HTML:
|
|
18592
|
-
return taggedTemplate(importExpr(Identifiers
|
|
18463
|
+
return taggedTemplate(importExpr(Identifiers.trustConstantHtml), new TemplateLiteral([new TemplateLiteralElement(attr.value)], []), undefined, attr.valueSpan);
|
|
18593
18464
|
// NB: no SecurityContext.SCRIPT here, as the corresponding tags are stripped by the compiler.
|
|
18594
18465
|
case SecurityContext.RESOURCE_URL:
|
|
18595
|
-
return taggedTemplate(importExpr(Identifiers
|
|
18466
|
+
return taggedTemplate(importExpr(Identifiers.trustConstantResourceUrl), new TemplateLiteral([new TemplateLiteralElement(attr.value)], []), undefined, attr.valueSpan);
|
|
18596
18467
|
default:
|
|
18597
18468
|
return value;
|
|
18598
18469
|
}
|
|
@@ -18721,16 +18592,16 @@ function addFeatures(definitionMap, meta) {
|
|
|
18721
18592
|
if (viewProviders) {
|
|
18722
18593
|
args.push(viewProviders);
|
|
18723
18594
|
}
|
|
18724
|
-
features.push(importExpr(Identifiers
|
|
18595
|
+
features.push(importExpr(Identifiers.ProvidersFeature).callFn(args));
|
|
18725
18596
|
}
|
|
18726
18597
|
if (meta.usesInheritance) {
|
|
18727
|
-
features.push(importExpr(Identifiers
|
|
18598
|
+
features.push(importExpr(Identifiers.InheritDefinitionFeature));
|
|
18728
18599
|
}
|
|
18729
18600
|
if (meta.fullInheritance) {
|
|
18730
|
-
features.push(importExpr(Identifiers
|
|
18601
|
+
features.push(importExpr(Identifiers.CopyDefinitionFeature));
|
|
18731
18602
|
}
|
|
18732
18603
|
if (meta.lifecycle.usesOnChanges) {
|
|
18733
|
-
features.push(importExpr(Identifiers
|
|
18604
|
+
features.push(importExpr(Identifiers.NgOnChangesFeature));
|
|
18734
18605
|
}
|
|
18735
18606
|
if (features.length) {
|
|
18736
18607
|
definitionMap.set('features', literalArr(features));
|
|
@@ -18742,7 +18613,7 @@ function addFeatures(definitionMap, meta) {
|
|
|
18742
18613
|
function compileDirectiveFromMetadata(meta, constantPool, bindingParser) {
|
|
18743
18614
|
const definitionMap = baseDirectiveFields(meta, constantPool, bindingParser);
|
|
18744
18615
|
addFeatures(definitionMap, meta);
|
|
18745
|
-
const expression = importExpr(Identifiers
|
|
18616
|
+
const expression = importExpr(Identifiers.defineDirective).callFn([definitionMap.toLiteralMap()], undefined, true);
|
|
18746
18617
|
const type = createDirectiveType(meta);
|
|
18747
18618
|
return { expression, type, statements: [] };
|
|
18748
18619
|
}
|
|
@@ -18768,7 +18639,7 @@ function compileComponentFromMetadata(meta, constantPool, bindingParser) {
|
|
|
18768
18639
|
const templateName = templateTypeName ? `${templateTypeName}_Template` : null;
|
|
18769
18640
|
const changeDetection = meta.changeDetection;
|
|
18770
18641
|
const template = meta.template;
|
|
18771
|
-
const templateBuilder = new TemplateDefinitionBuilder(constantPool, BindingScope.createRootScope(), 0, templateTypeName, null, null, templateName, Identifiers
|
|
18642
|
+
const templateBuilder = new TemplateDefinitionBuilder(constantPool, BindingScope.createRootScope(), 0, templateTypeName, null, null, templateName, Identifiers.namespaceHTML, meta.relativeContextFilePath, meta.i18nUseExternalIds);
|
|
18772
18643
|
const templateFunctionExpression = templateBuilder.buildTemplateFunction(template.nodes, []);
|
|
18773
18644
|
// We need to provide this so that dynamically generated components know what
|
|
18774
18645
|
// projected content blocks to pass through to the component when it is instantiated.
|
|
@@ -18834,7 +18705,7 @@ function compileComponentFromMetadata(meta, constantPool, bindingParser) {
|
|
|
18834
18705
|
if (changeDetection != null && changeDetection !== ChangeDetectionStrategy.Default) {
|
|
18835
18706
|
definitionMap.set('changeDetection', literal(changeDetection));
|
|
18836
18707
|
}
|
|
18837
|
-
const expression = importExpr(Identifiers
|
|
18708
|
+
const expression = importExpr(Identifiers.defineComponent).callFn([definitionMap.toLiteralMap()], undefined, true);
|
|
18838
18709
|
const type = createComponentType(meta);
|
|
18839
18710
|
return { expression, type, statements: [] };
|
|
18840
18711
|
}
|
|
@@ -18845,7 +18716,7 @@ function compileComponentFromMetadata(meta, constantPool, bindingParser) {
|
|
|
18845
18716
|
function createComponentType(meta) {
|
|
18846
18717
|
const typeParams = createDirectiveTypeParams(meta);
|
|
18847
18718
|
typeParams.push(stringArrayAsType(meta.template.ngContentSelectors));
|
|
18848
|
-
return expressionType(importExpr(Identifiers
|
|
18719
|
+
return expressionType(importExpr(Identifiers.ComponentDeclaration, typeParams));
|
|
18849
18720
|
}
|
|
18850
18721
|
/**
|
|
18851
18722
|
* Compiles the array literal of declarations into an expression according to the provided emit
|
|
@@ -18861,7 +18732,7 @@ function compileDeclarationList(list, mode) {
|
|
|
18861
18732
|
return fn([], [new ReturnStatement(list)]);
|
|
18862
18733
|
case 2 /* ClosureResolved */:
|
|
18863
18734
|
// directives: function () { return [MyDir].map(ng.resolveForwardRef); }
|
|
18864
|
-
const resolvedList = list.prop('map').callFn([importExpr(Identifiers
|
|
18735
|
+
const resolvedList = list.prop('map').callFn([importExpr(Identifiers.resolveForwardRef)]);
|
|
18865
18736
|
return fn([], [new ReturnStatement(resolvedList)]);
|
|
18866
18737
|
}
|
|
18867
18738
|
}
|
|
@@ -18896,13 +18767,13 @@ function createContentQueriesFunction(queries, constantPool, name) {
|
|
|
18896
18767
|
const tempAllocator = temporaryAllocator(updateStatements, TEMPORARY_NAME);
|
|
18897
18768
|
for (const query of queries) {
|
|
18898
18769
|
// creation, e.g. r3.contentQuery(dirIndex, somePredicate, true, null);
|
|
18899
|
-
createStatements.push(importExpr(Identifiers
|
|
18770
|
+
createStatements.push(importExpr(Identifiers.contentQuery)
|
|
18900
18771
|
.callFn([variable('dirIndex'), ...prepareQueryParams(query, constantPool)])
|
|
18901
18772
|
.toStmt());
|
|
18902
18773
|
// update, e.g. (r3.queryRefresh(tmp = r3.loadQuery()) && (ctx.someDir = tmp));
|
|
18903
18774
|
const temporary = tempAllocator();
|
|
18904
|
-
const getQueryList = importExpr(Identifiers
|
|
18905
|
-
const refresh = importExpr(Identifiers
|
|
18775
|
+
const getQueryList = importExpr(Identifiers.loadQuery).callFn([]);
|
|
18776
|
+
const refresh = importExpr(Identifiers.queryRefresh).callFn([temporary.set(getQueryList)]);
|
|
18906
18777
|
const updateDirective = variable(CONTEXT_NAME)
|
|
18907
18778
|
.prop(query.propertyName)
|
|
18908
18779
|
.set(query.first ? temporary.prop('first') : temporary);
|
|
@@ -18954,7 +18825,7 @@ function createDirectiveTypeParams(meta) {
|
|
|
18954
18825
|
*/
|
|
18955
18826
|
function createDirectiveType(meta) {
|
|
18956
18827
|
const typeParams = createDirectiveTypeParams(meta);
|
|
18957
|
-
return expressionType(importExpr(Identifiers
|
|
18828
|
+
return expressionType(importExpr(Identifiers.DirectiveDeclaration, typeParams));
|
|
18958
18829
|
}
|
|
18959
18830
|
// Define and update any view queries
|
|
18960
18831
|
function createViewQueriesFunction(viewQueries, constantPool, name) {
|
|
@@ -18963,12 +18834,12 @@ function createViewQueriesFunction(viewQueries, constantPool, name) {
|
|
|
18963
18834
|
const tempAllocator = temporaryAllocator(updateStatements, TEMPORARY_NAME);
|
|
18964
18835
|
viewQueries.forEach((query) => {
|
|
18965
18836
|
// creation, e.g. r3.viewQuery(somePredicate, true);
|
|
18966
|
-
const queryDefinition = importExpr(Identifiers
|
|
18837
|
+
const queryDefinition = importExpr(Identifiers.viewQuery).callFn(prepareQueryParams(query, constantPool));
|
|
18967
18838
|
createStatements.push(queryDefinition.toStmt());
|
|
18968
18839
|
// update, e.g. (r3.queryRefresh(tmp = r3.loadQuery()) && (ctx.someDir = tmp));
|
|
18969
18840
|
const temporary = tempAllocator();
|
|
18970
|
-
const getQueryList = importExpr(Identifiers
|
|
18971
|
-
const refresh = importExpr(Identifiers
|
|
18841
|
+
const getQueryList = importExpr(Identifiers.loadQuery).callFn([]);
|
|
18842
|
+
const refresh = importExpr(Identifiers.queryRefresh).callFn([temporary.set(getQueryList)]);
|
|
18972
18843
|
const updateDirective = variable(CONTEXT_NAME)
|
|
18973
18844
|
.prop(query.propertyName)
|
|
18974
18845
|
.set(query.first ? temporary.prop('first') : temporary);
|
|
@@ -19050,7 +18921,7 @@ function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindin
|
|
|
19050
18921
|
// of different security contexts. In this case we use special sanitization function and
|
|
19051
18922
|
// select the actual sanitizer at runtime based on a tag name that is provided while
|
|
19052
18923
|
// invoking sanitization function.
|
|
19053
|
-
sanitizerFn = importExpr(Identifiers
|
|
18924
|
+
sanitizerFn = importExpr(Identifiers.sanitizeUrlOrResourceUrl);
|
|
19054
18925
|
}
|
|
19055
18926
|
else {
|
|
19056
18927
|
sanitizerFn = resolveSanitizationFn(securityContexts[0], isAttribute);
|
|
@@ -19061,13 +18932,13 @@ function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindin
|
|
|
19061
18932
|
instructionParams.push(sanitizerFn);
|
|
19062
18933
|
}
|
|
19063
18934
|
updateStatements.push(...bindingExpr.stmts);
|
|
19064
|
-
if (instruction === Identifiers
|
|
18935
|
+
if (instruction === Identifiers.hostProperty) {
|
|
19065
18936
|
propertyBindings.push(instructionParams);
|
|
19066
18937
|
}
|
|
19067
|
-
else if (instruction === Identifiers
|
|
18938
|
+
else if (instruction === Identifiers.attribute) {
|
|
19068
18939
|
attributeBindings.push(instructionParams);
|
|
19069
18940
|
}
|
|
19070
|
-
else if (instruction === Identifiers
|
|
18941
|
+
else if (instruction === Identifiers.syntheticHostProperty) {
|
|
19071
18942
|
syntheticHostBindings.push(instructionParams);
|
|
19072
18943
|
}
|
|
19073
18944
|
else {
|
|
@@ -19075,13 +18946,13 @@ function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindin
|
|
|
19075
18946
|
}
|
|
19076
18947
|
});
|
|
19077
18948
|
if (propertyBindings.length > 0) {
|
|
19078
|
-
updateStatements.push(chainedInstruction(Identifiers
|
|
18949
|
+
updateStatements.push(chainedInstruction(Identifiers.hostProperty, propertyBindings).toStmt());
|
|
19079
18950
|
}
|
|
19080
18951
|
if (attributeBindings.length > 0) {
|
|
19081
|
-
updateStatements.push(chainedInstruction(Identifiers
|
|
18952
|
+
updateStatements.push(chainedInstruction(Identifiers.attribute, attributeBindings).toStmt());
|
|
19082
18953
|
}
|
|
19083
18954
|
if (syntheticHostBindings.length > 0) {
|
|
19084
|
-
updateStatements.push(chainedInstruction(Identifiers
|
|
18955
|
+
updateStatements.push(chainedInstruction(Identifiers.syntheticHostProperty, syntheticHostBindings).toStmt());
|
|
19085
18956
|
}
|
|
19086
18957
|
// since we're dealing with directives/components and both have hostBinding
|
|
19087
18958
|
// functions, we need to generate a special hostAttrs instruction that deals
|
|
@@ -19127,7 +18998,7 @@ function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindin
|
|
|
19127
18998
|
return null;
|
|
19128
18999
|
}
|
|
19129
19000
|
function bindingFn(implicit, value) {
|
|
19130
|
-
return convertPropertyBinding(null, implicit, value, 'b'
|
|
19001
|
+
return convertPropertyBinding(null, implicit, value, 'b');
|
|
19131
19002
|
}
|
|
19132
19003
|
function convertStylingCall(call, bindingContext, bindingFn) {
|
|
19133
19004
|
return call.params(value => bindingFn(bindingContext, value).currValExpr);
|
|
@@ -19139,7 +19010,7 @@ function getBindingNameAndInstruction(binding) {
|
|
|
19139
19010
|
const attrMatches = bindingName.match(ATTR_REGEX);
|
|
19140
19011
|
if (attrMatches) {
|
|
19141
19012
|
bindingName = attrMatches[1];
|
|
19142
|
-
instruction = Identifiers
|
|
19013
|
+
instruction = Identifiers.attribute;
|
|
19143
19014
|
}
|
|
19144
19015
|
else {
|
|
19145
19016
|
if (binding.isAnimation) {
|
|
@@ -19147,10 +19018,10 @@ function getBindingNameAndInstruction(binding) {
|
|
|
19147
19018
|
// host bindings that have a synthetic property (e.g. @foo) should always be rendered
|
|
19148
19019
|
// in the context of the component and not the parent. Therefore there is a special
|
|
19149
19020
|
// compatibility instruction available for this purpose.
|
|
19150
|
-
instruction = Identifiers
|
|
19021
|
+
instruction = Identifiers.syntheticHostProperty;
|
|
19151
19022
|
}
|
|
19152
19023
|
else {
|
|
19153
|
-
instruction = Identifiers
|
|
19024
|
+
instruction = Identifiers.hostProperty;
|
|
19154
19025
|
}
|
|
19155
19026
|
}
|
|
19156
19027
|
return { bindingName, instruction, isAttribute: !!attrMatches };
|
|
@@ -19174,10 +19045,10 @@ function createHostListeners(eventBindings, name) {
|
|
|
19174
19045
|
}
|
|
19175
19046
|
});
|
|
19176
19047
|
if (syntheticListeners.length > 0) {
|
|
19177
|
-
instructions.push(chainedInstruction(Identifiers
|
|
19048
|
+
instructions.push(chainedInstruction(Identifiers.syntheticHostListener, syntheticListeners).toStmt());
|
|
19178
19049
|
}
|
|
19179
19050
|
if (listeners.length > 0) {
|
|
19180
|
-
instructions.push(chainedInstruction(Identifiers
|
|
19051
|
+
instructions.push(chainedInstruction(Identifiers.listener, listeners).toStmt());
|
|
19181
19052
|
}
|
|
19182
19053
|
return instructions;
|
|
19183
19054
|
}
|
|
@@ -19298,6 +19169,7 @@ class CompilerFacadeImpl {
|
|
|
19298
19169
|
deps: null,
|
|
19299
19170
|
pipeName: facade.pipeName,
|
|
19300
19171
|
pure: facade.pure,
|
|
19172
|
+
isStandalone: facade.isStandalone,
|
|
19301
19173
|
};
|
|
19302
19174
|
const res = compilePipeFromMetadata(metadata);
|
|
19303
19175
|
return this.jitExpression(res.expression, angularCoreEnv, sourceMapUrl, []);
|
|
@@ -19508,7 +19380,7 @@ function convertDirectiveFacadeToMetadata(facade) {
|
|
|
19508
19380
|
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
19381
|
}
|
|
19510
19382
|
function convertDeclareDirectiveFacadeToMetadata(declaration, typeSourceSpan) {
|
|
19511
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
19383
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
19512
19384
|
return {
|
|
19513
19385
|
name: declaration.type.name,
|
|
19514
19386
|
type: wrapReference(declaration.type),
|
|
@@ -19528,6 +19400,7 @@ function convertDeclareDirectiveFacadeToMetadata(declaration, typeSourceSpan) {
|
|
|
19528
19400
|
deps: null,
|
|
19529
19401
|
typeArgumentCount: 0,
|
|
19530
19402
|
fullInheritance: false,
|
|
19403
|
+
isStandalone: (_j = declaration.isStandalone) !== null && _j !== void 0 ? _j : false,
|
|
19531
19404
|
};
|
|
19532
19405
|
}
|
|
19533
19406
|
function convertHostDeclarationToMetadata(host = {}) {
|
|
@@ -19691,7 +19564,7 @@ function parseInputOutputs(values) {
|
|
|
19691
19564
|
}, {});
|
|
19692
19565
|
}
|
|
19693
19566
|
function convertDeclarePipeFacadeToMetadata(declaration) {
|
|
19694
|
-
var _a;
|
|
19567
|
+
var _a, _b;
|
|
19695
19568
|
return {
|
|
19696
19569
|
name: declaration.type.name,
|
|
19697
19570
|
type: wrapReference(declaration.type),
|
|
@@ -19700,6 +19573,7 @@ function convertDeclarePipeFacadeToMetadata(declaration) {
|
|
|
19700
19573
|
pipeName: declaration.name,
|
|
19701
19574
|
deps: null,
|
|
19702
19575
|
pure: (_a = declaration.pure) !== null && _a !== void 0 ? _a : true,
|
|
19576
|
+
isStandalone: (_b = declaration.isStandalone) !== null && _b !== void 0 ? _b : false,
|
|
19703
19577
|
};
|
|
19704
19578
|
}
|
|
19705
19579
|
function convertDeclareInjectorFacadeToMetadata(declaration) {
|
|
@@ -19726,7 +19600,7 @@ function publishFacade(global) {
|
|
|
19726
19600
|
* Use of this source code is governed by an MIT-style license that can be
|
|
19727
19601
|
* found in the LICENSE file at https://angular.io/license
|
|
19728
19602
|
*/
|
|
19729
|
-
const VERSION = new Version('
|
|
19603
|
+
const VERSION = new Version('14.0.0-next.2');
|
|
19730
19604
|
|
|
19731
19605
|
/**
|
|
19732
19606
|
* @license
|
|
@@ -21725,7 +21599,7 @@ function compileClassMetadata(metadata) {
|
|
|
21725
21599
|
var _a, _b;
|
|
21726
21600
|
// Generate an ngDevMode guarded call to setClassMetadata with the class identifier and its
|
|
21727
21601
|
// metadata.
|
|
21728
|
-
const fnCall = importExpr(Identifiers
|
|
21602
|
+
const fnCall = importExpr(Identifiers.setClassMetadata).callFn([
|
|
21729
21603
|
metadata.type,
|
|
21730
21604
|
metadata.decorators,
|
|
21731
21605
|
(_a = metadata.ctorParameters) !== null && _a !== void 0 ? _a : literal(null),
|
|
@@ -21753,13 +21627,13 @@ const MINIMUM_PARTIAL_LINKER_VERSION$6 = '12.0.0';
|
|
|
21753
21627
|
function compileDeclareClassMetadata(metadata) {
|
|
21754
21628
|
const definitionMap = new DefinitionMap();
|
|
21755
21629
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$6));
|
|
21756
|
-
definitionMap.set('version', literal('
|
|
21757
|
-
definitionMap.set('ngImport', importExpr(Identifiers
|
|
21630
|
+
definitionMap.set('version', literal('14.0.0-next.2'));
|
|
21631
|
+
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
21758
21632
|
definitionMap.set('type', metadata.type);
|
|
21759
21633
|
definitionMap.set('decorators', metadata.decorators);
|
|
21760
21634
|
definitionMap.set('ctorParameters', metadata.ctorParameters);
|
|
21761
21635
|
definitionMap.set('propDecorators', metadata.propDecorators);
|
|
21762
|
-
return importExpr(Identifiers
|
|
21636
|
+
return importExpr(Identifiers.declareClassMetadata).callFn([definitionMap.toLiteralMap()]);
|
|
21763
21637
|
}
|
|
21764
21638
|
|
|
21765
21639
|
/**
|
|
@@ -21859,7 +21733,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$5 = '12.0.0';
|
|
|
21859
21733
|
*/
|
|
21860
21734
|
function compileDeclareDirectiveFromMetadata(meta) {
|
|
21861
21735
|
const definitionMap = createDirectiveDefinitionMap(meta);
|
|
21862
|
-
const expression = importExpr(Identifiers
|
|
21736
|
+
const expression = importExpr(Identifiers.declareDirective).callFn([definitionMap.toLiteralMap()]);
|
|
21863
21737
|
const type = createDirectiveType(meta);
|
|
21864
21738
|
return { expression, type, statements: [] };
|
|
21865
21739
|
}
|
|
@@ -21870,7 +21744,7 @@ function compileDeclareDirectiveFromMetadata(meta) {
|
|
|
21870
21744
|
function createDirectiveDefinitionMap(meta) {
|
|
21871
21745
|
const definitionMap = new DefinitionMap();
|
|
21872
21746
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
|
|
21873
|
-
definitionMap.set('version', literal('
|
|
21747
|
+
definitionMap.set('version', literal('14.0.0-next.2'));
|
|
21874
21748
|
// e.g. `type: MyDirective`
|
|
21875
21749
|
definitionMap.set('type', meta.internalType);
|
|
21876
21750
|
// e.g. `selector: 'some-dir'`
|
|
@@ -21896,7 +21770,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
21896
21770
|
if (meta.lifecycle.usesOnChanges) {
|
|
21897
21771
|
definitionMap.set('usesOnChanges', literal(true));
|
|
21898
21772
|
}
|
|
21899
|
-
definitionMap.set('ngImport', importExpr(Identifiers
|
|
21773
|
+
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
21900
21774
|
return definitionMap;
|
|
21901
21775
|
}
|
|
21902
21776
|
/**
|
|
@@ -21963,7 +21837,7 @@ function compileHostMetadata(meta) {
|
|
|
21963
21837
|
*/
|
|
21964
21838
|
function compileDeclareComponentFromMetadata(meta, template, additionalTemplateInfo) {
|
|
21965
21839
|
const definitionMap = createComponentDefinitionMap(meta, template, additionalTemplateInfo);
|
|
21966
|
-
const expression = importExpr(Identifiers
|
|
21840
|
+
const expression = importExpr(Identifiers.declareComponent).callFn([definitionMap.toLiteralMap()]);
|
|
21967
21841
|
const type = createComponentType(meta);
|
|
21968
21842
|
return { expression, type, statements: [] };
|
|
21969
21843
|
}
|
|
@@ -21983,11 +21857,11 @@ function createComponentDefinitionMap(meta, template, templateInfo) {
|
|
|
21983
21857
|
definitionMap.set('viewProviders', meta.viewProviders);
|
|
21984
21858
|
definitionMap.set('animations', meta.animations);
|
|
21985
21859
|
if (meta.changeDetection !== undefined) {
|
|
21986
|
-
definitionMap.set('changeDetection', importExpr(Identifiers
|
|
21860
|
+
definitionMap.set('changeDetection', importExpr(Identifiers.ChangeDetectionStrategy)
|
|
21987
21861
|
.prop(ChangeDetectionStrategy[meta.changeDetection]));
|
|
21988
21862
|
}
|
|
21989
21863
|
if (meta.encapsulation !== ViewEncapsulation.Emulated) {
|
|
21990
|
-
definitionMap.set('encapsulation', importExpr(Identifiers
|
|
21864
|
+
definitionMap.set('encapsulation', importExpr(Identifiers.ViewEncapsulation).prop(ViewEncapsulation[meta.encapsulation]));
|
|
21991
21865
|
}
|
|
21992
21866
|
if (meta.interpolation !== DEFAULT_INTERPOLATION_CONFIG) {
|
|
21993
21867
|
definitionMap.set('interpolation', literalArr([literal(meta.interpolation.start), literal(meta.interpolation.end)]));
|
|
@@ -22091,13 +21965,13 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
|
|
|
22091
21965
|
function compileDeclareFactoryFunction(meta) {
|
|
22092
21966
|
const definitionMap = new DefinitionMap();
|
|
22093
21967
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
|
|
22094
|
-
definitionMap.set('version', literal('
|
|
22095
|
-
definitionMap.set('ngImport', importExpr(Identifiers
|
|
21968
|
+
definitionMap.set('version', literal('14.0.0-next.2'));
|
|
21969
|
+
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22096
21970
|
definitionMap.set('type', meta.internalType);
|
|
22097
21971
|
definitionMap.set('deps', compileDependencies(meta.deps));
|
|
22098
|
-
definitionMap.set('target', importExpr(Identifiers
|
|
21972
|
+
definitionMap.set('target', importExpr(Identifiers.FactoryTarget).prop(FactoryTarget$1[meta.target]));
|
|
22099
21973
|
return {
|
|
22100
|
-
expression: importExpr(Identifiers
|
|
21974
|
+
expression: importExpr(Identifiers.declareFactory).callFn([definitionMap.toLiteralMap()]),
|
|
22101
21975
|
statements: [],
|
|
22102
21976
|
type: createFactoryType(meta),
|
|
22103
21977
|
};
|
|
@@ -22123,7 +21997,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$3 = '12.0.0';
|
|
|
22123
21997
|
*/
|
|
22124
21998
|
function compileDeclareInjectableFromMetadata(meta) {
|
|
22125
21999
|
const definitionMap = createInjectableDefinitionMap(meta);
|
|
22126
|
-
const expression = importExpr(Identifiers
|
|
22000
|
+
const expression = importExpr(Identifiers.declareInjectable).callFn([definitionMap.toLiteralMap()]);
|
|
22127
22001
|
const type = createInjectableType(meta);
|
|
22128
22002
|
return { expression, type, statements: [] };
|
|
22129
22003
|
}
|
|
@@ -22133,8 +22007,8 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
22133
22007
|
function createInjectableDefinitionMap(meta) {
|
|
22134
22008
|
const definitionMap = new DefinitionMap();
|
|
22135
22009
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
|
|
22136
|
-
definitionMap.set('version', literal('
|
|
22137
|
-
definitionMap.set('ngImport', importExpr(Identifiers
|
|
22010
|
+
definitionMap.set('version', literal('14.0.0-next.2'));
|
|
22011
|
+
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22138
22012
|
definitionMap.set('type', meta.internalType);
|
|
22139
22013
|
// Only generate providedIn property if it has a non-null value
|
|
22140
22014
|
if (meta.providedIn !== undefined) {
|
|
@@ -22181,7 +22055,7 @@ function createInjectableDefinitionMap(meta) {
|
|
|
22181
22055
|
const MINIMUM_PARTIAL_LINKER_VERSION$2 = '12.0.0';
|
|
22182
22056
|
function compileDeclareInjectorFromMetadata(meta) {
|
|
22183
22057
|
const definitionMap = createInjectorDefinitionMap(meta);
|
|
22184
|
-
const expression = importExpr(Identifiers
|
|
22058
|
+
const expression = importExpr(Identifiers.declareInjector).callFn([definitionMap.toLiteralMap()]);
|
|
22185
22059
|
const type = createInjectorType(meta);
|
|
22186
22060
|
return { expression, type, statements: [] };
|
|
22187
22061
|
}
|
|
@@ -22191,8 +22065,8 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
22191
22065
|
function createInjectorDefinitionMap(meta) {
|
|
22192
22066
|
const definitionMap = new DefinitionMap();
|
|
22193
22067
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
|
|
22194
|
-
definitionMap.set('version', literal('
|
|
22195
|
-
definitionMap.set('ngImport', importExpr(Identifiers
|
|
22068
|
+
definitionMap.set('version', literal('14.0.0-next.2'));
|
|
22069
|
+
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22196
22070
|
definitionMap.set('type', meta.internalType);
|
|
22197
22071
|
definitionMap.set('providers', meta.providers);
|
|
22198
22072
|
if (meta.imports.length > 0) {
|
|
@@ -22218,7 +22092,7 @@ function createInjectorDefinitionMap(meta) {
|
|
|
22218
22092
|
const MINIMUM_PARTIAL_LINKER_VERSION$1 = '12.0.0';
|
|
22219
22093
|
function compileDeclareNgModuleFromMetadata(meta) {
|
|
22220
22094
|
const definitionMap = createNgModuleDefinitionMap(meta);
|
|
22221
|
-
const expression = importExpr(Identifiers
|
|
22095
|
+
const expression = importExpr(Identifiers.declareNgModule).callFn([definitionMap.toLiteralMap()]);
|
|
22222
22096
|
const type = createNgModuleType(meta);
|
|
22223
22097
|
return { expression, type, statements: [] };
|
|
22224
22098
|
}
|
|
@@ -22228,8 +22102,8 @@ function compileDeclareNgModuleFromMetadata(meta) {
|
|
|
22228
22102
|
function createNgModuleDefinitionMap(meta) {
|
|
22229
22103
|
const definitionMap = new DefinitionMap();
|
|
22230
22104
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
|
|
22231
|
-
definitionMap.set('version', literal('
|
|
22232
|
-
definitionMap.set('ngImport', importExpr(Identifiers
|
|
22105
|
+
definitionMap.set('version', literal('14.0.0-next.2'));
|
|
22106
|
+
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22233
22107
|
definitionMap.set('type', meta.internalType);
|
|
22234
22108
|
// We only generate the keys in the metadata if the arrays contain values.
|
|
22235
22109
|
// We must wrap the arrays inside a function if any of the values are a forward reference to a
|
|
@@ -22276,7 +22150,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION = '12.0.0';
|
|
|
22276
22150
|
*/
|
|
22277
22151
|
function compileDeclarePipeFromMetadata(meta) {
|
|
22278
22152
|
const definitionMap = createPipeDefinitionMap(meta);
|
|
22279
|
-
const expression = importExpr(Identifiers
|
|
22153
|
+
const expression = importExpr(Identifiers.declarePipe).callFn([definitionMap.toLiteralMap()]);
|
|
22280
22154
|
const type = createPipeType(meta);
|
|
22281
22155
|
return { expression, type, statements: [] };
|
|
22282
22156
|
}
|
|
@@ -22286,8 +22160,8 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
22286
22160
|
function createPipeDefinitionMap(meta) {
|
|
22287
22161
|
const definitionMap = new DefinitionMap();
|
|
22288
22162
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
22289
|
-
definitionMap.set('version', literal('
|
|
22290
|
-
definitionMap.set('ngImport', importExpr(Identifiers
|
|
22163
|
+
definitionMap.set('version', literal('14.0.0-next.2'));
|
|
22164
|
+
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22291
22165
|
// e.g. `type: MyPipe`
|
|
22292
22166
|
definitionMap.set('type', meta.internalType);
|
|
22293
22167
|
// e.g. `name: "myPipe"`
|
|
@@ -22336,5 +22210,5 @@ publishFacade(_global);
|
|
|
22336
22210
|
* found in the LICENSE file at https://angular.io/license
|
|
22337
22211
|
*/
|
|
22338
22212
|
|
|
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,
|
|
22213
|
+
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, 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
22214
|
//# sourceMappingURL=compiler.mjs.map
|