@angular/core 9.0.6 → 9.0.7

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.
Files changed (45) hide show
  1. package/bundles/core-testing.umd.js +1 -1
  2. package/bundles/core-testing.umd.min.js +1 -1
  3. package/bundles/core-testing.umd.min.js.map +1 -1
  4. package/bundles/core.umd.js +414 -399
  5. package/bundles/core.umd.js.map +1 -1
  6. package/bundles/core.umd.min.js +133 -132
  7. package/bundles/core.umd.min.js.map +1 -1
  8. package/core.d.ts +1 -1
  9. package/core.metadata.json +1 -1
  10. package/esm2015/src/render3/assert.js +4 -1
  11. package/esm2015/src/render3/i18n.js +12 -6
  12. package/esm2015/src/render3/instructions/attribute.js +6 -6
  13. package/esm2015/src/render3/instructions/attribute_interpolation.js +29 -47
  14. package/esm2015/src/render3/instructions/host_property.js +13 -10
  15. package/esm2015/src/render3/instructions/property.js +7 -6
  16. package/esm2015/src/render3/instructions/property_interpolation.js +40 -39
  17. package/esm2015/src/render3/instructions/shared.js +17 -26
  18. package/esm2015/src/render3/node_assert.js +1 -1
  19. package/esm2015/src/render3/pure_function.js +23 -6
  20. package/esm2015/src/render3/state.js +11 -1
  21. package/esm2015/src/util/assert.js +1 -1
  22. package/esm2015/src/version.js +1 -1
  23. package/esm5/src/render3/assert.js +3 -1
  24. package/esm5/src/render3/i18n.js +11 -5
  25. package/esm5/src/render3/instructions/attribute.js +5 -5
  26. package/esm5/src/render3/instructions/attribute_interpolation.js +29 -38
  27. package/esm5/src/render3/instructions/host_property.js +10 -8
  28. package/esm5/src/render3/instructions/property.js +6 -5
  29. package/esm5/src/render3/instructions/property_interpolation.js +31 -30
  30. package/esm5/src/render3/instructions/shared.js +9 -13
  31. package/esm5/src/render3/node_assert.js +1 -1
  32. package/esm5/src/render3/pure_function.js +19 -6
  33. package/esm5/src/render3/state.js +9 -1
  34. package/esm5/src/util/assert.js +1 -1
  35. package/esm5/src/version.js +1 -1
  36. package/fesm2015/core.js +879 -870
  37. package/fesm2015/core.js.map +1 -1
  38. package/fesm2015/testing.js +1 -1
  39. package/fesm5/core.js +414 -399
  40. package/fesm5/core.js.map +1 -1
  41. package/fesm5/testing.js +1 -1
  42. package/package.json +1 -1
  43. package/src/r3_symbols.d.ts +1 -1
  44. package/testing/testing.d.ts +1 -1
  45. package/testing.d.ts +1 -1
