@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
@@ -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
  */
@@ -2160,6 +2160,8 @@
2160
2160
  * Use of this source code is governed by an MIT-style license that can be
2161
2161
  * found in the LICENSE file at https://angular.io/license
2162
2162
  */
2163
+ // [Assert functions do not constraint type when they are guarded by a truthy
2164
+ // expression.](https://github.com/microsoft/TypeScript/issues/37295)
2163
2165
  function assertTNodeForLView(tNode, lView) {
2164
2166
  tNode.hasOwnProperty('tView_') && assertEqual(tNode.tView_, lView[TVIEW], 'This TNode does not belong to this LView.');
2165
2167
  }
@@ -2227,6 +2229,266 @@
2227
2229
  var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
2228
2230
  var MATH_ML_NAMESPACE = 'http://www.w3.org/1998/MathML/';
2229
2231
 
2232
+ /**
2233
+ * @license
2234
+ * Copyright Google Inc. All Rights Reserved.
2235
+ *
2236
+ * Use of this source code is governed by an MIT-style license that can be
2237
+ * found in the LICENSE file at https://angular.io/license
2238
+ */
2239
+ /**
2240
+ * This property will be monkey-patched on elements, components and directives
2241
+ */
2242
+ var MONKEY_PATCH_KEY_NAME = '__ngContext__';
2243
+
2244
+ /**
2245
+ * @license
2246
+ * Copyright Google Inc. All Rights Reserved.
2247
+ *
2248
+ * Use of this source code is governed by an MIT-style license that can be
2249
+ * found in the LICENSE file at https://angular.io/license
2250
+ */
2251
+ /**
2252
+ * Most of the use of `document` in Angular is from within the DI system so it is possible to simply
2253
+ * inject the `DOCUMENT` token and are done.
2254
+ *
2255
+ * Ivy is special because it does not rely upon the DI and must get hold of the document some other
2256
+ * way.
2257
+ *
2258
+ * The solution is to define `getDocument()` and `setDocument()` top-level functions for ivy.
2259
+ * Wherever ivy needs the global document, it calls `getDocument()` instead.
2260
+ *
2261
+ * When running ivy outside of a browser environment, it is necessary to call `setDocument()` to
2262
+ * tell ivy what the global `document` is.
2263
+ *
2264
+ * Angular does this for us in each of the standard platforms (`Browser`, `Server`, and `WebWorker`)
2265
+ * by calling `setDocument()` when providing the `DOCUMENT` token.
2266
+ */
2267
+ var DOCUMENT = undefined;
2268
+ /**
2269
+ * Tell ivy what the `document` is for this platform.
2270
+ *
2271
+ * It is only necessary to call this if the current platform is not a browser.
2272
+ *
2273
+ * @param document The object representing the global `document` in this environment.
2274
+ */
2275
+ function setDocument(document) {
2276
+ DOCUMENT = document;
2277
+ }
2278
+ /**
2279
+ * Access the object that represents the `document` for this platform.
2280
+ *
2281
+ * Ivy calls this whenever it needs to access the `document` object.
2282
+ * For example to create the renderer or to do sanitization.
2283
+ */
2284
+ function getDocument() {
2285
+ if (DOCUMENT !== undefined) {
2286
+ return DOCUMENT;
2287
+ }
2288
+ else if (typeof document !== 'undefined') {
2289
+ return document;
2290
+ }
2291
+ // No "document" can be found. This should only happen if we are running ivy outside Angular and
2292
+ // the current platform is not a browser. Since this is not a supported scenario at the moment
2293
+ // this should not happen in Angular apps.
2294
+ // Once we support running ivy outside of Angular we will need to publish `setDocument()` as a
2295
+ // public API. Meanwhile we just return `undefined` and let the application fail.
2296
+ return undefined;
2297
+ }
2298
+
2299
+ /**
2300
+ * @license
2301
+ * Copyright Google Inc. All Rights Reserved.
2302
+ *
2303
+ * Use of this source code is governed by an MIT-style license that can be
2304
+ * found in the LICENSE file at https://angular.io/license
2305
+ */
2306
+ // TODO: cleanup once the code is merged in angular/angular
2307
+ var RendererStyleFlags3;
2308
+ (function (RendererStyleFlags3) {
2309
+ RendererStyleFlags3[RendererStyleFlags3["Important"] = 1] = "Important";
2310
+ RendererStyleFlags3[RendererStyleFlags3["DashCase"] = 2] = "DashCase";
2311
+ })(RendererStyleFlags3 || (RendererStyleFlags3 = {}));
2312
+ /** Returns whether the `renderer` is a `ProceduralRenderer3` */
2313
+ function isProceduralRenderer(renderer) {
2314
+ return !!(renderer.listen);
2315
+ }
2316
+ var ɵ0$2 = function (hostElement, rendererType) { return getDocument(); };
2317
+ var domRendererFactory3 = {
2318
+ createRenderer: ɵ0$2
2319
+ };
2320
+ // Note: This hack is necessary so we don't erroneously get a circular dependency
2321
+ // failure based on types.
2322
+ var unusedValueExportToPlacateAjd$2 = 1;
2323
+
2324
+ /**
2325
+ * @license
2326
+ * Copyright Google Inc. All Rights Reserved.
2327
+ *
2328
+ * Use of this source code is governed by an MIT-style license that can be
2329
+ * found in the LICENSE file at https://angular.io/license
2330
+ */
2331
+ /**
2332
+ * For efficiency reasons we often put several different data types (`RNode`, `LView`, `LContainer`)
2333
+ * in same location in `LView`. This is because we don't want to pre-allocate space for it
2334
+ * because the storage is sparse. This file contains utilities for dealing with such data types.
2335
+ *
2336
+ * How do we know what is stored at a given location in `LView`.
2337
+ * - `Array.isArray(value) === false` => `RNode` (The normal storage value)
2338
+ * - `Array.isArray(value) === true` => then the `value[0]` represents the wrapped value.
2339
+ * - `typeof value[TYPE] === 'object'` => `LView`
2340
+ * - This happens when we have a component at a given location
2341
+ * - `typeof value[TYPE] === true` => `LContainer`
2342
+ * - This happens when we have `LContainer` binding at a given location.
2343
+ *
2344
+ *
2345
+ * NOTE: it is assumed that `Array.isArray` and `typeof` operations are very efficient.
2346
+ */
2347
+ /**
2348
+ * Returns `RNode`.
2349
+ * @param value wrapped value of `RNode`, `LView`, `LContainer`
2350
+ */
2351
+ function unwrapRNode(value) {
2352
+ while (Array.isArray(value)) {
2353
+ value = value[HOST];
2354
+ }
2355
+ return value;
2356
+ }
2357
+ /**
2358
+ * Returns `LView` or `null` if not found.
2359
+ * @param value wrapped value of `RNode`, `LView`, `LContainer`
2360
+ */
2361
+ function unwrapLView(value) {
2362
+ while (Array.isArray(value)) {
2363
+ // This check is same as `isLView()` but we don't call at as we don't want to call
2364
+ // `Array.isArray()` twice and give JITer more work for inlining.
2365
+ if (typeof value[TYPE] === 'object')
2366
+ return value;
2367
+ value = value[HOST];
2368
+ }
2369
+ return null;
2370
+ }
2371
+ /**
2372
+ * Returns `LContainer` or `null` if not found.
2373
+ * @param value wrapped value of `RNode`, `LView`, `LContainer`
2374
+ */
2375
+ function unwrapLContainer(value) {
2376
+ while (Array.isArray(value)) {
2377
+ // This check is same as `isLContainer()` but we don't call at as we don't want to call
2378
+ // `Array.isArray()` twice and give JITer more work for inlining.
2379
+ if (value[TYPE] === true)
2380
+ return value;
2381
+ value = value[HOST];
2382
+ }
2383
+ return null;
2384
+ }
2385
+ /**
2386
+ * Retrieves an element value from the provided `viewData`, by unwrapping
2387
+ * from any containers, component views, or style contexts.
2388
+ */
2389
+ function getNativeByIndex(index, lView) {
2390
+ return unwrapRNode(lView[index + HEADER_OFFSET]);
2391
+ }
2392
+ /**
2393
+ * Retrieve an `RNode` for a given `TNode` and `LView`.
2394
+ *
2395
+ * This function guarantees in dev mode to retrieve a non-null `RNode`.
2396
+ *
2397
+ * @param tNode
2398
+ * @param lView
2399
+ */
2400
+ function getNativeByTNode(tNode, lView) {
2401
+ ngDevMode && assertTNodeForLView(tNode, lView);
2402
+ ngDevMode && assertDataInRange(lView, tNode.index);
2403
+ var node = unwrapRNode(lView[tNode.index]);
2404
+ ngDevMode && !isProceduralRenderer(lView[RENDERER]) && assertDomNode(node);
2405
+ return node;
2406
+ }
2407
+ /**
2408
+ * Retrieve an `RNode` or `null` for a given `TNode` and `LView`.
2409
+ *
2410
+ * Some `TNode`s don't have associated `RNode`s. For example `Projection`
2411
+ *
2412
+ * @param tNode
2413
+ * @param lView
2414
+ */
2415
+ function getNativeByTNodeOrNull(tNode, lView) {
2416
+ var index = tNode.index;
2417
+ if (index !== -1) {
2418
+ ngDevMode && assertTNodeForLView(tNode, lView);
2419
+ var node = unwrapRNode(lView[index]);
2420
+ ngDevMode && node !== null && !isProceduralRenderer(lView[RENDERER]) && assertDomNode(node);
2421
+ return node;
2422
+ }
2423
+ return null;
2424
+ }
2425
+ function getTNode(tView, index) {
2426
+ ngDevMode && assertGreaterThan(index, -1, 'wrong index for TNode');
2427
+ ngDevMode && assertLessThan(index, tView.data.length, 'wrong index for TNode');
2428
+ return tView.data[index + HEADER_OFFSET];
2429
+ }
2430
+ /** Retrieves a value from any `LView` or `TData`. */
2431
+ function load(view, index) {
2432
+ ngDevMode && assertDataInRange(view, index + HEADER_OFFSET);
2433
+ return view[index + HEADER_OFFSET];
2434
+ }
2435
+ function getComponentLViewByIndex(nodeIndex, hostView) {
2436
+ // Could be an LView or an LContainer. If LContainer, unwrap to find LView.
2437
+ ngDevMode && assertDataInRange(hostView, nodeIndex);
2438
+ var slotValue = hostView[nodeIndex];
2439
+ var lView = isLView(slotValue) ? slotValue : slotValue[HOST];
2440
+ return lView;
2441
+ }
2442
+ /**
2443
+ * Returns the monkey-patch value data present on the target (which could be
2444
+ * a component, directive or a DOM node).
2445
+ */
2446
+ function readPatchedData(target) {
2447
+ ngDevMode && assertDefined(target, 'Target expected');
2448
+ return target[MONKEY_PATCH_KEY_NAME] || null;
2449
+ }
2450
+ function readPatchedLView(target) {
2451
+ var value = readPatchedData(target);
2452
+ if (value) {
2453
+ return Array.isArray(value) ? value : value.lView;
2454
+ }
2455
+ return null;
2456
+ }
2457
+ /** Checks whether a given view is in creation mode */
2458
+ function isCreationMode(view) {
2459
+ return (view[FLAGS] & 4 /* CreationMode */) === 4 /* CreationMode */;
2460
+ }
2461
+ /**
2462
+ * Returns a boolean for whether the view is attached to the change detection tree.
2463
+ *
2464
+ * Note: This determines whether a view should be checked, not whether it's inserted
2465
+ * into a container. For that, you'll want `viewAttachedToContainer` below.
2466
+ */
2467
+ function viewAttachedToChangeDetector(view) {
2468
+ return (view[FLAGS] & 128 /* Attached */) === 128 /* Attached */;
2469
+ }
2470
+ /** Returns a boolean for whether the view is attached to a container. */
2471
+ function viewAttachedToContainer(view) {
2472
+ return isLContainer(view[PARENT]);
2473
+ }
2474
+ /** Returns a constant from `TConstants` instance. */
2475
+ function getConstant(consts, index) {
2476
+ return consts === null || index == null ? null : consts[index];
2477
+ }
2478
+ /**
2479
+ * Resets the pre-order hook flags of the view.
2480
+ * @param lView the LView on which the flags are reset
2481
+ */
2482
+ function resetPreOrderHookFlags(lView) {
2483
+ lView[PREORDER_HOOK_FLAGS] = 0;
2484
+ }
2485
+ function getLContainerActiveIndex(lContainer) {
2486
+ return lContainer[ACTIVE_INDEX] >> 1 /* SHIFT */;
2487
+ }
2488
+ function setLContainerActiveIndex(lContainer, index) {
2489
+ lContainer[ACTIVE_INDEX] = index << 1 /* SHIFT */;
2490
+ }
2491
+
2230
2492
  /**
2231
2493
  * @license
2232
2494
  * Copyright Google Inc. All Rights Reserved.
@@ -2557,6 +2819,13 @@
2557
2819
  function setSelectedIndex(index) {
2558
2820
  instructionState.lFrame.selectedIndex = index;
2559
2821
  }
2822
+ /**
2823
+ * Gets the `tNode` that represents currently selected element.
2824
+ */
2825
+ function getSelectedTNode() {
2826
+ var lFrame = instructionState.lFrame;
2827
+ return getTNode(lFrame.tView, lFrame.selectedIndex);
2828
+ }
2560
2829
  /**
2561
2830
  * Sets the namespace used to create elements to `'http://www.w3.org/2000/svg'` in global state.
2562
2831
  *
@@ -2938,110 +3207,19 @@
2938
3207
  /**
2939
3208
  * Marker set to true during factory invocation to see if we get into recursive loop.
2940
3209
  * Recursive loop causes an error to be displayed.
2941
- */
2942
- this.resolving = false;
2943
- this.canSeeViewProviders = isViewProvider;
2944
- this.injectImpl = injectImplementation;
2945
- }
2946
- return NodeInjectorFactory;
2947
- }());
2948
- function isFactory(obj) {
2949
- return obj instanceof NodeInjectorFactory;
2950
- }
2951
- // Note: This hack is necessary so we don't erroneously get a circular dependency
2952
- // failure based on types.
2953
- var unusedValueExportToPlacateAjd$2 = 1;
2954
-
2955
- /**
2956
- * @license
2957
- * Copyright Google Inc. All Rights Reserved.
2958
- *
2959
- * Use of this source code is governed by an MIT-style license that can be
2960
- * found in the LICENSE file at https://angular.io/license
2961
- */
2962
- function assertNodeType(tNode, type) {
2963
- assertDefined(tNode, 'should be called with a TNode');
2964
- assertEqual(tNode.type, type, "should be a " + typeName(type));
2965
- }
2966
- function assertNodeOfPossibleTypes(tNode) {
2967
- var types = [];
2968
- for (var _i = 1; _i < arguments.length; _i++) {
2969
- types[_i - 1] = arguments[_i];
2970
- }
2971
- assertDefined(tNode, 'should be called with a TNode');
2972
- var found = types.some(function (type) { return tNode.type === type; });
2973
- assertEqual(found, true, "Should be one of " + types.map(typeName).join(', ') + " but got " + typeName(tNode.type));
2974
- }
2975
- function typeName(type) {
2976
- if (type == 1 /* Projection */)
2977
- return 'Projection';
2978
- if (type == 0 /* Container */)
2979
- return 'Container';
2980
- if (type == 5 /* IcuContainer */)
2981
- return 'IcuContainer';
2982
- if (type == 2 /* View */)
2983
- return 'View';
2984
- if (type == 3 /* Element */)
2985
- return 'Element';
2986
- if (type == 4 /* ElementContainer */)
2987
- return 'ElementContainer';
2988
- return '<unknown>';
2989
- }
2990
-
2991
- /**
2992
- * @license
2993
- * Copyright Google Inc. All Rights Reserved.
2994
- *
2995
- * Use of this source code is governed by an MIT-style license that can be
2996
- * found in the LICENSE file at https://angular.io/license
2997
- */
2998
- /**
2999
- * Most of the use of `document` in Angular is from within the DI system so it is possible to simply
3000
- * inject the `DOCUMENT` token and are done.
3001
- *
3002
- * Ivy is special because it does not rely upon the DI and must get hold of the document some other
3003
- * way.
3004
- *
3005
- * The solution is to define `getDocument()` and `setDocument()` top-level functions for ivy.
3006
- * Wherever ivy needs the global document, it calls `getDocument()` instead.
3007
- *
3008
- * When running ivy outside of a browser environment, it is necessary to call `setDocument()` to
3009
- * tell ivy what the global `document` is.
3010
- *
3011
- * Angular does this for us in each of the standard platforms (`Browser`, `Server`, and `WebWorker`)
3012
- * by calling `setDocument()` when providing the `DOCUMENT` token.
3013
- */
3014
- var DOCUMENT = undefined;
3015
- /**
3016
- * Tell ivy what the `document` is for this platform.
3017
- *
3018
- * It is only necessary to call this if the current platform is not a browser.
3019
- *
3020
- * @param document The object representing the global `document` in this environment.
3021
- */
3022
- function setDocument(document) {
3023
- DOCUMENT = document;
3024
- }
3025
- /**
3026
- * Access the object that represents the `document` for this platform.
3027
- *
3028
- * Ivy calls this whenever it needs to access the `document` object.
3029
- * For example to create the renderer or to do sanitization.
3030
- */
3031
- function getDocument() {
3032
- if (DOCUMENT !== undefined) {
3033
- return DOCUMENT;
3034
- }
3035
- else if (typeof document !== 'undefined') {
3036
- return document;
3037
- }
3038
- // No "document" can be found. This should only happen if we are running ivy outside Angular and
3039
- // the current platform is not a browser. Since this is not a supported scenario at the moment
3040
- // this should not happen in Angular apps.
3041
- // Once we support running ivy outside of Angular we will need to publish `setDocument()` as a
3042
- // public API. Meanwhile we just return `undefined` and let the application fail.
3043
- return undefined;
3210
+ */
3211
+ this.resolving = false;
3212
+ this.canSeeViewProviders = isViewProvider;
3213
+ this.injectImpl = injectImplementation;
3214
+ }
3215
+ return NodeInjectorFactory;
3216
+ }());
3217
+ function isFactory(obj) {
3218
+ return obj instanceof NodeInjectorFactory;
3044
3219
  }
