@angular/core 15.1.0-next.0 → 15.1.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/src/render/api.mjs +1 -3
- package/esm2020/src/render3/assert.mjs +1 -5
- package/esm2020/src/render3/component_ref.mjs +1 -12
- package/esm2020/src/render3/index.mjs +2 -2
- package/esm2020/src/render3/instructions/shared.mjs +87 -162
- package/esm2020/src/render3/interfaces/view.mjs +1 -10
- package/esm2020/src/render3/util/discovery_utils.mjs +3 -32
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/testing/src/logger.mjs +3 -3
- package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
- package/fesm2015/core.mjs +184 -1019
- package/fesm2015/core.mjs.map +1 -1
- package/fesm2015/testing.mjs +186 -1021
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2020/core.mjs +184 -1019
- package/fesm2020/core.mjs.map +1 -1
- package/fesm2020/testing.mjs +186 -1021
- package/fesm2020/testing.mjs.map +1 -1
- package/index.d.ts +1 -222
- package/package.json +1 -1
- package/testing/index.d.ts +1 -1
- package/esm2020/src/render3/instructions/lview_debug.mjs +0 -684
- package/esm2020/src/util/named_array_type.mjs +0 -40
package/fesm2015/testing.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v15.1.0-next.
|
|
2
|
+
* @license Angular v15.1.0-next.1
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { getDebugNode
|
|
7
|
+
import { getDebugNode, RendererFactory2 as RendererFactory2$1, InjectionToken as InjectionToken$1, ɵstringify, ɵReflectionCapabilities, Directive, Component, Pipe, NgModule, ɵgetInjectableDef, resolveForwardRef as resolveForwardRef$1, ɵNG_COMP_DEF, ɵRender3NgModuleRef, ApplicationInitStatus, LOCALE_ID as LOCALE_ID$1, ɵDEFAULT_LOCALE_ID, ɵsetLocaleId, ɵRender3ComponentFactory, ɵcompileComponent, ɵNG_DIR_DEF, ɵcompileDirective, ɵNG_PIPE_DEF, ɵcompilePipe, ɵNG_MOD_DEF, ɵtransitiveScopesFor, ɵpatchComponentDefWithScope, ɵNG_INJ_DEF, ɵcompileNgModuleDefs, NgZone, Compiler, COMPILER_OPTIONS, ɵNgModuleFactory, ɵisEnvironmentProviders, ModuleWithComponentFactories, ɵconvertToBitFlags, Injector as Injector$1, InjectFlags as InjectFlags$1, ɵsetAllowDuplicateNgModuleIdsForTest, ɵresetCompiledComponents, ɵsetUnknownElementStrictMode as ɵsetUnknownElementStrictMode$1, ɵsetUnknownPropertyStrictMode as ɵsetUnknownPropertyStrictMode$1, ɵgetUnknownElementStrictMode as ɵgetUnknownElementStrictMode$1, ɵgetUnknownPropertyStrictMode as ɵgetUnknownPropertyStrictMode$1, EnvironmentInjector as EnvironmentInjector$1, ɵflushModuleScopingQueueAsMuchAsPossible } from '@angular/core';
|
|
8
8
|
import { __awaiter } from 'tslib';
|
|
9
9
|
import { ResourceLoader } from '@angular/compiler';
|
|
10
10
|
import { Subject, Subscription } from 'rxjs';
|
|
@@ -86,7 +86,7 @@ class ComponentFixture {
|
|
|
86
86
|
this._onErrorSubscription = null;
|
|
87
87
|
this.changeDetectorRef = componentRef.changeDetectorRef;
|
|
88
88
|
this.elementRef = componentRef.location;
|
|
89
|
-
this.debugElement = getDebugNode
|
|
89
|
+
this.debugElement = getDebugNode(this.elementRef.nativeElement);
|
|
90
90
|
this.componentInstance = componentRef.instance;
|
|
91
91
|
this.nativeElement = this.elementRef.nativeElement;
|
|
92
92
|
this.componentRef = componentRef;
|
|
@@ -2894,15 +2894,6 @@ const EMBEDDED_VIEW_INJECTOR = 21;
|
|
|
2894
2894
|
* there should be no need to refer to `HEADER_OFFSET` anywhere else.
|
|
2895
2895
|
*/
|
|
2896
2896
|
const HEADER_OFFSET = 22;
|
|
2897
|
-
/**
|
|
2898
|
-
* Converts `TViewType` into human readable text.
|
|
2899
|
-
* Make sure this matches with `TViewType`
|
|
2900
|
-
*/
|
|
2901
|
-
const TViewTypeAsString = [
|
|
2902
|
-
'Root',
|
|
2903
|
-
'Component',
|
|
2904
|
-
'Embedded', // 2
|
|
2905
|
-
];
|
|
2906
2897
|
// Note: This hack is necessary so we don't erroneously get a circular dependency
|
|
2907
2898
|
// failure based on types.
|
|
2908
2899
|
const unusedValueExportToPlacateAjd$7 = 1;
|
|
@@ -3025,10 +3016,6 @@ function assertIndexInDeclRange(lView, index) {
|
|
|
3025
3016
|
const tView = lView[1];
|
|
3026
3017
|
assertBetween(HEADER_OFFSET, tView.bindingStartIndex, index);
|
|
3027
3018
|
}
|
|
3028
|
-
function assertIndexInVarsRange(lView, index) {
|
|
3029
|
-
const tView = lView[1];
|
|
3030
|
-
assertBetween(tView.bindingStartIndex, tView.expandoStartIndex, index);
|
|
3031
|
-
}
|
|
3032
3019
|
function assertIndexInExpandoRange(lView, index) {
|
|
3033
3020
|
const tView = lView[1];
|
|
3034
3021
|
assertBetween(tView.expandoStartIndex, lView.length, index);
|
|
@@ -9442,7 +9429,6 @@ function unwrapElementRef(value) {
|
|
|
9442
9429
|
* Use of this source code is governed by an MIT-style license that can be
|
|
9443
9430
|
* found in the LICENSE file at https://angular.io/license
|
|
9444
9431
|
*/
|
|
9445
|
-
const Renderer2Interceptor = new InjectionToken('Renderer2Interceptor');
|
|
9446
9432
|
/**
|
|
9447
9433
|
* Creates and initializes a custom renderer that implements the `Renderer2` base class.
|
|
9448
9434
|
*
|
|
@@ -9526,7 +9512,7 @@ class Version {
|
|
|
9526
9512
|
/**
|
|
9527
9513
|
* @publicApi
|
|
9528
9514
|
*/
|
|
9529
|
-
const VERSION = new Version('15.1.0-next.
|
|
9515
|
+
const VERSION = new Version('15.1.0-next.1');
|
|
9530
9516
|
|
|
9531
9517
|
/**
|
|
9532
9518
|
* @license
|
|
@@ -11320,812 +11306,6 @@ function ɵɵinvalidFactory() {
|
|
|
11320
11306
|
throw new Error(msg);
|
|
11321
11307
|
}
|
|
11322
11308
|
|
|
11323
|
-
/**
|
|
11324
|
-
* @license
|
|
11325
|
-
* Copyright Google LLC All Rights Reserved.
|
|
11326
|
-
*
|
|
11327
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
11328
|
-
* found in the LICENSE file at https://angular.io/license
|
|
11329
|
-
*/
|
|
11330
|
-
/**
|
|
11331
|
-
* THIS FILE CONTAINS CODE WHICH SHOULD BE TREE SHAKEN AND NEVER CALLED FROM PRODUCTION CODE!!!
|
|
11332
|
-
*/
|
|
11333
|
-
/**
|
|
11334
|
-
* Creates an `Array` construction with a given name. This is useful when
|
|
11335
|
-
* looking for memory consumption to see what time of array it is.
|
|
11336
|
-
*
|
|
11337
|
-
*
|
|
11338
|
-
* @param name Name to give to the constructor
|
|
11339
|
-
* @returns A subclass of `Array` if possible. This can only be done in
|
|
11340
|
-
* environments which support `class` construct.
|
|
11341
|
-
*/
|
|
11342
|
-
function createNamedArrayType(name) {
|
|
11343
|
-
// This should never be called in prod mode, so let's verify that is the case.
|
|
11344
|
-
if (ngDevMode) {
|
|
11345
|
-
try {
|
|
11346
|
-
// If this function were compromised the following could lead to arbitrary
|
|
11347
|
-
// script execution. We bless it with Trusted Types anyway since this
|
|
11348
|
-
// function is stripped out of production binaries.
|
|
11349
|
-
return (newTrustedFunctionForDev('Array', `return class ${name} extends Array{}`))(Array);
|
|
11350
|
-
}
|
|
11351
|
-
catch (e) {
|
|
11352
|
-
// If it does not work just give up and fall back to regular Array.
|
|
11353
|
-
return Array;
|
|
11354
|
-
}
|
|
11355
|
-
}
|
|
11356
|
-
else {
|
|
11357
|
-
throw new Error('Looks like we are in \'prod mode\', but we are creating a named Array type, which is wrong! Check your code');
|
|
11358
|
-
}
|
|
11359
|
-
}
|
|
11360
|
-
|
|
11361
|
-
/**
|
|
11362
|
-
* @license
|
|
11363
|
-
* Copyright Google LLC All Rights Reserved.
|
|
11364
|
-
*
|
|
11365
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
11366
|
-
* found in the LICENSE file at https://angular.io/license
|
|
11367
|
-
*/
|
|
11368
|
-
function toTStylingRange(prev, next) {
|
|
11369
|
-
ngDevMode && assertNumberInRange(prev, 0, 32767 /* StylingRange.UNSIGNED_MASK */);
|
|
11370
|
-
ngDevMode && assertNumberInRange(next, 0, 32767 /* StylingRange.UNSIGNED_MASK */);
|
|
11371
|
-
return (prev << 17 /* StylingRange.PREV_SHIFT */ | next << 2 /* StylingRange.NEXT_SHIFT */);
|
|
11372
|
-
}
|
|
11373
|
-
function getTStylingRangePrev(tStylingRange) {
|
|
11374
|
-
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
11375
|
-
return (tStylingRange >> 17 /* StylingRange.PREV_SHIFT */) & 32767 /* StylingRange.UNSIGNED_MASK */;
|
|
11376
|
-
}
|
|
11377
|
-
function getTStylingRangePrevDuplicate(tStylingRange) {
|
|
11378
|
-
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
11379
|
-
return (tStylingRange & 2 /* StylingRange.PREV_DUPLICATE */) ==
|
|
11380
|
-
2 /* StylingRange.PREV_DUPLICATE */;
|
|
11381
|
-
}
|
|
11382
|
-
function setTStylingRangePrev(tStylingRange, previous) {
|
|
11383
|
-
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
11384
|
-
ngDevMode && assertNumberInRange(previous, 0, 32767 /* StylingRange.UNSIGNED_MASK */);
|
|
11385
|
-
return ((tStylingRange & ~4294836224 /* StylingRange.PREV_MASK */) |
|
|
11386
|
-
(previous << 17 /* StylingRange.PREV_SHIFT */));
|
|
11387
|
-
}
|
|
11388
|
-
function setTStylingRangePrevDuplicate(tStylingRange) {
|
|
11389
|
-
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
11390
|
-
return (tStylingRange | 2 /* StylingRange.PREV_DUPLICATE */);
|
|
11391
|
-
}
|
|
11392
|
-
function getTStylingRangeNext(tStylingRange) {
|
|
11393
|
-
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
11394
|
-
return (tStylingRange & 131068 /* StylingRange.NEXT_MASK */) >> 2 /* StylingRange.NEXT_SHIFT */;
|
|
11395
|
-
}
|
|
11396
|
-
function setTStylingRangeNext(tStylingRange, next) {
|
|
11397
|
-
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
11398
|
-
ngDevMode && assertNumberInRange(next, 0, 32767 /* StylingRange.UNSIGNED_MASK */);
|
|
11399
|
-
return ((tStylingRange & ~131068 /* StylingRange.NEXT_MASK */) | //
|
|
11400
|
-
next << 2 /* StylingRange.NEXT_SHIFT */);
|
|
11401
|
-
}
|
|
11402
|
-
function getTStylingRangeNextDuplicate(tStylingRange) {
|
|
11403
|
-
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
11404
|
-
return (tStylingRange & 1 /* StylingRange.NEXT_DUPLICATE */) ===
|
|
11405
|
-
1 /* StylingRange.NEXT_DUPLICATE */;
|
|
11406
|
-
}
|
|
11407
|
-
function setTStylingRangeNextDuplicate(tStylingRange) {
|
|
11408
|
-
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
11409
|
-
return (tStylingRange | 1 /* StylingRange.NEXT_DUPLICATE */);
|
|
11410
|
-
}
|
|
11411
|
-
function getTStylingRangeTail(tStylingRange) {
|
|
11412
|
-
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
11413
|
-
const next = getTStylingRangeNext(tStylingRange);
|
|
11414
|
-
return next === 0 ? getTStylingRangePrev(tStylingRange) : next;
|
|
11415
|
-
}
|
|
11416
|
-
|
|
11417
|
-
/**
|
|
11418
|
-
* @license
|
|
11419
|
-
* Copyright Google LLC All Rights Reserved.
|
|
11420
|
-
*
|
|
11421
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
11422
|
-
* found in the LICENSE file at https://angular.io/license
|
|
11423
|
-
*/
|
|
11424
|
-
/**
|
|
11425
|
-
* Patch a `debug` property on top of the existing object.
|
|
11426
|
-
*
|
|
11427
|
-
* NOTE: always call this method with `ngDevMode && attachDebugObject(...)`
|
|
11428
|
-
*
|
|
11429
|
-
* @param obj Object to patch
|
|
11430
|
-
* @param debug Value to patch
|
|
11431
|
-
*/
|
|
11432
|
-
function attachDebugObject(obj, debug) {
|
|
11433
|
-
if (ngDevMode) {
|
|
11434
|
-
Object.defineProperty(obj, 'debug', { value: debug, enumerable: false });
|
|
11435
|
-
}
|
|
11436
|
-
else {
|
|
11437
|
-
throw new Error('This method should be guarded with `ngDevMode` so that it can be tree shaken in production!');
|
|
11438
|
-
}
|
|
11439
|
-
}
|
|
11440
|
-
/**
|
|
11441
|
-
* Patch a `debug` property getter on top of the existing object.
|
|
11442
|
-
*
|
|
11443
|
-
* NOTE: always call this method with `ngDevMode && attachDebugObject(...)`
|
|
11444
|
-
*
|
|
11445
|
-
* @param obj Object to patch
|
|
11446
|
-
* @param debugGetter Getter returning a value to patch
|
|
11447
|
-
*/
|
|
11448
|
-
function attachDebugGetter(obj, debugGetter) {
|
|
11449
|
-
if (ngDevMode) {
|
|
11450
|
-
Object.defineProperty(obj, 'debug', { get: debugGetter, enumerable: false });
|
|
11451
|
-
}
|
|
11452
|
-
else {
|
|
11453
|
-
throw new Error('This method should be guarded with `ngDevMode` so that it can be tree shaken in production!');
|
|
11454
|
-
}
|
|
11455
|
-
}
|
|
11456
|
-
|
|
11457
|
-
/**
|
|
11458
|
-
* @license
|
|
11459
|
-
* Copyright Google LLC All Rights Reserved.
|
|
11460
|
-
*
|
|
11461
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
11462
|
-
* found in the LICENSE file at https://angular.io/license
|
|
11463
|
-
*/
|
|
11464
|
-
/*
|
|
11465
|
-
* This file contains conditionally attached classes which provide human readable (debug) level
|
|
11466
|
-
* information for `LView`, `LContainer` and other internal data structures. These data structures
|
|
11467
|
-
* are stored internally as array which makes it very difficult during debugging to reason about the
|
|
11468
|
-
* current state of the system.
|
|
11469
|
-
*
|
|
11470
|
-
* Patching the array with extra property does change the array's hidden class' but it does not
|
|
11471
|
-
* change the cost of access, therefore this patching should not have significant if any impact in
|
|
11472
|
-
* `ngDevMode` mode. (see: https://jsperf.com/array-vs-monkey-patch-array)
|
|
11473
|
-
*
|
|
11474
|
-
* So instead of seeing:
|
|
11475
|
-
* ```
|
|
11476
|
-
* Array(30) [Object, 659, null, …]
|
|
11477
|
-
* ```
|
|
11478
|
-
*
|
|
11479
|
-
* You get to see:
|
|
11480
|
-
* ```
|
|
11481
|
-
* LViewDebug {
|
|
11482
|
-
* views: [...],
|
|
11483
|
-
* flags: {attached: true, ...}
|
|
11484
|
-
* nodes: [
|
|
11485
|
-
* {html: '<div id="123">', ..., nodes: [
|
|
11486
|
-
* {html: '<span>', ..., nodes: null}
|
|
11487
|
-
* ]}
|
|
11488
|
-
* ]
|
|
11489
|
-
* }
|
|
11490
|
-
* ```
|
|
11491
|
-
*/
|
|
11492
|
-
let LVIEW_COMPONENT_CACHE;
|
|
11493
|
-
let LVIEW_EMBEDDED_CACHE;
|
|
11494
|
-
let LVIEW_ROOT;
|
|
11495
|
-
let LVIEW_COMPONENT;
|
|
11496
|
-
let LVIEW_EMBEDDED;
|
|
11497
|
-
/**
|
|
11498
|
-
* This function clones a blueprint and creates LView.
|
|
11499
|
-
*
|
|
11500
|
-
* Simple slice will keep the same type, and we need it to be LView
|
|
11501
|
-
*/
|
|
11502
|
-
function cloneToLViewFromTViewBlueprint(tView) {
|
|
11503
|
-
const debugTView = tView;
|
|
11504
|
-
const lView = getLViewToClone(debugTView.type, tView.template && tView.template.name);
|
|
11505
|
-
return lView.concat(tView.blueprint);
|
|
11506
|
-
}
|
|
11507
|
-
class LRootView extends Array {
|
|
11508
|
-
}
|
|
11509
|
-
class LComponentView extends Array {
|
|
11510
|
-
}
|
|
11511
|
-
class LEmbeddedView extends Array {
|
|
11512
|
-
}
|
|
11513
|
-
function getLViewToClone(type, name) {
|
|
11514
|
-
switch (type) {
|
|
11515
|
-
case 0 /* TViewType.Root */:
|
|
11516
|
-
if (LVIEW_ROOT === undefined)
|
|
11517
|
-
LVIEW_ROOT = new LRootView();
|
|
11518
|
-
return LVIEW_ROOT;
|
|
11519
|
-
case 1 /* TViewType.Component */:
|
|
11520
|
-
if (!ngDevMode || !ngDevMode.namedConstructors) {
|
|
11521
|
-
if (LVIEW_COMPONENT === undefined)
|
|
11522
|
-
LVIEW_COMPONENT = new LComponentView();
|
|
11523
|
-
return LVIEW_COMPONENT;
|
|
11524
|
-
}
|
|
11525
|
-
if (LVIEW_COMPONENT_CACHE === undefined)
|
|
11526
|
-
LVIEW_COMPONENT_CACHE = new Map();
|
|
11527
|
-
let componentArray = LVIEW_COMPONENT_CACHE.get(name);
|
|
11528
|
-
if (componentArray === undefined) {
|
|
11529
|
-
componentArray = new (createNamedArrayType('LComponentView' + nameSuffix(name)))();
|
|
11530
|
-
LVIEW_COMPONENT_CACHE.set(name, componentArray);
|
|
11531
|
-
}
|
|
11532
|
-
return componentArray;
|
|
11533
|
-
case 2 /* TViewType.Embedded */:
|
|
11534
|
-
if (!ngDevMode || !ngDevMode.namedConstructors) {
|
|
11535
|
-
if (LVIEW_EMBEDDED === undefined)
|
|
11536
|
-
LVIEW_EMBEDDED = new LEmbeddedView();
|
|
11537
|
-
return LVIEW_EMBEDDED;
|
|
11538
|
-
}
|
|
11539
|
-
if (LVIEW_EMBEDDED_CACHE === undefined)
|
|
11540
|
-
LVIEW_EMBEDDED_CACHE = new Map();
|
|
11541
|
-
let embeddedArray = LVIEW_EMBEDDED_CACHE.get(name);
|
|
11542
|
-
if (embeddedArray === undefined) {
|
|
11543
|
-
embeddedArray = new (createNamedArrayType('LEmbeddedView' + nameSuffix(name)))();
|
|
11544
|
-
LVIEW_EMBEDDED_CACHE.set(name, embeddedArray);
|
|
11545
|
-
}
|
|
11546
|
-
return embeddedArray;
|
|
11547
|
-
}
|
|
11548
|
-
}
|
|
11549
|
-
function nameSuffix(text) {
|
|
11550
|
-
if (text == null)
|
|
11551
|
-
return '';
|
|
11552
|
-
const index = text.lastIndexOf('_Template');
|
|
11553
|
-
return '_' + (index === -1 ? text : text.slice(0, index));
|
|
11554
|
-
}
|
|
11555
|
-
/**
|
|
11556
|
-
* This class is a debug version of Object literal so that we can have constructor name show up
|
|
11557
|
-
* in
|
|
11558
|
-
* debug tools in ngDevMode.
|
|
11559
|
-
*/
|
|
11560
|
-
const TViewConstructor = class TView {
|
|
11561
|
-
constructor(type, blueprint, template, queries, viewQuery, declTNode, data, bindingStartIndex, expandoStartIndex, hostBindingOpCodes, firstCreatePass, firstUpdatePass, staticViewQueries, staticContentQueries, preOrderHooks, preOrderCheckHooks, contentHooks, contentCheckHooks, viewHooks, viewCheckHooks, destroyHooks, cleanup, contentQueries, components, directiveRegistry, pipeRegistry, firstChild, schemas, consts, incompleteFirstPass, _decls, _vars) {
|
|
11562
|
-
this.type = type;
|
|
11563
|
-
this.blueprint = blueprint;
|
|
11564
|
-
this.template = template;
|
|
11565
|
-
this.queries = queries;
|
|
11566
|
-
this.viewQuery = viewQuery;
|
|
11567
|
-
this.declTNode = declTNode;
|
|
11568
|
-
this.data = data;
|
|
11569
|
-
this.bindingStartIndex = bindingStartIndex;
|
|
11570
|
-
this.expandoStartIndex = expandoStartIndex;
|
|
11571
|
-
this.hostBindingOpCodes = hostBindingOpCodes;
|
|
11572
|
-
this.firstCreatePass = firstCreatePass;
|
|
11573
|
-
this.firstUpdatePass = firstUpdatePass;
|
|
11574
|
-
this.staticViewQueries = staticViewQueries;
|
|
11575
|
-
this.staticContentQueries = staticContentQueries;
|
|
11576
|
-
this.preOrderHooks = preOrderHooks;
|
|
11577
|
-
this.preOrderCheckHooks = preOrderCheckHooks;
|
|
11578
|
-
this.contentHooks = contentHooks;
|
|
11579
|
-
this.contentCheckHooks = contentCheckHooks;
|
|
11580
|
-
this.viewHooks = viewHooks;
|
|
11581
|
-
this.viewCheckHooks = viewCheckHooks;
|
|
11582
|
-
this.destroyHooks = destroyHooks;
|
|
11583
|
-
this.cleanup = cleanup;
|
|
11584
|
-
this.contentQueries = contentQueries;
|
|
11585
|
-
this.components = components;
|
|
11586
|
-
this.directiveRegistry = directiveRegistry;
|
|
11587
|
-
this.pipeRegistry = pipeRegistry;
|
|
11588
|
-
this.firstChild = firstChild;
|
|
11589
|
-
this.schemas = schemas;
|
|
11590
|
-
this.consts = consts;
|
|
11591
|
-
this.incompleteFirstPass = incompleteFirstPass;
|
|
11592
|
-
this._decls = _decls;
|
|
11593
|
-
this._vars = _vars;
|
|
11594
|
-
}
|
|
11595
|
-
get template_() {
|
|
11596
|
-
const buf = [];
|
|
11597
|
-
processTNodeChildren(this.firstChild, buf);
|
|
11598
|
-
return buf.join('');
|
|
11599
|
-
}
|
|
11600
|
-
get type_() {
|
|
11601
|
-
return TViewTypeAsString[this.type] || `TViewType.?${this.type}?`;
|
|
11602
|
-
}
|
|
11603
|
-
};
|
|
11604
|
-
class TNode {
|
|
11605
|
-
constructor(tView_, //
|
|
11606
|
-
type, //
|
|
11607
|
-
index, //
|
|
11608
|
-
insertBeforeIndex, //
|
|
11609
|
-
injectorIndex, //
|
|
11610
|
-
componentOffset, //
|
|
11611
|
-
directiveStart, //
|
|
11612
|
-
directiveEnd, //
|
|
11613
|
-
directiveStylingLast, //
|
|
11614
|
-
propertyBindings, //
|
|
11615
|
-
flags, //
|
|
11616
|
-
providerIndexes, //
|
|
11617
|
-
value, //
|
|
11618
|
-
attrs, //
|
|
11619
|
-
mergedAttrs, //
|
|
11620
|
-
localNames, //
|
|
11621
|
-
initialInputs, //
|
|
11622
|
-
inputs, //
|
|
11623
|
-
outputs, //
|
|
11624
|
-
tViews, //
|
|
11625
|
-
next, //
|
|
11626
|
-
projectionNext, //
|
|
11627
|
-
child, //
|
|
11628
|
-
parent, //
|
|
11629
|
-
projection, //
|
|
11630
|
-
styles, //
|
|
11631
|
-
stylesWithoutHost, //
|
|
11632
|
-
residualStyles, //
|
|
11633
|
-
classes, //
|
|
11634
|
-
classesWithoutHost, //
|
|
11635
|
-
residualClasses, //
|
|
11636
|
-
classBindings, //
|
|
11637
|
-
styleBindings) {
|
|
11638
|
-
this.tView_ = tView_;
|
|
11639
|
-
this.type = type;
|
|
11640
|
-
this.index = index;
|
|
11641
|
-
this.insertBeforeIndex = insertBeforeIndex;
|
|
11642
|
-
this.injectorIndex = injectorIndex;
|
|
11643
|
-
this.componentOffset = componentOffset;
|
|
11644
|
-
this.directiveStart = directiveStart;
|
|
11645
|
-
this.directiveEnd = directiveEnd;
|
|
11646
|
-
this.directiveStylingLast = directiveStylingLast;
|
|
11647
|
-
this.propertyBindings = propertyBindings;
|
|
11648
|
-
this.flags = flags;
|
|
11649
|
-
this.providerIndexes = providerIndexes;
|
|
11650
|
-
this.value = value;
|
|
11651
|
-
this.attrs = attrs;
|
|
11652
|
-
this.mergedAttrs = mergedAttrs;
|
|
11653
|
-
this.localNames = localNames;
|
|
11654
|
-
this.initialInputs = initialInputs;
|
|
11655
|
-
this.inputs = inputs;
|
|
11656
|
-
this.outputs = outputs;
|
|
11657
|
-
this.tViews = tViews;
|
|
11658
|
-
this.next = next;
|
|
11659
|
-
this.projectionNext = projectionNext;
|
|
11660
|
-
this.child = child;
|
|
11661
|
-
this.parent = parent;
|
|
11662
|
-
this.projection = projection;
|
|
11663
|
-
this.styles = styles;
|
|
11664
|
-
this.stylesWithoutHost = stylesWithoutHost;
|
|
11665
|
-
this.residualStyles = residualStyles;
|
|
11666
|
-
this.classes = classes;
|
|
11667
|
-
this.classesWithoutHost = classesWithoutHost;
|
|
11668
|
-
this.residualClasses = residualClasses;
|
|
11669
|
-
this.classBindings = classBindings;
|
|
11670
|
-
this.styleBindings = styleBindings;
|
|
11671
|
-
}
|
|
11672
|
-
/**
|
|
11673
|
-
* Return a human debug version of the set of `NodeInjector`s which will be consulted when
|
|
11674
|
-
* resolving tokens from this `TNode`.
|
|
11675
|
-
*
|
|
11676
|
-
* When debugging applications, it is often difficult to determine which `NodeInjector`s will be
|
|
11677
|
-
* consulted. This method shows a list of `DebugNode`s representing the `TNode`s which will be
|
|
11678
|
-
* consulted in order when resolving a token starting at this `TNode`.
|
|
11679
|
-
*
|
|
11680
|
-
* The original data is stored in `LView` and `TView` with a lot of offset indexes, and so it is
|
|
11681
|
-
* difficult to reason about.
|
|
11682
|
-
*
|
|
11683
|
-
* @param lView The `LView` instance for this `TNode`.
|
|
11684
|
-
*/
|
|
11685
|
-
debugNodeInjectorPath(lView) {
|
|
11686
|
-
const path = [];
|
|
11687
|
-
let injectorIndex = getInjectorIndex(this, lView);
|
|
11688
|
-
if (injectorIndex === -1) {
|
|
11689
|
-
// Looks like the current `TNode` does not have `NodeInjector` associated with it => look for
|
|
11690
|
-
// parent NodeInjector.
|
|
11691
|
-
const parentLocation = getParentInjectorLocation(this, lView);
|
|
11692
|
-
if (parentLocation !== NO_PARENT_INJECTOR) {
|
|
11693
|
-
// We found a parent, so start searching from the parent location.
|
|
11694
|
-
injectorIndex = getParentInjectorIndex(parentLocation);
|
|
11695
|
-
lView = getParentInjectorView(parentLocation, lView);
|
|
11696
|
-
}
|
|
11697
|
-
else {
|
|
11698
|
-
// No parents have been found, so there are no `NodeInjector`s to consult.
|
|
11699
|
-
}
|
|
11700
|
-
}
|
|
11701
|
-
while (injectorIndex !== -1) {
|
|
11702
|
-
ngDevMode && assertNodeInjector(lView, injectorIndex);
|
|
11703
|
-
const tNode = lView[TVIEW].data[injectorIndex + 8 /* NodeInjectorOffset.TNODE */];
|
|
11704
|
-
path.push(buildDebugNode(tNode, lView));
|
|
11705
|
-
const parentLocation = lView[injectorIndex + 8 /* NodeInjectorOffset.PARENT */];
|
|
11706
|
-
if (parentLocation === NO_PARENT_INJECTOR) {
|
|
11707
|
-
injectorIndex = -1;
|
|
11708
|
-
}
|
|
11709
|
-
else {
|
|
11710
|
-
injectorIndex = getParentInjectorIndex(parentLocation);
|
|
11711
|
-
lView = getParentInjectorView(parentLocation, lView);
|
|
11712
|
-
}
|
|
11713
|
-
}
|
|
11714
|
-
return path;
|
|
11715
|
-
}
|
|
11716
|
-
get type_() {
|
|
11717
|
-
return toTNodeTypeAsString(this.type) || `TNodeType.?${this.type}?`;
|
|
11718
|
-
}
|
|
11719
|
-
get flags_() {
|
|
11720
|
-
const flags = [];
|
|
11721
|
-
if (this.flags & 8 /* TNodeFlags.hasClassInput */)
|
|
11722
|
-
flags.push('TNodeFlags.hasClassInput');
|
|
11723
|
-
if (this.flags & 4 /* TNodeFlags.hasContentQuery */)
|
|
11724
|
-
flags.push('TNodeFlags.hasContentQuery');
|
|
11725
|
-
if (this.flags & 16 /* TNodeFlags.hasStyleInput */)
|
|
11726
|
-
flags.push('TNodeFlags.hasStyleInput');
|
|
11727
|
-
if (this.flags & 64 /* TNodeFlags.hasHostBindings */)
|
|
11728
|
-
flags.push('TNodeFlags.hasHostBindings');
|
|
11729
|
-
if (this.flags & 1 /* TNodeFlags.isDirectiveHost */)
|
|
11730
|
-
flags.push('TNodeFlags.isDirectiveHost');
|
|
11731
|
-
if (this.flags & 32 /* TNodeFlags.isDetached */)
|
|
11732
|
-
flags.push('TNodeFlags.isDetached');
|
|
11733
|
-
if (this.flags & 2 /* TNodeFlags.isProjected */)
|
|
11734
|
-
flags.push('TNodeFlags.isProjected');
|
|
11735
|
-
return flags.join('|');
|
|
11736
|
-
}
|
|
11737
|
-
get template_() {
|
|
11738
|
-
if (this.type & 1 /* TNodeType.Text */)
|
|
11739
|
-
return this.value;
|
|
11740
|
-
const buf = [];
|
|
11741
|
-
const tagName = typeof this.value === 'string' && this.value || this.type_;
|
|
11742
|
-
buf.push('<', tagName);
|
|
11743
|
-
if (this.flags) {
|
|
11744
|
-
buf.push(' ', this.flags_);
|
|
11745
|
-
}
|
|
11746
|
-
if (this.attrs) {
|
|
11747
|
-
for (let i = 0; i < this.attrs.length;) {
|
|
11748
|
-
const attrName = this.attrs[i++];
|
|
11749
|
-
if (typeof attrName == 'number') {
|
|
11750
|
-
break;
|
|
11751
|
-
}
|
|
11752
|
-
const attrValue = this.attrs[i++];
|
|
11753
|
-
buf.push(' ', attrName, '="', attrValue, '"');
|
|
11754
|
-
}
|
|
11755
|
-
}
|
|
11756
|
-
buf.push('>');
|
|
11757
|
-
processTNodeChildren(this.child, buf);
|
|
11758
|
-
buf.push('</', tagName, '>');
|
|
11759
|
-
return buf.join('');
|
|
11760
|
-
}
|
|
11761
|
-
get styleBindings_() {
|
|
11762
|
-
return toDebugStyleBinding(this, false);
|
|
11763
|
-
}
|
|
11764
|
-
get classBindings_() {
|
|
11765
|
-
return toDebugStyleBinding(this, true);
|
|
11766
|
-
}
|
|
11767
|
-
get providerIndexStart_() {
|
|
11768
|
-
return this.providerIndexes & 1048575 /* TNodeProviderIndexes.ProvidersStartIndexMask */;
|
|
11769
|
-
}
|
|
11770
|
-
get providerIndexEnd_() {
|
|
11771
|
-
return this.providerIndexStart_ +
|
|
11772
|
-
(this.providerIndexes >>> 20 /* TNodeProviderIndexes.CptViewProvidersCountShift */);
|
|
11773
|
-
}
|
|
11774
|
-
}
|
|
11775
|
-
const TNodeDebug = TNode;
|
|
11776
|
-
function toDebugStyleBinding(tNode, isClassBased) {
|
|
11777
|
-
const tData = tNode.tView_.data;
|
|
11778
|
-
const bindings = [];
|
|
11779
|
-
const range = isClassBased ? tNode.classBindings : tNode.styleBindings;
|
|
11780
|
-
const prev = getTStylingRangePrev(range);
|
|
11781
|
-
const next = getTStylingRangeNext(range);
|
|
11782
|
-
let isTemplate = next !== 0;
|
|
11783
|
-
let cursor = isTemplate ? next : prev;
|
|
11784
|
-
while (cursor !== 0) {
|
|
11785
|
-
const itemKey = tData[cursor];
|
|
11786
|
-
const itemRange = tData[cursor + 1];
|
|
11787
|
-
bindings.unshift({
|
|
11788
|
-
key: itemKey,
|
|
11789
|
-
index: cursor,
|
|
11790
|
-
isTemplate: isTemplate,
|
|
11791
|
-
prevDuplicate: getTStylingRangePrevDuplicate(itemRange),
|
|
11792
|
-
nextDuplicate: getTStylingRangeNextDuplicate(itemRange),
|
|
11793
|
-
nextIndex: getTStylingRangeNext(itemRange),
|
|
11794
|
-
prevIndex: getTStylingRangePrev(itemRange),
|
|
11795
|
-
});
|
|
11796
|
-
if (cursor === prev)
|
|
11797
|
-
isTemplate = false;
|
|
11798
|
-
cursor = getTStylingRangePrev(itemRange);
|
|
11799
|
-
}
|
|
11800
|
-
bindings.push((isClassBased ? tNode.residualClasses : tNode.residualStyles) || null);
|
|
11801
|
-
return bindings;
|
|
11802
|
-
}
|
|
11803
|
-
function processTNodeChildren(tNode, buf) {
|
|
11804
|
-
while (tNode) {
|
|
11805
|
-
buf.push(tNode.template_);
|
|
11806
|
-
tNode = tNode.next;
|
|
11807
|
-
}
|
|
11808
|
-
}
|
|
11809
|
-
class TViewData extends Array {
|
|
11810
|
-
}
|
|
11811
|
-
let TVIEWDATA_EMPTY; // can't initialize here or it will not be tree shaken, because
|
|
11812
|
-
// `LView` constructor could have side-effects.
|
|
11813
|
-
/**
|
|
11814
|
-
* This function clones a blueprint and creates TData.
|
|
11815
|
-
*
|
|
11816
|
-
* Simple slice will keep the same type, and we need it to be TData
|
|
11817
|
-
*/
|
|
11818
|
-
function cloneToTViewData(list) {
|
|
11819
|
-
if (TVIEWDATA_EMPTY === undefined)
|
|
11820
|
-
TVIEWDATA_EMPTY = new TViewData();
|
|
11821
|
-
return TVIEWDATA_EMPTY.concat(list);
|
|
11822
|
-
}
|
|
11823
|
-
class LViewBlueprint extends Array {
|
|
11824
|
-
}
|
|
11825
|
-
class MatchesArray extends Array {
|
|
11826
|
-
}
|
|
11827
|
-
class TViewComponents extends Array {
|
|
11828
|
-
}
|
|
11829
|
-
class TNodeLocalNames extends Array {
|
|
11830
|
-
}
|
|
11831
|
-
class TNodeInitialInputs extends Array {
|
|
11832
|
-
}
|
|
11833
|
-
class LCleanup extends Array {
|
|
11834
|
-
}
|
|
11835
|
-
class TCleanup extends Array {
|
|
11836
|
-
}
|
|
11837
|
-
function attachLViewDebug(lView) {
|
|
11838
|
-
attachDebugObject(lView, new LViewDebug(lView));
|
|
11839
|
-
}
|
|
11840
|
-
function attachLContainerDebug(lContainer) {
|
|
11841
|
-
attachDebugObject(lContainer, new LContainerDebug(lContainer));
|
|
11842
|
-
}
|
|
11843
|
-
function toDebug(obj) {
|
|
11844
|
-
if (obj) {
|
|
11845
|
-
const debug = obj.debug;
|
|
11846
|
-
assertDefined(debug, 'Object does not have a debug representation.');
|
|
11847
|
-
return debug;
|
|
11848
|
-
}
|
|
11849
|
-
else {
|
|
11850
|
-
return obj;
|
|
11851
|
-
}
|
|
11852
|
-
}
|
|
11853
|
-
/**
|
|
11854
|
-
* Use this method to unwrap a native element in `LView` and convert it into HTML for easier
|
|
11855
|
-
* reading.
|
|
11856
|
-
*
|
|
11857
|
-
* @param value possibly wrapped native DOM node.
|
|
11858
|
-
* @param includeChildren If `true` then the serialized HTML form will include child elements
|
|
11859
|
-
* (same
|
|
11860
|
-
* as `outerHTML`). If `false` then the serialized HTML form will only contain the element
|
|
11861
|
-
* itself
|
|
11862
|
-
* (will not serialize child elements).
|
|
11863
|
-
*/
|
|
11864
|
-
function toHtml(value, includeChildren = false) {
|
|
11865
|
-
const node = unwrapRNode(value);
|
|
11866
|
-
if (node) {
|
|
11867
|
-
switch (node.nodeType) {
|
|
11868
|
-
case Node.TEXT_NODE:
|
|
11869
|
-
return node.textContent;
|
|
11870
|
-
case Node.COMMENT_NODE:
|
|
11871
|
-
return `<!--${node.textContent}-->`;
|
|
11872
|
-
case Node.ELEMENT_NODE:
|
|
11873
|
-
const outerHTML = node.outerHTML;
|
|
11874
|
-
if (includeChildren) {
|
|
11875
|
-
return outerHTML;
|
|
11876
|
-
}
|
|
11877
|
-
else {
|
|
11878
|
-
const innerHTML = '>' + node.innerHTML + '<';
|
|
11879
|
-
return (outerHTML.split(innerHTML)[0]) + '>';
|
|
11880
|
-
}
|
|
11881
|
-
}
|
|
11882
|
-
}
|
|
11883
|
-
return null;
|
|
11884
|
-
}
|
|
11885
|
-
class LViewDebug {
|
|
11886
|
-
constructor(_raw_lView) {
|
|
11887
|
-
this._raw_lView = _raw_lView;
|
|
11888
|
-
}
|
|
11889
|
-
/**
|
|
11890
|
-
* Flags associated with the `LView` unpacked into a more readable state.
|
|
11891
|
-
*/
|
|
11892
|
-
get flags() {
|
|
11893
|
-
const flags = this._raw_lView[FLAGS];
|
|
11894
|
-
return {
|
|
11895
|
-
__raw__flags__: flags,
|
|
11896
|
-
initPhaseState: flags & 3 /* LViewFlags.InitPhaseStateMask */,
|
|
11897
|
-
creationMode: !!(flags & 4 /* LViewFlags.CreationMode */),
|
|
11898
|
-
firstViewPass: !!(flags & 8 /* LViewFlags.FirstLViewPass */),
|
|
11899
|
-
checkAlways: !!(flags & 16 /* LViewFlags.CheckAlways */),
|
|
11900
|
-
dirty: !!(flags & 32 /* LViewFlags.Dirty */),
|
|
11901
|
-
attached: !!(flags & 64 /* LViewFlags.Attached */),
|
|
11902
|
-
destroyed: !!(flags & 128 /* LViewFlags.Destroyed */),
|
|
11903
|
-
isRoot: !!(flags & 256 /* LViewFlags.IsRoot */),
|
|
11904
|
-
indexWithinInitPhase: flags >> 11 /* LViewFlags.IndexWithinInitPhaseShift */,
|
|
11905
|
-
};
|
|
11906
|
-
}
|
|
11907
|
-
get parent() {
|
|
11908
|
-
return toDebug(this._raw_lView[PARENT]);
|
|
11909
|
-
}
|
|
11910
|
-
get hostHTML() {
|
|
11911
|
-
return toHtml(this._raw_lView[HOST], true);
|
|
11912
|
-
}
|
|
11913
|
-
get html() {
|
|
11914
|
-
return (this.nodes || []).map(mapToHTML).join('');
|
|
11915
|
-
}
|
|
11916
|
-
get context() {
|
|
11917
|
-
return this._raw_lView[CONTEXT];
|
|
11918
|
-
}
|
|
11919
|
-
/**
|
|
11920
|
-
* The tree of nodes associated with the current `LView`. The nodes have been normalized into
|
|
11921
|
-
* a tree structure with relevant details pulled out for readability.
|
|
11922
|
-
*/
|
|
11923
|
-
get nodes() {
|
|
11924
|
-
const lView = this._raw_lView;
|
|
11925
|
-
const tNode = lView[TVIEW].firstChild;
|
|
11926
|
-
return toDebugNodes(tNode, lView);
|
|
11927
|
-
}
|
|
11928
|
-
get template() {
|
|
11929
|
-
return this.tView.template_;
|
|
11930
|
-
}
|
|
11931
|
-
get tView() {
|
|
11932
|
-
return this._raw_lView[TVIEW];
|
|
11933
|
-
}
|
|
11934
|
-
get cleanup() {
|
|
11935
|
-
return this._raw_lView[CLEANUP];
|
|
11936
|
-
}
|
|
11937
|
-
get injector() {
|
|
11938
|
-
return this._raw_lView[INJECTOR$1];
|
|
11939
|
-
}
|
|
11940
|
-
get rendererFactory() {
|
|
11941
|
-
return this._raw_lView[RENDERER_FACTORY];
|
|
11942
|
-
}
|
|
11943
|
-
get renderer() {
|
|
11944
|
-
return this._raw_lView[RENDERER];
|
|
11945
|
-
}
|
|
11946
|
-
get sanitizer() {
|
|
11947
|
-
return this._raw_lView[SANITIZER];
|
|
11948
|
-
}
|
|
11949
|
-
get childHead() {
|
|
11950
|
-
return toDebug(this._raw_lView[CHILD_HEAD]);
|
|
11951
|
-
}
|
|
11952
|
-
get next() {
|
|
11953
|
-
return toDebug(this._raw_lView[NEXT]);
|
|
11954
|
-
}
|
|
11955
|
-
get childTail() {
|
|
11956
|
-
return toDebug(this._raw_lView[CHILD_TAIL]);
|
|
11957
|
-
}
|
|
11958
|
-
get declarationView() {
|
|
11959
|
-
return toDebug(this._raw_lView[DECLARATION_VIEW]);
|
|
11960
|
-
}
|
|
11961
|
-
get queries() {
|
|
11962
|
-
return this._raw_lView[QUERIES];
|
|
11963
|
-
}
|
|
11964
|
-
get tHost() {
|
|
11965
|
-
return this._raw_lView[T_HOST];
|
|
11966
|
-
}
|
|
11967
|
-
get id() {
|
|
11968
|
-
return this._raw_lView[ID];
|
|
11969
|
-
}
|
|
11970
|
-
get decls() {
|
|
11971
|
-
return toLViewRange(this.tView, this._raw_lView, HEADER_OFFSET, this.tView.bindingStartIndex);
|
|
11972
|
-
}
|
|
11973
|
-
get vars() {
|
|
11974
|
-
return toLViewRange(this.tView, this._raw_lView, this.tView.bindingStartIndex, this.tView.expandoStartIndex);
|
|
11975
|
-
}
|
|
11976
|
-
get expando() {
|
|
11977
|
-
return toLViewRange(this.tView, this._raw_lView, this.tView.expandoStartIndex, this._raw_lView.length);
|
|
11978
|
-
}
|
|
11979
|
-
/**
|
|
11980
|
-
* Normalized view of child views (and containers) attached at this location.
|
|
11981
|
-
*/
|
|
11982
|
-
get childViews() {
|
|
11983
|
-
const childViews = [];
|
|
11984
|
-
let child = this.childHead;
|
|
11985
|
-
while (child) {
|
|
11986
|
-
childViews.push(child);
|
|
11987
|
-
child = child.next;
|
|
11988
|
-
}
|
|
11989
|
-
return childViews;
|
|
11990
|
-
}
|
|
11991
|
-
}
|
|
11992
|
-
function mapToHTML(node) {
|
|
11993
|
-
if (node.type === 'ElementContainer') {
|
|
11994
|
-
return (node.children || []).map(mapToHTML).join('');
|
|
11995
|
-
}
|
|
11996
|
-
else if (node.type === 'IcuContainer') {
|
|
11997
|
-
throw new Error('Not implemented');
|
|
11998
|
-
}
|
|
11999
|
-
else {
|
|
12000
|
-
return toHtml(node.native, true) || '';
|
|
12001
|
-
}
|
|
12002
|
-
}
|
|
12003
|
-
function toLViewRange(tView, lView, start, end) {
|
|
12004
|
-
let content = [];
|
|
12005
|
-
for (let index = start; index < end; index++) {
|
|
12006
|
-
content.push({ index: index, t: tView.data[index], l: lView[index] });
|
|
12007
|
-
}
|
|
12008
|
-
return { start: start, end: end, length: end - start, content: content };
|
|
12009
|
-
}
|
|
12010
|
-
/**
|
|
12011
|
-
* Turns a flat list of nodes into a tree by walking the associated `TNode` tree.
|
|
12012
|
-
*
|
|
12013
|
-
* @param tNode
|
|
12014
|
-
* @param lView
|
|
12015
|
-
*/
|
|
12016
|
-
function toDebugNodes(tNode, lView) {
|
|
12017
|
-
if (tNode) {
|
|
12018
|
-
const debugNodes = [];
|
|
12019
|
-
let tNodeCursor = tNode;
|
|
12020
|
-
while (tNodeCursor) {
|
|
12021
|
-
debugNodes.push(buildDebugNode(tNodeCursor, lView));
|
|
12022
|
-
tNodeCursor = tNodeCursor.next;
|
|
12023
|
-
}
|
|
12024
|
-
return debugNodes;
|
|
12025
|
-
}
|
|
12026
|
-
else {
|
|
12027
|
-
return [];
|
|
12028
|
-
}
|
|
12029
|
-
}
|
|
12030
|
-
function buildDebugNode(tNode, lView) {
|
|
12031
|
-
const rawValue = lView[tNode.index];
|
|
12032
|
-
const native = unwrapRNode(rawValue);
|
|
12033
|
-
const factories = [];
|
|
12034
|
-
const instances = [];
|
|
12035
|
-
const tView = lView[TVIEW];
|
|
12036
|
-
for (let i = tNode.directiveStart; i < tNode.directiveEnd; i++) {
|
|
12037
|
-
const def = tView.data[i];
|
|
12038
|
-
factories.push(def.type);
|
|
12039
|
-
instances.push(lView[i]);
|
|
12040
|
-
}
|
|
12041
|
-
return {
|
|
12042
|
-
html: toHtml(native),
|
|
12043
|
-
type: toTNodeTypeAsString(tNode.type),
|
|
12044
|
-
tNode,
|
|
12045
|
-
native: native,
|
|
12046
|
-
children: toDebugNodes(tNode.child, lView),
|
|
12047
|
-
factories,
|
|
12048
|
-
instances,
|
|
12049
|
-
injector: buildNodeInjectorDebug(tNode, tView, lView),
|
|
12050
|
-
get injectorResolutionPath() {
|
|
12051
|
-
return tNode.debugNodeInjectorPath(lView);
|
|
12052
|
-
},
|
|
12053
|
-
};
|
|
12054
|
-
}
|
|
12055
|
-
function buildNodeInjectorDebug(tNode, tView, lView) {
|
|
12056
|
-
const viewProviders = [];
|
|
12057
|
-
for (let i = tNode.providerIndexStart_; i < tNode.providerIndexEnd_; i++) {
|
|
12058
|
-
viewProviders.push(tView.data[i]);
|
|
12059
|
-
}
|
|
12060
|
-
const providers = [];
|
|
12061
|
-
for (let i = tNode.providerIndexEnd_; i < tNode.directiveEnd; i++) {
|
|
12062
|
-
providers.push(tView.data[i]);
|
|
12063
|
-
}
|
|
12064
|
-
const nodeInjectorDebug = {
|
|
12065
|
-
bloom: toBloom(lView, tNode.injectorIndex),
|
|
12066
|
-
cumulativeBloom: toBloom(tView.data, tNode.injectorIndex),
|
|
12067
|
-
providers,
|
|
12068
|
-
viewProviders,
|
|
12069
|
-
parentInjectorIndex: lView[tNode.providerIndexStart_ - 1],
|
|
12070
|
-
};
|
|
12071
|
-
return nodeInjectorDebug;
|
|
12072
|
-
}
|
|
12073
|
-
/**
|
|
12074
|
-
* Convert a number at `idx` location in `array` into binary representation.
|
|
12075
|
-
*
|
|
12076
|
-
* @param array
|
|
12077
|
-
* @param idx
|
|
12078
|
-
*/
|
|
12079
|
-
function binary(array, idx) {
|
|
12080
|
-
const value = array[idx];
|
|
12081
|
-
// If not a number we print 8 `?` to retain alignment but let user know that it was called on
|
|
12082
|
-
// wrong type.
|
|
12083
|
-
if (typeof value !== 'number')
|
|
12084
|
-
return '????????';
|
|
12085
|
-
// We prefix 0s so that we have constant length number
|
|
12086
|
-
const text = '00000000' + value.toString(2);
|
|
12087
|
-
return text.substring(text.length - 8);
|
|
12088
|
-
}
|
|
12089
|
-
/**
|
|
12090
|
-
* Convert a bloom filter at location `idx` in `array` into binary representation.
|
|
12091
|
-
*
|
|
12092
|
-
* @param array
|
|
12093
|
-
* @param idx
|
|
12094
|
-
*/
|
|
12095
|
-
function toBloom(array, idx) {
|
|
12096
|
-
if (idx < 0) {
|
|
12097
|
-
return 'NO_NODE_INJECTOR';
|
|
12098
|
-
}
|
|
12099
|
-
return `${binary(array, idx + 7)}_${binary(array, idx + 6)}_${binary(array, idx + 5)}_${binary(array, idx + 4)}_${binary(array, idx + 3)}_${binary(array, idx + 2)}_${binary(array, idx + 1)}_${binary(array, idx + 0)}`;
|
|
12100
|
-
}
|
|
12101
|
-
class LContainerDebug {
|
|
12102
|
-
constructor(_raw_lContainer) {
|
|
12103
|
-
this._raw_lContainer = _raw_lContainer;
|
|
12104
|
-
}
|
|
12105
|
-
get hasTransplantedViews() {
|
|
12106
|
-
return this._raw_lContainer[HAS_TRANSPLANTED_VIEWS];
|
|
12107
|
-
}
|
|
12108
|
-
get views() {
|
|
12109
|
-
return this._raw_lContainer.slice(CONTAINER_HEADER_OFFSET)
|
|
12110
|
-
.map(toDebug);
|
|
12111
|
-
}
|
|
12112
|
-
get parent() {
|
|
12113
|
-
return toDebug(this._raw_lContainer[PARENT]);
|
|
12114
|
-
}
|
|
12115
|
-
get movedViews() {
|
|
12116
|
-
return this._raw_lContainer[MOVED_VIEWS];
|
|
12117
|
-
}
|
|
12118
|
-
get host() {
|
|
12119
|
-
return this._raw_lContainer[HOST];
|
|
12120
|
-
}
|
|
12121
|
-
get native() {
|
|
12122
|
-
return this._raw_lContainer[NATIVE];
|
|
12123
|
-
}
|
|
12124
|
-
get next() {
|
|
12125
|
-
return toDebug(this._raw_lContainer[NEXT]);
|
|
12126
|
-
}
|
|
12127
|
-
}
|
|
12128
|
-
|
|
12129
11309
|
/**
|
|
12130
11310
|
* @license
|
|
12131
11311
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -12199,7 +11379,7 @@ function renderChildComponents(hostLView, components) {
|
|
|
12199
11379
|
}
|
|
12200
11380
|
}
|
|
12201
11381
|
function createLView(parentLView, tView, context, flags, host, tHostNode, rendererFactory, renderer, sanitizer, injector, embeddedViewInjector) {
|
|
12202
|
-
const lView =
|
|
11382
|
+
const lView = tView.blueprint.slice();
|
|
12203
11383
|
lView[HOST] = host;
|
|
12204
11384
|
lView[FLAGS] = flags | 4 /* LViewFlags.CreationMode */ | 64 /* LViewFlags.Attached */ | 8 /* LViewFlags.FirstLViewPass */;
|
|
12205
11385
|
if (embeddedViewInjector !== null ||
|
|
@@ -12223,7 +11403,6 @@ function createLView(parentLView, tView, context, flags, host, tHostNode, render
|
|
|
12223
11403
|
assertEqual(tView.type == 2 /* TViewType.Embedded */ ? parentLView !== null : true, true, 'Embedded views must have parentLView');
|
|
12224
11404
|
lView[DECLARATION_COMPONENT_VIEW] =
|
|
12225
11405
|
tView.type == 2 /* TViewType.Embedded */ ? parentLView[DECLARATION_COMPONENT_VIEW] : lView;
|
|
12226
|
-
ngDevMode && attachLViewDebug(lView);
|
|
12227
11406
|
return lView;
|
|
12228
11407
|
}
|
|
12229
11408
|
function getOrCreateTNode(tView, index, type, name, attrs) {
|
|
@@ -12606,73 +11785,38 @@ function createTView(type, declTNode, templateFn, decls, vars, directives, pipes
|
|
|
12606
11785
|
const initialViewLength = bindingStartIndex + vars;
|
|
12607
11786
|
const blueprint = createViewBlueprint(bindingStartIndex, initialViewLength);
|
|
12608
11787
|
const consts = typeof constsOrFactory === 'function' ? constsOrFactory() : constsOrFactory;
|
|
12609
|
-
const tView = blueprint[TVIEW] =
|
|
12610
|
-
|
|
12611
|
-
blueprint
|
|
12612
|
-
|
|
12613
|
-
|
|
12614
|
-
viewQuery
|
|
12615
|
-
declTNode
|
|
12616
|
-
|
|
12617
|
-
bindingStartIndex
|
|
12618
|
-
|
|
12619
|
-
|
|
12620
|
-
|
|
12621
|
-
|
|
12622
|
-
|
|
12623
|
-
|
|
12624
|
-
|
|
12625
|
-
|
|
12626
|
-
|
|
12627
|
-
|
|
12628
|
-
|
|
12629
|
-
|
|
12630
|
-
|
|
12631
|
-
|
|
12632
|
-
|
|
12633
|
-
|
|
12634
|
-
typeof directives === 'function' ?
|
|
12635
|
-
|
|
12636
|
-
|
|
12637
|
-
|
|
12638
|
-
|
|
12639
|
-
|
|
12640
|
-
|
|
12641
|
-
false, // incompleteFirstPass: boolean
|
|
12642
|
-
decls, // ngDevMode only: decls
|
|
12643
|
-
vars) :
|
|
12644
|
-
{
|
|
12645
|
-
type: type,
|
|
12646
|
-
blueprint: blueprint,
|
|
12647
|
-
template: templateFn,
|
|
12648
|
-
queries: null,
|
|
12649
|
-
viewQuery: viewQuery,
|
|
12650
|
-
declTNode: declTNode,
|
|
12651
|
-
data: blueprint.slice().fill(null, bindingStartIndex),
|
|
12652
|
-
bindingStartIndex: bindingStartIndex,
|
|
12653
|
-
expandoStartIndex: initialViewLength,
|
|
12654
|
-
hostBindingOpCodes: null,
|
|
12655
|
-
firstCreatePass: true,
|
|
12656
|
-
firstUpdatePass: true,
|
|
12657
|
-
staticViewQueries: false,
|
|
12658
|
-
staticContentQueries: false,
|
|
12659
|
-
preOrderHooks: null,
|
|
12660
|
-
preOrderCheckHooks: null,
|
|
12661
|
-
contentHooks: null,
|
|
12662
|
-
contentCheckHooks: null,
|
|
12663
|
-
viewHooks: null,
|
|
12664
|
-
viewCheckHooks: null,
|
|
12665
|
-
destroyHooks: null,
|
|
12666
|
-
cleanup: null,
|
|
12667
|
-
contentQueries: null,
|
|
12668
|
-
components: null,
|
|
12669
|
-
directiveRegistry: typeof directives === 'function' ? directives() : directives,
|
|
12670
|
-
pipeRegistry: typeof pipes === 'function' ? pipes() : pipes,
|
|
12671
|
-
firstChild: null,
|
|
12672
|
-
schemas: schemas,
|
|
12673
|
-
consts: consts,
|
|
12674
|
-
incompleteFirstPass: false
|
|
12675
|
-
};
|
|
11788
|
+
const tView = blueprint[TVIEW] = {
|
|
11789
|
+
type: type,
|
|
11790
|
+
blueprint: blueprint,
|
|
11791
|
+
template: templateFn,
|
|
11792
|
+
queries: null,
|
|
11793
|
+
viewQuery: viewQuery,
|
|
11794
|
+
declTNode: declTNode,
|
|
11795
|
+
data: blueprint.slice().fill(null, bindingStartIndex),
|
|
11796
|
+
bindingStartIndex: bindingStartIndex,
|
|
11797
|
+
expandoStartIndex: initialViewLength,
|
|
11798
|
+
hostBindingOpCodes: null,
|
|
11799
|
+
firstCreatePass: true,
|
|
11800
|
+
firstUpdatePass: true,
|
|
11801
|
+
staticViewQueries: false,
|
|
11802
|
+
staticContentQueries: false,
|
|
11803
|
+
preOrderHooks: null,
|
|
11804
|
+
preOrderCheckHooks: null,
|
|
11805
|
+
contentHooks: null,
|
|
11806
|
+
contentCheckHooks: null,
|
|
11807
|
+
viewHooks: null,
|
|
11808
|
+
viewCheckHooks: null,
|
|
11809
|
+
destroyHooks: null,
|
|
11810
|
+
cleanup: null,
|
|
11811
|
+
contentQueries: null,
|
|
11812
|
+
components: null,
|
|
11813
|
+
directiveRegistry: typeof directives === 'function' ? directives() : directives,
|
|
11814
|
+
pipeRegistry: typeof pipes === 'function' ? pipes() : pipes,
|
|
11815
|
+
firstChild: null,
|
|
11816
|
+
schemas: schemas,
|
|
11817
|
+
consts: consts,
|
|
11818
|
+
incompleteFirstPass: false
|
|
11819
|
+
};
|
|
12676
11820
|
if (ngDevMode) {
|
|
12677
11821
|
// For performance reasons it is important that the tView retains the same shape during runtime.
|
|
12678
11822
|
// (To make sure that all of the code is monomorphic.) For this reason we seal the object to
|
|
@@ -12682,7 +11826,7 @@ function createTView(type, declTNode, templateFn, decls, vars, directives, pipes
|
|
|
12682
11826
|
return tView;
|
|
12683
11827
|
}
|
|
12684
11828
|
function createViewBlueprint(bindingStartIndex, initialViewLength) {
|
|
12685
|
-
const blueprint =
|
|
11829
|
+
const blueprint = [];
|
|
12686
11830
|
for (let i = 0; i < initialViewLength; i++) {
|
|
12687
11831
|
blueprint.push(i < bindingStartIndex ? null : NO_CHANGE);
|
|
12688
11832
|
}
|
|
@@ -12735,74 +11879,40 @@ function createTNode(tView, tParent, type, index, value, attrs) {
|
|
|
12735
11879
|
ngDevMode && ngDevMode.tNode++;
|
|
12736
11880
|
ngDevMode && tParent && assertTNodeForTView(tParent, tView);
|
|
12737
11881
|
let injectorIndex = tParent ? tParent.injectorIndex : -1;
|
|
12738
|
-
const tNode =
|
|
12739
|
-
|
|
12740
|
-
|
|
12741
|
-
|
|
12742
|
-
|
|
12743
|
-
|
|
12744
|
-
-1,
|
|
12745
|
-
-1,
|
|
12746
|
-
-1,
|
|
12747
|
-
|
|
12748
|
-
|
|
12749
|
-
0,
|
|
12750
|
-
|
|
12751
|
-
|
|
12752
|
-
|
|
12753
|
-
null,
|
|
12754
|
-
|
|
12755
|
-
|
|
12756
|
-
|
|
12757
|
-
|
|
12758
|
-
|
|
12759
|
-
|
|
12760
|
-
|
|
12761
|
-
|
|
12762
|
-
|
|
12763
|
-
|
|
12764
|
-
|
|
12765
|
-
|
|
12766
|
-
|
|
12767
|
-
|
|
12768
|
-
|
|
12769
|
-
|
|
12770
|
-
0,
|
|
12771
|
-
|
|
12772
|
-
{
|
|
12773
|
-
type,
|
|
12774
|
-
index,
|
|
12775
|
-
insertBeforeIndex: null,
|
|
12776
|
-
injectorIndex,
|
|
12777
|
-
directiveStart: -1,
|
|
12778
|
-
directiveEnd: -1,
|
|
12779
|
-
directiveStylingLast: -1,
|
|
12780
|
-
componentOffset: -1,
|
|
12781
|
-
propertyBindings: null,
|
|
12782
|
-
flags: 0,
|
|
12783
|
-
providerIndexes: 0,
|
|
12784
|
-
value: value,
|
|
12785
|
-
attrs: attrs,
|
|
12786
|
-
mergedAttrs: null,
|
|
12787
|
-
localNames: null,
|
|
12788
|
-
initialInputs: undefined,
|
|
12789
|
-
inputs: null,
|
|
12790
|
-
outputs: null,
|
|
12791
|
-
tViews: null,
|
|
12792
|
-
next: null,
|
|
12793
|
-
projectionNext: null,
|
|
12794
|
-
child: null,
|
|
12795
|
-
parent: tParent,
|
|
12796
|
-
projection: null,
|
|
12797
|
-
styles: null,
|
|
12798
|
-
stylesWithoutHost: null,
|
|
12799
|
-
residualStyles: undefined,
|
|
12800
|
-
classes: null,
|
|
12801
|
-
classesWithoutHost: null,
|
|
12802
|
-
residualClasses: undefined,
|
|
12803
|
-
classBindings: 0,
|
|
12804
|
-
styleBindings: 0,
|
|
12805
|
-
};
|
|
11882
|
+
const tNode = {
|
|
11883
|
+
type,
|
|
11884
|
+
index,
|
|
11885
|
+
insertBeforeIndex: null,
|
|
11886
|
+
injectorIndex,
|
|
11887
|
+
directiveStart: -1,
|
|
11888
|
+
directiveEnd: -1,
|
|
11889
|
+
directiveStylingLast: -1,
|
|
11890
|
+
componentOffset: -1,
|
|
11891
|
+
propertyBindings: null,
|
|
11892
|
+
flags: 0,
|
|
11893
|
+
providerIndexes: 0,
|
|
11894
|
+
value: value,
|
|
11895
|
+
attrs: attrs,
|
|
11896
|
+
mergedAttrs: null,
|
|
11897
|
+
localNames: null,
|
|
11898
|
+
initialInputs: undefined,
|
|
11899
|
+
inputs: null,
|
|
11900
|
+
outputs: null,
|
|
11901
|
+
tViews: null,
|
|
11902
|
+
next: null,
|
|
11903
|
+
projectionNext: null,
|
|
11904
|
+
child: null,
|
|
11905
|
+
parent: tParent,
|
|
11906
|
+
projection: null,
|
|
11907
|
+
styles: null,
|
|
11908
|
+
stylesWithoutHost: null,
|
|
11909
|
+
residualStyles: undefined,
|
|
11910
|
+
classes: null,
|
|
11911
|
+
classesWithoutHost: null,
|
|
11912
|
+
residualClasses: undefined,
|
|
11913
|
+
classBindings: 0,
|
|
11914
|
+
styleBindings: 0,
|
|
11915
|
+
};
|
|
12806
11916
|
if (ngDevMode) {
|
|
12807
11917
|
// For performance reasons it is important that the tNode retains the same shape during runtime.
|
|
12808
11918
|
// (To make sure that all of the code is monomorphic.) For this reason we seal the object to
|
|
@@ -12859,7 +11969,7 @@ function initializeInputAndOutputAliases(tView, tNode, hostDirectiveDefinitionMa
|
|
|
12859
11969
|
const end = tNode.directiveEnd;
|
|
12860
11970
|
const tViewData = tView.data;
|
|
12861
11971
|
const tNodeAttrs = tNode.attrs;
|
|
12862
|
-
const inputsFromAttrs =
|
|
11972
|
+
const inputsFromAttrs = [];
|
|
12863
11973
|
let inputsStore = null;
|
|
12864
11974
|
let outputsStore = null;
|
|
12865
11975
|
for (let directiveIndex = start; directiveIndex < end; directiveIndex++) {
|
|
@@ -13198,7 +12308,7 @@ function findDirectiveDefMatches(tView, tNode) {
|
|
|
13198
12308
|
for (let i = 0; i < registry.length; i++) {
|
|
13199
12309
|
const def = registry[i];
|
|
13200
12310
|
if (isNodeMatchingSelectorList(tNode, def.selectors, /* isProjectionMode */ false)) {
|
|
13201
|
-
matches || (matches =
|
|
12311
|
+
matches || (matches = []);
|
|
13202
12312
|
if (isComponentDef(def)) {
|
|
13203
12313
|
if (ngDevMode) {
|
|
13204
12314
|
assertTNodeType(tNode, 2 /* TNodeType.Element */, `"${tNode.value}" tags cannot be used as component hosts. ` +
|
|
@@ -13256,13 +12366,12 @@ function markAsComponentHost(tView, hostTNode, componentOffset) {
|
|
|
13256
12366
|
ngDevMode && assertFirstCreatePass(tView);
|
|
13257
12367
|
ngDevMode && assertGreaterThan(componentOffset, -1, 'componentOffset must be great than -1');
|
|
13258
12368
|
hostTNode.componentOffset = componentOffset;
|
|
13259
|
-
(tView.components || (tView.components =
|
|
13260
|
-
.push(hostTNode.index);
|
|
12369
|
+
(tView.components || (tView.components = [])).push(hostTNode.index);
|
|
13261
12370
|
}
|
|
13262
12371
|
/** Caches local names and their matching directive indices for query and template lookups. */
|
|
13263
12372
|
function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {
|
|
13264
12373
|
if (localRefs) {
|
|
13265
|
-
const localNames = tNode.localNames =
|
|
12374
|
+
const localNames = tNode.localNames = [];
|
|
13266
12375
|
// Local names must be stored in tNode in the same order that localRefs are defined
|
|
13267
12376
|
// in the template to ensure the data is loaded in the same slots as their refs
|
|
13268
12377
|
// in the template (for template queries).
|
|
@@ -13445,9 +12554,6 @@ function generateInitialInputs(inputs, directiveIndex, attrs) {
|
|
|
13445
12554
|
//////////////////////////
|
|
13446
12555
|
//// ViewContainer & View
|
|
13447
12556
|
//////////////////////////
|
|
13448
|
-
// Not sure why I need to do `any` here but TS complains later.
|
|
13449
|
-
const LContainerArray = class LContainer extends Array {
|
|
13450
|
-
};
|
|
13451
12557
|
/**
|
|
13452
12558
|
* Creates a LContainer, either from a container instruction, or for a ViewContainerRef.
|
|
13453
12559
|
*
|
|
@@ -13460,20 +12566,20 @@ const LContainerArray = class LContainer extends Array {
|
|
|
13460
12566
|
*/
|
|
13461
12567
|
function createLContainer(hostNative, currentView, native, tNode) {
|
|
13462
12568
|
ngDevMode && assertLView(currentView);
|
|
13463
|
-
|
|
13464
|
-
|
|
13465
|
-
|
|
13466
|
-
|
|
13467
|
-
|
|
13468
|
-
|
|
13469
|
-
|
|
13470
|
-
|
|
13471
|
-
|
|
13472
|
-
|
|
13473
|
-
|
|
12569
|
+
const lContainer = [
|
|
12570
|
+
hostNative,
|
|
12571
|
+
true,
|
|
12572
|
+
false,
|
|
12573
|
+
currentView,
|
|
12574
|
+
null,
|
|
12575
|
+
0,
|
|
12576
|
+
tNode,
|
|
12577
|
+
native,
|
|
12578
|
+
null,
|
|
12579
|
+
null, // moved views
|
|
12580
|
+
];
|
|
13474
12581
|
ngDevMode &&
|
|
13475
12582
|
assertEqual(lContainer.length, CONTAINER_HEADER_OFFSET, 'Should allocate correct number of slots for LContainer header.');
|
|
13476
|
-
ngDevMode && attachLContainerDebug(lContainer);
|
|
13477
12583
|
return lContainer;
|
|
13478
12584
|
}
|
|
13479
12585
|
/**
|
|
@@ -13747,10 +12853,10 @@ function storePropertyBindingMetadata(tData, tNode, propertyName, bindingIndex,
|
|
|
13747
12853
|
}
|
|
13748
12854
|
function getOrCreateLViewCleanup(view) {
|
|
13749
12855
|
// top level variables should not be exported for performance reasons (PERF_NOTES.md)
|
|
13750
|
-
return view[CLEANUP] || (view[CLEANUP] =
|
|
12856
|
+
return view[CLEANUP] || (view[CLEANUP] = []);
|
|
13751
12857
|
}
|
|
13752
12858
|
function getOrCreateTViewCleanup(tView) {
|
|
13753
|
-
return tView.cleanup || (tView.cleanup =
|
|
12859
|
+
return tView.cleanup || (tView.cleanup = []);
|
|
13754
12860
|
}
|
|
13755
12861
|
/**
|
|
13756
12862
|
* There are cases where the sub component's renderer needs to be included
|
|
@@ -14362,17 +13468,6 @@ class ComponentFactory extends ComponentFactory$1 {
|
|
|
14362
13468
|
return new ComponentRef(this.componentType, component, createElementRef(tElementNode, rootLView), rootLView, tElementNode);
|
|
14363
13469
|
}
|
|
14364
13470
|
}
|
|
14365
|
-
const componentFactoryResolver = new ComponentFactoryResolver();
|
|
14366
|
-
/**
|
|
14367
|
-
* Creates a ComponentFactoryResolver and stores it on the injector. Or, if the
|
|
14368
|
-
* ComponentFactoryResolver
|
|
14369
|
-
* already exists, retrieves the existing ComponentFactoryResolver.
|
|
14370
|
-
*
|
|
14371
|
-
* @returns The ComponentFactoryResolver instance to use
|
|
14372
|
-
*/
|
|
14373
|
-
function injectComponentFactoryResolver() {
|
|
14374
|
-
return componentFactoryResolver;
|
|
14375
|
-
}
|
|
14376
13471
|
/**
|
|
14377
13472
|
* Represents an instance of a Component created via a {@link ComponentFactory}.
|
|
14378
13473
|
*
|
|
@@ -16958,6 +16053,62 @@ function ɵɵpropertyInterpolateV(propName, values, sanitizer) {
|
|
|
16958
16053
|
return ɵɵpropertyInterpolateV;
|
|
16959
16054
|
}
|
|
16960
16055
|
|
|
16056
|
+
/**
|
|
16057
|
+
* @license
|
|
16058
|
+
* Copyright Google LLC All Rights Reserved.
|
|
16059
|
+
*
|
|
16060
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
16061
|
+
* found in the LICENSE file at https://angular.io/license
|
|
16062
|
+
*/
|
|
16063
|
+
function toTStylingRange(prev, next) {
|
|
16064
|
+
ngDevMode && assertNumberInRange(prev, 0, 32767 /* StylingRange.UNSIGNED_MASK */);
|
|
16065
|
+
ngDevMode && assertNumberInRange(next, 0, 32767 /* StylingRange.UNSIGNED_MASK */);
|
|
16066
|
+
return (prev << 17 /* StylingRange.PREV_SHIFT */ | next << 2 /* StylingRange.NEXT_SHIFT */);
|
|
16067
|
+
}
|
|
16068
|
+
function getTStylingRangePrev(tStylingRange) {
|
|
16069
|
+
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
16070
|
+
return (tStylingRange >> 17 /* StylingRange.PREV_SHIFT */) & 32767 /* StylingRange.UNSIGNED_MASK */;
|
|
16071
|
+
}
|
|
16072
|
+
function getTStylingRangePrevDuplicate(tStylingRange) {
|
|
16073
|
+
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
16074
|
+
return (tStylingRange & 2 /* StylingRange.PREV_DUPLICATE */) ==
|
|
16075
|
+
2 /* StylingRange.PREV_DUPLICATE */;
|
|
16076
|
+
}
|
|
16077
|
+
function setTStylingRangePrev(tStylingRange, previous) {
|
|
16078
|
+
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
16079
|
+
ngDevMode && assertNumberInRange(previous, 0, 32767 /* StylingRange.UNSIGNED_MASK */);
|
|
16080
|
+
return ((tStylingRange & ~4294836224 /* StylingRange.PREV_MASK */) |
|
|
16081
|
+
(previous << 17 /* StylingRange.PREV_SHIFT */));
|
|
16082
|
+
}
|
|
16083
|
+
function setTStylingRangePrevDuplicate(tStylingRange) {
|
|
16084
|
+
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
16085
|
+
return (tStylingRange | 2 /* StylingRange.PREV_DUPLICATE */);
|
|
16086
|
+
}
|
|
16087
|
+
function getTStylingRangeNext(tStylingRange) {
|
|
16088
|
+
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
16089
|
+
return (tStylingRange & 131068 /* StylingRange.NEXT_MASK */) >> 2 /* StylingRange.NEXT_SHIFT */;
|
|
16090
|
+
}
|
|
16091
|
+
function setTStylingRangeNext(tStylingRange, next) {
|
|
16092
|
+
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
16093
|
+
ngDevMode && assertNumberInRange(next, 0, 32767 /* StylingRange.UNSIGNED_MASK */);
|
|
16094
|
+
return ((tStylingRange & ~131068 /* StylingRange.NEXT_MASK */) | //
|
|
16095
|
+
next << 2 /* StylingRange.NEXT_SHIFT */);
|
|
16096
|
+
}
|
|
16097
|
+
function getTStylingRangeNextDuplicate(tStylingRange) {
|
|
16098
|
+
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
16099
|
+
return (tStylingRange & 1 /* StylingRange.NEXT_DUPLICATE */) ===
|
|
16100
|
+
1 /* StylingRange.NEXT_DUPLICATE */;
|
|
16101
|
+
}
|
|
16102
|
+
function setTStylingRangeNextDuplicate(tStylingRange) {
|
|
16103
|
+
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
16104
|
+
return (tStylingRange | 1 /* StylingRange.NEXT_DUPLICATE */);
|
|
16105
|
+
}
|
|
16106
|
+
function getTStylingRangeTail(tStylingRange) {
|
|
16107
|
+
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
16108
|
+
const next = getTStylingRangeNext(tStylingRange);
|
|
16109
|
+
return next === 0 ? getTStylingRangePrev(tStylingRange) : next;
|
|
16110
|
+
}
|
|
16111
|
+
|
|
16961
16112
|
/**
|
|
16962
16113
|
* @license
|
|
16963
16114
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -20779,6 +19930,46 @@ function loadIcuContainerVisitor() {
|
|
|
20779
19930
|
return icuContainerIteratorStart;
|
|
20780
19931
|
}
|
|
20781
19932
|
|
|
19933
|
+
/**
|
|
19934
|
+
* @license
|
|
19935
|
+
* Copyright Google LLC All Rights Reserved.
|
|
19936
|
+
*
|
|
19937
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
19938
|
+
* found in the LICENSE file at https://angular.io/license
|
|
19939
|
+
*/
|
|
19940
|
+
/**
|
|
19941
|
+
* Patch a `debug` property on top of the existing object.
|
|
19942
|
+
*
|
|
19943
|
+
* NOTE: always call this method with `ngDevMode && attachDebugObject(...)`
|
|
19944
|
+
*
|
|
19945
|
+
* @param obj Object to patch
|
|
19946
|
+
* @param debug Value to patch
|
|
19947
|
+
*/
|
|
19948
|
+
function attachDebugObject(obj, debug) {
|
|
19949
|
+
if (ngDevMode) {
|
|
19950
|
+
Object.defineProperty(obj, 'debug', { value: debug, enumerable: false });
|
|
19951
|
+
}
|
|
19952
|
+
else {
|
|
19953
|
+
throw new Error('This method should be guarded with `ngDevMode` so that it can be tree shaken in production!');
|
|
19954
|
+
}
|
|
19955
|
+
}
|
|
19956
|
+
/**
|
|
19957
|
+
* Patch a `debug` property getter on top of the existing object.
|
|
19958
|
+
*
|
|
19959
|
+
* NOTE: always call this method with `ngDevMode && attachDebugObject(...)`
|
|
19960
|
+
*
|
|
19961
|
+
* @param obj Object to patch
|
|
19962
|
+
* @param debugGetter Getter returning a value to patch
|
|
19963
|
+
*/
|
|
19964
|
+
function attachDebugGetter(obj, debugGetter) {
|
|
19965
|
+
if (ngDevMode) {
|
|
19966
|
+
Object.defineProperty(obj, 'debug', { get: debugGetter, enumerable: false });
|
|
19967
|
+
}
|
|
19968
|
+
else {
|
|
19969
|
+
throw new Error('This method should be guarded with `ngDevMode` so that it can be tree shaken in production!');
|
|
19970
|
+
}
|
|
19971
|
+
}
|
|
19972
|
+
|
|
20782
19973
|
/**
|
|
20783
19974
|
* @license
|
|
20784
19975
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -22748,32 +21939,6 @@ function sortListeners(a, b) {
|
|
|
22748
21939
|
function isDirectiveDefHack(obj) {
|
|
22749
21940
|
return obj.type !== undefined && obj.template !== undefined && obj.declaredInputs !== undefined;
|
|
22750
21941
|
}
|
|
22751
|
-
/**
|
|
22752
|
-
* Returns the attached `DebugNode` instance for an element in the DOM.
|
|
22753
|
-
*
|
|
22754
|
-
* @param element DOM element which is owned by an existing component's view.
|
|
22755
|
-
*/
|
|
22756
|
-
function getDebugNode(element) {
|
|
22757
|
-
if (ngDevMode && !(element instanceof Node)) {
|
|
22758
|
-
throw new Error('Expecting instance of DOM Element');
|
|
22759
|
-
}
|
|
22760
|
-
const lContext = getLContext(element);
|
|
22761
|
-
const lView = lContext ? lContext.lView : null;
|
|
22762
|
-
if (lView === null) {
|
|
22763
|
-
return null;
|
|
22764
|
-
}
|
|
22765
|
-
const nodeIndex = lContext.nodeIndex;
|
|
22766
|
-
if (nodeIndex !== -1) {
|
|
22767
|
-
const valueInLView = lView[nodeIndex];
|
|
22768
|
-
// this means that value in the lView is a component with its own
|
|
22769
|
-
// data. In this situation the TNode is not accessed at the same spot.
|
|
22770
|
-
const tNode = isLView(valueInLView) ? valueInLView[T_HOST] : getTNode(lView[TVIEW], nodeIndex);
|
|
22771
|
-
ngDevMode &&
|
|
22772
|
-
assertEqual(tNode.index, nodeIndex, 'Expecting that TNode at index is same as index');
|
|
22773
|
-
return buildDebugNode(tNode, lView);
|
|
22774
|
-
}
|
|
22775
|
-
return null;
|
|
22776
|
-
}
|
|
22777
21942
|
/**
|
|
22778
21943
|
* Retrieve the component `LView` from component/element.
|
|
22779
21944
|
*
|