package/fesm5/core.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v9.0.6
2
+ * @license Angular v9.0.7
3
3
  * (c) 2010-2020 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1992,6 +1992,8 @@ function isRootView(target) {
1992
1992
  * Use of this source code is governed by an MIT-style license that can be
1993
1993
  * found in the LICENSE file at https://angular.io/license
1994
1994
  */
1995
+ // [Assert functions do not constraint type when they are guarded by a truthy
1996
+ // expression.](https://github.com/microsoft/TypeScript/issues/37295)
1995
1997
  function assertTNodeForLView(tNode, lView) {
1996
1998
  tNode.hasOwnProperty('tView_') && assertEqual(tNode.tView_, lView[TVIEW], 'This TNode does not belong to this LView.');
1997
1999
  }
@@ -2059,6 +2061,266 @@ function assertDirectiveDef(obj) {
2059
2061
  var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
2060
2062
  var MATH_ML_NAMESPACE = 'http://www.w3.org/1998/MathML/';
2061
2063
 
2064
+ /**
2065
+ * @license
2066
+ * Copyright Google Inc. All Rights Reserved.
2067
+ *
2068
+ * Use of this source code is governed by an MIT-style license that can be
2069
+ * found in the LICENSE file at https://angular.io/license
2070
+ */
2071
+ /**
2072
+ * This property will be monkey-patched on elements, components and directives
2073
+ */
2074
+ var MONKEY_PATCH_KEY_NAME = '__ngContext__';
2075
+
2076
+ /**
2077
+ * @license
2078
+ * Copyright Google Inc. All Rights Reserved.
2079
+ *
2080
+ * Use of this source code is governed by an MIT-style license that can be
2081
+ * found in the LICENSE file at https://angular.io/license
2082
+ */
2083
+ /**
2084
+ * Most of the use of `document` in Angular is from within the DI system so it is possible to simply
2085
+ * inject the `DOCUMENT` token and are done.
2086
+ *
2087
+ * Ivy is special because it does not rely upon the DI and must get hold of the document some other
2088
+ * way.
2089
+ *
2090
+ * The solution is to define `getDocument()` and `setDocument()` top-level functions for ivy.
2091
+ * Wherever ivy needs the global document, it calls `getDocument()` instead.
2092
+ *
2093
+ * When running ivy outside of a browser environment, it is necessary to call `setDocument()` to
2094
+ * tell ivy what the global `document` is.
2095
+ *
2096
+ * Angular does this for us in each of the standard platforms (`Browser`, `Server`, and `WebWorker`)
2097
+ * by calling `setDocument()` when providing the `DOCUMENT` token.
2098
+ */
2099
+ var DOCUMENT = undefined;
2100
+ /**
2101
+ * Tell ivy what the `document` is for this platform.
2102
+ *
2103
+ * It is only necessary to call this if the current platform is not a browser.
2104
+ *
2105
+ * @param document The object representing the global `document` in this environment.
2106
+ */
2107
+ function setDocument(document) {
2108
+ DOCUMENT = document;
2109
+ }
2110
+ /**
2111
+ * Access the object that represents the `document` for this platform.
2112
+ *
2113
+ * Ivy calls this whenever it needs to access the `document` object.
2114
+ * For example to create the renderer or to do sanitization.
2115
+ */
2116
+ function getDocument() {
2117
+ if (DOCUMENT !== undefined) {
2118
+ return DOCUMENT;
2119
+ }
2120
+ else if (typeof document !== 'undefined') {
2121
+ return document;
2122
+ }
2123
+ // No "document" can be found. This should only happen if we are running ivy outside Angular and
2124
+ // the current platform is not a browser. Since this is not a supported scenario at the moment
2125
+ // this should not happen in Angular apps.
2126
+ // Once we support running ivy outside of Angular we will need to publish `setDocument()` as a
2127
+ // public API. Meanwhile we just return `undefined` and let the application fail.
2128
+ return undefined;
2129
+ }
2130
+
2131
+ /**
2132
+ * @license
2133
+ * Copyright Google Inc. All Rights Reserved.
2134
+ *
2135
+ * Use of this source code is governed by an MIT-style license that can be
2136
+ * found in the LICENSE file at https://angular.io/license
2137
+ */
2138
+ // TODO: cleanup once the code is merged in angular/angular
2139
+ var RendererStyleFlags3;
2140
+ (function (RendererStyleFlags3) {
2141
+ RendererStyleFlags3[RendererStyleFlags3["Important"] = 1] = "Important";
2142
+ RendererStyleFlags3[RendererStyleFlags3["DashCase"] = 2] = "DashCase";
2143
+ })(RendererStyleFlags3 || (RendererStyleFlags3 = {}));
2144
+ /** Returns whether the `renderer` is a `ProceduralRenderer3` */
2145
+ function isProceduralRenderer(renderer) {
2146
+ return !!(renderer.listen);
2147
+ }
2148
+ var ɵ0$2 = function (hostElement, rendererType) { return getDocument(); };
2149
+ var domRendererFactory3 = {
2150
+ createRenderer: ɵ0$2
2151
+ };
2152
+ // Note: This hack is necessary so we don't erroneously get a circular dependency
2153
+ // failure based on types.
2154
+ var unusedValueExportToPlacateAjd$2 = 1;
2155
+
2156
+ /**
2157
+ * @license
2158
+ * Copyright Google Inc. All Rights Reserved.
2159
+ *
2160
+ * Use of this source code is governed by an MIT-style license that can be
2161
+ * found in the LICENSE file at https://angular.io/license
2162
+ */
2163
+ /**
2164
+ * For efficiency reasons we often put several different data types (`RNode`, `LView`, `LContainer`)
2165
+ * in same location in `LView`. This is because we don't want to pre-allocate space for it
2166
+ * because the storage is sparse. This file contains utilities for dealing with such data types.
2167
+ *
2168
+ * How do we know what is stored at a given location in `LView`.
2169
+ * - `Array.isArray(value) === false` => `RNode` (The normal storage value)
2170
+ * - `Array.isArray(value) === true` => then the `value[0]` represents the wrapped value.
2171
+ * - `typeof value[TYPE] === 'object'` => `LView`
2172
+ * - This happens when we have a component at a given location
2173
+ * - `typeof value[TYPE] === true` => `LContainer`
2174
+ * - This happens when we have `LContainer` binding at a given location.
2175
+ *
2176
+ *
2177
+ * NOTE: it is assumed that `Array.isArray` and `typeof` operations are very efficient.
2178
+ */
2179
+ /**
2180
+ * Returns `RNode`.
2181
+ * @param value wrapped value of `RNode`, `LView`, `LContainer`
2182
+ */
2183
+ function unwrapRNode(value) {
2184
+ while (Array.isArray(value)) {
2185
+ value = value[HOST];
2186
+ }
2187
+ return value;
2188
+ }
2189
+ /**
2190
+ * Returns `LView` or `null` if not found.
2191
+ * @param value wrapped value of `RNode`, `LView`, `LContainer`
2192
+ */
2193
+ function unwrapLView(value) {
2194
+ while (Array.isArray(value)) {
2195
+ // This check is same as `isLView()` but we don't call at as we don't want to call
2196
+ // `Array.isArray()` twice and give JITer more work for inlining.
2197
+ if (typeof value[TYPE] === 'object')
2198
+ return value;
2199
+ value = value[HOST];
2200
+ }
2201
+ return null;
2202
+ }
2203
+ /**
2204
+ * Returns `LContainer` or `null` if not found.
2205
+ * @param value wrapped value of `RNode`, `LView`, `LContainer`
2206
+ */
2207
+ function unwrapLContainer(value) {
2208
+ while (Array.isArray(value)) {
2209
+ // This check is same as `isLContainer()` but we don't call at as we don't want to call
2210
+ // `Array.isArray()` twice and give JITer more work for inlining.
2211
+ if (value[TYPE] === true)
2212
+ return value;
2213
+ value = value[HOST];
2214
+ }
2215
+ return null;
2216
+ }
2217
+ /**
2218
+ * Retrieves an element value from the provided `viewData`, by unwrapping
2219
+ * from any containers, component views, or style contexts.
2220
+ */
2221
+ function getNativeByIndex(index, lView) {
2222
+ return unwrapRNode(lView[index + HEADER_OFFSET]);
2223
+ }
2224
+ /**
2225
+ * Retrieve an `RNode` for a given `TNode` and `LView`.
2226
+ *
2227
+ * This function guarantees in dev mode to retrieve a non-null `RNode`.
2228
+ *
2229
+ * @param tNode
2230
+ * @param lView
2231
+ */
2232
+ function getNativeByTNode(tNode, lView) {
2233
+ ngDevMode && assertTNodeForLView(tNode, lView);
2234
+ ngDevMode && assertDataInRange(lView, tNode.index);
2235
+ var node = unwrapRNode(lView[tNode.index]);
2236
+ ngDevMode && !isProceduralRenderer(lView[RENDERER]) && assertDomNode(node);
2237
+ return node;
2238
+ }
2239
+ /**
2240
+ * Retrieve an `RNode` or `null` for a given `TNode` and `LView`.
2241
+ *
2242
+ * Some `TNode`s don't have associated `RNode`s. For example `Projection`
2243
+ *
2244
+ * @param tNode
2245
+ * @param lView
2246
+ */
2247
+ function getNativeByTNodeOrNull(tNode, lView) {
2248
+ var index = tNode.index;
2249
+ if (index !== -1) {
2250
+ ngDevMode && assertTNodeForLView(tNode, lView);
2251
+ var node = unwrapRNode(lView[index]);
2252
+ ngDevMode && node !== null && !isProceduralRenderer(lView[RENDERER]) && assertDomNode(node);
2253
+ return node;
2254
+ }
2255
+ return null;
2256
+ }
2257
+ function getTNode(tView, index) {
2258
+ ngDevMode && assertGreaterThan(index, -1, 'wrong index for TNode');
2259
+ ngDevMode && assertLessThan(index, tView.data.length, 'wrong index for TNode');
2260
+ return tView.data[index + HEADER_OFFSET];
2261
+ }
2262
+ /** Retrieves a value from any `LView` or `TData`. */
2263
+ function load(view, index) {
2264
+ ngDevMode && assertDataInRange(view, index + HEADER_OFFSET);
2265
+ return view[index + HEADER_OFFSET];
2266
+ }
2267
+ function getComponentLViewByIndex(nodeIndex, hostView) {
2268
+ // Could be an LView or an LContainer. If LContainer, unwrap to find LView.
2269
+ ngDevMode && assertDataInRange(hostView, nodeIndex);
2270
+ var slotValue = hostView[nodeIndex];
2271
+ var lView = isLView(slotValue) ? slotValue : slotValue[HOST];
2272
+ return lView;
2273
+ }
2274
+ /**
2275
+ * Returns the monkey-patch value data present on the target (which could be
2276
+ * a component, directive or a DOM node).
2277
+ */
2278
+ function readPatchedData(target) {
2279
+ ngDevMode && assertDefined(target, 'Target expected');
2280
+ return target[MONKEY_PATCH_KEY_NAME] || null;
2281
+ }
2282
+ function readPatchedLView(target) {
2283
+ var value = readPatchedData(target);
2284
+ if (value) {
2285
+ return Array.isArray(value) ? value : value.lView;
2286
+ }
2287
+ return null;
2288
+ }
2289
+ /** Checks whether a given view is in creation mode */
2290
+ function isCreationMode(view) {
2291
+ return (view[FLAGS] & 4 /* CreationMode */) === 4 /* CreationMode */;
2292
+ }
2293
+ /**
2294
+ * Returns a boolean for whether the view is attached to the change detection tree.
2295
+ *
2296
+ * Note: This determines whether a view should be checked, not whether it's inserted
2297
+ * into a container. For that, you'll want `viewAttachedToContainer` below.
2298
+ */
2299
+ function viewAttachedToChangeDetector(view) {
2300
+ return (view[FLAGS] & 128 /* Attached */) === 128 /* Attached */;
2301
+ }
2302
+ /** Returns a boolean for whether the view is attached to a container. */
2303
+ function viewAttachedToContainer(view) {
2304
+ return isLContainer(view[PARENT]);
2305
+ }
2306
+ /** Returns a constant from `TConstants` instance. */
2307
+ function getConstant(consts, index) {
2308
+ return consts === null || index == null ? null : consts[index];
2309
+ }
2310
+ /**
2311
+ * Resets the pre-order hook flags of the view.
2312
+ * @param lView the LView on which the flags are reset
2313
+ */
2314
+ function resetPreOrderHookFlags(lView) {
2315
+ lView[PREORDER_HOOK_FLAGS] = 0;
2316
+ }
2317
+ function getLContainerActiveIndex(lContainer) {
2318
+ return lContainer[ACTIVE_INDEX] >> 1 /* SHIFT */;
2319
+ }
2320
+ function setLContainerActiveIndex(lContainer, index) {
2321
+ lContainer[ACTIVE_INDEX] = index << 1 /* SHIFT */;
2322
+ }
2323
+
2062
2324
  /**
2063
2325
  * @license
2064
2326
  * Copyright Google Inc. All Rights Reserved.
@@ -2389,6 +2651,13 @@ function getSelectedIndex() {
2389
2651
  function setSelectedIndex(index) {
2390
2652
  instructionState.lFrame.selectedIndex = index;
2391
2653
  }
2654
+ /**
2655
+ * Gets the `tNode` that represents currently selected element.
2656
+ */
2657
+ function getSelectedTNode() {
2658
+ var lFrame = instructionState.lFrame;
2659
+ return getTNode(lFrame.tView, lFrame.selectedIndex);
2660
+ }
2392
2661
  /**
2393
2662
  * Sets the namespace used to create elements to `'http://www.w3.org/2000/svg'` in global state.
2394
2663
  *
@@ -2770,110 +3039,19 @@ var NodeInjectorFactory = /** @class */ (function () {
2770
3039
  /**
2771
3040
  * Marker set to true during factory invocation to see if we get into recursive loop.
2772
3041
  * Recursive loop causes an error to be displayed.
2773
- */
2774
- this.resolving = false;
2775
- this.canSeeViewProviders = isViewProvider;
2776
- this.injectImpl = injectImplementation;
2777
- }
2778
- return NodeInjectorFactory;
2779
- }());
2780
- function isFactory(obj) {
2781
- return obj instanceof NodeInjectorFactory;
2782
- }
2783
- // Note: This hack is necessary so we don't erroneously get a circular dependency
2784
- // failure based on types.
2785
- var unusedValueExportToPlacateAjd$2 = 1;
2786
-
2787
- /**
2788
- * @license
2789
- * Copyright Google Inc. All Rights Reserved.
2790
- *
2791
- * Use of this source code is governed by an MIT-style license that can be
2792
- * found in the LICENSE file at https://angular.io/license
2793
- */
2794
- function assertNodeType(tNode, type) {
2795
- assertDefined(tNode, 'should be called with a TNode');
2796
- assertEqual(tNode.type, type, "should be a " + typeName(type));
2797
- }
2798
- function assertNodeOfPossibleTypes(tNode) {
2799
- var types = [];
2800
- for (var _i = 1; _i < arguments.length; _i++) {
2801
- types[_i - 1] = arguments[_i];
2802
- }
2803
- assertDefined(tNode, 'should be called with a TNode');
2804
- var found = types.some(function (type) { return tNode.type === type; });
2805
- assertEqual(found, true, "Should be one of " + types.map(typeName).join(', ') + " but got " + typeName(tNode.type));
2806
- }
2807
- function typeName(type) {
2808
- if (type == 1 /* Projection */)
2809
- return 'Projection';
2810
- if (type == 0 /* Container */)
2811
- return 'Container';
2812
- if (type == 5 /* IcuContainer */)
2813
- return 'IcuContainer';
2814
- if (type == 2 /* View */)
2815
- return 'View';
2816
- if (type == 3 /* Element */)
2817
- return 'Element';
2818
- if (type == 4 /* ElementContainer */)
2819
- return 'ElementContainer';
2820
- return '<unknown>';
2821
- }
2822
-
2823
- /**
2824
- * @license
2825
- * Copyright Google Inc. All Rights Reserved.
2826
- *
2827
- * Use of this source code is governed by an MIT-style license that can be
2828
- * found in the LICENSE file at https://angular.io/license
2829
- */
2830
- /**
2831
- * Most of the use of `document` in Angular is from within the DI system so it is possible to simply
2832
- * inject the `DOCUMENT` token and are done.
2833
- *
2834
- * Ivy is special because it does not rely upon the DI and must get hold of the document some other
2835
- * way.
2836
- *
2837
- * The solution is to define `getDocument()` and `setDocument()` top-level functions for ivy.
2838
- * Wherever ivy needs the global document, it calls `getDocument()` instead.
2839
- *
2840
- * When running ivy outside of a browser environment, it is necessary to call `setDocument()` to
2841
- * tell ivy what the global `document` is.
2842
- *
2843
- * Angular does this for us in each of the standard platforms (`Browser`, `Server`, and `WebWorker`)
2844
- * by calling `setDocument()` when providing the `DOCUMENT` token.
2845
- */
2846
- var DOCUMENT = undefined;
2847
- /**
2848
- * Tell ivy what the `document` is for this platform.
2849
- *
2850
- * It is only necessary to call this if the current platform is not a browser.
2851
- *
2852
- * @param document The object representing the global `document` in this environment.
2853
- */
2854
- function setDocument(document) {
2855
- DOCUMENT = document;
2856
- }
2857
- /**
2858
- * Access the object that represents the `document` for this platform.
2859
- *
2860
- * Ivy calls this whenever it needs to access the `document` object.
2861
- * For example to create the renderer or to do sanitization.
2862
- */
2863
- function getDocument() {
2864
- if (DOCUMENT !== undefined) {
2865
- return DOCUMENT;
2866
- }
2867
- else if (typeof document !== 'undefined') {
2868
- return document;
2869
- }
2870
- // No "document" can be found. This should only happen if we are running ivy outside Angular and
2871
- // the current platform is not a browser. Since this is not a supported scenario at the moment
2872
- // this should not happen in Angular apps.
2873
- // Once we support running ivy outside of Angular we will need to publish `setDocument()` as a
2874
- // public API. Meanwhile we just return `undefined` and let the application fail.
2875
- return undefined;
3042
+ */
3043
+ this.resolving = false;
3044
+ this.canSeeViewProviders = isViewProvider;
3045
+ this.injectImpl = injectImplementation;
3046
+ }
3047
+ return NodeInjectorFactory;
3048
+ }());
3049
+ function isFactory(obj) {
3050
+ return obj instanceof NodeInjectorFactory;
2876
3051
  }