3220
+ // Note: This hack is necessary so we don't erroneously get a circular dependency
3221
+ // failure based on types.
3222
+ var unusedValueExportToPlacateAjd$3 = 1;
3045
3223
 
3046
3224
  /**
3047
3225
  * @license
@@ -3050,23 +3228,34 @@
3050
3228
  * Use of this source code is governed by an MIT-style license that can be
3051
3229
  * found in the LICENSE file at https://angular.io/license
3052
3230
  */
3053
- // TODO: cleanup once the code is merged in angular/angular
3054
- var RendererStyleFlags3;
3055
- (function (RendererStyleFlags3) {
3056
- RendererStyleFlags3[RendererStyleFlags3["Important"] = 1] = "Important";
3057
- RendererStyleFlags3[RendererStyleFlags3["DashCase"] = 2] = "DashCase";
3058
- })(RendererStyleFlags3 || (RendererStyleFlags3 = {}));
3059
- /** Returns whether the `renderer` is a `ProceduralRenderer3` */
3060
- function isProceduralRenderer(renderer) {
3061
- return !!(renderer.listen);
3231
+ function assertNodeType(tNode, type) {
3232
+ assertDefined(tNode, 'should be called with a TNode');
3233
+ assertEqual(tNode.type, type, "should be a " + typeName(type));
3234
+ }
3235
+ function assertNodeOfPossibleTypes(tNode) {
3236
+ var types = [];
3237
+ for (var _i = 1; _i < arguments.length; _i++) {
3238
+ types[_i - 1] = arguments[_i];
3239
+ }
3240
+ assertDefined(tNode, 'should be called with a TNode');
3241
+ var found = types.some(function (type) { return tNode.type === type; });
3242
+ assertEqual(found, true, "Should be one of " + types.map(typeName).join(', ') + " but got " + typeName(tNode.type));
3243
+ }
3244
+ function typeName(type) {
3245
+ if (type == 1 /* Projection */)
3246
+ return 'Projection';
3247
+ if (type == 0 /* Container */)
3248
+ return 'Container';
3249
+ if (type == 5 /* IcuContainer */)
3250
+ return 'IcuContainer';
3251
+ if (type == 2 /* View */)
3252
+ return 'View';
3253
+ if (type == 3 /* Element */)
3254
+ return 'Element';
3255
+ if (type == 4 /* ElementContainer */)
3256
+ return 'ElementContainer';
3257
+ return '<unknown>';
3062
3258
  }
3063
- var ɵ0$2 = function (hostElement, rendererType) { return getDocument(); };
3064
- var domRendererFactory3 = {
3065
- createRenderer: ɵ0$2
3066
- };
3067
- // Note: This hack is necessary so we don't erroneously get a circular dependency
3068
- // failure based on types.
3069
- var unusedValueExportToPlacateAjd$3 = 1;
3070
3259
 
3071
3260
  /**
3072
3261
  * Assigns all attribute values to the provided element via the inferred renderer.
@@ -5200,186 +5389,6 @@
5200
5389
  }
5201
5390
  }
5202
5391
 
5203
- /**
5204
- * @license
5205
- * Copyright Google Inc. All Rights Reserved.
5206
- *
5207
- * Use of this source code is governed by an MIT-style license that can be
5208
- * found in the LICENSE file at https://angular.io/license
5209
- */
5210
- /**
5211
- * This property will be monkey-patched on elements, components and directives
5212
- */
5213
- var MONKEY_PATCH_KEY_NAME = '__ngContext__';
5214
-
5215
- /**
5216
- * @license
5217
- * Copyright Google Inc. All Rights Reserved.
5218
- *
5219
- * Use of this source code is governed by an MIT-style license that can be
5220
- * found in the LICENSE file at https://angular.io/license
5221
- */
5222
- /**
5223
- * For efficiency reasons we often put several different data types (`RNode`, `LView`, `LContainer`)
5224
- * in same location in `LView`. This is because we don't want to pre-allocate space for it
5225
- * because the storage is sparse. This file contains utilities for dealing with such data types.
5226
- *
5227
- * How do we know what is stored at a given location in `LView`.
5228
- * - `Array.isArray(value) === false` => `RNode` (The normal storage value)
5229
- * - `Array.isArray(value) === true` => then the `value[0]` represents the wrapped value.
5230
- * - `typeof value[TYPE] === 'object'` => `LView`
5231
- * - This happens when we have a component at a given location
5232
- * - `typeof value[TYPE] === true` => `LContainer`
5233
- * - This happens when we have `LContainer` binding at a given location.
5234
- *
5235
- *
5236
- * NOTE: it is assumed that `Array.isArray` and `typeof` operations are very efficient.
5237
- */
5238
- /**
5239
- * Returns `RNode`.
5240
- * @param value wrapped value of `RNode`, `LView`, `LContainer`
5241
- */
5242
- function unwrapRNode(value) {
5243
- while (Array.isArray(value)) {
5244
- value = value[HOST];
5245
- }
5246
- return value;
5247
- }
5248
- /**
5249
- * Returns `LView` or `null` if not found.
5250
- * @param value wrapped value of `RNode`, `LView`, `LContainer`
5251
- */
5252
- function unwrapLView(value) {
5253
- while (Array.isArray(value)) {
5254
- // This check is same as `isLView()` but we don't call at as we don't want to call
5255
- // `Array.isArray()` twice and give JITer more work for inlining.
5256
- if (typeof value[TYPE] === 'object')
5257
- return value;
5258
- value = value[HOST];
5259
- }
5260
- return null;
5261
- }
5262
- /**
5263
- * Returns `LContainer` or `null` if not found.
5264
- * @param value wrapped value of `RNode`, `LView`, `LContainer`
5265
- */
5266
- function unwrapLContainer(value) {
5267
- while (Array.isArray(value)) {
5268
- // This check is same as `isLContainer()` but we don't call at as we don't want to call
5269
- // `Array.isArray()` twice and give JITer more work for inlining.
5270
- if (value[TYPE] === true)
5271
- return value;
5272
- value = value[HOST];
5273
- }
5274
- return null;
5275
- }
5276
- /**
5277
- * Retrieves an element value from the provided `viewData`, by unwrapping
5278
- * from any containers, component views, or style contexts.
5279
- */
5280
- function getNativeByIndex(index, lView) {
5281
- return unwrapRNode(lView[index + HEADER_OFFSET]);
5282
- }
5283
- /**
5284
- * Retrieve an `RNode` for a given `TNode` and `LView`.
5285
- *
5286
- * This function guarantees in dev mode to retrieve a non-null `RNode`.
5287
- *
5288
- * @param tNode
5289
- * @param lView
5290
- */
5291
- function getNativeByTNode(tNode, lView) {
5292
- ngDevMode && assertTNodeForLView(tNode, lView);
5293
- ngDevMode && assertDataInRange(lView, tNode.index);
5294
- var node = unwrapRNode(lView[tNode.index]);
5295
- ngDevMode && !isProceduralRenderer(lView[RENDERER]) && assertDomNode(node);
5296
- return node;
5297
- }
5298
- /**
5299
- * Retrieve an `RNode` or `null` for a given `TNode` and `LView`.
5300
- *
5301
- * Some `TNode`s don't have associated `RNode`s. For example `Projection`
5302
- *
5303
- * @param tNode
5304
- * @param lView
5305
- */
5306
- function getNativeByTNodeOrNull(tNode, lView) {
5307
- var index = tNode.index;
5308
- if (index !== -1) {
5309
- ngDevMode && assertTNodeForLView(tNode, lView);
5310
- var node = unwrapRNode(lView[index]);
5311
- ngDevMode && node !== null && !isProceduralRenderer(lView[RENDERER]) && assertDomNode(node);
5312
- return node;
5313
- }
5314
- return null;
5315
- }
5316
- function getTNode(tView, index) {
5317
- ngDevMode && assertGreaterThan(index, -1, 'wrong index for TNode');
5318
- ngDevMode && assertLessThan(index, tView.data.length, 'wrong index for TNode');
5319
- return tView.data[index + HEADER_OFFSET];
5320
- }
5321
- /** Retrieves a value from any `LView` or `TData`. */
5322
- function load(view, index) {
5323
- ngDevMode && assertDataInRange(view, index + HEADER_OFFSET);
5324
- return view[index + HEADER_OFFSET];
5325
- }
5326
- function getComponentLViewByIndex(nodeIndex, hostView) {
5327
- // Could be an LView or an LContainer. If LContainer, unwrap to find LView.
5328
- ngDevMode && assertDataInRange(hostView, nodeIndex);
5329
- var slotValue = hostView[nodeIndex];
5330
- var lView = isLView(slotValue) ? slotValue : slotValue[HOST];
5331
- return lView;
5332
- }
5333
- /**
5334
- * Returns the monkey-patch value data present on the target (which could be
5335
- * a component, directive or a DOM node).
5336
- */
5337
- function readPatchedData(target) {
5338
- ngDevMode && assertDefined(target, 'Target expected');
5339
- return target[MONKEY_PATCH_KEY_NAME] || null;
5340
- }
5341
- function readPatchedLView(target) {
5342
- var value = readPatchedData(target);
5343
- if (value) {
5344
- return Array.isArray(value) ? value : value.lView;
5345
- }
5346
- return null;
5347
- }
5348
- /** Checks whether a given view is in creation mode */
5349
- function isCreationMode(view) {
5350
- return (view[FLAGS] & 4 /* CreationMode */) === 4 /* CreationMode */;
5351
- }
5352
- /**
5353
- * Returns a boolean for whether the view is attached to the change detection tree.
5354
- *
5355
- * Note: This determines whether a view should be checked, not whether it's inserted
5356
- * into a container. For that, you'll want `viewAttachedToContainer` below.
5357
- */
5358
- function viewAttachedToChangeDetector(view) {
5359
- return (view[FLAGS] & 128 /* Attached */) === 128 /* Attached */;
5360
- }
5361
- /** Returns a boolean for whether the view is attached to a container. */
5362
- function viewAttachedToContainer(view) {
5363
- return isLContainer(view[PARENT]);
5364
- }
5365
- /** Returns a constant from `TConstants` instance. */
5366
- function getConstant(consts, index) {
5367
- return consts === null || index == null ? null : consts[index];
5368
- }
5369
- /**
5370
- * Resets the pre-order hook flags of the view.
5371
- * @param lView the LView on which the flags are reset
5372
- */
5373
- function resetPreOrderHookFlags(lView) {
5374
- lView[PREORDER_HOOK_FLAGS] = 0;
5375
- }
5376
- function getLContainerActiveIndex(lContainer) {
5377
- return lContainer[ACTIVE_INDEX] >> 1 /* SHIFT */;
5378
- }
5379
- function setLContainerActiveIndex(lContainer, index) {
5380
- lContainer[ACTIVE_INDEX] = index << 1 /* SHIFT */;
5381
- }
5382
-
5383
5392
  /**
5384
5393
  * @license
5385
5394
  * Copyright Google Inc. All Rights Reserved.
@@ -8085,16 +8094,15 @@
8085
8094
  return 'tabIndex';
8086
8095
  return name;
8087
8096
  }
8088
- function elementPropertyInternal(tView, lView, index, propName, value, sanitizer, nativeOnly, loadRendererFn) {
8097
+ function elementPropertyInternal(tView, tNode, lView, propName, value, renderer, sanitizer, nativeOnly) {
8089
8098
  ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');
8090
- var element = getNativeByIndex(index, lView);
8091
- var tNode = getTNode(tView, index);
8099
+ var element = getNativeByTNode(tNode, lView);
8092
8100
  var inputData = tNode.inputs;
8093
8101
  var dataValue;
8094
8102
  if (!nativeOnly && inputData != null && (dataValue = inputData[propName])) {
8095
8103
  setInputsForProperty(tView, lView, dataValue, propName, value);
8096
8104
  if (isComponentHost(tNode))
8097
- markDirtyIfOnPush(lView, index + HEADER_OFFSET);
8105
+ markDirtyIfOnPush(lView, tNode.index);
8098
8106
  if (ngDevMode) {
8099
8107
  setNgReflectProperties(lView, element, tNode.type, dataValue, value);
8100
8108
  }
@@ -8110,7 +8118,6 @@
8110
8118
  }
8111
8119
  ngDevMode.rendererSetProperty++;
8112
8120
  }
8113
- var renderer = loadRendererFn ? loadRendererFn(tNode, lView) : lView[RENDERER];
8114
8121
  // It is assumed that the sanitizer is only added when the compiler determines that the
8115
8122
  // property is risky, so sanitization can be done without further checks.
8116
8123
  value = sanitizer != null ? sanitizer(value, tNode.tagName || '', propName) : value;
@@ -8520,10 +8527,10 @@
8520
8527
  // so this is a regular element, wrap it with the component view
8521
8528
  lView[hostTNode.index] = componentView;
8522
8529
  }
8523
- function elementAttributeInternal(index, name, value, tView, lView, sanitizer, namespace) {
8530
+ function elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace) {
8524
8531
  ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');
8525
8532
  ngDevMode && validateAgainstEventAttributes(name);
8526
- var element = getNativeByIndex(index, lView);
8533
+ var element = getNativeByTNode(tNode, lView);
8527
8534
  var renderer = lView[RENDERER];
8528
8535
  if (value == null) {
8529
8536
  ngDevMode && ngDevMode.rendererRemoveAttribute++;
@@ -8532,7 +8539,6 @@
8532
8539
  }
8533
8540
  else {
8534
8541
  ngDevMode && ngDevMode.rendererSetAttribute++;
8535
- var tNode = getTNode(tView, index);
8536
8542
  var strValue = sanitizer == null ? renderStringify(value) : sanitizer(value, tNode.tagName || '', name);
8537
8543
  if (isProceduralRenderer(renderer)) {
8538
8544
  renderer.setAttribute(element, name, strValue, namespace);
@@ -8939,12 +8945,12 @@
8939
8945
  * interpolated properties.
8940
8946
  *
8941
8947
  * @param tData `TData` where meta-data will be saved;
8942
- * @param nodeIndex index of a `TNode` that is a target of the binding;
8948
+ * @param tNode `TNode` that is a target of the binding;
8943
8949
  * @param propertyName bound property name;
8944
8950
  * @param bindingIndex binding index in `LView`
8945
8951
  * @param interpolationParts static interpolation parts (for property interpolations)
8946
8952
  */
8947
- function storePropertyBindingMetadata(tData, nodeIndex, propertyName, bindingIndex) {
8953
+ function storePropertyBindingMetadata(tData, tNode, propertyName, bindingIndex) {
8948
8954
  var interpolationParts = [];
8949
8955
  for (var _i = 4; _i < arguments.length; _i++) {
8950
8956
  interpolationParts[_i - 4] = arguments[_i];
@@ -8953,7 +8959,6 @@
8953
8959
  // Since we don't have a concept of the "first update pass" we need to check for presence of the
8954
8960
  // binding meta-data to decide if one should be stored (or if was stored already).
8955
8961
  if (tData[bindingIndex] === null) {
8956
- var tNode = tData[nodeIndex + HEADER_OFFSET];
8957
8962
  if (tNode.inputs == null || !tNode.inputs[propertyName]) {
8958
8963
  var propBindingIdxs = tNode.propertyBindings || (tNode.propertyBindings = []);
8959
8964
  propBindingIdxs.push(bindingIndex);
@@ -9032,7 +9037,7 @@
9032
9037
  * Use of this source code is governed by an MIT-style license that can be
9033
9038
  * found in the LICENSE file at https://angular.io/license
9034
9039
  */
9035
- var unusedValueToPlacateAjd$1 = unusedValueExportToPlacateAjd$1 + unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd$3 + unusedValueExportToPlacateAjd;
9040
+ var unusedValueToPlacateAjd$1 = unusedValueExportToPlacateAjd$1 + unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd$2 + unusedValueExportToPlacateAjd;
9036
9041
  function getLContainer(tNode, embeddedView) {
9037
9042
  ngDevMode && assertLView(embeddedView);
9038
9043
  var container = embeddedView[PARENT];
@@ -13507,10 +13512,10 @@
13507
13512
  var lView = getLView();
13508
13513
  var bindingIndex = nextBindingIndex();
13509
13514
  if (bindingUpdated(lView, bindingIndex, value)) {
13510
- var nodeIndex = getSelectedIndex();
13511
13515
  var tView = getTView();
13512
- elementAttributeInternal(nodeIndex, name, value, tView, lView, sanitizer, namespace);
13513
- ngDevMode && storePropertyBindingMetadata(tView.data, nodeIndex, 'attr.' + name, bindingIndex);
13516
+ var tNode = getSelectedTNode();
13517
+ elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace);
13518
+ ngDevMode && storePropertyBindingMetadata(tView.data, tNode, 'attr.' + name, bindingIndex);
13514
13519
  }
13515
13520
  return ɵɵattribute;
13516
13521
  }
@@ -13680,11 +13685,10 @@
13680
13685
  var lView = getLView();
13681
13686
  var interpolatedValue = interpolation1(lView, prefix, v0, suffix);
13682
13687
  if (interpolatedValue !== NO_CHANGE) {
13683
- var nodeIndex = getSelectedIndex();
13684
- var tView = getTView();
13685
- elementAttributeInternal(nodeIndex, attrName, interpolatedValue, tView, lView, sanitizer, namespace);
13688
+ var tNode = getSelectedTNode();
13689
+ elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
13686
13690
  ngDevMode &&
13687
- storePropertyBindingMetadata(tView.data, nodeIndex, 'attr.' + attrName, getBindingIndex() - 1, prefix, suffix);
13691
+ storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 1, prefix, suffix);
13688
13692
  }
13689
13693
  return ɵɵattributeInterpolate1;
13690
13694
  }
@@ -13718,11 +13722,10 @@
13718
13722
  var lView = getLView();
13719
13723
  var interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);
13720
13724
  if (interpolatedValue !== NO_CHANGE) {
13721
- var nodeIndex = getSelectedIndex();
13722
- var tView = getTView();
13723
- elementAttributeInternal(nodeIndex, attrName, interpolatedValue, tView, lView, sanitizer, namespace);
13725
+ var tNode = getSelectedTNode();
13726
+ elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
13724
13727
  ngDevMode &&
13725
- storePropertyBindingMetadata(tView.data, nodeIndex, 'attr.' + attrName, getBindingIndex() - 2, prefix, i0, suffix);
13728
+ storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 2, prefix, i0, suffix);
13726
13729
  }
13727
13730
  return ɵɵattributeInterpolate2;
13728
13731
  }
