@angular/core 15.0.0 → 15.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/src/core_private_export.mjs +2 -1
- package/esm2020/src/error_details_base_url.mjs +6 -2
- 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/i18n/i18n_parse.mjs +3 -2
- package/esm2020/src/render3/index.mjs +2 -2
- package/esm2020/src/render3/instructions/listener.mjs +6 -5
- package/esm2020/src/render3/instructions/shared.mjs +87 -162
- package/esm2020/src/render3/interfaces/view.mjs +1 -10
- package/esm2020/src/render3/node_manipulation.mjs +11 -20
- package/esm2020/src/render3/util/discovery_utils.mjs +3 -32
- package/esm2020/src/sanitization/bypass.mjs +4 -3
- package/esm2020/src/sanitization/html_sanitizer.mjs +3 -2
- package/esm2020/src/sanitization/sanitization.mjs +3 -3
- package/esm2020/src/sanitization/url_sanitizer.mjs +3 -2
- 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 +210 -1050
- package/fesm2015/core.mjs.map +1 -1
- package/fesm2015/testing.mjs +211 -1051
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2020/core.mjs +210 -1050
- package/fesm2020/core.mjs.map +1 -1
- package/fesm2020/testing.mjs +211 -1051
- package/fesm2020/testing.mjs.map +1 -1
- package/index.d.ts +8 -223
- 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/fesm2020/testing.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v15.0.
|
|
2
|
+
* @license Angular v15.0.2
|
|
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, ɵflushModuleScopingQueueAsMuchAsPossible } from '@angular/core';
|
|
8
8
|
import { ResourceLoader } from '@angular/compiler';
|
|
9
9
|
import { Subject, Subscription } from 'rxjs';
|
|
10
10
|
|
|
@@ -85,7 +85,7 @@ class ComponentFixture {
|
|
|
85
85
|
this._onErrorSubscription = null;
|
|
86
86
|
this.changeDetectorRef = componentRef.changeDetectorRef;
|
|
87
87
|
this.elementRef = componentRef.location;
|
|
88
|
-
this.debugElement = getDebugNode
|
|
88
|
+
this.debugElement = getDebugNode(this.elementRef.nativeElement);
|
|
89
89
|
this.componentInstance = componentRef.instance;
|
|
90
90
|
this.nativeElement = this.elementRef.nativeElement;
|
|
91
91
|
this.componentRef = componentRef;
|
|
@@ -906,11 +906,15 @@ const NG_INJECTOR_DEF = getClosureSafeProperty({ ngInjectorDef: getClosureSafePr
|
|
|
906
906
|
/**
|
|
907
907
|
* Base URL for the error details page.
|
|
908
908
|
*
|
|
909
|
-
* Keep
|
|
909
|
+
* Keep this constant in sync across:
|
|
910
910
|
* - packages/compiler-cli/src/ngtsc/diagnostics/src/error_details_base_url.ts
|
|
911
911
|
* - packages/core/src/error_details_base_url.ts
|
|
912
912
|
*/
|
|
913
913
|
const ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.io/errors';
|
|
914
|
+
/**
|
|
915
|
+
* URL for the XSS security documentation.
|
|
916
|
+
*/
|
|
917
|
+
const XSS_SECURITY_URL = 'https://g.co/ng/security#xss';
|
|
914
918
|
|
|
915
919
|
/**
|
|
916
920
|
* @license
|
|
@@ -2851,15 +2855,6 @@ const EMBEDDED_VIEW_INJECTOR = 21;
|
|
|
2851
2855
|
* there should be no need to refer to `HEADER_OFFSET` anywhere else.
|
|
2852
2856
|
*/
|
|
2853
2857
|
const HEADER_OFFSET = 22;
|
|
2854
|
-
/**
|
|
2855
|
-
* Converts `TViewType` into human readable text.
|
|
2856
|
-
* Make sure this matches with `TViewType`
|
|
2857
|
-
*/
|
|
2858
|
-
const TViewTypeAsString = [
|
|
2859
|
-
'Root',
|
|
2860
|
-
'Component',
|
|
2861
|
-
'Embedded', // 2
|
|
2862
|
-
];
|
|
2863
2858
|
// Note: This hack is necessary so we don't erroneously get a circular dependency
|
|
2864
2859
|
// failure based on types.
|
|
2865
2860
|
const unusedValueExportToPlacateAjd$8 = 1;
|
|
@@ -3027,10 +3022,6 @@ function assertIndexInDeclRange(lView, index) {
|
|
|
3027
3022
|
const tView = lView[1];
|
|
3028
3023
|
assertBetween(HEADER_OFFSET, tView.bindingStartIndex, index);
|
|
3029
3024
|
}
|
|
3030
|
-
function assertIndexInVarsRange(lView, index) {
|
|
3031
|
-
const tView = lView[1];
|
|
3032
|
-
assertBetween(tView.bindingStartIndex, tView.expandoStartIndex, index);
|
|
3033
|
-
}
|
|
3034
3025
|
function assertIndexInExpandoRange(lView, index) {
|
|
3035
3026
|
const tView = lView[1];
|
|
3036
3027
|
assertBetween(tView.expandoStartIndex, lView.length, index);
|
|
@@ -6817,26 +6808,17 @@ function processCleanups(tView, lView) {
|
|
|
6817
6808
|
if (tCleanup !== null) {
|
|
6818
6809
|
for (let i = 0; i < tCleanup.length - 1; i += 2) {
|
|
6819
6810
|
if (typeof tCleanup[i] === 'string') {
|
|
6820
|
-
// This is a native DOM listener
|
|
6821
|
-
|
|
6822
|
-
const
|
|
6823
|
-
|
|
6824
|
-
|
|
6825
|
-
|
|
6826
|
-
|
|
6827
|
-
if (typeof useCaptureOrSubIdx === 'boolean') {
|
|
6828
|
-
// native DOM listener registered with Renderer3
|
|
6829
|
-
target.removeEventListener(tCleanup[i], listener, useCaptureOrSubIdx);
|
|
6811
|
+
// This is a native DOM listener. It will occupy 4 entries in the TCleanup array (hence i +=
|
|
6812
|
+
// 2 at the end of this block).
|
|
6813
|
+
const targetIdx = tCleanup[i + 3];
|
|
6814
|
+
ngDevMode && assertNumber(targetIdx, 'cleanup target must be a number');
|
|
6815
|
+
if (targetIdx >= 0) {
|
|
6816
|
+
// unregister
|
|
6817
|
+
lCleanup[lastLCleanupIndex = targetIdx]();
|
|
6830
6818
|
}
|
|
6831
6819
|
else {
|
|
6832
|
-
|
|
6833
|
-
|
|
6834
|
-
lCleanup[lastLCleanupIndex = useCaptureOrSubIdx]();
|
|
6835
|
-
}
|
|
6836
|
-
else {
|
|
6837
|
-
// Subscription
|
|
6838
|
-
lCleanup[lastLCleanupIndex = -useCaptureOrSubIdx].unsubscribe();
|
|
6839
|
-
}
|
|
6820
|
+
// Subscription
|
|
6821
|
+
lCleanup[lastLCleanupIndex = -targetIdx].unsubscribe();
|
|
6840
6822
|
}
|
|
6841
6823
|
i += 2;
|
|
6842
6824
|
}
|
|
@@ -7692,7 +7674,7 @@ class SafeValueImpl {
|
|
|
7692
7674
|
}
|
|
7693
7675
|
toString() {
|
|
7694
7676
|
return `SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity}` +
|
|
7695
|
-
` (see
|
|
7677
|
+
` (see ${XSS_SECURITY_URL})`;
|
|
7696
7678
|
}
|
|
7697
7679
|
}
|
|
7698
7680
|
class SafeHtmlImpl extends SafeValueImpl {
|
|
@@ -7730,7 +7712,7 @@ function allowSanitizationBypassAndThrow(value, type) {
|
|
|
7730
7712
|
// Allow ResourceURLs in URL contexts, they are strictly more trusted.
|
|
7731
7713
|
if (actualType === "ResourceURL" /* BypassType.ResourceUrl */ && type === "URL" /* BypassType.Url */)
|
|
7732
7714
|
return true;
|
|
7733
|
-
throw new Error(`Required a safe ${type}, got a ${actualType} (see
|
|
7715
|
+
throw new Error(`Required a safe ${type}, got a ${actualType} (see ${XSS_SECURITY_URL})`);
|
|
7734
7716
|
}
|
|
7735
7717
|
return actualType === type;
|
|
7736
7718
|
}
|
|
@@ -7970,7 +7952,7 @@ function _sanitizeUrl(url) {
|
|
|
7970
7952
|
if (url.match(SAFE_URL_PATTERN))
|
|
7971
7953
|
return url;
|
|
7972
7954
|
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
7973
|
-
console.warn(`WARNING: sanitizing unsafe URL value ${url} (see
|
|
7955
|
+
console.warn(`WARNING: sanitizing unsafe URL value ${url} (see ${XSS_SECURITY_URL})`);
|
|
7974
7956
|
}
|
|
7975
7957
|
return 'unsafe:' + url;
|
|
7976
7958
|
}
|
|
@@ -8198,7 +8180,7 @@ function _sanitizeHtml(defaultDoc, unsafeHtmlInput) {
|
|
|
8198
8180
|
const sanitizer = new SanitizingHtmlSerializer();
|
|
8199
8181
|
const safeHtml = sanitizer.sanitizeChildren(getTemplateContent(inertBodyElement) || inertBodyElement);
|
|
8200
8182
|
if ((typeof ngDevMode === 'undefined' || ngDevMode) && sanitizer.sanitizedSomething) {
|
|
8201
|
-
console.warn(
|
|
8183
|
+
console.warn(`WARNING: sanitizing HTML stripped some content, see ${XSS_SECURITY_URL}`);
|
|
8202
8184
|
}
|
|
8203
8185
|
return trustedHTMLFromString(safeHtml);
|
|
8204
8186
|
}
|
|
@@ -8345,8 +8327,7 @@ function ɵɵsanitizeResourceUrl(unsafeResourceUrl) {
|
|
|
8345
8327
|
if (allowSanitizationBypassAndThrow(unsafeResourceUrl, "ResourceURL" /* BypassType.ResourceUrl */)) {
|
|
8346
8328
|
return trustedScriptURLFromStringBypass(unwrapSafeValue(unsafeResourceUrl));
|
|
8347
8329
|
}
|
|
8348
|
-
throw new RuntimeError(904 /* RuntimeErrorCode.UNSAFE_VALUE_IN_RESOURCE_URL */, ngDevMode &&
|
|
8349
|
-
'unsafe value used in a resource URL context (see https://g.co/ng/security#xss)');
|
|
8330
|
+
throw new RuntimeError(904 /* RuntimeErrorCode.UNSAFE_VALUE_IN_RESOURCE_URL */, ngDevMode && `unsafe value used in a resource URL context (see ${XSS_SECURITY_URL})`);
|
|
8350
8331
|
}
|
|
8351
8332
|
/**
|
|
8352
8333
|
* A `script` sanitizer which only lets trusted javascript through.
|
|
@@ -9447,7 +9428,6 @@ function unwrapElementRef(value) {
|
|
|
9447
9428
|
* Use of this source code is governed by an MIT-style license that can be
|
|
9448
9429
|
* found in the LICENSE file at https://angular.io/license
|
|
9449
9430
|
*/
|
|
9450
|
-
const Renderer2Interceptor = new InjectionToken('Renderer2Interceptor');
|
|
9451
9431
|
/**
|
|
9452
9432
|
* Creates and initializes a custom renderer that implements the `Renderer2` base class.
|
|
9453
9433
|
*
|
|
@@ -9531,7 +9511,7 @@ class Version {
|
|
|
9531
9511
|
/**
|
|
9532
9512
|
* @publicApi
|
|
9533
9513
|
*/
|
|
9534
|
-
const VERSION = new Version('15.0.
|
|
9514
|
+
const VERSION = new Version('15.0.2');
|
|
9535
9515
|
|
|
9536
9516
|
/**
|
|
9537
9517
|
* @license
|
|
@@ -11324,812 +11304,6 @@ function ɵɵinvalidFactory() {
|
|
|
11324
11304
|
throw new Error(msg);
|
|
11325
11305
|
}
|
|
11326
11306
|
|
|
11327
|
-
/**
|
|
11328
|
-
* @license
|
|
11329
|
-
* Copyright Google LLC All Rights Reserved.
|
|
11330
|
-
*
|
|
11331
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
11332
|
-
* found in the LICENSE file at https://angular.io/license
|
|
11333
|
-
*/
|
|
11334
|
-
/**
|
|
11335
|
-
* THIS FILE CONTAINS CODE WHICH SHOULD BE TREE SHAKEN AND NEVER CALLED FROM PRODUCTION CODE!!!
|
|
11336
|
-
*/
|
|
11337
|
-
/**
|
|
11338
|
-
* Creates an `Array` construction with a given name. This is useful when
|
|
11339
|
-
* looking for memory consumption to see what time of array it is.
|
|
11340
|
-
*
|
|
11341
|
-
*
|
|
11342
|
-
* @param name Name to give to the constructor
|
|
11343
|
-
* @returns A subclass of `Array` if possible. This can only be done in
|
|
11344
|
-
* environments which support `class` construct.
|
|
11345
|
-
*/
|
|
11346
|
-
function createNamedArrayType(name) {
|
|
11347
|
-
// This should never be called in prod mode, so let's verify that is the case.
|
|
11348
|
-
if (ngDevMode) {
|
|
11349
|
-
try {
|
|
11350
|
-
// If this function were compromised the following could lead to arbitrary
|
|
11351
|
-
// script execution. We bless it with Trusted Types anyway since this
|
|
11352
|
-
// function is stripped out of production binaries.
|
|
11353
|
-
return (newTrustedFunctionForDev('Array', `return class ${name} extends Array{}`))(Array);
|
|
11354
|
-
}
|
|
11355
|
-
catch (e) {
|
|
11356
|
-
// If it does not work just give up and fall back to regular Array.
|
|
11357
|
-
return Array;
|
|
11358
|
-
}
|
|
11359
|
-
}
|
|
11360
|
-
else {
|
|
11361
|
-
throw new Error('Looks like we are in \'prod mode\', but we are creating a named Array type, which is wrong! Check your code');
|
|
11362
|
-
}
|
|
11363
|
-
}
|
|
11364
|
-
|
|
11365
|
-
/**
|
|
11366
|
-
* @license
|
|
11367
|
-
* Copyright Google LLC All Rights Reserved.
|
|
11368
|
-
*
|
|
11369
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
11370
|
-
* found in the LICENSE file at https://angular.io/license
|
|
11371
|
-
*/
|
|
11372
|
-
function toTStylingRange(prev, next) {
|
|
11373
|
-
ngDevMode && assertNumberInRange(prev, 0, 32767 /* StylingRange.UNSIGNED_MASK */);
|
|
11374
|
-
ngDevMode && assertNumberInRange(next, 0, 32767 /* StylingRange.UNSIGNED_MASK */);
|
|
11375
|
-
return (prev << 17 /* StylingRange.PREV_SHIFT */ | next << 2 /* StylingRange.NEXT_SHIFT */);
|
|
11376
|
-
}
|
|
11377
|
-
function getTStylingRangePrev(tStylingRange) {
|
|
11378
|
-
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
11379
|
-
return (tStylingRange >> 17 /* StylingRange.PREV_SHIFT */) & 32767 /* StylingRange.UNSIGNED_MASK */;
|
|
11380
|
-
}
|
|
11381
|
-
function getTStylingRangePrevDuplicate(tStylingRange) {
|
|
11382
|
-
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
11383
|
-
return (tStylingRange & 2 /* StylingRange.PREV_DUPLICATE */) ==
|
|
11384
|
-
2 /* StylingRange.PREV_DUPLICATE */;
|
|
11385
|
-
}
|
|
11386
|
-
function setTStylingRangePrev(tStylingRange, previous) {
|
|
11387
|
-
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
11388
|
-
ngDevMode && assertNumberInRange(previous, 0, 32767 /* StylingRange.UNSIGNED_MASK */);
|
|
11389
|
-
return ((tStylingRange & ~4294836224 /* StylingRange.PREV_MASK */) |
|
|
11390
|
-
(previous << 17 /* StylingRange.PREV_SHIFT */));
|
|
11391
|
-
}
|
|
11392
|
-
function setTStylingRangePrevDuplicate(tStylingRange) {
|
|
11393
|
-
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
11394
|
-
return (tStylingRange | 2 /* StylingRange.PREV_DUPLICATE */);
|
|
11395
|
-
}
|
|
11396
|
-
function getTStylingRangeNext(tStylingRange) {
|
|
11397
|
-
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
11398
|
-
return (tStylingRange & 131068 /* StylingRange.NEXT_MASK */) >> 2 /* StylingRange.NEXT_SHIFT */;
|
|
11399
|
-
}
|
|
11400
|
-
function setTStylingRangeNext(tStylingRange, next) {
|
|
11401
|
-
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
11402
|
-
ngDevMode && assertNumberInRange(next, 0, 32767 /* StylingRange.UNSIGNED_MASK */);
|
|
11403
|
-
return ((tStylingRange & ~131068 /* StylingRange.NEXT_MASK */) | //
|
|
11404
|
-
next << 2 /* StylingRange.NEXT_SHIFT */);
|
|
11405
|
-
}
|
|
11406
|
-
function getTStylingRangeNextDuplicate(tStylingRange) {
|
|
11407
|
-
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
11408
|
-
return (tStylingRange & 1 /* StylingRange.NEXT_DUPLICATE */) ===
|
|
11409
|
-
1 /* StylingRange.NEXT_DUPLICATE */;
|
|
11410
|
-
}
|
|
11411
|
-
function setTStylingRangeNextDuplicate(tStylingRange) {
|
|
11412
|
-
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
11413
|
-
return (tStylingRange | 1 /* StylingRange.NEXT_DUPLICATE */);
|
|
11414
|
-
}
|
|
11415
|
-
function getTStylingRangeTail(tStylingRange) {
|
|
11416
|
-
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
11417
|
-
const next = getTStylingRangeNext(tStylingRange);
|
|
11418
|
-
return next === 0 ? getTStylingRangePrev(tStylingRange) : next;
|
|
11419
|
-
}
|
|
11420
|
-
|
|
11421
|
-
/**
|
|
11422
|
-
* @license
|
|
11423
|
-
* Copyright Google LLC All Rights Reserved.
|
|
11424
|
-
*
|
|
11425
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
11426
|
-
* found in the LICENSE file at https://angular.io/license
|
|
11427
|
-
*/
|
|
11428
|
-
/**
|
|
11429
|
-
* Patch a `debug` property on top of the existing object.
|
|
11430
|
-
*
|
|
11431
|
-
* NOTE: always call this method with `ngDevMode && attachDebugObject(...)`
|
|
11432
|
-
*
|
|
11433
|
-
* @param obj Object to patch
|
|
11434
|
-
* @param debug Value to patch
|
|
11435
|
-
*/
|
|
11436
|
-
function attachDebugObject(obj, debug) {
|
|
11437
|
-
if (ngDevMode) {
|
|
11438
|
-
Object.defineProperty(obj, 'debug', { value: debug, enumerable: false });
|
|
11439
|
-
}
|
|
11440
|
-
else {
|
|
11441
|
-
throw new Error('This method should be guarded with `ngDevMode` so that it can be tree shaken in production!');
|
|
11442
|
-
}
|
|
11443
|
-
}
|
|
11444
|
-
/**
|
|
11445
|
-
* Patch a `debug` property getter on top of the existing object.
|
|
11446
|
-
*
|
|
11447
|
-
* NOTE: always call this method with `ngDevMode && attachDebugObject(...)`
|
|
11448
|
-
*
|
|
11449
|
-
* @param obj Object to patch
|
|
11450
|
-
* @param debugGetter Getter returning a value to patch
|
|
11451
|
-
*/
|
|
11452
|
-
function attachDebugGetter(obj, debugGetter) {
|
|
11453
|
-
if (ngDevMode) {
|
|
11454
|
-
Object.defineProperty(obj, 'debug', { get: debugGetter, enumerable: false });
|
|
11455
|
-
}
|
|
11456
|
-
else {
|
|
11457
|
-
throw new Error('This method should be guarded with `ngDevMode` so that it can be tree shaken in production!');
|
|
11458
|
-
}
|
|
11459
|
-
}
|
|
11460
|
-
|
|
11461
|
-
/**
|
|
11462
|
-
* @license
|
|
11463
|
-
* Copyright Google LLC All Rights Reserved.
|
|
11464
|
-
*
|
|
11465
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
11466
|
-
* found in the LICENSE file at https://angular.io/license
|
|
11467
|
-
*/
|
|
11468
|
-
/*
|
|
11469
|
-
* This file contains conditionally attached classes which provide human readable (debug) level
|
|
11470
|
-
* information for `LView`, `LContainer` and other internal data structures. These data structures
|
|
11471
|
-
* are stored internally as array which makes it very difficult during debugging to reason about the
|
|
11472
|
-
* current state of the system.
|
|
11473
|
-
*
|
|
11474
|
-
* Patching the array with extra property does change the array's hidden class' but it does not
|
|
11475
|
-
* change the cost of access, therefore this patching should not have significant if any impact in
|
|
11476
|
-
* `ngDevMode` mode. (see: https://jsperf.com/array-vs-monkey-patch-array)
|
|
11477
|
-
*
|
|
11478
|
-
* So instead of seeing:
|
|
11479
|
-
* ```
|
|
11480
|
-
* Array(30) [Object, 659, null, …]
|
|
11481
|
-
* ```
|
|
11482
|
-
*
|
|
11483
|
-
* You get to see:
|
|
11484
|
-
* ```
|
|
11485
|
-
* LViewDebug {
|
|
11486
|
-
* views: [...],
|
|
11487
|
-
* flags: {attached: true, ...}
|
|
11488
|
-
* nodes: [
|
|
11489
|
-
* {html: '<div id="123">', ..., nodes: [
|
|
11490
|
-
* {html: '<span>', ..., nodes: null}
|
|
11491
|
-
* ]}
|
|
11492
|
-
* ]
|
|
11493
|
-
* }
|
|
11494
|
-
* ```
|
|
11495
|
-
*/
|
|
11496
|
-
let LVIEW_COMPONENT_CACHE;
|
|
11497
|
-
let LVIEW_EMBEDDED_CACHE;
|
|
11498
|
-
let LVIEW_ROOT;
|
|
11499
|
-
let LVIEW_COMPONENT;
|
|
11500
|
-
let LVIEW_EMBEDDED;
|
|
11501
|
-
/**
|
|
11502
|
-
* This function clones a blueprint and creates LView.
|
|
11503
|
-
*
|
|
11504
|
-
* Simple slice will keep the same type, and we need it to be LView
|
|
11505
|
-
*/
|
|
11506
|
-
function cloneToLViewFromTViewBlueprint(tView) {
|
|
11507
|
-
const debugTView = tView;
|
|
11508
|
-
const lView = getLViewToClone(debugTView.type, tView.template && tView.template.name);
|
|
11509
|
-
return lView.concat(tView.blueprint);
|
|
11510
|
-
}
|
|
11511
|
-
class LRootView extends Array {
|
|
11512
|
-
}
|
|
11513
|
-
class LComponentView extends Array {
|
|
11514
|
-
}
|
|
11515
|
-
class LEmbeddedView extends Array {
|
|
11516
|
-
}
|
|
11517
|
-
function getLViewToClone(type, name) {
|
|
11518
|
-
switch (type) {
|
|
11519
|
-
case 0 /* TViewType.Root */:
|
|
11520
|
-
if (LVIEW_ROOT === undefined)
|
|
11521
|
-
LVIEW_ROOT = new LRootView();
|
|
11522
|
-
return LVIEW_ROOT;
|
|
11523
|
-
case 1 /* TViewType.Component */:
|
|
11524
|
-
if (!ngDevMode || !ngDevMode.namedConstructors) {
|
|
11525
|
-
if (LVIEW_COMPONENT === undefined)
|
|
11526
|
-
LVIEW_COMPONENT = new LComponentView();
|
|
11527
|
-
return LVIEW_COMPONENT;
|
|
11528
|
-
}
|
|
11529
|
-
if (LVIEW_COMPONENT_CACHE === undefined)
|
|
11530
|
-
LVIEW_COMPONENT_CACHE = new Map();
|
|
11531
|
-
let componentArray = LVIEW_COMPONENT_CACHE.get(name);
|
|
11532
|
-
if (componentArray === undefined) {
|
|
11533
|
-
componentArray = new (createNamedArrayType('LComponentView' + nameSuffix(name)))();
|
|
11534
|
-
LVIEW_COMPONENT_CACHE.set(name, componentArray);
|
|
11535
|
-
}
|
|
11536
|
-
return componentArray;
|
|
11537
|
-
case 2 /* TViewType.Embedded */:
|
|
11538
|
-
if (!ngDevMode || !ngDevMode.namedConstructors) {
|
|
11539
|
-
if (LVIEW_EMBEDDED === undefined)
|
|
11540
|
-
LVIEW_EMBEDDED = new LEmbeddedView();
|
|
11541
|
-
return LVIEW_EMBEDDED;
|
|
11542
|
-
}
|
|
11543
|
-
if (LVIEW_EMBEDDED_CACHE === undefined)
|
|
11544
|
-
LVIEW_EMBEDDED_CACHE = new Map();
|
|
11545
|
-
let embeddedArray = LVIEW_EMBEDDED_CACHE.get(name);
|
|
11546
|
-
if (embeddedArray === undefined) {
|
|
11547
|
-
embeddedArray = new (createNamedArrayType('LEmbeddedView' + nameSuffix(name)))();
|
|
11548
|
-
LVIEW_EMBEDDED_CACHE.set(name, embeddedArray);
|
|
11549
|
-
}
|
|
11550
|
-
return embeddedArray;
|
|
11551
|
-
}
|
|
11552
|
-
}
|
|
11553
|
-
function nameSuffix(text) {
|
|
11554
|
-
if (text == null)
|
|
11555
|
-
return '';
|
|
11556
|
-
const index = text.lastIndexOf('_Template');
|
|
11557
|
-
return '_' + (index === -1 ? text : text.slice(0, index));
|
|
11558
|
-
}
|
|
11559
|
-
/**
|
|
11560
|
-
* This class is a debug version of Object literal so that we can have constructor name show up
|
|
11561
|
-
* in
|
|
11562
|
-
* debug tools in ngDevMode.
|
|
11563
|
-
*/
|
|
11564
|
-
const TViewConstructor = class TView {
|
|
11565
|
-
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) {
|
|
11566
|
-
this.type = type;
|
|
11567
|
-
this.blueprint = blueprint;
|
|
11568
|
-
this.template = template;
|
|
11569
|
-
this.queries = queries;
|
|
11570
|
-
this.viewQuery = viewQuery;
|
|
11571
|
-
this.declTNode = declTNode;
|
|
11572
|
-
this.data = data;
|
|
11573
|
-
this.bindingStartIndex = bindingStartIndex;
|
|
11574
|
-
this.expandoStartIndex = expandoStartIndex;
|
|
11575
|
-
this.hostBindingOpCodes = hostBindingOpCodes;
|
|
11576
|
-
this.firstCreatePass = firstCreatePass;
|
|
11577
|
-
this.firstUpdatePass = firstUpdatePass;
|
|
11578
|
-
this.staticViewQueries = staticViewQueries;
|
|
11579
|
-
this.staticContentQueries = staticContentQueries;
|
|
11580
|
-
this.preOrderHooks = preOrderHooks;
|
|
11581
|
-
this.preOrderCheckHooks = preOrderCheckHooks;
|
|
11582
|
-
this.contentHooks = contentHooks;
|
|
11583
|
-
this.contentCheckHooks = contentCheckHooks;
|
|
11584
|
-
this.viewHooks = viewHooks;
|
|
11585
|
-
this.viewCheckHooks = viewCheckHooks;
|
|
11586
|
-
this.destroyHooks = destroyHooks;
|
|
11587
|
-
this.cleanup = cleanup;
|
|
11588
|
-
this.contentQueries = contentQueries;
|
|
11589
|
-
this.components = components;
|
|
11590
|
-
this.directiveRegistry = directiveRegistry;
|
|
11591
|
-
this.pipeRegistry = pipeRegistry;
|
|
11592
|
-
this.firstChild = firstChild;
|
|
11593
|
-
this.schemas = schemas;
|
|
11594
|
-
this.consts = consts;
|
|
11595
|
-
this.incompleteFirstPass = incompleteFirstPass;
|
|
11596
|
-
this._decls = _decls;
|
|
11597
|
-
this._vars = _vars;
|
|
11598
|
-
}
|
|
11599
|
-
get template_() {
|
|
11600
|
-
const buf = [];
|
|
11601
|
-
processTNodeChildren(this.firstChild, buf);
|
|
11602
|
-
return buf.join('');
|
|
11603
|
-
}
|
|
11604
|
-
get type_() {
|
|
11605
|
-
return TViewTypeAsString[this.type] || `TViewType.?${this.type}?`;
|
|
11606
|
-
}
|
|
11607
|
-
};
|
|
11608
|
-
class TNode {
|
|
11609
|
-
constructor(tView_, //
|
|
11610
|
-
type, //
|
|
11611
|
-
index, //
|
|
11612
|
-
insertBeforeIndex, //
|
|
11613
|
-
injectorIndex, //
|
|
11614
|
-
componentOffset, //
|
|
11615
|
-
directiveStart, //
|
|
11616
|
-
directiveEnd, //
|
|
11617
|
-
directiveStylingLast, //
|
|
11618
|
-
propertyBindings, //
|
|
11619
|
-
flags, //
|
|
11620
|
-
providerIndexes, //
|
|
11621
|
-
value, //
|
|
11622
|
-
attrs, //
|
|
11623
|
-
mergedAttrs, //
|
|
11624
|
-
localNames, //
|
|
11625
|
-
initialInputs, //
|
|
11626
|
-
inputs, //
|
|
11627
|
-
outputs, //
|
|
11628
|
-
tViews, //
|
|
11629
|
-
next, //
|
|
11630
|
-
projectionNext, //
|
|
11631
|
-
child, //
|
|
11632
|
-
parent, //
|
|
11633
|
-
projection, //
|
|
11634
|
-
styles, //
|
|
11635
|
-
stylesWithoutHost, //
|
|
11636
|
-
residualStyles, //
|
|
11637
|
-
classes, //
|
|
11638
|
-
classesWithoutHost, //
|
|
11639
|
-
residualClasses, //
|
|
11640
|
-
classBindings, //
|
|
11641
|
-
styleBindings) {
|
|
11642
|
-
this.tView_ = tView_;
|
|
11643
|
-
this.type = type;
|
|
11644
|
-
this.index = index;
|
|
11645
|
-
this.insertBeforeIndex = insertBeforeIndex;
|
|
11646
|
-
this.injectorIndex = injectorIndex;
|
|
11647
|
-
this.componentOffset = componentOffset;
|
|
11648
|
-
this.directiveStart = directiveStart;
|
|
11649
|
-
this.directiveEnd = directiveEnd;
|
|
11650
|
-
this.directiveStylingLast = directiveStylingLast;
|
|
11651
|
-
this.propertyBindings = propertyBindings;
|
|
11652
|
-
this.flags = flags;
|
|
11653
|
-
this.providerIndexes = providerIndexes;
|
|
11654
|
-
this.value = value;
|
|
11655
|
-
this.attrs = attrs;
|
|
11656
|
-
this.mergedAttrs = mergedAttrs;
|
|
11657
|
-
this.localNames = localNames;
|
|
11658
|
-
this.initialInputs = initialInputs;
|
|
11659
|
-
this.inputs = inputs;
|
|
11660
|
-
this.outputs = outputs;
|
|
11661
|
-
this.tViews = tViews;
|
|
11662
|
-
this.next = next;
|
|
11663
|
-
this.projectionNext = projectionNext;
|
|
11664
|
-
this.child = child;
|
|
11665
|
-
this.parent = parent;
|
|
11666
|
-
this.projection = projection;
|
|
11667
|
-
this.styles = styles;
|
|
11668
|
-
this.stylesWithoutHost = stylesWithoutHost;
|
|
11669
|
-
this.residualStyles = residualStyles;
|
|
11670
|
-
this.classes = classes;
|
|
11671
|
-
this.classesWithoutHost = classesWithoutHost;
|
|
11672
|
-
this.residualClasses = residualClasses;
|
|
11673
|
-
this.classBindings = classBindings;
|
|
11674
|
-
this.styleBindings = styleBindings;
|
|
11675
|
-
}
|
|
11676
|
-
/**
|
|
11677
|
-
* Return a human debug version of the set of `NodeInjector`s which will be consulted when
|
|
11678
|
-
* resolving tokens from this `TNode`.
|
|
11679
|
-
*
|
|
11680
|
-
* When debugging applications, it is often difficult to determine which `NodeInjector`s will be
|
|
11681
|
-
* consulted. This method shows a list of `DebugNode`s representing the `TNode`s which will be
|
|
11682
|
-
* consulted in order when resolving a token starting at this `TNode`.
|
|
11683
|
-
*
|
|
11684
|
-
* The original data is stored in `LView` and `TView` with a lot of offset indexes, and so it is
|
|
11685
|
-
* difficult to reason about.
|
|
11686
|
-
*
|
|
11687
|
-
* @param lView The `LView` instance for this `TNode`.
|
|
11688
|
-
*/
|
|
11689
|
-
debugNodeInjectorPath(lView) {
|
|
11690
|
-
const path = [];
|
|
11691
|
-
let injectorIndex = getInjectorIndex(this, lView);
|
|
11692
|
-
if (injectorIndex === -1) {
|
|
11693
|
-
// Looks like the current `TNode` does not have `NodeInjector` associated with it => look for
|
|
11694
|
-
// parent NodeInjector.
|
|
11695
|
-
const parentLocation = getParentInjectorLocation(this, lView);
|
|
11696
|
-
if (parentLocation !== NO_PARENT_INJECTOR) {
|
|
11697
|
-
// We found a parent, so start searching from the parent location.
|
|
11698
|
-
injectorIndex = getParentInjectorIndex(parentLocation);
|
|
11699
|
-
lView = getParentInjectorView(parentLocation, lView);
|
|
11700
|
-
}
|
|
11701
|
-
else {
|
|
11702
|
-
// No parents have been found, so there are no `NodeInjector`s to consult.
|
|
11703
|
-
}
|
|
11704
|
-
}
|
|
11705
|
-
while (injectorIndex !== -1) {
|
|
11706
|
-
ngDevMode && assertNodeInjector(lView, injectorIndex);
|
|
11707
|
-
const tNode = lView[TVIEW].data[injectorIndex + 8 /* NodeInjectorOffset.TNODE */];
|
|
11708
|
-
path.push(buildDebugNode(tNode, lView));
|
|
11709
|
-
const parentLocation = lView[injectorIndex + 8 /* NodeInjectorOffset.PARENT */];
|
|
11710
|
-
if (parentLocation === NO_PARENT_INJECTOR) {
|
|
11711
|
-
injectorIndex = -1;
|
|
11712
|
-
}
|
|
11713
|
-
else {
|
|
11714
|
-
injectorIndex = getParentInjectorIndex(parentLocation);
|
|
11715
|
-
lView = getParentInjectorView(parentLocation, lView);
|
|
11716
|
-
}
|
|
11717
|
-
}
|
|
11718
|
-
return path;
|
|
11719
|
-
}
|
|
11720
|
-
get type_() {
|
|
11721
|
-
return toTNodeTypeAsString(this.type) || `TNodeType.?${this.type}?`;
|
|
11722
|
-
}
|
|
11723
|
-
get flags_() {
|
|
11724
|
-
const flags = [];
|
|
11725
|
-
if (this.flags & 8 /* TNodeFlags.hasClassInput */)
|
|
11726
|
-
flags.push('TNodeFlags.hasClassInput');
|
|
11727
|
-
if (this.flags & 4 /* TNodeFlags.hasContentQuery */)
|
|
11728
|
-
flags.push('TNodeFlags.hasContentQuery');
|
|
11729
|
-
if (this.flags & 16 /* TNodeFlags.hasStyleInput */)
|
|
11730
|
-
flags.push('TNodeFlags.hasStyleInput');
|
|
11731
|
-
if (this.flags & 64 /* TNodeFlags.hasHostBindings */)
|
|
11732
|
-
flags.push('TNodeFlags.hasHostBindings');
|
|
11733
|
-
if (this.flags & 1 /* TNodeFlags.isDirectiveHost */)
|
|
11734
|
-
flags.push('TNodeFlags.isDirectiveHost');
|
|
11735
|
-
if (this.flags & 32 /* TNodeFlags.isDetached */)
|
|
11736
|
-
flags.push('TNodeFlags.isDetached');
|
|
11737
|
-
if (this.flags & 2 /* TNodeFlags.isProjected */)
|
|
11738
|
-
flags.push('TNodeFlags.isProjected');
|
|
11739
|
-
return flags.join('|');
|
|
11740
|
-
}
|
|
11741
|
-
get template_() {
|
|
11742
|
-
if (this.type & 1 /* TNodeType.Text */)
|
|
11743
|
-
return this.value;
|
|
11744
|
-
const buf = [];
|
|
11745
|
-
const tagName = typeof this.value === 'string' && this.value || this.type_;
|
|
11746
|
-
buf.push('<', tagName);
|
|
11747
|
-
if (this.flags) {
|
|
11748
|
-
buf.push(' ', this.flags_);
|
|
11749
|
-
}
|
|
11750
|
-
if (this.attrs) {
|
|
11751
|
-
for (let i = 0; i < this.attrs.length;) {
|
|
11752
|
-
const attrName = this.attrs[i++];
|
|
11753
|
-
if (typeof attrName == 'number') {
|
|
11754
|
-
break;
|
|
11755
|
-
}
|
|
11756
|
-
const attrValue = this.attrs[i++];
|
|
11757
|
-
buf.push(' ', attrName, '="', attrValue, '"');
|
|
11758
|
-
}
|
|
11759
|
-
}
|
|
11760
|
-
buf.push('>');
|
|
11761
|
-
processTNodeChildren(this.child, buf);
|
|
11762
|
-
buf.push('</', tagName, '>');
|
|
11763
|
-
return buf.join('');
|
|
11764
|
-
}
|
|
11765
|
-
get styleBindings_() {
|
|
11766
|
-
return toDebugStyleBinding(this, false);
|
|
11767
|
-
}
|
|
11768
|
-
get classBindings_() {
|
|
11769
|
-
return toDebugStyleBinding(this, true);
|
|
11770
|
-
}
|
|
11771
|
-
get providerIndexStart_() {
|
|
11772
|
-
return this.providerIndexes & 1048575 /* TNodeProviderIndexes.ProvidersStartIndexMask */;
|
|
11773
|
-
}
|
|
11774
|
-
get providerIndexEnd_() {
|
|
11775
|
-
return this.providerIndexStart_ +
|
|
11776
|
-
(this.providerIndexes >>> 20 /* TNodeProviderIndexes.CptViewProvidersCountShift */);
|
|
11777
|
-
}
|
|
11778
|
-
}
|
|
11779
|
-
const TNodeDebug = TNode;
|
|
11780
|
-
function toDebugStyleBinding(tNode, isClassBased) {
|
|
11781
|
-
const tData = tNode.tView_.data;
|
|
11782
|
-
const bindings = [];
|
|
11783
|
-
const range = isClassBased ? tNode.classBindings : tNode.styleBindings;
|
|
11784
|
-
const prev = getTStylingRangePrev(range);
|
|
11785
|
-
const next = getTStylingRangeNext(range);
|
|
11786
|
-
let isTemplate = next !== 0;
|
|
11787
|
-
let cursor = isTemplate ? next : prev;
|
|
11788
|
-
while (cursor !== 0) {
|
|
11789
|
-
const itemKey = tData[cursor];
|
|
11790
|
-
const itemRange = tData[cursor + 1];
|
|
11791
|
-
bindings.unshift({
|
|
11792
|
-
key: itemKey,
|
|
11793
|
-
index: cursor,
|
|
11794
|
-
isTemplate: isTemplate,
|
|
11795
|
-
prevDuplicate: getTStylingRangePrevDuplicate(itemRange),
|
|
11796
|
-
nextDuplicate: getTStylingRangeNextDuplicate(itemRange),
|
|
11797
|
-
nextIndex: getTStylingRangeNext(itemRange),
|
|
11798
|
-
prevIndex: getTStylingRangePrev(itemRange),
|
|
11799
|
-
});
|
|
11800
|
-
if (cursor === prev)
|
|
11801
|
-
isTemplate = false;
|
|
11802
|
-
cursor = getTStylingRangePrev(itemRange);
|
|
11803
|
-
}
|
|
11804
|
-
bindings.push((isClassBased ? tNode.residualClasses : tNode.residualStyles) || null);
|
|
11805
|
-
return bindings;
|
|
11806
|
-
}
|
|
11807
|
-
function processTNodeChildren(tNode, buf) {
|
|
11808
|
-
while (tNode) {
|
|
11809
|
-
buf.push(tNode.template_);
|
|
11810
|
-
tNode = tNode.next;
|
|
11811
|
-
}
|
|
11812
|
-
}
|
|
11813
|
-
class TViewData extends Array {
|
|
11814
|
-
}
|
|
11815
|
-
let TVIEWDATA_EMPTY; // can't initialize here or it will not be tree shaken, because
|
|
11816
|
-
// `LView` constructor could have side-effects.
|
|
11817
|
-
/**
|
|
11818
|
-
* This function clones a blueprint and creates TData.
|
|
11819
|
-
*
|
|
11820
|
-
* Simple slice will keep the same type, and we need it to be TData
|
|
11821
|
-
*/
|
|
11822
|
-
function cloneToTViewData(list) {
|
|
11823
|
-
if (TVIEWDATA_EMPTY === undefined)
|
|
11824
|
-
TVIEWDATA_EMPTY = new TViewData();
|
|
11825
|
-
return TVIEWDATA_EMPTY.concat(list);
|
|
11826
|
-
}
|
|
11827
|
-
class LViewBlueprint extends Array {
|
|
11828
|
-
}
|
|
11829
|
-
class MatchesArray extends Array {
|
|
11830
|
-
}
|
|
11831
|
-
class TViewComponents extends Array {
|
|
11832
|
-
}
|
|
11833
|
-
class TNodeLocalNames extends Array {
|
|
11834
|
-
}
|
|
11835
|
-
class TNodeInitialInputs extends Array {
|
|
11836
|
-
}
|
|
11837
|
-
class LCleanup extends Array {
|
|
11838
|
-
}
|
|
11839
|
-
class TCleanup extends Array {
|
|
11840
|
-
}
|
|
11841
|
-
function attachLViewDebug(lView) {
|
|
11842
|
-
attachDebugObject(lView, new LViewDebug(lView));
|
|
11843
|
-
}
|
|
11844
|
-
function attachLContainerDebug(lContainer) {
|
|
11845
|
-
attachDebugObject(lContainer, new LContainerDebug(lContainer));
|
|
11846
|
-
}
|
|
11847
|
-
function toDebug(obj) {
|
|
11848
|
-
if (obj) {
|
|
11849
|
-
const debug = obj.debug;
|
|
11850
|
-
assertDefined(debug, 'Object does not have a debug representation.');
|
|
11851
|
-
return debug;
|
|
11852
|
-
}
|
|
11853
|
-
else {
|
|
11854
|
-
return obj;
|
|
11855
|
-
}
|
|
11856
|
-
}
|
|
11857
|
-
/**
|
|
11858
|
-
* Use this method to unwrap a native element in `LView` and convert it into HTML for easier
|
|
11859
|
-
* reading.
|
|
11860
|
-
*
|
|
11861
|
-
* @param value possibly wrapped native DOM node.
|
|
11862
|
-
* @param includeChildren If `true` then the serialized HTML form will include child elements
|
|
11863
|
-
* (same
|
|
11864
|
-
* as `outerHTML`). If `false` then the serialized HTML form will only contain the element
|
|
11865
|
-
* itself
|
|
11866
|
-
* (will not serialize child elements).
|
|
11867
|
-
*/
|
|
11868
|
-
function toHtml(value, includeChildren = false) {
|
|
11869
|
-
const node = unwrapRNode(value);
|
|
11870
|
-
if (node) {
|
|
11871
|
-
switch (node.nodeType) {
|
|
11872
|
-
case Node.TEXT_NODE:
|
|
11873
|
-
return node.textContent;
|
|
11874
|
-
case Node.COMMENT_NODE:
|
|
11875
|
-
return `<!--${node.textContent}-->`;
|
|
11876
|
-
case Node.ELEMENT_NODE:
|
|
11877
|
-
const outerHTML = node.outerHTML;
|
|
11878
|
-
if (includeChildren) {
|
|
11879
|
-
return outerHTML;
|
|
11880
|
-
}
|
|
11881
|
-
else {
|
|
11882
|
-
const innerHTML = '>' + node.innerHTML + '<';
|
|
11883
|
-
return (outerHTML.split(innerHTML)[0]) + '>';
|
|
11884
|
-
}
|
|
11885
|
-
}
|
|
11886
|
-
}
|
|
11887
|
-
return null;
|
|
11888
|
-
}
|
|
11889
|
-
class LViewDebug {
|
|
11890
|
-
constructor(_raw_lView) {
|
|
11891
|
-
this._raw_lView = _raw_lView;
|
|
11892
|
-
}
|
|
11893
|
-
/**
|
|
11894
|
-
* Flags associated with the `LView` unpacked into a more readable state.
|
|
11895
|
-
*/
|
|
11896
|
-
get flags() {
|
|
11897
|
-
const flags = this._raw_lView[FLAGS];
|
|
11898
|
-
return {
|
|
11899
|
-
__raw__flags__: flags,
|
|
11900
|
-
initPhaseState: flags & 3 /* LViewFlags.InitPhaseStateMask */,
|
|
11901
|
-
creationMode: !!(flags & 4 /* LViewFlags.CreationMode */),
|
|
11902
|
-
firstViewPass: !!(flags & 8 /* LViewFlags.FirstLViewPass */),
|
|
11903
|
-
checkAlways: !!(flags & 16 /* LViewFlags.CheckAlways */),
|
|
11904
|
-
dirty: !!(flags & 32 /* LViewFlags.Dirty */),
|
|
11905
|
-
attached: !!(flags & 64 /* LViewFlags.Attached */),
|
|
11906
|
-
destroyed: !!(flags & 128 /* LViewFlags.Destroyed */),
|
|
11907
|
-
isRoot: !!(flags & 256 /* LViewFlags.IsRoot */),
|
|
11908
|
-
indexWithinInitPhase: flags >> 11 /* LViewFlags.IndexWithinInitPhaseShift */,
|
|
11909
|
-
};
|
|
11910
|
-
}
|
|
11911
|
-
get parent() {
|
|
11912
|
-
return toDebug(this._raw_lView[PARENT]);
|
|
11913
|
-
}
|
|
11914
|
-
get hostHTML() {
|
|
11915
|
-
return toHtml(this._raw_lView[HOST], true);
|
|
11916
|
-
}
|
|
11917
|
-
get html() {
|
|
11918
|
-
return (this.nodes || []).map(mapToHTML).join('');
|
|
11919
|
-
}
|
|
11920
|
-
get context() {
|
|
11921
|
-
return this._raw_lView[CONTEXT];
|
|
11922
|
-
}
|
|
11923
|
-
/**
|
|
11924
|
-
* The tree of nodes associated with the current `LView`. The nodes have been normalized into
|
|
11925
|
-
* a tree structure with relevant details pulled out for readability.
|
|
11926
|
-
*/
|
|
11927
|
-
get nodes() {
|
|
11928
|
-
const lView = this._raw_lView;
|
|
11929
|
-
const tNode = lView[TVIEW].firstChild;
|
|
11930
|
-
return toDebugNodes(tNode, lView);
|
|
11931
|
-
}
|
|
11932
|
-
get template() {
|
|
11933
|
-
return this.tView.template_;
|
|
11934
|
-
}
|
|
11935
|
-
get tView() {
|
|
11936
|
-
return this._raw_lView[TVIEW];
|
|
11937
|
-
}
|
|
11938
|
-
get cleanup() {
|
|
11939
|
-
return this._raw_lView[CLEANUP];
|
|
11940
|
-
}
|
|
11941
|
-
get injector() {
|
|
11942
|
-
return this._raw_lView[INJECTOR$1];
|
|
11943
|
-
}
|
|
11944
|
-
get rendererFactory() {
|
|
11945
|
-
return this._raw_lView[RENDERER_FACTORY];
|
|
11946
|
-
}
|
|
11947
|
-
get renderer() {
|
|
11948
|
-
return this._raw_lView[RENDERER];
|
|
11949
|
-
}
|
|
11950
|
-
get sanitizer() {
|
|
11951
|
-
return this._raw_lView[SANITIZER];
|
|
11952
|
-
}
|
|
11953
|
-
get childHead() {
|
|
11954
|
-
return toDebug(this._raw_lView[CHILD_HEAD]);
|
|
11955
|
-
}
|
|
11956
|
-
get next() {
|
|
11957
|
-
return toDebug(this._raw_lView[NEXT]);
|
|
11958
|
-
}
|
|
11959
|
-
get childTail() {
|
|
11960
|
-
return toDebug(this._raw_lView[CHILD_TAIL]);
|
|
11961
|
-
}
|
|
11962
|
-
get declarationView() {
|
|
11963
|
-
return toDebug(this._raw_lView[DECLARATION_VIEW]);
|
|
11964
|
-
}
|
|
11965
|
-
get queries() {
|
|
11966
|
-
return this._raw_lView[QUERIES];
|
|
11967
|
-
}
|
|
11968
|
-
get tHost() {
|
|
11969
|
-
return this._raw_lView[T_HOST];
|
|
11970
|
-
}
|
|
11971
|
-
get id() {
|
|
11972
|
-
return this._raw_lView[ID];
|
|
11973
|
-
}
|
|
11974
|
-
get decls() {
|
|
11975
|
-
return toLViewRange(this.tView, this._raw_lView, HEADER_OFFSET, this.tView.bindingStartIndex);
|
|
11976
|
-
}
|
|
11977
|
-
get vars() {
|
|
11978
|
-
return toLViewRange(this.tView, this._raw_lView, this.tView.bindingStartIndex, this.tView.expandoStartIndex);
|
|
11979
|
-
}
|
|
11980
|
-
get expando() {
|
|
11981
|
-
return toLViewRange(this.tView, this._raw_lView, this.tView.expandoStartIndex, this._raw_lView.length);
|
|
11982
|
-
}
|
|
11983
|
-
/**
|
|
11984
|
-
* Normalized view of child views (and containers) attached at this location.
|
|
11985
|
-
*/
|
|
11986
|
-
get childViews() {
|
|
11987
|
-
const childViews = [];
|
|
11988
|
-
let child = this.childHead;
|
|
11989
|
-
while (child) {
|
|
11990
|
-
childViews.push(child);
|
|
11991
|
-
child = child.next;
|
|
11992
|
-
}
|
|
11993
|
-
return childViews;
|
|
11994
|
-
}
|
|
11995
|
-
}
|
|
11996
|
-
function mapToHTML(node) {
|
|
11997
|
-
if (node.type === 'ElementContainer') {
|
|
11998
|
-
return (node.children || []).map(mapToHTML).join('');
|
|
11999
|
-
}
|
|
12000
|
-
else if (node.type === 'IcuContainer') {
|
|
12001
|
-
throw new Error('Not implemented');
|
|
12002
|
-
}
|
|
12003
|
-
else {
|
|
12004
|
-
return toHtml(node.native, true) || '';
|
|
12005
|
-
}
|
|
12006
|
-
}
|
|
12007
|
-
function toLViewRange(tView, lView, start, end) {
|
|
12008
|
-
let content = [];
|
|
12009
|
-
for (let index = start; index < end; index++) {
|
|
12010
|
-
content.push({ index: index, t: tView.data[index], l: lView[index] });
|
|
12011
|
-
}
|
|
12012
|
-
return { start: start, end: end, length: end - start, content: content };
|
|
12013
|
-
}
|
|
12014
|
-
/**
|
|
12015
|
-
* Turns a flat list of nodes into a tree by walking the associated `TNode` tree.
|
|
12016
|
-
*
|
|
12017
|
-
* @param tNode
|
|
12018
|
-
* @param lView
|
|
12019
|
-
*/
|
|
12020
|
-
function toDebugNodes(tNode, lView) {
|
|
12021
|
-
if (tNode) {
|
|
12022
|
-
const debugNodes = [];
|
|
12023
|
-
let tNodeCursor = tNode;
|
|
12024
|
-
while (tNodeCursor) {
|
|
12025
|
-
debugNodes.push(buildDebugNode(tNodeCursor, lView));
|
|
12026
|
-
tNodeCursor = tNodeCursor.next;
|
|
12027
|
-
}
|
|
12028
|
-
return debugNodes;
|
|
12029
|
-
}
|
|
12030
|
-
else {
|
|
12031
|
-
return [];
|
|
12032
|
-
}
|
|
12033
|
-
}
|
|
12034
|
-
function buildDebugNode(tNode, lView) {
|
|
12035
|
-
const rawValue = lView[tNode.index];
|
|
12036
|
-
const native = unwrapRNode(rawValue);
|
|
12037
|
-
const factories = [];
|
|
12038
|
-
const instances = [];
|
|
12039
|
-
const tView = lView[TVIEW];
|
|
12040
|
-
for (let i = tNode.directiveStart; i < tNode.directiveEnd; i++) {
|
|
12041
|
-
const def = tView.data[i];
|
|
12042
|
-
factories.push(def.type);
|
|
12043
|
-
instances.push(lView[i]);
|
|
12044
|
-
}
|
|
12045
|
-
return {
|
|
12046
|
-
html: toHtml(native),
|
|
12047
|
-
type: toTNodeTypeAsString(tNode.type),
|
|
12048
|
-
tNode,
|
|
12049
|
-
native: native,
|
|
12050
|
-
children: toDebugNodes(tNode.child, lView),
|
|
12051
|
-
factories,
|
|
12052
|
-
instances,
|
|
12053
|
-
injector: buildNodeInjectorDebug(tNode, tView, lView),
|
|
12054
|
-
get injectorResolutionPath() {
|
|
12055
|
-
return tNode.debugNodeInjectorPath(lView);
|
|
12056
|
-
},
|
|
12057
|
-
};
|
|
12058
|
-
}
|
|
12059
|
-
function buildNodeInjectorDebug(tNode, tView, lView) {
|
|
12060
|
-
const viewProviders = [];
|
|
12061
|
-
for (let i = tNode.providerIndexStart_; i < tNode.providerIndexEnd_; i++) {
|
|
12062
|
-
viewProviders.push(tView.data[i]);
|
|
12063
|
-
}
|
|
12064
|
-
const providers = [];
|
|
12065
|
-
for (let i = tNode.providerIndexEnd_; i < tNode.directiveEnd; i++) {
|
|
12066
|
-
providers.push(tView.data[i]);
|
|
12067
|
-
}
|
|
12068
|
-
const nodeInjectorDebug = {
|
|
12069
|
-
bloom: toBloom(lView, tNode.injectorIndex),
|
|
12070
|
-
cumulativeBloom: toBloom(tView.data, tNode.injectorIndex),
|
|
12071
|
-
providers,
|
|
12072
|
-
viewProviders,
|
|
12073
|
-
parentInjectorIndex: lView[tNode.providerIndexStart_ - 1],
|
|
12074
|
-
};
|
|
12075
|
-
return nodeInjectorDebug;
|
|
12076
|
-
}
|
|
12077
|
-
/**
|
|
12078
|
-
* Convert a number at `idx` location in `array` into binary representation.
|
|
12079
|
-
*
|
|
12080
|
-
* @param array
|
|
12081
|
-
* @param idx
|
|
12082
|
-
*/
|
|
12083
|
-
function binary(array, idx) {
|
|
12084
|
-
const value = array[idx];
|
|
12085
|
-
// If not a number we print 8 `?` to retain alignment but let user know that it was called on
|
|
12086
|
-
// wrong type.
|
|
12087
|
-
if (typeof value !== 'number')
|
|
12088
|
-
return '????????';
|
|
12089
|
-
// We prefix 0s so that we have constant length number
|
|
12090
|
-
const text = '00000000' + value.toString(2);
|
|
12091
|
-
return text.substring(text.length - 8);
|
|
12092
|
-
}
|
|
12093
|
-
/**
|
|
12094
|
-
* Convert a bloom filter at location `idx` in `array` into binary representation.
|
|
12095
|
-
*
|
|
12096
|
-
* @param array
|
|
12097
|
-
* @param idx
|
|
12098
|
-
*/
|
|
12099
|
-
function toBloom(array, idx) {
|
|
12100
|
-
if (idx < 0) {
|
|
12101
|
-
return 'NO_NODE_INJECTOR';
|
|
12102
|
-
}
|
|
12103
|
-
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)}`;
|
|
12104
|
-
}
|
|
12105
|
-
class LContainerDebug {
|
|
12106
|
-
constructor(_raw_lContainer) {
|
|
12107
|
-
this._raw_lContainer = _raw_lContainer;
|
|
12108
|
-
}
|
|
12109
|
-
get hasTransplantedViews() {
|
|
12110
|
-
return this._raw_lContainer[HAS_TRANSPLANTED_VIEWS];
|
|
12111
|
-
}
|
|
12112
|
-
get views() {
|
|
12113
|
-
return this._raw_lContainer.slice(CONTAINER_HEADER_OFFSET)
|
|
12114
|
-
.map(toDebug);
|
|
12115
|
-
}
|
|
12116
|
-
get parent() {
|
|
12117
|
-
return toDebug(this._raw_lContainer[PARENT]);
|
|
12118
|
-
}
|
|
12119
|
-
get movedViews() {
|
|
12120
|
-
return this._raw_lContainer[MOVED_VIEWS];
|
|
12121
|
-
}
|
|
12122
|
-
get host() {
|
|
12123
|
-
return this._raw_lContainer[HOST];
|
|
12124
|
-
}
|
|
12125
|
-
get native() {
|
|
12126
|
-
return this._raw_lContainer[NATIVE];
|
|
12127
|
-
}
|
|
12128
|
-
get next() {
|
|
12129
|
-
return toDebug(this._raw_lContainer[NEXT]);
|
|
12130
|
-
}
|
|
12131
|
-
}
|
|
12132
|
-
|
|
12133
11307
|
/**
|
|
12134
11308
|
* @license
|
|
12135
11309
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -12203,7 +11377,7 @@ function renderChildComponents(hostLView, components) {
|
|
|
12203
11377
|
}
|
|
12204
11378
|
}
|
|
12205
11379
|
function createLView(parentLView, tView, context, flags, host, tHostNode, rendererFactory, renderer, sanitizer, injector, embeddedViewInjector) {
|
|
12206
|
-
const lView =
|
|
11380
|
+
const lView = tView.blueprint.slice();
|
|
12207
11381
|
lView[HOST] = host;
|
|
12208
11382
|
lView[FLAGS] = flags | 4 /* LViewFlags.CreationMode */ | 64 /* LViewFlags.Attached */ | 8 /* LViewFlags.FirstLViewPass */;
|
|
12209
11383
|
if (embeddedViewInjector !== null ||
|
|
@@ -12227,7 +11401,6 @@ function createLView(parentLView, tView, context, flags, host, tHostNode, render
|
|
|
12227
11401
|
assertEqual(tView.type == 2 /* TViewType.Embedded */ ? parentLView !== null : true, true, 'Embedded views must have parentLView');
|
|
12228
11402
|
lView[DECLARATION_COMPONENT_VIEW] =
|
|
12229
11403
|
tView.type == 2 /* TViewType.Embedded */ ? parentLView[DECLARATION_COMPONENT_VIEW] : lView;
|
|
12230
|
-
ngDevMode && attachLViewDebug(lView);
|
|
12231
11404
|
return lView;
|
|
12232
11405
|
}
|
|
12233
11406
|
function getOrCreateTNode(tView, index, type, name, attrs) {
|
|
@@ -12610,73 +11783,38 @@ function createTView(type, declTNode, templateFn, decls, vars, directives, pipes
|
|
|
12610
11783
|
const initialViewLength = bindingStartIndex + vars;
|
|
12611
11784
|
const blueprint = createViewBlueprint(bindingStartIndex, initialViewLength);
|
|
12612
11785
|
const consts = typeof constsOrFactory === 'function' ? constsOrFactory() : constsOrFactory;
|
|
12613
|
-
const tView = blueprint[TVIEW] =
|
|
12614
|
-
|
|
12615
|
-
blueprint
|
|
12616
|
-
|
|
12617
|
-
|
|
12618
|
-
viewQuery
|
|
12619
|
-
declTNode
|
|
12620
|
-
|
|
12621
|
-
bindingStartIndex
|
|
12622
|
-
|
|
12623
|
-
|
|
12624
|
-
|
|
12625
|
-
|
|
12626
|
-
|
|
12627
|
-
|
|
12628
|
-
|
|
12629
|
-
|
|
12630
|
-
|
|
12631
|
-
|
|
12632
|
-
|
|
12633
|
-
|
|
12634
|
-
|
|
12635
|
-
|
|
12636
|
-
|
|
12637
|
-
|
|
12638
|
-
typeof directives === 'function' ?
|
|
12639
|
-
|
|
12640
|
-
|
|
12641
|
-
|
|
12642
|
-
|
|
12643
|
-
|
|
12644
|
-
|
|
12645
|
-
false, // incompleteFirstPass: boolean
|
|
12646
|
-
decls, // ngDevMode only: decls
|
|
12647
|
-
vars) :
|
|
12648
|
-
{
|
|
12649
|
-
type: type,
|
|
12650
|
-
blueprint: blueprint,
|
|
12651
|
-
template: templateFn,
|
|
12652
|
-
queries: null,
|
|
12653
|
-
viewQuery: viewQuery,
|
|
12654
|
-
declTNode: declTNode,
|
|
12655
|
-
data: blueprint.slice().fill(null, bindingStartIndex),
|
|
12656
|
-
bindingStartIndex: bindingStartIndex,
|
|
12657
|
-
expandoStartIndex: initialViewLength,
|
|
12658
|
-
hostBindingOpCodes: null,
|
|
12659
|
-
firstCreatePass: true,
|
|
12660
|
-
firstUpdatePass: true,
|
|
12661
|
-
staticViewQueries: false,
|
|
12662
|
-
staticContentQueries: false,
|
|
12663
|
-
preOrderHooks: null,
|
|
12664
|
-
preOrderCheckHooks: null,
|
|
12665
|
-
contentHooks: null,
|
|
12666
|
-
contentCheckHooks: null,
|
|
12667
|
-
viewHooks: null,
|
|
12668
|
-
viewCheckHooks: null,
|
|
12669
|
-
destroyHooks: null,
|
|
12670
|
-
cleanup: null,
|
|
12671
|
-
contentQueries: null,
|
|
12672
|
-
components: null,
|
|
12673
|
-
directiveRegistry: typeof directives === 'function' ? directives() : directives,
|
|
12674
|
-
pipeRegistry: typeof pipes === 'function' ? pipes() : pipes,
|
|
12675
|
-
firstChild: null,
|
|
12676
|
-
schemas: schemas,
|
|
12677
|
-
consts: consts,
|
|
12678
|
-
incompleteFirstPass: false
|
|
12679
|
-
};
|
|
11786
|
+
const tView = blueprint[TVIEW] = {
|
|
11787
|
+
type: type,
|
|
11788
|
+
blueprint: blueprint,
|
|
11789
|
+
template: templateFn,
|
|
11790
|
+
queries: null,
|
|
11791
|
+
viewQuery: viewQuery,
|
|
11792
|
+
declTNode: declTNode,
|
|
11793
|
+
data: blueprint.slice().fill(null, bindingStartIndex),
|
|
11794
|
+
bindingStartIndex: bindingStartIndex,
|
|
11795
|
+
expandoStartIndex: initialViewLength,
|
|
11796
|
+
hostBindingOpCodes: null,
|
|
11797
|
+
firstCreatePass: true,
|
|
11798
|
+
firstUpdatePass: true,
|
|
11799
|
+
staticViewQueries: false,
|
|
11800
|
+
staticContentQueries: false,
|
|
11801
|
+
preOrderHooks: null,
|
|
11802
|
+
preOrderCheckHooks: null,
|
|
11803
|
+
contentHooks: null,
|
|
11804
|
+
contentCheckHooks: null,
|
|
11805
|
+
viewHooks: null,
|
|
11806
|
+
viewCheckHooks: null,
|
|
11807
|
+
destroyHooks: null,
|
|
11808
|
+
cleanup: null,
|
|
11809
|
+
contentQueries: null,
|
|
11810
|
+
components: null,
|
|
11811
|
+
directiveRegistry: typeof directives === 'function' ? directives() : directives,
|
|
11812
|
+
pipeRegistry: typeof pipes === 'function' ? pipes() : pipes,
|
|
11813
|
+
firstChild: null,
|
|
11814
|
+
schemas: schemas,
|
|
11815
|
+
consts: consts,
|
|
11816
|
+
incompleteFirstPass: false
|
|
11817
|
+
};
|
|
12680
11818
|
if (ngDevMode) {
|
|
12681
11819
|
// For performance reasons it is important that the tView retains the same shape during runtime.
|
|
12682
11820
|
// (To make sure that all of the code is monomorphic.) For this reason we seal the object to
|
|
@@ -12686,7 +11824,7 @@ function createTView(type, declTNode, templateFn, decls, vars, directives, pipes
|
|
|
12686
11824
|
return tView;
|
|
12687
11825
|
}
|
|
12688
11826
|
function createViewBlueprint(bindingStartIndex, initialViewLength) {
|
|
12689
|
-
const blueprint =
|
|
11827
|
+
const blueprint = [];
|
|
12690
11828
|
for (let i = 0; i < initialViewLength; i++) {
|
|
12691
11829
|
blueprint.push(i < bindingStartIndex ? null : NO_CHANGE);
|
|
12692
11830
|
}
|
|
@@ -12739,74 +11877,40 @@ function createTNode(tView, tParent, type, index, value, attrs) {
|
|
|
12739
11877
|
ngDevMode && ngDevMode.tNode++;
|
|
12740
11878
|
ngDevMode && tParent && assertTNodeForTView(tParent, tView);
|
|
12741
11879
|
let injectorIndex = tParent ? tParent.injectorIndex : -1;
|
|
12742
|
-
const tNode =
|
|
12743
|
-
|
|
12744
|
-
|
|
12745
|
-
|
|
12746
|
-
|
|
12747
|
-
|
|
12748
|
-
-1,
|
|
12749
|
-
-1,
|
|
12750
|
-
-1,
|
|
12751
|
-
|
|
12752
|
-
|
|
12753
|
-
0,
|
|
12754
|
-
|
|
12755
|
-
|
|
12756
|
-
|
|
12757
|
-
null,
|
|
12758
|
-
|
|
12759
|
-
|
|
12760
|
-
|
|
12761
|
-
|
|
12762
|
-
|
|
12763
|
-
|
|
12764
|
-
|
|
12765
|
-
|
|
12766
|
-
|
|
12767
|
-
|
|
12768
|
-
|
|
12769
|
-
|
|
12770
|
-
|
|
12771
|
-
|
|
12772
|
-
|
|
12773
|
-
|
|
12774
|
-
0,
|
|
12775
|
-
|
|
12776
|
-
{
|
|
12777
|
-
type,
|
|
12778
|
-
index,
|
|
12779
|
-
insertBeforeIndex: null,
|
|
12780
|
-
injectorIndex,
|
|
12781
|
-
directiveStart: -1,
|
|
12782
|
-
directiveEnd: -1,
|
|
12783
|
-
directiveStylingLast: -1,
|
|
12784
|
-
componentOffset: -1,
|
|
12785
|
-
propertyBindings: null,
|
|
12786
|
-
flags: 0,
|
|
12787
|
-
providerIndexes: 0,
|
|
12788
|
-
value: value,
|
|
12789
|
-
attrs: attrs,
|
|
12790
|
-
mergedAttrs: null,
|
|
12791
|
-
localNames: null,
|
|
12792
|
-
initialInputs: undefined,
|
|
12793
|
-
inputs: null,
|
|
12794
|
-
outputs: null,
|
|
12795
|
-
tViews: null,
|
|
12796
|
-
next: null,
|
|
12797
|
-
projectionNext: null,
|
|
12798
|
-
child: null,
|
|
12799
|
-
parent: tParent,
|
|
12800
|
-
projection: null,
|
|
12801
|
-
styles: null,
|
|
12802
|
-
stylesWithoutHost: null,
|
|
12803
|
-
residualStyles: undefined,
|
|
12804
|
-
classes: null,
|
|
12805
|
-
classesWithoutHost: null,
|
|
12806
|
-
residualClasses: undefined,
|
|
12807
|
-
classBindings: 0,
|
|
12808
|
-
styleBindings: 0,
|
|
12809
|
-
};
|
|
11880
|
+
const tNode = {
|
|
11881
|
+
type,
|
|
11882
|
+
index,
|
|
11883
|
+
insertBeforeIndex: null,
|
|
11884
|
+
injectorIndex,
|
|
11885
|
+
directiveStart: -1,
|
|
11886
|
+
directiveEnd: -1,
|
|
11887
|
+
directiveStylingLast: -1,
|
|
11888
|
+
componentOffset: -1,
|
|
11889
|
+
propertyBindings: null,
|
|
11890
|
+
flags: 0,
|
|
11891
|
+
providerIndexes: 0,
|
|
11892
|
+
value: value,
|
|
11893
|
+
attrs: attrs,
|
|
11894
|
+
mergedAttrs: null,
|
|
11895
|
+
localNames: null,
|
|
11896
|
+
initialInputs: undefined,
|
|
11897
|
+
inputs: null,
|
|
11898
|
+
outputs: null,
|
|
11899
|
+
tViews: null,
|
|
11900
|
+
next: null,
|
|
11901
|
+
projectionNext: null,
|
|
11902
|
+
child: null,
|
|
11903
|
+
parent: tParent,
|
|
11904
|
+
projection: null,
|
|
11905
|
+
styles: null,
|
|
11906
|
+
stylesWithoutHost: null,
|
|
11907
|
+
residualStyles: undefined,
|
|
11908
|
+
classes: null,
|
|
11909
|
+
classesWithoutHost: null,
|
|
11910
|
+
residualClasses: undefined,
|
|
11911
|
+
classBindings: 0,
|
|
11912
|
+
styleBindings: 0,
|
|
11913
|
+
};
|
|
12810
11914
|
if (ngDevMode) {
|
|
12811
11915
|
// For performance reasons it is important that the tNode retains the same shape during runtime.
|
|
12812
11916
|
// (To make sure that all of the code is monomorphic.) For this reason we seal the object to
|
|
@@ -12863,7 +11967,7 @@ function initializeInputAndOutputAliases(tView, tNode, hostDirectiveDefinitionMa
|
|
|
12863
11967
|
const end = tNode.directiveEnd;
|
|
12864
11968
|
const tViewData = tView.data;
|
|
12865
11969
|
const tNodeAttrs = tNode.attrs;
|
|
12866
|
-
const inputsFromAttrs =
|
|
11970
|
+
const inputsFromAttrs = [];
|
|
12867
11971
|
let inputsStore = null;
|
|
12868
11972
|
let outputsStore = null;
|
|
12869
11973
|
for (let directiveIndex = start; directiveIndex < end; directiveIndex++) {
|
|
@@ -13201,7 +12305,7 @@ function findDirectiveDefMatches(tView, tNode) {
|
|
|
13201
12305
|
for (let i = 0; i < registry.length; i++) {
|
|
13202
12306
|
const def = registry[i];
|
|
13203
12307
|
if (isNodeMatchingSelectorList(tNode, def.selectors, /* isProjectionMode */ false)) {
|
|
13204
|
-
matches || (matches =
|
|
12308
|
+
matches || (matches = []);
|
|
13205
12309
|
if (isComponentDef(def)) {
|
|
13206
12310
|
if (ngDevMode) {
|
|
13207
12311
|
assertTNodeType(tNode, 2 /* TNodeType.Element */, `"${tNode.value}" tags cannot be used as component hosts. ` +
|
|
@@ -13259,13 +12363,12 @@ function markAsComponentHost(tView, hostTNode, componentOffset) {
|
|
|
13259
12363
|
ngDevMode && assertFirstCreatePass(tView);
|
|
13260
12364
|
ngDevMode && assertGreaterThan(componentOffset, -1, 'componentOffset must be great than -1');
|
|
13261
12365
|
hostTNode.componentOffset = componentOffset;
|
|
13262
|
-
(tView.components || (tView.components =
|
|
13263
|
-
.push(hostTNode.index);
|
|
12366
|
+
(tView.components || (tView.components = [])).push(hostTNode.index);
|
|
13264
12367
|
}
|
|
13265
12368
|
/** Caches local names and their matching directive indices for query and template lookups. */
|
|
13266
12369
|
function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {
|
|
13267
12370
|
if (localRefs) {
|
|
13268
|
-
const localNames = tNode.localNames =
|
|
12371
|
+
const localNames = tNode.localNames = [];
|
|
13269
12372
|
// Local names must be stored in tNode in the same order that localRefs are defined
|
|
13270
12373
|
// in the template to ensure the data is loaded in the same slots as their refs
|
|
13271
12374
|
// in the template (for template queries).
|
|
@@ -13448,9 +12551,6 @@ function generateInitialInputs(inputs, directiveIndex, attrs) {
|
|
|
13448
12551
|
//////////////////////////
|
|
13449
12552
|
//// ViewContainer & View
|
|
13450
12553
|
//////////////////////////
|
|
13451
|
-
// Not sure why I need to do `any` here but TS complains later.
|
|
13452
|
-
const LContainerArray = class LContainer extends Array {
|
|
13453
|
-
};
|
|
13454
12554
|
/**
|
|
13455
12555
|
* Creates a LContainer, either from a container instruction, or for a ViewContainerRef.
|
|
13456
12556
|
*
|
|
@@ -13463,20 +12563,20 @@ const LContainerArray = class LContainer extends Array {
|
|
|
13463
12563
|
*/
|
|
13464
12564
|
function createLContainer(hostNative, currentView, native, tNode) {
|
|
13465
12565
|
ngDevMode && assertLView(currentView);
|
|
13466
|
-
|
|
13467
|
-
|
|
13468
|
-
|
|
13469
|
-
|
|
13470
|
-
|
|
13471
|
-
|
|
13472
|
-
|
|
13473
|
-
|
|
13474
|
-
|
|
13475
|
-
|
|
13476
|
-
|
|
12566
|
+
const lContainer = [
|
|
12567
|
+
hostNative,
|
|
12568
|
+
true,
|
|
12569
|
+
false,
|
|
12570
|
+
currentView,
|
|
12571
|
+
null,
|
|
12572
|
+
0,
|
|
12573
|
+
tNode,
|
|
12574
|
+
native,
|
|
12575
|
+
null,
|
|
12576
|
+
null, // moved views
|
|
12577
|
+
];
|
|
13477
12578
|
ngDevMode &&
|
|
13478
12579
|
assertEqual(lContainer.length, CONTAINER_HEADER_OFFSET, 'Should allocate correct number of slots for LContainer header.');
|
|
13479
|
-
ngDevMode && attachLContainerDebug(lContainer);
|
|
13480
12580
|
return lContainer;
|
|
13481
12581
|
}
|
|
13482
12582
|
/**
|
|
@@ -13750,10 +12850,10 @@ function storePropertyBindingMetadata(tData, tNode, propertyName, bindingIndex,
|
|
|
13750
12850
|
}
|
|
13751
12851
|
function getOrCreateLViewCleanup(view) {
|
|
13752
12852
|
// top level variables should not be exported for performance reasons (PERF_NOTES.md)
|
|
13753
|
-
return view[CLEANUP] || (view[CLEANUP] =
|
|
12853
|
+
return view[CLEANUP] || (view[CLEANUP] = []);
|
|
13754
12854
|
}
|
|
13755
12855
|
function getOrCreateTViewCleanup(tView) {
|
|
13756
|
-
return tView.cleanup || (tView.cleanup =
|
|
12856
|
+
return tView.cleanup || (tView.cleanup = []);
|
|
13757
12857
|
}
|
|
13758
12858
|
/**
|
|
13759
12859
|
* There are cases where the sub component's renderer needs to be included
|
|
@@ -14365,17 +13465,6 @@ class ComponentFactory extends ComponentFactory$1 {
|
|
|
14365
13465
|
return new ComponentRef(this.componentType, component, createElementRef(tElementNode, rootLView), rootLView, tElementNode);
|
|
14366
13466
|
}
|
|
14367
13467
|
}
|
|
14368
|
-
const componentFactoryResolver = new ComponentFactoryResolver();
|
|
14369
|
-
/**
|
|
14370
|
-
* Creates a ComponentFactoryResolver and stores it on the injector. Or, if the
|
|
14371
|
-
* ComponentFactoryResolver
|
|
14372
|
-
* already exists, retrieves the existing ComponentFactoryResolver.
|
|
14373
|
-
*
|
|
14374
|
-
* @returns The ComponentFactoryResolver instance to use
|
|
14375
|
-
*/
|
|
14376
|
-
function injectComponentFactoryResolver() {
|
|
14377
|
-
return componentFactoryResolver;
|
|
14378
|
-
}
|
|
14379
13468
|
/**
|
|
14380
13469
|
* Represents an instance of a Component created via a {@link ComponentFactory}.
|
|
14381
13470
|
*
|
|
@@ -16136,7 +15225,8 @@ const isObservable = isSubscribable;
|
|
|
16136
15225
|
*
|
|
16137
15226
|
* @param eventName Name of the event
|
|
16138
15227
|
* @param listenerFn The function to be called when event emits
|
|
16139
|
-
* @param useCapture Whether or not to use capture in event listener
|
|
15228
|
+
* @param useCapture Whether or not to use capture in event listener - this argument is a reminder
|
|
15229
|
+
* from the Renderer3 infrastructure and should be removed from the instruction arguments
|
|
16140
15230
|
* @param eventTargetResolver Function that returns global target information in case this listener
|
|
16141
15231
|
* should be attached to a global object like window, document or body
|
|
16142
15232
|
*
|
|
@@ -16146,7 +15236,7 @@ function ɵɵlistener(eventName, listenerFn, useCapture, eventTargetResolver) {
|
|
|
16146
15236
|
const lView = getLView();
|
|
16147
15237
|
const tView = getTView();
|
|
16148
15238
|
const tNode = getCurrentTNode();
|
|
16149
|
-
listenerInternal(tView, lView, lView[RENDERER], tNode, eventName, listenerFn,
|
|
15239
|
+
listenerInternal(tView, lView, lView[RENDERER], tNode, eventName, listenerFn, eventTargetResolver);
|
|
16150
15240
|
return ɵɵlistener;
|
|
16151
15241
|
}
|
|
16152
15242
|
/**
|
|
@@ -16176,7 +15266,7 @@ function ɵɵsyntheticHostListener(eventName, listenerFn) {
|
|
|
16176
15266
|
const tView = getTView();
|
|
16177
15267
|
const currentDef = getCurrentDirectiveDef(tView.data);
|
|
16178
15268
|
const renderer = loadComponentRenderer(currentDef, tNode, lView);
|
|
16179
|
-
listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn
|
|
15269
|
+
listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn);
|
|
16180
15270
|
return ɵɵsyntheticHostListener;
|
|
16181
15271
|
}
|
|
16182
15272
|
/**
|
|
@@ -16209,7 +15299,7 @@ function findExistingListener(tView, lView, eventName, tNodeIdx) {
|
|
|
16209
15299
|
}
|
|
16210
15300
|
return null;
|
|
16211
15301
|
}
|
|
16212
|
-
function listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn,
|
|
15302
|
+
function listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn, eventTargetResolver) {
|
|
16213
15303
|
const isTNodeDirectiveHost = isDirectiveHost(tNode);
|
|
16214
15304
|
const firstCreatePass = tView.firstCreatePass;
|
|
16215
15305
|
const tCleanup = firstCreatePass && getOrCreateTViewCleanup(tView);
|
|
@@ -16960,6 +16050,62 @@ function ɵɵpropertyInterpolateV(propName, values, sanitizer) {
|
|
|
16960
16050
|
return ɵɵpropertyInterpolateV;
|
|
16961
16051
|
}
|
|
16962
16052
|
|
|
16053
|
+
/**
|
|
16054
|
+
* @license
|
|
16055
|
+
* Copyright Google LLC All Rights Reserved.
|
|
16056
|
+
*
|
|
16057
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
16058
|
+
* found in the LICENSE file at https://angular.io/license
|
|
16059
|
+
*/
|
|
16060
|
+
function toTStylingRange(prev, next) {
|
|
16061
|
+
ngDevMode && assertNumberInRange(prev, 0, 32767 /* StylingRange.UNSIGNED_MASK */);
|
|
16062
|
+
ngDevMode && assertNumberInRange(next, 0, 32767 /* StylingRange.UNSIGNED_MASK */);
|
|
16063
|
+
return (prev << 17 /* StylingRange.PREV_SHIFT */ | next << 2 /* StylingRange.NEXT_SHIFT */);
|
|
16064
|
+
}
|
|
16065
|
+
function getTStylingRangePrev(tStylingRange) {
|
|
16066
|
+
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
16067
|
+
return (tStylingRange >> 17 /* StylingRange.PREV_SHIFT */) & 32767 /* StylingRange.UNSIGNED_MASK */;
|
|
16068
|
+
}
|
|
16069
|
+
function getTStylingRangePrevDuplicate(tStylingRange) {
|
|
16070
|
+
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
16071
|
+
return (tStylingRange & 2 /* StylingRange.PREV_DUPLICATE */) ==
|
|
16072
|
+
2 /* StylingRange.PREV_DUPLICATE */;
|
|
16073
|
+
}
|
|
16074
|
+
function setTStylingRangePrev(tStylingRange, previous) {
|
|
16075
|
+
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
16076
|
+
ngDevMode && assertNumberInRange(previous, 0, 32767 /* StylingRange.UNSIGNED_MASK */);
|
|
16077
|
+
return ((tStylingRange & ~4294836224 /* StylingRange.PREV_MASK */) |
|
|
16078
|
+
(previous << 17 /* StylingRange.PREV_SHIFT */));
|
|
16079
|
+
}
|
|
16080
|
+
function setTStylingRangePrevDuplicate(tStylingRange) {
|
|
16081
|
+
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
16082
|
+
return (tStylingRange | 2 /* StylingRange.PREV_DUPLICATE */);
|
|
16083
|
+
}
|
|
16084
|
+
function getTStylingRangeNext(tStylingRange) {
|
|
16085
|
+
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
16086
|
+
return (tStylingRange & 131068 /* StylingRange.NEXT_MASK */) >> 2 /* StylingRange.NEXT_SHIFT */;
|
|
16087
|
+
}
|
|
16088
|
+
function setTStylingRangeNext(tStylingRange, next) {
|
|
16089
|
+
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
16090
|
+
ngDevMode && assertNumberInRange(next, 0, 32767 /* StylingRange.UNSIGNED_MASK */);
|
|
16091
|
+
return ((tStylingRange & ~131068 /* StylingRange.NEXT_MASK */) | //
|
|
16092
|
+
next << 2 /* StylingRange.NEXT_SHIFT */);
|
|
16093
|
+
}
|
|
16094
|
+
function getTStylingRangeNextDuplicate(tStylingRange) {
|
|
16095
|
+
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
16096
|
+
return (tStylingRange & 1 /* StylingRange.NEXT_DUPLICATE */) ===
|
|
16097
|
+
1 /* StylingRange.NEXT_DUPLICATE */;
|
|
16098
|
+
}
|
|
16099
|
+
function setTStylingRangeNextDuplicate(tStylingRange) {
|
|
16100
|
+
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
16101
|
+
return (tStylingRange | 1 /* StylingRange.NEXT_DUPLICATE */);
|
|
16102
|
+
}
|
|
16103
|
+
function getTStylingRangeTail(tStylingRange) {
|
|
16104
|
+
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
16105
|
+
const next = getTStylingRangeNext(tStylingRange);
|
|
16106
|
+
return next === 0 ? getTStylingRangePrev(tStylingRange) : next;
|
|
16107
|
+
}
|
|
16108
|
+
|
|
16963
16109
|
/**
|
|
16964
16110
|
* @license
|
|
16965
16111
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -20781,6 +19927,46 @@ function loadIcuContainerVisitor() {
|
|
|
20781
19927
|
return icuContainerIteratorStart;
|
|
20782
19928
|
}
|
|
20783
19929
|
|
|
19930
|
+
/**
|
|
19931
|
+
* @license
|
|
19932
|
+
* Copyright Google LLC All Rights Reserved.
|
|
19933
|
+
*
|
|
19934
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
19935
|
+
* found in the LICENSE file at https://angular.io/license
|
|
19936
|
+
*/
|
|
19937
|
+
/**
|
|
19938
|
+
* Patch a `debug` property on top of the existing object.
|
|
19939
|
+
*
|
|
19940
|
+
* NOTE: always call this method with `ngDevMode && attachDebugObject(...)`
|
|
19941
|
+
*
|
|
19942
|
+
* @param obj Object to patch
|
|
19943
|
+
* @param debug Value to patch
|
|
19944
|
+
*/
|
|
19945
|
+
function attachDebugObject(obj, debug) {
|
|
19946
|
+
if (ngDevMode) {
|
|
19947
|
+
Object.defineProperty(obj, 'debug', { value: debug, enumerable: false });
|
|
19948
|
+
}
|
|
19949
|
+
else {
|
|
19950
|
+
throw new Error('This method should be guarded with `ngDevMode` so that it can be tree shaken in production!');
|
|
19951
|
+
}
|
|
19952
|
+
}
|
|
19953
|
+
/**
|
|
19954
|
+
* Patch a `debug` property getter on top of the existing object.
|
|
19955
|
+
*
|
|
19956
|
+
* NOTE: always call this method with `ngDevMode && attachDebugObject(...)`
|
|
19957
|
+
*
|
|
19958
|
+
* @param obj Object to patch
|
|
19959
|
+
* @param debugGetter Getter returning a value to patch
|
|
19960
|
+
*/
|
|
19961
|
+
function attachDebugGetter(obj, debugGetter) {
|
|
19962
|
+
if (ngDevMode) {
|
|
19963
|
+
Object.defineProperty(obj, 'debug', { get: debugGetter, enumerable: false });
|
|
19964
|
+
}
|
|
19965
|
+
else {
|
|
19966
|
+
throw new Error('This method should be guarded with `ngDevMode` so that it can be tree shaken in production!');
|
|
19967
|
+
}
|
|
19968
|
+
}
|
|
19969
|
+
|
|
20784
19970
|
/**
|
|
20785
19971
|
* @license
|
|
20786
19972
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -21536,7 +20722,7 @@ function walkIcuTree(tView, tIcu, lView, sharedUpdateOpCodes, create, remove, up
|
|
|
21536
20722
|
ngDevMode &&
|
|
21537
20723
|
console.warn(`WARNING: ignoring unsafe attribute value ` +
|
|
21538
20724
|
`${lowerAttrName} on element ${tagName} ` +
|
|
21539
|
-
`(see
|
|
20725
|
+
`(see ${XSS_SECURITY_URL})`);
|
|
21540
20726
|
}
|
|
21541
20727
|
}
|
|
21542
20728
|
else {
|
|
@@ -22750,32 +21936,6 @@ function sortListeners(a, b) {
|
|
|
22750
21936
|
function isDirectiveDefHack(obj) {
|
|
22751
21937
|
return obj.type !== undefined && obj.template !== undefined && obj.declaredInputs !== undefined;
|
|
22752
21938
|
}
|
|
22753
|
-
/**
|
|
22754
|
-
* Returns the attached `DebugNode` instance for an element in the DOM.
|
|
22755
|
-
*
|
|
22756
|
-
* @param element DOM element which is owned by an existing component's view.
|
|
22757
|
-
*/
|
|
22758
|
-
function getDebugNode(element) {
|
|
22759
|
-
if (ngDevMode && !(element instanceof Node)) {
|
|
22760
|
-
throw new Error('Expecting instance of DOM Element');
|
|
22761
|
-
}
|
|
22762
|
-
const lContext = getLContext(element);
|
|
22763
|
-
const lView = lContext ? lContext.lView : null;
|
|
22764
|
-
if (lView === null) {
|
|
22765
|
-
return null;
|
|
22766
|
-
}
|
|
22767
|
-
const nodeIndex = lContext.nodeIndex;
|
|
22768
|
-
if (nodeIndex !== -1) {
|
|
22769
|
-
const valueInLView = lView[nodeIndex];
|
|
22770
|
-
// this means that value in the lView is a component with its own
|
|
22771
|
-
// data. In this situation the TNode is not accessed at the same spot.
|
|
22772
|
-
const tNode = isLView(valueInLView) ? valueInLView[T_HOST] : getTNode(lView[TVIEW], nodeIndex);
|
|
22773
|
-
ngDevMode &&
|
|
22774
|
-
assertEqual(tNode.index, nodeIndex, 'Expecting that TNode at index is same as index');
|
|
22775
|
-
return buildDebugNode(tNode, lView);
|
|
22776
|
-
}
|
|
22777
|
-
return null;
|
|
22778
|
-
}
|
|
22779
21939
|
/**
|
|
22780
21940
|
* Retrieve the component `LView` from component/element.
|
|
22781
21941
|
*
|