3052
+ // Note: This hack is necessary so we don't erroneously get a circular dependency
3053
+ // failure based on types.
3054
+ var unusedValueExportToPlacateAjd$3 = 1;
2877
3055
 
2878
3056
  /**
2879
3057
  * @license
@@ -2882,23 +3060,34 @@ function getDocument() {
2882
3060
  * Use of this source code is governed by an MIT-style license that can be
2883
3061
  * found in the LICENSE file at https://angular.io/license
2884
3062
  */
2885
- // TODO: cleanup once the code is merged in angular/angular
2886
- var RendererStyleFlags3;
2887
- (function (RendererStyleFlags3) {
2888
- RendererStyleFlags3[RendererStyleFlags3["Important"] = 1] = "Important";
2889
- RendererStyleFlags3[RendererStyleFlags3["DashCase"] = 2] = "DashCase";
2890
- })(RendererStyleFlags3 || (RendererStyleFlags3 = {}));
2891
- /** Returns whether the `renderer` is a `ProceduralRenderer3` */
2892
- function isProceduralRenderer(renderer) {
2893
- return !!(renderer.listen);
3063
+ function assertNodeType(tNode, type) {
3064
+ assertDefined(tNode, 'should be called with a TNode');
3065
+ assertEqual(tNode.type, type, "should be a " + typeName(type));
3066
+ }
3067
+ function assertNodeOfPossibleTypes(tNode) {
3068
+ var types = [];
3069
+ for (var _i = 1; _i < arguments.length; _i++) {
3070
+ types[_i - 1] = arguments[_i];
3071
+ }
3072
+ assertDefined(tNode, 'should be called with a TNode');
3073
+ var found = types.some(function (type) { return tNode.type === type; });
3074
+ assertEqual(found, true, "Should be one of " + types.map(typeName).join(', ') + " but got " + typeName(tNode.type));
3075
+ }
3076
+ function typeName(type) {
3077
+ if (type == 1 /* Projection */)
3078
+ return 'Projection';
3079
+ if (type == 0 /* Container */)
3080
+ return 'Container';
3081
+ if (type == 5 /* IcuContainer */)
3082
+ return 'IcuContainer';
3083
+ if (type == 2 /* View */)
3084
+ return 'View';
3085
+ if (type == 3 /* Element */)
3086
+ return 'Element';
3087
+ if (type == 4 /* ElementContainer */)
3088
+ return 'ElementContainer';
3089
+ return '<unknown>';
2894
3090
  }
2895
- var ɵ0$2 = function (hostElement, rendererType) { return getDocument(); };
2896
- var domRendererFactory3 = {
2897
- createRenderer: ɵ0$2
2898
- };
2899
- // Note: This hack is necessary so we don't erroneously get a circular dependency
2900
- // failure based on types.
2901
- var unusedValueExportToPlacateAjd$3 = 1;
2902
3091
 
2903
3092
  /**
2904
3093
  * Assigns all attribute values to the provided element via the inferred renderer.
@@ -5042,186 +5231,6 @@ function normalizeDebugBindingValue(value) {
5042
5231
  }
5043
5232
  }
5044
5233
 
5045
- /**
5046
- * @license
5047
- * Copyright Google Inc. All Rights Reserved.
5048
- *
5049
- * Use of this source code is governed by an MIT-style license that can be
5050
- * found in the LICENSE file at https://angular.io/license
5051
- */
5052
- /**
5053
- * This property will be monkey-patched on elements, components and directives
5054
- */
5055
- var MONKEY_PATCH_KEY_NAME = '__ngContext__';
5056
-
5057
- /**
5058
- * @license
5059
- * Copyright Google Inc. All Rights Reserved.
5060
- *
5061
- * Use of this source code is governed by an MIT-style license that can be
5062
- * found in the LICENSE file at https://angular.io/license
5063
- */
5064
- /**
5065
- * For efficiency reasons we often put several different data types (`RNode`, `LView`, `LContainer`)
5066
- * in same location in `LView`. This is because we don't want to pre-allocate space for it
5067
- * because the storage is sparse. This file contains utilities for dealing with such data types.
5068
- *
5069
- * How do we know what is stored at a given location in `LView`.
5070
- * - `Array.isArray(value) === false` => `RNode` (The normal storage value)
5071
- * - `Array.isArray(value) === true` => then the `value[0]` represents the wrapped value.
5072
- * - `typeof value[TYPE] === 'object'` => `LView`
5073
- * - This happens when we have a component at a given location
5074
- * - `typeof value[TYPE] === true` => `LContainer`
5075
- * - This happens when we have `LContainer` binding at a given location.
5076
- *
5077
- *
5078
- * NOTE: it is assumed that `Array.isArray` and `typeof` operations are very efficient.
5079
- */
5080
- /**
5081
- * Returns `RNode`.
5082
- * @param value wrapped value of `RNode`, `LView`, `LContainer`
5083
- */
5084
- function unwrapRNode(value) {
5085
- while (Array.isArray(value)) {
5086
- value = value[HOST];
5087
- }
5088
- return value;
5089
- }
5090
- /**
5091
- * Returns `LView` or `null` if not found.
5092
- * @param value wrapped value of `RNode`, `LView`, `LContainer`
5093
- */
5094
- function unwrapLView(value) {
5095
- while (Array.isArray(value)) {
5096
- // This check is same as `isLView()` but we don't call at as we don't want to call
5097
- // `Array.isArray()` twice and give JITer more work for inlining.
5098
- if (typeof value[TYPE] === 'object')
5099
- return value;
5100
- value = value[HOST];
5101
- }
5102
- return null;
5103
- }
5104
- /**
5105
- * Returns `LContainer` or `null` if not found.
5106
- * @param value wrapped value of `RNode`, `LView`, `LContainer`
5107
- */
5108
- function unwrapLContainer(value) {
5109
- while (Array.isArray(value)) {
5110
- // This check is same as `isLContainer()` but we don't call at as we don't want to call
5111
- // `Array.isArray()` twice and give JITer more work for inlining.
5112
- if (value[TYPE] === true)
5113
- return value;
5114
- value = value[HOST];
5115
- }
5116
- return null;
5117
- }
5118
- /**
5119
- * Retrieves an element value from the provided `viewData`, by unwrapping
5120
- * from any containers, component views, or style contexts.
5121
- */
5122
- function getNativeByIndex(index, lView) {
5123
- return unwrapRNode(lView[index + HEADER_OFFSET]);
5124
- }
5125
- /**
5126
- * Retrieve an `RNode` for a given `TNode` and `LView`.
5127
- *
5128
- * This function guarantees in dev mode to retrieve a non-null `RNode`.
5129
- *
5130
- * @param tNode
5131
- * @param lView
5132
- */
5133
- function getNativeByTNode(tNode, lView) {
5134
- ngDevMode && assertTNodeForLView(tNode, lView);
5135
- ngDevMode && assertDataInRange(lView, tNode.index);
5136
- var node = unwrapRNode(lView[tNode.index]);
5137
- ngDevMode && !isProceduralRenderer(lView[RENDERER]) && assertDomNode(node);
5138
- return node;
5139
- }
5140
- /**
5141
- * Retrieve an `RNode` or `null` for a given `TNode` and `LView`.
5142
- *
5143
- * Some `TNode`s don't have associated `RNode`s. For example `Projection`
5144
- *
5145
- * @param tNode
5146
- * @param lView
5147
- */
5148
- function getNativeByTNodeOrNull(tNode, lView) {
5149
- var index = tNode.index;
5150
- if (index !== -1) {
5151
- ngDevMode && assertTNodeForLView(tNode, lView);
5152
- var node = unwrapRNode(lView[index]);
5153
- ngDevMode && node !== null && !isProceduralRenderer(lView[RENDERER]) && assertDomNode(node);
5154
- return node;
5155
- }
5156
- return null;
5157
- }
5158
- function getTNode(tView, index) {
5159
- ngDevMode && assertGreaterThan(index, -1, 'wrong index for TNode');
5160
- ngDevMode && assertLessThan(index, tView.data.length, 'wrong index for TNode');
5161
- return tView.data[index + HEADER_OFFSET];
5162
- }
5163
- /** Retrieves a value from any `LView` or `TData`. */
5164
- function load(view, index) {
5165
- ngDevMode && assertDataInRange(view, index + HEADER_OFFSET);
5166
- return view[index + HEADER_OFFSET];
5167
- }
5168
- function getComponentLViewByIndex(nodeIndex, hostView) {
5169
- // Could be an LView or an LContainer. If LContainer, unwrap to find LView.
5170
- ngDevMode && assertDataInRange(hostView, nodeIndex);
5171
- var slotValue = hostView[nodeIndex];
5172
- var lView = isLView(slotValue) ? slotValue : slotValue[HOST];
5173
- return lView;
5174
- }
5175
- /**
5176
- * Returns the monkey-patch value data present on the target (which could be
5177
- * a component, directive or a DOM node).
5178
- */
5179
- function readPatchedData(target) {
5180
- ngDevMode && assertDefined(target, 'Target expected');
5181
- return target[MONKEY_PATCH_KEY_NAME] || null;
5182
- }
5183
- function readPatchedLView(target) {
5184
- var value = readPatchedData(target);
5185
- if (value) {
5186
- return Array.isArray(value) ? value : value.lView;
5187
- }
5188
- return null;
5189
- }
5190
- /** Checks whether a given view is in creation mode */
5191
- function isCreationMode(view) {
5192
- return (view[FLAGS] & 4 /* CreationMode */) === 4 /* CreationMode */;
5193
- }
5194
- /**
5195
- * Returns a boolean for whether the view is attached to the change detection tree.
5196
- *
5197
- * Note: This determines whether a view should be checked, not whether it's inserted
5198
- * into a container. For that, you'll want `viewAttachedToContainer` below.
5199
- */
5200
- function viewAttachedToChangeDetector(view) {
5201
- return (view[FLAGS] & 128 /* Attached */) === 128 /* Attached */;
5202
- }
5203
- /** Returns a boolean for whether the view is attached to a container. */
5204
- function viewAttachedToContainer(view) {
5205
- return isLContainer(view[PARENT]);
5206
- }
5207
- /** Returns a constant from `TConstants` instance. */
5208
- function getConstant(consts, index) {
5209
- return consts === null || index == null ? null : consts[index];
5210
- }
5211
- /**
5212
- * Resets the pre-order hook flags of the view.
5213
- * @param lView the LView on which the flags are reset
5214
- */
5215
- function resetPreOrderHookFlags(lView) {
5216
- lView[PREORDER_HOOK_FLAGS] = 0;
5217
- }
5218
- function getLContainerActiveIndex(lContainer) {
5219
- return lContainer[ACTIVE_INDEX] >> 1 /* SHIFT */;
5220
- }
5221
- function setLContainerActiveIndex(lContainer, index) {
5222
- lContainer[ACTIVE_INDEX] = index << 1 /* SHIFT */;
5223
- }
5224
-
5225
5234
  /**
5226
5235
  * @license
5227
5236
  * Copyright Google Inc. All Rights Reserved.
@@ -7927,16 +7936,15 @@ function mapPropName(name) {
7927
7936
  return 'tabIndex';
7928
7937
  return name;
7929
7938
  }
7930
- function elementPropertyInternal(tView, lView, index, propName, value, sanitizer, nativeOnly, loadRendererFn) {
7939
+ function elementPropertyInternal(tView, tNode, lView, propName, value, renderer, sanitizer, nativeOnly) {
7931
7940
  ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');
7932
- var element = getNativeByIndex(index, lView);
7933
- var tNode = getTNode(tView, index);
7941
+ var element = getNativeByTNode(tNode, lView);
7934
7942
  var inputData = tNode.inputs;
7935
7943
  var dataValue;
7936
7944
  if (!nativeOnly && inputData != null && (dataValue = inputData[propName])) {
7937
7945
  setInputsForProperty(tView, lView, dataValue, propName, value);
7938
7946
  if (isComponentHost(tNode))
7939
- markDirtyIfOnPush(lView, index + HEADER_OFFSET);
7947
+ markDirtyIfOnPush(lView, tNode.index);
7940
7948
  if (ngDevMode) {
7941
7949
  setNgReflectProperties(lView, element, tNode.type, dataValue, value);
7942
7950
  }
@@ -7952,7 +7960,6 @@ function elementPropertyInternal(tView, lView, index, propName, value, sanitizer
7952
7960
  }
7953
7961
  ngDevMode.rendererSetProperty++;
7954
7962
  }
7955
- var renderer = loadRendererFn ? loadRendererFn(tNode, lView) : lView[RENDERER];
7956
7963
  // It is assumed that the sanitizer is only added when the compiler determines that the
7957
7964
  // property is risky, so sanitization can be done without further checks.
7958
7965
  value = sanitizer != null ? sanitizer(value, tNode.tagName || '', propName) : value;
@@ -8362,10 +8369,10 @@ function addComponentLogic(lView, hostTNode, def) {
8362
8369
  // so this is a regular element, wrap it with the component view
8363
8370
  lView[hostTNode.index] = componentView;
8364
8371
  }
8365
- function elementAttributeInternal(index, name, value, tView, lView, sanitizer, namespace) {
8372
+ function elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace) {
8366
8373
  ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');
8367
8374
  ngDevMode && validateAgainstEventAttributes(name);
8368
- var element = getNativeByIndex(index, lView);
8375
+ var element = getNativeByTNode(tNode, lView);
8369
8376
  var renderer = lView[RENDERER];
8370
8377
  if (value == null) {
8371
8378
  ngDevMode && ngDevMode.rendererRemoveAttribute++;
@@ -8374,7 +8381,6 @@ function elementAttributeInternal(index, name, value, tView, lView, sanitizer, n
8374
8381
  }
8375
8382
  else {
8376
8383
  ngDevMode && ngDevMode.rendererSetAttribute++;
8377
- var tNode = getTNode(tView, index);
8378
8384
  var strValue = sanitizer == null ? renderStringify(value) : sanitizer(value, tNode.tagName || '', name);
8379
8385
  if (isProceduralRenderer(renderer)) {
8380
8386
  renderer.setAttribute(element, name, strValue, namespace);
@@ -8781,12 +8787,12 @@ function executeViewQueryFn(flags, viewQueryFn, component) {
8781
8787
  * interpolated properties.
8782
8788
  *
8783
8789
  * @param tData `TData` where meta-data will be saved;
8784
- * @param nodeIndex index of a `TNode` that is a target of the binding;
8790
+ * @param tNode `TNode` that is a target of the binding;
8785
8791
  * @param propertyName bound property name;
8786
8792
  * @param bindingIndex binding index in `LView`
8787
8793
  * @param interpolationParts static interpolation parts (for property interpolations)
8788
8794
  */
8789
- function storePropertyBindingMetadata(tData, nodeIndex, propertyName, bindingIndex) {
8795
+ function storePropertyBindingMetadata(tData, tNode, propertyName, bindingIndex) {
8790
8796
  var interpolationParts = [];
8791
8797
  for (var _i = 4; _i < arguments.length; _i++) {
8792
8798
  interpolationParts[_i - 4] = arguments[_i];
@@ -8795,7 +8801,6 @@ function storePropertyBindingMetadata(tData, nodeIndex, propertyName, bindingInd
8795
8801
  // Since we don't have a concept of the "first update pass" we need to check for presence of the
8796
8802
  // binding meta-data to decide if one should be stored (or if was stored already).
8797
8803
  if (tData[bindingIndex] === null) {
8798
- var tNode = tData[nodeIndex + HEADER_OFFSET];
8799
8804
  if (tNode.inputs == null || !tNode.inputs[propertyName]) {
8800
8805
  var propBindingIdxs = tNode.propertyBindings || (tNode.propertyBindings = []);
8801
8806
  propBindingIdxs.push(bindingIndex);
@@ -8874,7 +8879,7 @@ function textBindingInternal(lView, index, value) {
8874
8879
  * Use of this source code is governed by an MIT-style license that can be
8875
8880
  * found in the LICENSE file at https://angular.io/license
8876
8881
  */
8877
- var unusedValueToPlacateAjd$1 = unusedValueExportToPlacateAjd$1 + unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd$3 + unusedValueExportToPlacateAjd;
8882
+ var unusedValueToPlacateAjd$1 = unusedValueExportToPlacateAjd$1 + unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd$2 + unusedValueExportToPlacateAjd;
8878
8883
  function getLContainer(tNode, embeddedView) {
8879
8884
  ngDevMode && assertLView(embeddedView);
8880
8885
  var container = embeddedView[PARENT];
@@ -13349,10 +13354,10 @@ function ɵɵattribute(name, value, sanitizer, namespace) {
13349
13354
  var lView = getLView();
13350
13355
  var bindingIndex = nextBindingIndex();
13351
13356
  if (bindingUpdated(lView, bindingIndex, value)) {
13352
- var nodeIndex = getSelectedIndex();
13353
13357
  var tView = getTView();
13354
- elementAttributeInternal(nodeIndex, name, value, tView, lView, sanitizer, namespace);
13355
- ngDevMode && storePropertyBindingMetadata(tView.data, nodeIndex, 'attr.' + name, bindingIndex);
13358
+ var tNode = getSelectedTNode();
13359
+ elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace);
13360
+ ngDevMode && storePropertyBindingMetadata(tView.data, tNode, 'attr.' + name, bindingIndex);
13356
13361
  }
13357
13362
  return ɵɵattribute;
13358
13363
  }
@@ -13522,11 +13527,10 @@ function ɵɵattributeInterpolate1(attrName, prefix, v0, suffix, sanitizer, name
13522
13527
  var lView = getLView();
13523
13528
  var interpolatedValue = interpolation1(lView, prefix, v0, suffix);
13524
13529
  if (interpolatedValue !== NO_CHANGE) {
13525
- var nodeIndex = getSelectedIndex();
13526
- var tView = getTView();
13527
- elementAttributeInternal(nodeIndex, attrName, interpolatedValue, tView, lView, sanitizer, namespace);
13530
+ var tNode = getSelectedTNode();
13531
+ elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
13528
13532
  ngDevMode &&
13529
- storePropertyBindingMetadata(tView.data, nodeIndex, 'attr.' + attrName, getBindingIndex() - 1, prefix, suffix);
13533
+ storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 1, prefix, suffix);
13530
13534
  }
13531
13535
  return ɵɵattributeInterpolate1;
13532
13536
  }
@@ -13560,11 +13564,10 @@ function ɵɵattributeInterpolate2(attrName, prefix, v0, i0, v1, suffix, sanitiz
13560
13564
  var lView = getLView();
13561
13565
  var interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);
13562
13566
  if (interpolatedValue !== NO_CHANGE) {
13563
- var nodeIndex = getSelectedIndex();
13564
- var tView = getTView();
13565
- elementAttributeInternal(nodeIndex, attrName, interpolatedValue, tView, lView, sanitizer, namespace);
13567
+ var tNode = getSelectedTNode();
13568
+ elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
13566
13569
  ngDevMode &&
13567
- storePropertyBindingMetadata(tView.data, nodeIndex, 'attr.' + attrName, getBindingIndex() - 2, prefix, i0, suffix);
13570
+ storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 2, prefix, i0, suffix);
13568
13571
  }
13569
13572
  return ɵɵattributeInterpolate2;
13570
13573
  }
@@ -13601,10 +13604,9 @@ function ɵɵattributeInterpolate3(attrName, prefix, v0, i0, v1, i1, v2, suffix,
13601
13604
  var lView = getLView();
13602
13605
  var interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);
13603
13606
  if (interpolatedValue !== NO_CHANGE) {
13604
- var nodeIndex = getSelectedIndex();
13605
- var tView = getTView();
13606
- elementAttributeInternal(nodeIndex, attrName, interpolatedValue, tView, lView, sanitizer, namespace);
13607
- ngDevMode && storePropertyBindingMetadata(tView.data, nodeIndex, 'attr.' + attrName, getBindingIndex() - 3, prefix, i0, i1, suffix);
13607
+ var tNode = getSelectedTNode();
13608
+ elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
13609
+ ngDevMode && storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 3, prefix, i0, i1, suffix);
13608
13610
  }
13609
13611
  return ɵɵattributeInterpolate3;
13610
13612
  }
@@ -13643,10 +13645,9 @@ function ɵɵattributeInterpolate4(attrName, prefix, v0, i0, v1, i1, v2, i2, v3,
13643
13645
  var lView = getLView();
13644
13646
  var interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);
13645
13647
  if (interpolatedValue !== NO_CHANGE) {
13646
- var nodeIndex = getSelectedIndex();
13647
- var tView = getTView();
13648
- elementAttributeInternal(nodeIndex, attrName, interpolatedValue, tView, lView, sanitizer, namespace);
13649
- ngDevMode && storePropertyBindingMetadata(tView.data, nodeIndex, 'attr.' + attrName, getBindingIndex() - 4, prefix, i0, i1, i2, suffix);
13648
+ var tNode = getSelectedTNode();
13649
+ elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
13650
+ ngDevMode && storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 4, prefix, i0, i1, i2, suffix);
13650
13651
  }
13651
13652
  return ɵɵattributeInterpolate4;
13652
13653
  }
@@ -13687,10 +13688,9 @@ function ɵɵattributeInterpolate5(attrName, prefix, v0, i0, v1, i1, v2, i2, v3,
13687
13688
  var lView = getLView();
13688
13689
  var interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);
13689
13690
  if (interpolatedValue !== NO_CHANGE) {
13690
- var nodeIndex = getSelectedIndex();
13691
- var tView = getTView();
13692
- elementAttributeInternal(nodeIndex, attrName, interpolatedValue, tView, lView, sanitizer, namespace);
13693
- ngDevMode && storePropertyBindingMetadata(tView.data, nodeIndex, 'attr.' + attrName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix);
13691
+ var tNode = getSelectedTNode();
13692
+ elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
13693
+ ngDevMode && storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix);
13694
13694
  }