@@ -13759,10 +13762,9 @@
13759
13762
  var lView = getLView();
13760
13763
  var interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);
13761
13764
  if (interpolatedValue !== NO_CHANGE) {
13762
- var nodeIndex = getSelectedIndex();
13763
- var tView = getTView();
13764
- elementAttributeInternal(nodeIndex, attrName, interpolatedValue, tView, lView, sanitizer, namespace);
13765
- ngDevMode && storePropertyBindingMetadata(tView.data, nodeIndex, 'attr.' + attrName, getBindingIndex() - 3, prefix, i0, i1, suffix);
13765
+ var tNode = getSelectedTNode();
13766
+ elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
13767
+ ngDevMode && storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 3, prefix, i0, i1, suffix);
13766
13768
  }
13767
13769
  return ɵɵattributeInterpolate3;
13768
13770
  }
@@ -13801,10 +13803,9 @@
13801
13803
  var lView = getLView();
13802
13804
  var interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);
13803
13805
  if (interpolatedValue !== NO_CHANGE) {
13804
- var nodeIndex = getSelectedIndex();
13805
- var tView = getTView();
13806
- elementAttributeInternal(nodeIndex, attrName, interpolatedValue, tView, lView, sanitizer, namespace);
13807
- ngDevMode && storePropertyBindingMetadata(tView.data, nodeIndex, 'attr.' + attrName, getBindingIndex() - 4, prefix, i0, i1, i2, suffix);
13806
+ var tNode = getSelectedTNode();
13807
+ elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
13808
+ ngDevMode && storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 4, prefix, i0, i1, i2, suffix);
13808
13809
  }
13809
13810
  return ɵɵattributeInterpolate4;
13810
13811
  }
@@ -13845,10 +13846,9 @@
13845
13846
  var lView = getLView();
13846
13847
  var interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);
13847
13848
  if (interpolatedValue !== NO_CHANGE) {
13848
- var nodeIndex = getSelectedIndex();
13849
- var tView = getTView();
13850
- elementAttributeInternal(nodeIndex, attrName, interpolatedValue, tView, lView, sanitizer, namespace);
13851
- ngDevMode && storePropertyBindingMetadata(tView.data, nodeIndex, 'attr.' + attrName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix);
13849
+ var tNode = getSelectedTNode();
13850
+ elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
13851
+ ngDevMode && storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix);
13852
13852
  }
13853
13853
  return ɵɵattributeInterpolate5;
13854
13854
  }
@@ -13891,10 +13891,9 @@
13891
13891
  var lView = getLView();
13892
13892
  var interpolatedValue = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);
13893
13893
  if (interpolatedValue !== NO_CHANGE) {
13894
- var nodeIndex = getSelectedIndex();
13895
- var tView = getTView();
13896
- elementAttributeInternal(nodeIndex, attrName, interpolatedValue, tView, lView, sanitizer, namespace);
13897
- ngDevMode && storePropertyBindingMetadata(tView.data, nodeIndex, 'attr.' + attrName, getBindingIndex() - 6, prefix, i0, i1, i2, i3, i4, suffix);
13894
+ var tNode = getSelectedTNode();
13895
+ elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
13896
+ ngDevMode && storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 6, prefix, i0, i1, i2, i3, i4, suffix);
13898
13897
  }