13695
13695
  return ɵɵattributeInterpolate5;
13696
13696
  }
@@ -13733,10 +13733,9 @@ function ɵɵattributeInterpolate6(attrName, prefix, v0, i0, v1, i1, v2, i2, v3,
13733
13733
  var lView = getLView();
13734
13734
  var interpolatedValue = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);
13735
13735
  if (interpolatedValue !== NO_CHANGE) {
13736
- var nodeIndex = getSelectedIndex();
13737
- var tView = getTView();
13738
- elementAttributeInternal(nodeIndex, attrName, interpolatedValue, tView, lView, sanitizer, namespace);
13739
- ngDevMode && storePropertyBindingMetadata(tView.data, nodeIndex, 'attr.' + attrName, getBindingIndex() - 6, prefix, i0, i1, i2, i3, i4, suffix);
13736
+ var tNode = getSelectedTNode();
13737
+ elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
13738
+ ngDevMode && storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 6, prefix, i0, i1, i2, i3, i4, suffix);
13740
13739
  }
13741
13740
  return ɵɵattributeInterpolate6;
13742
13741
  }
@@ -13781,10 +13780,9 @@ function ɵɵattributeInterpolate7(attrName, prefix, v0, i0, v1, i1, v2, i2, v3,
13781
13780
  var lView = getLView();
13782
13781
  var interpolatedValue = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);
13783
13782
  if (interpolatedValue !== NO_CHANGE) {
13784
- var nodeIndex = getSelectedIndex();
13785
- var tView = getTView();
13786
- elementAttributeInternal(nodeIndex, attrName, interpolatedValue, tView, lView, sanitizer, namespace);
13787
- ngDevMode && storePropertyBindingMetadata(tView.data, nodeIndex, 'attr.' + attrName, getBindingIndex() - 7, prefix, i0, i1, i2, i3, i4, i5, suffix);
13783
+ var tNode = getSelectedTNode();
13784
+ elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
13785
+ ngDevMode && storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 7, prefix, i0, i1, i2, i3, i4, i5, suffix);
13788
13786
  }
13789
13787
  return ɵɵattributeInterpolate7;
13790
13788
  }
@@ -13831,10 +13829,9 @@ function ɵɵattributeInterpolate8(attrName, prefix, v0, i0, v1, i1, v2, i2, v3,
13831
13829
  var lView = getLView();
13832
13830
  var interpolatedValue = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);
13833
13831
  if (interpolatedValue !== NO_CHANGE) {
13834
- var nodeIndex = getSelectedIndex();
13835
- var tView = getTView();
13836
- elementAttributeInternal(nodeIndex, attrName, interpolatedValue, tView, lView, sanitizer, namespace);
13837
- ngDevMode && storePropertyBindingMetadata(tView.data, nodeIndex, 'attr.' + attrName, getBindingIndex() - 8, prefix, i0, i1, i2, i3, i4, i5, i6, suffix);
13832
+ var tNode = getSelectedTNode();
13833
+ elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
13834
+ ngDevMode && storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 8, prefix, i0, i1, i2, i3, i4, i5, i6, suffix);
13838
13835
  }