13899
13898
  return ɵɵattributeInterpolate6;
13900
13899
  }
@@ -13939,10 +13938,9 @@
13939
13938
  var lView = getLView();
13940
13939
  var interpolatedValue = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);
13941
13940
  if (interpolatedValue !== NO_CHANGE) {
13942
- var nodeIndex = getSelectedIndex();
13943
- var tView = getTView();
13944
- elementAttributeInternal(nodeIndex, attrName, interpolatedValue, tView, lView, sanitizer, namespace);
13945
- ngDevMode && storePropertyBindingMetadata(tView.data, nodeIndex, 'attr.' + attrName, getBindingIndex() - 7, prefix, i0, i1, i2, i3, i4, i5, suffix);
13941
+ var tNode = getSelectedTNode();
13942
+ elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
13943
+ ngDevMode && storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 7, prefix, i0, i1, i2, i3, i4, i5, suffix);
13946
13944
  }
13947
13945
  return ɵɵattributeInterpolate7;
13948
13946
  }
@@ -13989,10 +13987,9 @@
13989
13987
  var lView = getLView();
13990
13988
  var interpolatedValue = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);
13991
13989
  if (interpolatedValue !== NO_CHANGE) {
13992
- var nodeIndex = getSelectedIndex();
13993
- var tView = getTView();
13994
- elementAttributeInternal(nodeIndex, attrName, interpolatedValue, tView, lView, sanitizer, namespace);
13995
- ngDevMode && storePropertyBindingMetadata(tView.data, nodeIndex, 'attr.' + attrName, getBindingIndex() - 8, prefix, i0, i1, i2, i3, i4, i5, i6, suffix);
13990
+ var tNode = getSelectedTNode();
13991
+ elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
13992
+ ngDevMode && storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 8, prefix, i0, i1, i2, i3, i4, i5, i6, suffix);
13996
13993
  }