13839
13836
  return ɵɵattributeInterpolate8;
13840
13837
  }
@@ -13868,15 +13865,14 @@ function ɵɵattributeInterpolateV(attrName, values, sanitizer, namespace) {
13868
13865
  var lView = getLView();
13869
13866
  var interpolated = interpolationV(lView, values);
13870
13867
  if (interpolated !== NO_CHANGE) {
13871
- var tView = getTView();
13872
- var nodeIndex = getSelectedIndex();
13873
- elementAttributeInternal(nodeIndex, attrName, interpolated, tView, lView, sanitizer, namespace);
13868
+ var tNode = getSelectedTNode();
13869
+ elementAttributeInternal(tNode, lView, attrName, interpolated, sanitizer, namespace);
13874
13870
  if (ngDevMode) {
13875
13871
  var interpolationInBetween = [values[0]]; // prefix
13876
13872
  for (var i = 2; i < values.length; i += 2) {
13877
13873
  interpolationInBetween.push(values[i]);
13878
13874
  }
13879
- storePropertyBindingMetadata.apply(void 0, __spread([tView.data, nodeIndex, 'attr.' + attrName,
13875
+ storePropertyBindingMetadata.apply(void 0, __spread([getTView().data, tNode, 'attr.' + attrName,
13880
13876
  getBindingIndex() - interpolationInBetween.length + 1], interpolationInBetween));
13881
13877
  }
13882
13878
  }
@@ -14198,10 +14194,10 @@ function ɵɵproperty(propName, value, sanitizer) {
14198
14194
  var lView = getLView();
14199
14195
  var bindingIndex = nextBindingIndex();
14200
14196
  if (bindingUpdated(lView, bindingIndex, value)) {
14201
- var nodeIndex = getSelectedIndex();
14202
14197
  var tView = getTView();
14203
- elementPropertyInternal(tView, lView, nodeIndex, propName, value, sanitizer);
14204
- ngDevMode && storePropertyBindingMetadata(tView.data, nodeIndex, propName, bindingIndex);
14198
+ var tNode = getSelectedTNode();
14199
+ elementPropertyInternal(tView, tNode, lView, propName, value, lView[RENDERER], sanitizer, false);
14200
+ ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);
14205
14201
  }
14206
14202
  return ɵɵproperty;
14207
14203
  }
@@ -15089,10 +15085,10 @@ function ɵɵpropertyInterpolate1(propName, prefix, v0, suffix, sanitizer) {
15089
15085
  var lView = getLView();
15090
15086
  var interpolatedValue = interpolation1(lView, prefix, v0, suffix);
15091
15087
  if (interpolatedValue !== NO_CHANGE) {
15092
- var nodeIndex = getSelectedIndex();
15093
15088
  var tView = getTView();
15094
- elementPropertyInternal(tView, lView, nodeIndex, propName, interpolatedValue, sanitizer);
15095
- ngDevMode && storePropertyBindingMetadata(tView.data, nodeIndex, propName, getBindingIndex() - 1, prefix, suffix);
15089
+ var tNode = getSelectedTNode();
15090
+ elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
15091
+ ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 1, prefix, suffix);
15096
15092
  }
15097
15093
  return ɵɵpropertyInterpolate1;
15098
15094
  }
@@ -15130,10 +15126,10 @@ function ɵɵpropertyInterpolate2(propName, prefix, v0, i0, v1, suffix, sanitize
15130
15126
  var lView = getLView();
15131
15127
  var interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);
15132
15128
  if (interpolatedValue !== NO_CHANGE) {
15133
- var nodeIndex = getSelectedIndex();
15134
15129
  var tView = getTView();
15135
- elementPropertyInternal(tView, lView, nodeIndex, propName, interpolatedValue, sanitizer);
15136
- ngDevMode && storePropertyBindingMetadata(tView.data, nodeIndex, propName, getBindingIndex() - 2, prefix, i0, suffix);
15130
+ var tNode = getSelectedTNode();
15131
+ elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
15132
+ ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 2, prefix, i0, suffix);
15137
15133
  }
15138
15134
  return ɵɵpropertyInterpolate2;
15139
15135
  }
@@ -15174,11 +15170,10 @@ function ɵɵpropertyInterpolate3(propName, prefix, v0, i0, v1, i1, v2, suffix,
15174
15170
  var lView = getLView();
15175
15171
  var interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);
15176
15172
  if (interpolatedValue !== NO_CHANGE) {
15177
- var nodeIndex = getSelectedIndex();
15178
15173
  var tView = getTView();
15179
- elementPropertyInternal(tView, lView, nodeIndex, propName, interpolatedValue, sanitizer);
15180
- ngDevMode &&
15181
- storePropertyBindingMetadata(tView.data, nodeIndex, propName, getBindingIndex() - 3, prefix, i0, i1, suffix);
15174
+ var tNode = getSelectedTNode();
15175
+ elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
15176
+ ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 3, prefix, i0, i1, suffix);
15182
15177
  }