13997
13994
  return ɵɵattributeInterpolate8;
13998
13995
  }
@@ -14026,15 +14023,14 @@
14026
14023
  var lView = getLView();
14027
14024
  var interpolated = interpolationV(lView, values);
14028
14025
  if (interpolated !== NO_CHANGE) {
14029
- var tView = getTView();
14030
- var nodeIndex = getSelectedIndex();
14031
- elementAttributeInternal(nodeIndex, attrName, interpolated, tView, lView, sanitizer, namespace);
14026
+ var tNode = getSelectedTNode();
14027
+ elementAttributeInternal(tNode, lView, attrName, interpolated, sanitizer, namespace);
14032
14028
  if (ngDevMode) {
14033
14029
  var interpolationInBetween = [values[0]]; // prefix
14034
14030
  for (var i = 2; i < values.length; i += 2) {
14035
14031
  interpolationInBetween.push(values[i]);
14036
14032
  }
14037
- storePropertyBindingMetadata.apply(void 0, __spread([tView.data, nodeIndex, 'attr.' + attrName,
14033
+ storePropertyBindingMetadata.apply(void 0, __spread([getTView().data, tNode, 'attr.' + attrName,
14038
14034
  getBindingIndex() - interpolationInBetween.length + 1], interpolationInBetween));
14039
14035
  }
14040
14036
  }
@@ -14356,10 +14352,10 @@
14356
14352
  var lView = getLView();
14357
14353
  var bindingIndex = nextBindingIndex();
14358
14354
  if (bindingUpdated(lView, bindingIndex, value)) {
14359
- var nodeIndex = getSelectedIndex();
14360
14355
  var tView = getTView();
14361
- elementPropertyInternal(tView, lView, nodeIndex, propName, value, sanitizer);
14362
- ngDevMode && storePropertyBindingMetadata(tView.data, nodeIndex, propName, bindingIndex);
14356
+ var tNode = getSelectedTNode();
14357
+ elementPropertyInternal(tView, tNode, lView, propName, value, lView[RENDERER], sanitizer, false);
14358
+ ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);
14363
14359
  }
14364
14360
  return ɵɵproperty;
14365
14361
  }
@@ -15247,10 +15243,10 @@
15247
15243
  var lView = getLView();
15248
15244
  var interpolatedValue = interpolation1(lView, prefix, v0, suffix);
15249
15245
  if (interpolatedValue !== NO_CHANGE) {
15250
- var nodeIndex = getSelectedIndex();
15251
15246
  var tView = getTView();
15252
- elementPropertyInternal(tView, lView, nodeIndex, propName, interpolatedValue, sanitizer);
15253
- ngDevMode && storePropertyBindingMetadata(tView.data, nodeIndex, propName, getBindingIndex() - 1, prefix, suffix);
15247
+ var tNode = getSelectedTNode();
15248
+ elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
15249
+ ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 1, prefix, suffix);
15254
15250
  }
15255
15251
  return ɵɵpropertyInterpolate1;
15256
15252
  }
@@ -15288,10 +15284,10 @@
15288
15284
  var lView = getLView();
15289
15285
  var interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);
15290
15286
  if (interpolatedValue !== NO_CHANGE) {
15291
- var nodeIndex = getSelectedIndex();
15292
15287
  var tView = getTView();
15293
- elementPropertyInternal(tView, lView, nodeIndex, propName, interpolatedValue, sanitizer);
15294
- ngDevMode && storePropertyBindingMetadata(tView.data, nodeIndex, propName, getBindingIndex() - 2, prefix, i0, suffix);
15288
+ var tNode = getSelectedTNode();
15289
+ elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
15290
+ ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 2, prefix, i0, suffix);
15295
15291
  }
15296
15292
  return ɵɵpropertyInterpolate2;
15297
15293
  }
@@ -15332,11 +15328,10 @@
15332
15328
  var lView = getLView();
15333
15329
  var interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);
15334
15330
  if (interpolatedValue !== NO_CHANGE) {
15335
- var nodeIndex = getSelectedIndex();
15336
15331
  var tView = getTView();
15337
- elementPropertyInternal(tView, lView, nodeIndex, propName, interpolatedValue, sanitizer);
15338
- ngDevMode &&
15339
- storePropertyBindingMetadata(tView.data, nodeIndex, propName, getBindingIndex() - 3, prefix, i0, i1, suffix);
15332
+ var tNode = getSelectedTNode();
15333
+ elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
15334
+ ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 3, prefix, i0, i1, suffix);
15340
15335
  }
15341
15336
  return ɵɵpropertyInterpolate3;
15342
15337
  }
@@ -15379,11 +15374,11 @@
15379
15374
  var lView = getLView();
15380
15375
  var interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);
15381
15376
  if (interpolatedValue !== NO_CHANGE) {
15382
- var nodeIndex = getSelectedIndex();
15383
15377
  var tView = getTView();
15384
- elementPropertyInternal(tView, lView, nodeIndex, propName, interpolatedValue, sanitizer);
15378
+ var tNode = getSelectedTNode();
15379
+ elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
15385
15380
  ngDevMode &&
15386
- storePropertyBindingMetadata(tView.data, nodeIndex, propName, getBindingIndex() - 4, prefix, i0, i1, i2, suffix);
15381
+ storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 4, prefix, i0, i1, i2, suffix);
15387
15382
  }
15388
15383
  return ɵɵpropertyInterpolate4;
15389
15384
  }
@@ -15428,11 +15423,11 @@
15428
15423
  var lView = getLView();
15429
15424
  var interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);
15430
15425
  if (interpolatedValue !== NO_CHANGE) {
15431
- var nodeIndex = getSelectedIndex();
15432
15426
  var tView = getTView();
15433
- elementPropertyInternal(tView, lView, nodeIndex, propName, interpolatedValue, sanitizer);
15427
+ var tNode = getSelectedTNode();
15428
+ elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
15434
15429
  ngDevMode &&
15435
- storePropertyBindingMetadata(tView.data, nodeIndex, propName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix);
15430
+ storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix);
15436
15431
  }
15437
15432
  return ɵɵpropertyInterpolate5;
15438
15433
  }
@@ -15479,10 +15474,11 @@
15479
15474
  var lView = getLView();
15480
15475
  var interpolatedValue = interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);
15481
15476
  if (interpolatedValue !== NO_CHANGE) {
15482
- var nodeIndex = getSelectedIndex();
15483
15477
  var tView = getTView();
15484
- elementPropertyInternal(tView, lView, nodeIndex, propName, interpolatedValue, sanitizer);
15485
- ngDevMode && storePropertyBindingMetadata(tView.data, nodeIndex, propName, getBindingIndex() - 6, prefix, i0, i1, i2, i3, i4, suffix);
15478
+ var tNode = getSelectedTNode();
15479
+ elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
15480
+ ngDevMode &&
15481
+ storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 6, prefix, i0, i1, i2, i3, i4, suffix);
15486
15482
  }
15487
15483
  return ɵɵpropertyInterpolate6;
15488
15484
  }
@@ -15531,10 +15527,10 @@
15531
15527
  var lView = getLView();
15532
15528
  var interpolatedValue = interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);
15533
15529
  if (interpolatedValue !== NO_CHANGE) {
15534
- var nodeIndex = getSelectedIndex();
15535
15530
  var tView = getTView();
15536
- elementPropertyInternal(tView, lView, nodeIndex, propName, interpolatedValue, sanitizer);
15537
- ngDevMode && storePropertyBindingMetadata(tView.data, nodeIndex, propName, getBindingIndex() - 7, prefix, i0, i1, i2, i3, i4, i5, suffix);
15531
+ var tNode = getSelectedTNode();
15532
+ elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
15533
+ ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 7, prefix, i0, i1, i2, i3, i4, i5, suffix);
15538
15534
  }
15539
15535
  return ɵɵpropertyInterpolate7;
15540
15536
  }
@@ -15585,10 +15581,10 @@
15585
15581
  var lView = getLView();
15586
15582
  var interpolatedValue = interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);
15587
15583
  if (interpolatedValue !== NO_CHANGE) {
15588
- var nodeIndex = getSelectedIndex();
15589
15584
  var tView = getTView();
15590
- elementPropertyInternal(tView, lView, nodeIndex, propName, interpolatedValue, sanitizer);
15591
- ngDevMode && storePropertyBindingMetadata(tView.data, nodeIndex, propName, getBindingIndex() - 8, prefix, i0, i1, i2, i3, i4, i5, i6, suffix);
15585
+ var tNode = getSelectedTNode();
15586
+ elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
15587
+ ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, getBindingIndex() - 8, prefix, i0, i1, i2, i3, i4, i5, i6, suffix);
15592
15588
  }
15593
15589
  return ɵɵpropertyInterpolate8;
15594
15590
  }
@@ -15626,15 +15622,15 @@
15626
15622
  var lView = getLView();
15627
15623
  var interpolatedValue = interpolationV(lView, values);
15628
15624
  if (interpolatedValue !== NO_CHANGE) {
15629
- var nodeIndex = getSelectedIndex();
15630
15625
  var tView = getTView();
15631
- elementPropertyInternal(tView, lView, nodeIndex, propName, interpolatedValue, sanitizer);
15626
+ var tNode = getSelectedTNode();
15627
+ elementPropertyInternal(tView, tNode, lView, propName, interpolatedValue, lView[RENDERER], sanitizer, false);
15632
15628
  if (ngDevMode) {
15633
15629
  var interpolationInBetween = [values[0]]; // prefix
15634
15630
  for (var i = 2; i < values.length; i += 2) {
15635
15631
  interpolationInBetween.push(values[i]);
15636
15632
  }
15637
- storePropertyBindingMetadata.apply(void 0, __spread([tView.data, nodeIndex, propName, getBindingIndex() - interpolationInBetween.length + 1], interpolationInBetween));
15633
+ storePropertyBindingMetadata.apply(void 0, __spread([tView.data, tNode, propName, getBindingIndex() - interpolationInBetween.length + 1], interpolationInBetween));
15638
15634
  }
15639
15635
  }
15640
15636
  return ɵɵpropertyInterpolateV;
@@ -18482,10 +18478,10 @@
18482
18478
  var lView = getLView();
18483
18479
  var bindingIndex = nextBindingIndex();
18484
18480
  if (bindingUpdated(lView, bindingIndex, value)) {
18485
- var nodeIndex = getSelectedIndex();
18486
18481
  var tView = getTView();
18487
- elementPropertyInternal(tView, lView, nodeIndex, propName, value, sanitizer, true);
18488
- ngDevMode && storePropertyBindingMetadata(tView.data, nodeIndex, propName, bindingIndex);
18482
+ var tNode = getSelectedTNode();
18483
+ elementPropertyInternal(tView, tNode, lView, propName, value, lView[RENDERER], sanitizer, true);
18484
+ ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);
18489
18485
  }
18490
18486
  return ɵɵhostProperty;
18491
18487
  }
@@ -18514,10 +18510,11 @@
18514
18510
  var lView = getLView();
18515
18511
  var bindingIndex = nextBindingIndex();
18516
18512
  if (bindingUpdated(lView, bindingIndex, value)) {
18517
- var nodeIndex = getSelectedIndex();
18518
18513
  var tView = getTView();
18519
- elementPropertyInternal(tView, lView, nodeIndex, propName, value, sanitizer, true, loadComponentRenderer);
18520
- ngDevMode && storePropertyBindingMetadata(tView.data, nodeIndex, propName, bindingIndex);
18514
+ var tNode = getSelectedTNode();
18515
+ var renderer = loadComponentRenderer(tNode, lView);
18516
+ elementPropertyInternal(tView, tNode, lView, propName, value, renderer, sanitizer, true);
18517
+ ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);
18521
18518
  }
18522
18519
  return ɵɵupdateSyntheticHostBinding;
18523
18520
  }
@@ -20072,7 +20069,7 @@
20072
20069
  /**
20073
20070
  * @publicApi
20074
20071
  */
20075
- var VERSION = new Version('9.0.6');
20072
+ var VERSION = new Version('9.0.7');
20076
20073
 