15183
15178
  return ɵɵpropertyInterpolate3;
15184
15179
  }
@@ -15221,11 +15216,11 @@ function ɵɵpropertyInterpolate4(propName, prefix, v0, i0, v1, i1, v2, i2, v3,
15221
15216
  var lView = getLView();
15222
15217
  var interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);
15223
15218
  if (interpolatedValue !== NO_CHANGE) {
15224
- var nodeIndex = getSelectedIndex();
15225
15219
  var tView = getTView();
15226
- elementPropertyInternal(tView, lView, nodeIndex, propName, interpolatedValue, sanitizer);
15220
+ var tNode = getSelectedTNode();
15221
+ elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
15227
15222
  ngDevMode &&
15228
- storePropertyBindingMetadata(tView.data, nodeIndex, propName, getBindingIndex() - 4, prefix, i0, i1, i2, suffix);
15223
+ storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 4, prefix, i0, i1, i2, suffix);
15229
15224
  }
15230
15225
  return ɵɵpropertyInterpolate4;
15231
15226
  }
@@ -15270,11 +15265,11 @@ function ɵɵpropertyInterpolate5(propName, prefix, v0, i0, v1, i1, v2, i2, v3,
15270
15265
  var lView = getLView();
15271
15266
  var interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);
15272
15267
  if (interpolatedValue !== NO_CHANGE) {
15273
- var nodeIndex = getSelectedIndex();
15274
15268
  var tView = getTView();
15275
- elementPropertyInternal(tView, lView, nodeIndex, propName, interpolatedValue, sanitizer);
15269
+ var tNode = getSelectedTNode();
15270
+ elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
15276
15271
  ngDevMode &&
15277
- storePropertyBindingMetadata(tView.data, nodeIndex, propName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix);
15272
+ storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix);
15278
15273
  }
15279
15274
  return ɵɵpropertyInterpolate5;
15280
15275
  }
@@ -15321,10 +15316,11 @@ function ɵɵpropertyInterpolate6(propName, prefix, v0, i0, v1, i1, v2, i2, v3,
15321
15316
  var lView = getLView();
15322
15317
  var interpolatedValue = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);
15323
15318
  if (interpolatedValue !== NO_CHANGE) {
15324
- var nodeIndex = getSelectedIndex();
15325
15319
  var tView = getTView();
15326
- elementPropertyInternal(tView, lView, nodeIndex, propName, interpolatedValue, sanitizer);
15327
- ngDevMode && storePropertyBindingMetadata(tView.data, nodeIndex, propName, getBindingIndex() - 6, prefix, i0, i1, i2, i3, i4, suffix);
15320
+ var tNode = getSelectedTNode();
15321
+ elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
15322
+ ngDevMode &&
15323
+ storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 6, prefix, i0, i1, i2, i3, i4, suffix);
15328
15324
  }
15329
15325
  return ɵɵpropertyInterpolate6;
15330
15326
  }
@@ -15373,10 +15369,10 @@ function ɵɵpropertyInterpolate7(propName, prefix, v0, i0, v1, i1, v2, i2, v3,
15373
15369
  var lView = getLView();
15374
15370
  var interpolatedValue = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);
15375
15371
  if (interpolatedValue !== NO_CHANGE) {
15376
- var nodeIndex = getSelectedIndex();
15377
15372
  var tView = getTView();
15378
- elementPropertyInternal(tView, lView, nodeIndex, propName, interpolatedValue, sanitizer);
15379
- ngDevMode && storePropertyBindingMetadata(tView.data, nodeIndex, propName, getBindingIndex() - 7, prefix, i0, i1, i2, i3, i4, i5, suffix);
15373
+ var tNode = getSelectedTNode();
15374
+ elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
15375
+ ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 7, prefix, i0, i1, i2, i3, i4, i5, suffix);
15380
15376
  }
15381
15377
  return ɵɵpropertyInterpolate7;
15382
15378
  }
@@ -15427,10 +15423,10 @@ function ɵɵpropertyInterpolate8(propName, prefix, v0, i0, v1, i1, v2, i2, v3,
15427
15423
  var lView = getLView();
15428
15424
  var interpolatedValue = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);
15429
15425
  if (interpolatedValue !== NO_CHANGE) {
15430
- var nodeIndex = getSelectedIndex();
15431
15426
  var tView = getTView();
15432
- elementPropertyInternal(tView, lView, nodeIndex, propName, interpolatedValue, sanitizer);
15433
- ngDevMode && storePropertyBindingMetadata(tView.data, nodeIndex, propName, getBindingIndex() - 8, prefix, i0, i1, i2, i3, i4, i5, i6, suffix);
15427
+ var tNode = getSelectedTNode();
15428
+ elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
15429
+ ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 8, prefix, i0, i1, i2, i3, i4, i5, i6, suffix);
15434
15430
  }
15435
15431
  return ɵɵpropertyInterpolate8;
15436
15432
  }
@@ -15468,15 +15464,15 @@ function ɵɵpropertyInterpolateV(propName, values, sanitizer) {
15468
15464
  var lView = getLView();
15469
15465
  var interpolatedValue = interpolationV(lView, values);
15470
15466
  if (interpolatedValue !== NO_CHANGE) {
15471
- var nodeIndex = getSelectedIndex();
15472
15467
  var tView = getTView();
15473
- elementPropertyInternal(tView, lView, nodeIndex, propName, interpolatedValue, sanitizer);
15468
+ var tNode = getSelectedTNode();
15469
+ elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
15474
15470
  if (ngDevMode) {
15475
15471
  var interpolationInBetween = [values[0]]; // prefix
15476
15472
  for (var i = 2; i < values.length; i += 2) {
15477
15473
  interpolationInBetween.push(values[i]);
15478
15474
  }
15479
- storePropertyBindingMetadata.apply(void 0, __spread([tView.data, nodeIndex, propName, getBindingIndex() - interpolationInBetween.length + 1], interpolationInBetween));
15475
+ storePropertyBindingMetadata.apply(void 0, __spread([tView.data, tNode, propName, getBindingIndex() - interpolationInBetween.length + 1], interpolationInBetween));
15480
15476
  }
15481
15477
  }
15482
15478
  return ɵɵpropertyInterpolateV;
@@ -18324,10 +18320,10 @@ function ɵɵhostProperty(propName, value, sanitizer) {
18324
18320
  var lView = getLView();
18325
18321
  var bindingIndex = nextBindingIndex();
18326
18322
  if (bindingUpdated(lView, bindingIndex, value)) {
18327
- var nodeIndex = getSelectedIndex();
18328
18323
  var tView = getTView();
18329
- elementPropertyInternal(tView, lView, nodeIndex, propName, value, sanitizer, true);
18330
- ngDevMode && storePropertyBindingMetadata(tView.data, nodeIndex, propName, bindingIndex);
18324
+ var tNode = getSelectedTNode();
18325
+ elementPropertyInternal(tView, tNode, lView, propName, value, lView[RENDERER], sanitizer, true);
18326
+ ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);
18331
18327
  }
18332
18328
  return ɵɵhostProperty;
18333
18329
  }
@@ -18356,10 +18352,11 @@ function ɵɵupdateSyntheticHostBinding(propName, value, sanitizer) {
18356
18352
  var lView = getLView();
18357
18353
  var bindingIndex = nextBindingIndex();
18358
18354
  if (bindingUpdated(lView, bindingIndex, value)) {
18359
- var nodeIndex = getSelectedIndex();
18360
18355
  var tView = getTView();
18361
- elementPropertyInternal(tView, lView, nodeIndex, propName, value, sanitizer, true, loadComponentRenderer);
18362
- ngDevMode && storePropertyBindingMetadata(tView.data, nodeIndex, propName, bindingIndex);
18356
+ var tNode = getSelectedTNode();
18357
+ var renderer = loadComponentRenderer(tNode, lView);
18358
+ elementPropertyInternal(tView, tNode, lView, propName, value, renderer, sanitizer, true);
18359
+ ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);
18363
18360
  }
18364
18361
  return ɵɵupdateSyntheticHostBinding;
18365
18362
  }