20077
20074
  /**
20078
20075
  * @license
@@ -23766,11 +23763,17 @@
23766
23763
  for (var j = 0; j < parts.length; j++) {
23767
23764
  if (j & 1) {
23768
23765
  // Odd indexes are ICU expressions
23766
+ var icuExpression = parts[j];
23767
+ // Verify that ICU expression has the right shape. Translations might contain invalid
23768
+ // constructions (while original messages were correct), so ICU parsing at runtime may not
23769
+ // succeed (thus `icuExpression` remains a string).
23770
+ if (typeof icuExpression !== 'object') {
23771
+ throw new Error("Unable to parse ICU expression in \"" + templateTranslation + "\" message.");
23772
+ }
23769
23773
  // Create the comment node that will anchor the ICU expression
23770
23774
  var icuNodeIndex = startIndex + i18nVarsCount++;
23771
23775
  createOpCodes.push(COMMENT_MARKER, ngDevMode ? "ICU " + icuNodeIndex : '', icuNodeIndex, parentIndex << 17 /* SHIFT_PARENT */ | 1 /* AppendChild */);
23772
23776
  // Update codes for the ICU expression
23773
- var icuExpression = parts[j];
23774
23777
  var mask = getBindingMask(icuExpression);
23775
23778
  icuStart(icuExpressions, icuExpression, icuNodeIndex, icuNodeIndex);
23776
23779
  // Since this is recursive, the last TIcu that was pushed is the one we want
@@ -24076,7 +24079,7 @@
24076
24079
  var attrValue = createOpCodes[++i];
24077
24080
  // This code is used for ICU expressions only, since we don't support
24078
24081
  // directives/components in ICUs, we don't need to worry about inputs here
24079
- elementAttributeInternal(elementNodeIndex, attrName, attrValue, tView, lView);
24082
+ elementAttributeInternal(getTNode(tView, elementNodeIndex), lView, attrName, attrValue, null, null);
24080
24083
  break;
24081
24084
  default:
24082
24085
  throw new Error("Unable to determine the type of mutate operation for \"" + opCode + "\"");
@@ -24146,7 +24149,7 @@
24146
24149
  case 1 /* Attr */:
24147
24150
  var propName = updateOpCodes[++j];
24148
24151
  var sanitizeFn = updateOpCodes[++j];
24149
- elementPropertyInternal(tView, lView, nodeIndex, propName, value, sanitizeFn);
24152
+ elementPropertyInternal(tView, getTNode(tView, nodeIndex), lView, propName, value, lView[RENDERER], sanitizeFn, false);
24150
24153
  break;
24151
24154
  case 0 /* Text */:
24152
24155
  textBindingInternal(lView, nodeIndex, value);
@@ -24300,7 +24303,7 @@
24300
24303
  // Set attributes for Elements only, for other types (like ElementContainer),
24301
24304
  // only set inputs below
24302
24305
  if (tNode.type === 3 /* Element */) {
24303
- elementAttributeInternal(previousElementIndex, attrName, value, tView, lView);
24306
+ elementAttributeInternal(tNode, lView, attrName, value, null, null);
24304
24307
  }
24305
24308
  // Check if that attribute is a directive input
24306
24309
  var dataValue = tNode.inputs !== null && tNode.inputs[attrName];
@@ -25052,6 +25055,18 @@
25052
25055
  function ɵɵpureFunctionV(slotOffset, pureFn, exps, thisArg) {
25053
25056
  return pureFunctionVInternal(getLView(), getBindingRoot(), slotOffset, pureFn, exps, thisArg);
25054
25057
  }
25058
+ /**
25059
+ * Results of a pure function invocation are stored in LView in a dedicated slot that is initialized
25060
+ * to NO_CHANGE. In rare situations a pure pipe might throw an exception on the very first
25061
+ * invocation and not produce any valid results. In this case LView would keep holding the NO_CHANGE
25062
+ * value. The NO_CHANGE is not something that we can use in expressions / bindings thus we convert
25063
+ * it to `undefined`.
25064
+ */
25065
+ function getPureFunctionReturnValue(lView, returnValueIndex) {
25066
+ ngDevMode && assertDataInRange(lView, returnValueIndex);
25067
+ var lastReturnValue = lView[returnValueIndex];
25068
+ return lastReturnValue === NO_CHANGE ? undefined : lastReturnValue;
25069
+ }
25055
25070
  /**
25056
25071
  * If the value of the provided exp has changed, calls the pure function to return
25057
25072
  * an updated value. Or if the value has not changed, returns cached value.
@@ -25068,7 +25083,7 @@
25068
25083
  var bindingIndex = bindingRoot + slotOffset;
25069
25084
  return bindingUpdated(lView, bindingIndex, exp) ?
25070
25085
  updateBinding(lView, bindingIndex + 1, thisArg ? pureFn.call(thisArg, exp) : pureFn(exp)) :
25071
- getBinding(lView, bindingIndex + 1);
25086
+ getPureFunctionReturnValue(lView, bindingIndex + 1);
25072
25087
  }
25073
25088
  /**
25074
25089
  * If the value of any provided exp has changed, calls the pure function to return
@@ -25087,7 +25102,7 @@
25087
25102
  var bindingIndex = bindingRoot + slotOffset;
25088
25103
  return bindingUpdated2(lView, bindingIndex, exp1, exp2) ?
25089
25104
  updateBinding(lView, bindingIndex + 2, thisArg ? pureFn.call(thisArg, exp1, exp2) : pureFn(exp1, exp2)) :
25090
- getBinding(lView, bindingIndex + 2);
25105
+ getPureFunctionReturnValue(lView, bindingIndex + 2);
25091
25106
  }
25092
25107
  /**
25093
25108
  * If the value of any provided exp has changed, calls the pure function to return
@@ -25107,7 +25122,7 @@
25107
25122
  var bindingIndex = bindingRoot + slotOffset;
25108
25123
  return bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) ?
25109
25124
  updateBinding(lView, bindingIndex + 3, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3) : pureFn(exp1, exp2, exp3)) :
25110
- getBinding(lView, bindingIndex + 3);
25125
+ getPureFunctionReturnValue(lView, bindingIndex + 3);
25111
25126
  }
25112
25127
  /**
25113
25128
  * If the value of any provided exp has changed, calls the pure function to return
@@ -25129,7 +25144,7 @@
25129
25144
  var bindingIndex = bindingRoot + slotOffset;
25130
25145
  return bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) ?
25131
25146
  updateBinding(lView, bindingIndex + 4, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4) : pureFn(exp1, exp2, exp3, exp4)) :
25132
- getBinding(lView, bindingIndex + 4);
25147
+ getPureFunctionReturnValue(lView, bindingIndex + 4);
25133
25148
  }
25134
25149
  /**
25135
25150
  * pureFunction instruction that can support any number of bindings.
@@ -25153,7 +25168,7 @@
25153
25168
  bindingUpdated(lView, bindingIndex++, exps[i]) && (different = true);
25154
25169
  }
25155
25170
  return different ? updateBinding(lView, bindingIndex, pureFn.apply(thisArg, exps)) :
25156
- getBinding(lView, bindingIndex);
25171
+ getPureFunctionReturnValue(lView, bindingIndex);
25157
25172
  }
25158
25173
 
25159
25174
  /**
@@ -25607,7 +25622,7 @@
25607
25622
  * Use of this source code is governed by an MIT-style license that can be
25608
25623
  * found in the LICENSE file at https://angular.io/license
25609
25624
  */
25610
- var unusedValueToPlacateAjd$2 = unusedValueExportToPlacateAjd$7 + unusedValueExportToPlacateAjd$2 + unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd$8;
25625
+ var unusedValueToPlacateAjd$2 = unusedValueExportToPlacateAjd$7 + unusedValueExportToPlacateAjd$3 + unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd$8;
25611
25626
  var LQuery_ = /** @class */ (function () {
25612
25627
  function LQuery_(queryList) {
25613
25628
  this.queryList = queryList;