@@ -19919,7 +19916,7 @@ var Version = /** @class */ (function () {
19919
19916
  /**
19920
19917
  * @publicApi
19921
19918
  */
19922
- var VERSION = new Version('9.0.6');
19919
+ var VERSION = new Version('9.0.7');
19923
19920
 
19924
19921
  /**
19925
19922
  * @license
@@ -23617,11 +23614,17 @@ function i18nStartFirstPass(lView, tView, index, message, subTemplateIndex) {
23617
23614
  for (var j = 0; j < parts.length; j++) {
23618
23615
  if (j & 1) {
23619
23616
  // Odd indexes are ICU expressions
23617
+ var icuExpression = parts[j];
23618
+ // Verify that ICU expression has the right shape. Translations might contain invalid
23619
+ // constructions (while original messages were correct), so ICU parsing at runtime may not
23620
+ // succeed (thus `icuExpression` remains a string).
23621
+ if (typeof icuExpression !== 'object') {
23622
+ throw new Error("Unable to parse ICU expression in \"" + templateTranslation + "\" message.");
23623
+ }
23620
23624
  // Create the comment node that will anchor the ICU expression
23621
23625
  var icuNodeIndex = startIndex + i18nVarsCount++;
23622
23626
  createOpCodes.push(COMMENT_MARKER, ngDevMode ? "ICU " + icuNodeIndex : '', icuNodeIndex, parentIndex << 17 /* SHIFT_PARENT */ | 1 /* AppendChild */);
23623
23627
  // Update codes for the ICU expression
23624
- var icuExpression = parts[j];
23625
23628
  var mask = getBindingMask(icuExpression);
23626
23629
  icuStart(icuExpressions, icuExpression, icuNodeIndex, icuNodeIndex);
23627
23630
  // Since this is recursive, the last TIcu that was pushed is the one we want
@@ -23927,7 +23930,7 @@ function readCreateOpCodes(index, createOpCodes, tView, lView) {
23927
23930
  var attrValue = createOpCodes[++i];
23928
23931
  // This code is used for ICU expressions only, since we don't support
23929
23932
  // directives/components in ICUs, we don't need to worry about inputs here
23930
- elementAttributeInternal(elementNodeIndex, attrName, attrValue, tView, lView);
23933
+ elementAttributeInternal(getTNode(tView, elementNodeIndex), lView, attrName, attrValue, null, null);
23931
23934
  break;
23932
23935
  default:
23933
23936
  throw new Error("Unable to determine the type of mutate operation for \"" + opCode + "\"");
@@ -23997,7 +24000,7 @@ function readUpdateOpCodes(updateOpCodes, icus, bindingsStartIndex, changeMask,
23997
24000
  case 1 /* Attr */:
23998
24001
  var propName = updateOpCodes[++j];
23999
24002
  var sanitizeFn = updateOpCodes[++j];
24000
- elementPropertyInternal(tView, lView, nodeIndex, propName, value, sanitizeFn);
24003
+ elementPropertyInternal(tView, getTNode(tView, nodeIndex), lView, propName, value, lView[RENDERER], sanitizeFn, false);
24001
24004
  break;
24002
24005
  case 0 /* Text */:
24003
24006
  textBindingInternal(lView, nodeIndex, value);
@@ -24151,7 +24154,7 @@ function i18nAttributesFirstPass(lView, tView, index, values) {
24151
24154
  // Set attributes for Elements only, for other types (like ElementContainer),
24152
24155
  // only set inputs below
24153
24156
  if (tNode.type === 3 /* Element */) {
24154
- elementAttributeInternal(previousElementIndex, attrName, value, tView, lView);
24157
+ elementAttributeInternal(tNode, lView, attrName, value, null, null);
24155
24158
  }
24156
24159
  // Check if that attribute is a directive input
24157
24160
  var dataValue = tNode.inputs !== null && tNode.inputs[attrName];
@@ -24903,6 +24906,18 @@ function ɵɵpureFunction8(slotOffset, pureFn, exp1, exp2, exp3, exp4, exp5, exp
24903
24906
  function ɵɵpureFunctionV(slotOffset, pureFn, exps, thisArg) {
24904
24907
  return pureFunctionVInternal(getLView(), getBindingRoot(), slotOffset, pureFn, exps, thisArg);
24905
24908
  }
24909
+ /**
24910
+ * Results of a pure function invocation are stored in LView in a dedicated slot that is initialized
24911
+ * to NO_CHANGE. In rare situations a pure pipe might throw an exception on the very first
24912
+ * invocation and not produce any valid results. In this case LView would keep holding the NO_CHANGE
24913
+ * value. The NO_CHANGE is not something that we can use in expressions / bindings thus we convert
24914
+ * it to `undefined`.
24915
+ */
24916
+ function getPureFunctionReturnValue(lView, returnValueIndex) {
24917
+ ngDevMode && assertDataInRange(lView, returnValueIndex);
24918
+ var lastReturnValue = lView[returnValueIndex];
24919
+ return lastReturnValue === NO_CHANGE ? undefined : lastReturnValue;
24920
+ }
24906
24921
  /**
24907
24922
  * If the value of the provided exp has changed, calls the pure function to return
24908
24923
  * an updated value. Or if the value has not changed, returns cached value.
@@ -24919,7 +24934,7 @@ function pureFunction1Internal(lView, bindingRoot, slotOffset, pureFn, exp, this
24919
24934
  var bindingIndex = bindingRoot + slotOffset;
24920
24935
  return bindingUpdated(lView, bindingIndex, exp) ?
24921
24936
  updateBinding(lView, bindingIndex + 1, thisArg ? pureFn.call(thisArg, exp) : pureFn(exp)) :
24922
- getBinding(lView, bindingIndex + 1);
24937
+ getPureFunctionReturnValue(lView, bindingIndex + 1);
24923
24938
  }
24924
24939
  /**
24925
24940
  * If the value of any provided exp has changed, calls the pure function to return
@@ -24938,7 +24953,7 @@ function pureFunction2Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp
24938
24953
  var bindingIndex = bindingRoot + slotOffset;
24939
24954
  return bindingUpdated2(lView, bindingIndex, exp1, exp2) ?
24940
24955
  updateBinding(lView, bindingIndex + 2, thisArg ? pureFn.call(thisArg, exp1, exp2) : pureFn(exp1, exp2)) :
24941
- getBinding(lView, bindingIndex + 2);
24956
+ getPureFunctionReturnValue(lView, bindingIndex + 2);
24942
24957
  }
24943
24958
  /**
24944
24959
  * If the value of any provided exp has changed, calls the pure function to return
@@ -24958,7 +24973,7 @@ function pureFunction3Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp
24958
24973
  var bindingIndex = bindingRoot + slotOffset;
24959
24974
  return bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) ?
24960
24975
  updateBinding(lView, bindingIndex + 3, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3) : pureFn(exp1, exp2, exp3)) :
24961
- getBinding(lView, bindingIndex + 3);
24976
+ getPureFunctionReturnValue(lView, bindingIndex + 3);
24962
24977
  }
24963
24978
  /**
24964
24979
  * If the value of any provided exp has changed, calls the pure function to return
@@ -24980,7 +24995,7 @@ function pureFunction4Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp
24980
24995
  var bindingIndex = bindingRoot + slotOffset;
24981
24996
  return bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) ?
24982
24997
  updateBinding(lView, bindingIndex + 4, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4) : pureFn(exp1, exp2, exp3, exp4)) :
24983
- getBinding(lView, bindingIndex + 4);
24998
+ getPureFunctionReturnValue(lView, bindingIndex + 4);
24984
24999
  }
24985
25000
  /**
24986
25001
  * pureFunction instruction that can support any number of bindings.
@@ -25004,7 +25019,7 @@ function pureFunctionVInternal(lView, bindingRoot, slotOffset, pureFn, exps, thi
25004
25019
  bindingUpdated(lView, bindingIndex++, exps[i]) && (different = true);
25005
25020
  }
25006
25021
  return different ? updateBinding(lView, bindingIndex, pureFn.apply(thisArg, exps)) :
25007
- getBinding(lView, bindingIndex);
25022
+ getPureFunctionReturnValue(lView, bindingIndex);
25008
25023
  }
25009
25024
 
25010
25025
  /**
@@ -25458,7 +25473,7 @@ var unusedValueExportToPlacateAjd$8 = 1;
25458
25473
  * Use of this source code is governed by an MIT-style license that can be
25459
25474
  * found in the LICENSE file at https://angular.io/license
25460
25475
  */
25461
- var unusedValueToPlacateAjd$2 = unusedValueExportToPlacateAjd$7 + unusedValueExportToPlacateAjd$2 + unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd$8;
25476
+ var unusedValueToPlacateAjd$2 = unusedValueExportToPlacateAjd$7 + unusedValueExportToPlacateAjd$3 + unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd$8;
25462
25477
  var LQuery_ = /** @class */ (function () {
25463
25478
  function LQuery_(queryList) {
25464
25479
  this.queryList = queryList;