@angular/core 10.2.0 → 10.2.4
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/bundles/core-testing.umd.js +1 -1
- package/bundles/core-testing.umd.min.js +1 -1
- package/bundles/core-testing.umd.min.js.map +1 -1
- package/bundles/core.umd.js +266 -205
- package/bundles/core.umd.js.map +1 -1
- package/bundles/core.umd.min.js +117 -110
- package/bundles/core.umd.min.js.map +1 -1
- package/core.d.ts +10 -8
- package/core.metadata.json +1 -1
- package/esm2015/src/application_ref.js +1 -1
- package/esm2015/src/compiler/compiler_facade_interface.js +1 -1
- package/esm2015/src/core.js +2 -2
- package/esm2015/src/di/r3_injector.js +3 -2
- package/esm2015/src/linker/ng_module_factory_registration.js +22 -14
- package/esm2015/src/render3/component.js +4 -3
- package/esm2015/src/render3/di.js +5 -4
- package/esm2015/src/render3/errors.js +10 -4
- package/esm2015/src/render3/instructions/shared.js +7 -4
- package/esm2015/src/render3/interfaces/view.js +1 -1
- package/esm2015/src/render3/view_engine_compatibility_prebound.js +3 -2
- package/esm2015/src/util/dom.js +36 -0
- package/esm2015/src/util/is_dev_mode.js +7 -1
- package/esm2015/src/version.js +1 -1
- package/esm2015/src/view/services.js +4 -3
- package/fesm2015/core.js +255 -198
- package/fesm2015/core.js.map +1 -1
- package/fesm2015/testing.js +1 -1
- package/package.json +1 -1
- package/src/r3_symbols.d.ts +1 -1
- package/testing/testing.d.ts +1 -1
- package/testing.d.ts +1 -1
package/bundles/core.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v10.2.
|
|
2
|
+
* @license Angular v10.2.4
|
|
3
3
|
* (c) 2010-2020 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -2381,6 +2381,182 @@
|
|
|
2381
2381
|
assertNumber(lView[injectorIndex + 8 /* PARENT */], 'injectorIndex should point to parent injector');
|
|
2382
2382
|
}
|
|
2383
2383
|
|
|
2384
|
+
/**
|
|
2385
|
+
* @license
|
|
2386
|
+
* Copyright Google LLC All Rights Reserved.
|
|
2387
|
+
*
|
|
2388
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
2389
|
+
* found in the LICENSE file at https://angular.io/license
|
|
2390
|
+
*/
|
|
2391
|
+
/**
|
|
2392
|
+
* Used for stringify render output in Ivy.
|
|
2393
|
+
* Important! This function is very performance-sensitive and we should
|
|
2394
|
+
* be extra careful not to introduce megamorphic reads in it.
|
|
2395
|
+
*/
|
|
2396
|
+
function renderStringify(value) {
|
|
2397
|
+
if (typeof value === 'string')
|
|
2398
|
+
return value;
|
|
2399
|
+
if (value == null)
|
|
2400
|
+
return '';
|
|
2401
|
+
return '' + value;
|
|
2402
|
+
}
|
|
2403
|
+
/**
|
|
2404
|
+
* Used to stringify a value so that it can be displayed in an error message.
|
|
2405
|
+
* Important! This function contains a megamorphic read and should only be
|
|
2406
|
+
* used for error messages.
|
|
2407
|
+
*/
|
|
2408
|
+
function stringifyForError(value) {
|
|
2409
|
+
if (typeof value === 'function')
|
|
2410
|
+
return value.name || value.toString();
|
|
2411
|
+
if (typeof value === 'object' && value != null && typeof value.type === 'function') {
|
|
2412
|
+
return value.type.name || value.type.toString();
|
|
2413
|
+
}
|
|
2414
|
+
return renderStringify(value);
|
|
2415
|
+
}
|
|
2416
|
+
var ɵ0$2 = function () { return (typeof requestAnimationFrame !== 'undefined' &&
|
|
2417
|
+
requestAnimationFrame || // browser only
|
|
2418
|
+
setTimeout // everything else
|
|
2419
|
+
)
|
|
2420
|
+
.bind(_global); };
|
|
2421
|
+
var defaultScheduler = (ɵ0$2)();
|
|
2422
|
+
/**
|
|
2423
|
+
*
|
|
2424
|
+
* @codeGenApi
|
|
2425
|
+
*/
|
|
2426
|
+
function ɵɵresolveWindow(element) {
|
|
2427
|
+
return { name: 'window', target: element.ownerDocument.defaultView };
|
|
2428
|
+
}
|
|
2429
|
+
/**
|
|
2430
|
+
*
|
|
2431
|
+
* @codeGenApi
|
|
2432
|
+
*/
|
|
2433
|
+
function ɵɵresolveDocument(element) {
|
|
2434
|
+
return { name: 'document', target: element.ownerDocument };
|
|
2435
|
+
}
|
|
2436
|
+
/**
|
|
2437
|
+
*
|
|
2438
|
+
* @codeGenApi
|
|
2439
|
+
*/
|
|
2440
|
+
function ɵɵresolveBody(element) {
|
|
2441
|
+
return { name: 'body', target: element.ownerDocument.body };
|
|
2442
|
+
}
|
|
2443
|
+
/**
|
|
2444
|
+
* The special delimiter we use to separate property names, prefixes, and suffixes
|
|
2445
|
+
* in property binding metadata. See storeBindingMetadata().
|
|
2446
|
+
*
|
|
2447
|
+
* We intentionally use the Unicode "REPLACEMENT CHARACTER" (U+FFFD) as a delimiter
|
|
2448
|
+
* because it is a very uncommon character that is unlikely to be part of a user's
|
|
2449
|
+
* property names or interpolation strings. If it is in fact used in a property
|
|
2450
|
+
* binding, DebugElement.properties will not return the correct value for that
|
|
2451
|
+
* binding. However, there should be no runtime effect for real applications.
|
|
2452
|
+
*
|
|
2453
|
+
* This character is typically rendered as a question mark inside of a diamond.
|
|
2454
|
+
* See https://en.wikipedia.org/wiki/Specials_(Unicode_block)
|
|
2455
|
+
*
|
|
2456
|
+
*/
|
|
2457
|
+
var INTERPOLATION_DELIMITER = "\uFFFD";
|
|
2458
|
+
/**
|
|
2459
|
+
* Unwrap a value which might be behind a closure (for forward declaration reasons).
|
|
2460
|
+
*/
|
|
2461
|
+
function maybeUnwrapFn(value) {
|
|
2462
|
+
if (value instanceof Function) {
|
|
2463
|
+
return value();
|
|
2464
|
+
}
|
|
2465
|
+
else {
|
|
2466
|
+
return value;
|
|
2467
|
+
}
|
|
2468
|
+
}
|
|
2469
|
+
|
|
2470
|
+
/** Called when directives inject each other (creating a circular dependency) */
|
|
2471
|
+
function throwCyclicDependencyError(token, path) {
|
|
2472
|
+
var depPath = path ? ". Dependency path: " + path.join(' > ') + " > " + token : '';
|
|
2473
|
+
throw new Error("Circular dependency in DI detected for " + token + depPath);
|
|
2474
|
+
}
|
|
2475
|
+
/** Called when there are multiple component selectors that match a given node */
|
|
2476
|
+
function throwMultipleComponentError(tNode) {
|
|
2477
|
+
throw new Error("Multiple components match node with tagname " + tNode.tagName);
|
|
2478
|
+
}
|
|
2479
|
+
function throwMixedMultiProviderError() {
|
|
2480
|
+
throw new Error("Cannot mix multi providers and regular providers");
|
|
2481
|
+
}
|
|
2482
|
+
function throwInvalidProviderError(ngModuleType, providers, provider) {
|
|
2483
|
+
var ngModuleDetail = '';
|
|
2484
|
+
if (ngModuleType && providers) {
|
|
2485
|
+
var providerDetail = providers.map(function (v) { return v == provider ? '?' + provider + '?' : '...'; });
|
|
2486
|
+
ngModuleDetail =
|
|
2487
|
+
" - only instances of Provider and Type are allowed, got: [" + providerDetail.join(', ') + "]";
|
|
2488
|
+
}
|
|
2489
|
+
throw new Error("Invalid provider for the NgModule '" + stringify(ngModuleType) + "'" + ngModuleDetail);
|
|
2490
|
+
}
|
|
2491
|
+
/** Throws an ExpressionChangedAfterChecked error if checkNoChanges mode is on. */
|
|
2492
|
+
function throwErrorIfNoChangesMode(creationMode, oldValue, currValue, propName) {
|
|
2493
|
+
var field = propName ? " for '" + propName + "'" : '';
|
|
2494
|
+
var msg = "ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value" + field + ": '" + oldValue + "'. Current value: '" + currValue + "'.";
|
|
2495
|
+
if (creationMode) {
|
|
2496
|
+
msg +=
|
|
2497
|
+
" It seems like the view has been created after its parent and its children have been dirty checked." +
|
|
2498
|
+
" Has it been created in a change detection hook?";
|
|
2499
|
+
}
|
|
2500
|
+
// TODO: include debug context, see `viewDebugError` function in
|
|
2501
|
+
// `packages/core/src/view/errors.ts` for reference.
|
|
2502
|
+
throw new Error(msg);
|
|
2503
|
+
}
|
|
2504
|
+
function constructDetailsForInterpolation(lView, rootIndex, expressionIndex, meta, changedValue) {
|
|
2505
|
+
var _a = __read(meta.split(INTERPOLATION_DELIMITER)), propName = _a[0], prefix = _a[1], chunks = _a.slice(2);
|
|
2506
|
+
var oldValue = prefix, newValue = prefix;
|
|
2507
|
+
for (var i = 0; i < chunks.length; i++) {
|
|
2508
|
+
var slotIdx = rootIndex + i;
|
|
2509
|
+
oldValue += "" + lView[slotIdx] + chunks[i];
|
|
2510
|
+
newValue += "" + (slotIdx === expressionIndex ? changedValue : lView[slotIdx]) + chunks[i];
|
|
2511
|
+
}
|
|
2512
|
+
return { propName: propName, oldValue: oldValue, newValue: newValue };
|
|
2513
|
+
}
|
|
2514
|
+
/**
|
|
2515
|
+
* Constructs an object that contains details for the ExpressionChangedAfterItHasBeenCheckedError:
|
|
2516
|
+
* - property name (for property bindings or interpolations)
|
|
2517
|
+
* - old and new values, enriched using information from metadata
|
|
2518
|
+
*
|
|
2519
|
+
* More information on the metadata storage format can be found in `storePropertyBindingMetadata`
|
|
2520
|
+
* function description.
|
|
2521
|
+
*/
|
|
2522
|
+
function getExpressionChangedErrorDetails(lView, bindingIndex, oldValue, newValue) {
|
|
2523
|
+
var tData = lView[TVIEW].data;
|
|
2524
|
+
var metadata = tData[bindingIndex];
|
|
2525
|
+
if (typeof metadata === 'string') {
|
|
2526
|
+
// metadata for property interpolation
|
|
2527
|
+
if (metadata.indexOf(INTERPOLATION_DELIMITER) > -1) {
|
|
2528
|
+
return constructDetailsForInterpolation(lView, bindingIndex, bindingIndex, metadata, newValue);
|
|
2529
|
+
}
|
|
2530
|
+
// metadata for property binding
|
|
2531
|
+
return { propName: metadata, oldValue: oldValue, newValue: newValue };
|
|
2532
|
+
}
|
|
2533
|
+
// metadata is not available for this expression, check if this expression is a part of the
|
|
2534
|
+
// property interpolation by going from the current binding index left and look for a string that
|
|
2535
|
+
// contains INTERPOLATION_DELIMITER, the layout in tView.data for this case will look like this:
|
|
2536
|
+
// [..., 'id�Prefix � and � suffix', null, null, null, ...]
|
|
2537
|
+
if (metadata === null) {
|
|
2538
|
+
var idx = bindingIndex - 1;
|
|
2539
|
+
while (typeof tData[idx] !== 'string' && tData[idx + 1] === null) {
|
|
2540
|
+
idx--;
|
|
2541
|
+
}
|
|
2542
|
+
var meta = tData[idx];
|
|
2543
|
+
if (typeof meta === 'string') {
|
|
2544
|
+
var matches = meta.match(new RegExp(INTERPOLATION_DELIMITER, 'g'));
|
|
2545
|
+
// first interpolation delimiter separates property name from interpolation parts (in case of
|
|
2546
|
+
// property interpolations), so we subtract one from total number of found delimiters
|
|
2547
|
+
if (matches && (matches.length - 1) > bindingIndex - idx) {
|
|
2548
|
+
return constructDetailsForInterpolation(lView, idx, bindingIndex, meta, newValue);
|
|
2549
|
+
}
|
|
2550
|
+
}
|
|
2551
|
+
}
|
|
2552
|
+
return { propName: undefined, oldValue: oldValue, newValue: newValue };
|
|
2553
|
+
}
|
|
2554
|
+
/** Throws an error when a token is not found in DI. */
|
|
2555
|
+
function throwProviderNotFoundError(token, injectorName) {
|
|
2556
|
+
var injectorDetails = injectorName ? " in " + injectorName : '';
|
|
2557
|
+
throw new Error("No provider for " + stringifyForError(token) + " found" + injectorDetails);
|
|
2558
|
+
}
|
|
2559
|
+
|
|
2384
2560
|
/**
|
|
2385
2561
|
* @license
|
|
2386
2562
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -2596,11 +2772,11 @@
|
|
|
2596
2772
|
function isProceduralRenderer(renderer) {
|
|
2597
2773
|
return !!(renderer.listen);
|
|
2598
2774
|
}
|
|
2599
|
-
var ɵ0$
|
|
2775
|
+
var ɵ0$3 = function (hostElement, rendererType) {
|
|
2600
2776
|
return getDocument();
|
|
2601
2777
|
};
|
|
2602
2778
|
var domRendererFactory3 = {
|
|
2603
|
-
createRenderer: ɵ0$
|
|
2779
|
+
createRenderer: ɵ0$3
|
|
2604
2780
|
};
|
|
2605
2781
|
// Note: This hack is necessary so we don't erroneously get a circular dependency
|
|
2606
2782
|
// failure based on types.
|
|
@@ -3869,92 +4045,6 @@
|
|
|
3869
4045
|
return parentView;
|
|
3870
4046
|
}
|
|
3871
4047
|
|
|
3872
|
-
/**
|
|
3873
|
-
* @license
|
|
3874
|
-
* Copyright Google LLC All Rights Reserved.
|
|
3875
|
-
*
|
|
3876
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
3877
|
-
* found in the LICENSE file at https://angular.io/license
|
|
3878
|
-
*/
|
|
3879
|
-
/**
|
|
3880
|
-
* Used for stringify render output in Ivy.
|
|
3881
|
-
* Important! This function is very performance-sensitive and we should
|
|
3882
|
-
* be extra careful not to introduce megamorphic reads in it.
|
|
3883
|
-
*/
|
|
3884
|
-
function renderStringify(value) {
|
|
3885
|
-
if (typeof value === 'string')
|
|
3886
|
-
return value;
|
|
3887
|
-
if (value == null)
|
|
3888
|
-
return '';
|
|
3889
|
-
return '' + value;
|
|
3890
|
-
}
|
|
3891
|
-
/**
|
|
3892
|
-
* Used to stringify a value so that it can be displayed in an error message.
|
|
3893
|
-
* Important! This function contains a megamorphic read and should only be
|
|
3894
|
-
* used for error messages.
|
|
3895
|
-
*/
|
|
3896
|
-
function stringifyForError(value) {
|
|
3897
|
-
if (typeof value === 'function')
|
|
3898
|
-
return value.name || value.toString();
|
|
3899
|
-
if (typeof value === 'object' && value != null && typeof value.type === 'function') {
|
|
3900
|
-
return value.type.name || value.type.toString();
|
|
3901
|
-
}
|
|
3902
|
-
return renderStringify(value);
|
|
3903
|
-
}
|
|
3904
|
-
var ɵ0$3 = function () { return (typeof requestAnimationFrame !== 'undefined' &&
|
|
3905
|
-
requestAnimationFrame || // browser only
|
|
3906
|
-
setTimeout // everything else
|
|
3907
|
-
)
|
|
3908
|
-
.bind(_global); };
|
|
3909
|
-
var defaultScheduler = (ɵ0$3)();
|
|
3910
|
-
/**
|
|
3911
|
-
*
|
|
3912
|
-
* @codeGenApi
|
|
3913
|
-
*/
|
|
3914
|
-
function ɵɵresolveWindow(element) {
|
|
3915
|
-
return { name: 'window', target: element.ownerDocument.defaultView };
|
|
3916
|
-
}
|
|
3917
|
-
/**
|
|
3918
|
-
*
|
|
3919
|
-
* @codeGenApi
|
|
3920
|
-
*/
|
|
3921
|
-
function ɵɵresolveDocument(element) {
|
|
3922
|
-
return { name: 'document', target: element.ownerDocument };
|
|
3923
|
-
}
|
|
3924
|
-
/**
|
|
3925
|
-
*
|
|
3926
|
-
* @codeGenApi
|
|
3927
|
-
*/
|
|
3928
|
-
function ɵɵresolveBody(element) {
|
|
3929
|
-
return { name: 'body', target: element.ownerDocument.body };
|
|
3930
|
-
}
|
|
3931
|
-
/**
|
|
3932
|
-
* The special delimiter we use to separate property names, prefixes, and suffixes
|
|
3933
|
-
* in property binding metadata. See storeBindingMetadata().
|
|
3934
|
-
*
|
|
3935
|
-
* We intentionally use the Unicode "REPLACEMENT CHARACTER" (U+FFFD) as a delimiter
|
|
3936
|
-
* because it is a very uncommon character that is unlikely to be part of a user's
|
|
3937
|
-
* property names or interpolation strings. If it is in fact used in a property
|
|
3938
|
-
* binding, DebugElement.properties will not return the correct value for that
|
|
3939
|
-
* binding. However, there should be no runtime effect for real applications.
|
|
3940
|
-
*
|
|
3941
|
-
* This character is typically rendered as a question mark inside of a diamond.
|
|
3942
|
-
* See https://en.wikipedia.org/wiki/Specials_(Unicode_block)
|
|
3943
|
-
*
|
|
3944
|
-
*/
|
|
3945
|
-
var INTERPOLATION_DELIMITER = "\uFFFD";
|
|
3946
|
-
/**
|
|
3947
|
-
* Unwrap a value which might be behind a closure (for forward declaration reasons).
|
|
3948
|
-
*/
|
|
3949
|
-
function maybeUnwrapFn(value) {
|
|
3950
|
-
if (value instanceof Function) {
|
|
3951
|
-
return value();
|
|
3952
|
-
}
|
|
3953
|
-
else {
|
|
3954
|
-
return value;
|
|
3955
|
-
}
|
|
3956
|
-
}
|
|
3957
|
-
|
|
3958
4048
|
/**
|
|
3959
4049
|
* @license
|
|
3960
4050
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -4280,7 +4370,7 @@
|
|
|
4280
4370
|
try {
|
|
4281
4371
|
var value = bloomHash();
|
|
4282
4372
|
if (value == null && !(flags & exports.InjectFlags.Optional)) {
|
|
4283
|
-
|
|
4373
|
+
throwProviderNotFoundError(token);
|
|
4284
4374
|
}
|
|
4285
4375
|
else {
|
|
4286
4376
|
return value;
|
|
@@ -4379,7 +4469,7 @@
|
|
|
4379
4469
|
return notFoundValue;
|
|
4380
4470
|
}
|
|
4381
4471
|
else {
|
|
4382
|
-
|
|
4472
|
+
throwProviderNotFoundError(token, 'NodeInjector');
|
|
4383
4473
|
}
|
|
4384
4474
|
}
|
|
4385
4475
|
var NOT_FOUND = {};
|
|
@@ -4463,7 +4553,7 @@
|
|
|
4463
4553
|
if (isFactory(value)) {
|
|
4464
4554
|
var factory = value;
|
|
4465
4555
|
if (factory.resolving) {
|
|
4466
|
-
|
|
4556
|
+
throwCyclicDependencyError(stringifyForError(tData[index]));
|
|
4467
4557
|
}
|
|
4468
4558
|
var previousIncludeViewProviders = setIncludeViewProviders(factory.canSeeViewProviders);
|
|
4469
4559
|
factory.resolving = true;
|
|
@@ -4924,6 +5014,11 @@
|
|
|
4924
5014
|
if (_runModeLocked) {
|
|
4925
5015
|
throw new Error('Cannot enable prod mode after platform setup.');
|
|
4926
5016
|
}
|
|
5017
|
+
// The below check is there so when ngDevMode is set via terser
|
|
5018
|
+
// `global['ngDevMode'] = false;` is also dropped.
|
|
5019
|
+
if (typeof ngDevMode === undefined || !!ngDevMode) {
|
|
5020
|
+
_global['ngDevMode'] = false;
|
|
5021
|
+
}
|
|
4927
5022
|
_devMode = false;
|
|
4928
5023
|
}
|
|
4929
5024
|
|
|
@@ -5568,6 +5663,42 @@
|
|
|
5568
5663
|
return lView && lView[SANITIZER];
|
|
5569
5664
|
}
|
|
5570
5665
|
|
|
5666
|
+
/**
|
|
5667
|
+
* @license
|
|
5668
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5669
|
+
*
|
|
5670
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
5671
|
+
* found in the LICENSE file at https://angular.io/license
|
|
5672
|
+
*/
|
|
5673
|
+
var END_COMMENT = /-->/g;
|
|
5674
|
+
var END_COMMENT_ESCAPED = '-\u200B-\u200B>';
|
|
5675
|
+
/**
|
|
5676
|
+
* Escape the content of the strings so that it can be safely inserted into a comment node.
|
|
5677
|
+
*
|
|
5678
|
+
* The issue is that HTML does not specify any way to escape comment end text inside the comment.
|
|
5679
|
+
* `<!-- The way you close a comment is with "-->". -->`. Above the `"-->"` is meant to be text not
|
|
5680
|
+
* an end to the comment. This can be created programmatically through DOM APIs.
|
|
5681
|
+
*
|
|
5682
|
+
* ```
|
|
5683
|
+
* div.innerHTML = div.innerHTML
|
|
5684
|
+
* ```
|
|
5685
|
+
*
|
|
5686
|
+
* One would expect that the above code would be safe to do, but it turns out that because comment
|
|
5687
|
+
* text is not escaped, the comment may contain text which will prematurely close the comment
|
|
5688
|
+
* opening up the application for XSS attack. (In SSR we programmatically create comment nodes which
|
|
5689
|
+
* may contain such text and expect them to be safe.)
|
|
5690
|
+
*
|
|
5691
|
+
* This function escapes the comment text by looking for the closing char sequence `-->` and replace
|
|
5692
|
+
* it with `-_-_>` where the `_` is a zero width space `\u200B`. The result is that if a comment
|
|
5693
|
+
* contains `-->` text it will render normally but it will not cause the HTML parser to close the
|
|
5694
|
+
* comment.
|
|
5695
|
+
*
|
|
5696
|
+
* @param value text to make safe for comment node by escaping the comment close character sequence
|
|
5697
|
+
*/
|
|
5698
|
+
function escapeCommentText(value) {
|
|
5699
|
+
return value.replace(END_COMMENT, END_COMMENT_ESCAPED);
|
|
5700
|
+
}
|
|
5701
|
+
|
|
5571
5702
|
/**
|
|
5572
5703
|
* @license
|
|
5573
5704
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -5926,90 +6057,6 @@
|
|
|
5926
6057
|
return null;
|
|
5927
6058
|
}
|
|
5928
6059
|
|
|
5929
|
-
/** Called when directives inject each other (creating a circular dependency) */
|
|
5930
|
-
function throwCyclicDependencyError(token) {
|
|
5931
|
-
throw new Error("Cannot instantiate cyclic dependency! " + token);
|
|
5932
|
-
}
|
|
5933
|
-
/** Called when there are multiple component selectors that match a given node */
|
|
5934
|
-
function throwMultipleComponentError(tNode) {
|
|
5935
|
-
throw new Error("Multiple components match node with tagname " + tNode.tagName);
|
|
5936
|
-
}
|
|
5937
|
-
function throwMixedMultiProviderError() {
|
|
5938
|
-
throw new Error("Cannot mix multi providers and regular providers");
|
|
5939
|
-
}
|
|
5940
|
-
function throwInvalidProviderError(ngModuleType, providers, provider) {
|
|
5941
|
-
var ngModuleDetail = '';
|
|
5942
|
-
if (ngModuleType && providers) {
|
|
5943
|
-
var providerDetail = providers.map(function (v) { return v == provider ? '?' + provider + '?' : '...'; });
|
|
5944
|
-
ngModuleDetail =
|
|
5945
|
-
" - only instances of Provider and Type are allowed, got: [" + providerDetail.join(', ') + "]";
|
|
5946
|
-
}
|
|
5947
|
-
throw new Error("Invalid provider for the NgModule '" + stringify(ngModuleType) + "'" + ngModuleDetail);
|
|
5948
|
-
}
|
|
5949
|
-
/** Throws an ExpressionChangedAfterChecked error if checkNoChanges mode is on. */
|
|
5950
|
-
function throwErrorIfNoChangesMode(creationMode, oldValue, currValue, propName) {
|
|
5951
|
-
var field = propName ? " for '" + propName + "'" : '';
|
|
5952
|
-
var msg = "ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value" + field + ": '" + oldValue + "'. Current value: '" + currValue + "'.";
|
|
5953
|
-
if (creationMode) {
|
|
5954
|
-
msg +=
|
|
5955
|
-
" It seems like the view has been created after its parent and its children have been dirty checked." +
|
|
5956
|
-
" Has it been created in a change detection hook?";
|
|
5957
|
-
}
|
|
5958
|
-
// TODO: include debug context, see `viewDebugError` function in
|
|
5959
|
-
// `packages/core/src/view/errors.ts` for reference.
|
|
5960
|
-
throw new Error(msg);
|
|
5961
|
-
}
|
|
5962
|
-
function constructDetailsForInterpolation(lView, rootIndex, expressionIndex, meta, changedValue) {
|
|
5963
|
-
var _a = __read(meta.split(INTERPOLATION_DELIMITER)), propName = _a[0], prefix = _a[1], chunks = _a.slice(2);
|
|
5964
|
-
var oldValue = prefix, newValue = prefix;
|
|
5965
|
-
for (var i = 0; i < chunks.length; i++) {
|
|
5966
|
-
var slotIdx = rootIndex + i;
|
|
5967
|
-
oldValue += "" + lView[slotIdx] + chunks[i];
|
|
5968
|
-
newValue += "" + (slotIdx === expressionIndex ? changedValue : lView[slotIdx]) + chunks[i];
|
|
5969
|
-
}
|
|
5970
|
-
return { propName: propName, oldValue: oldValue, newValue: newValue };
|
|
5971
|
-
}
|
|
5972
|
-
/**
|
|
5973
|
-
* Constructs an object that contains details for the ExpressionChangedAfterItHasBeenCheckedError:
|
|
5974
|
-
* - property name (for property bindings or interpolations)
|
|
5975
|
-
* - old and new values, enriched using information from metadata
|
|
5976
|
-
*
|
|
5977
|
-
* More information on the metadata storage format can be found in `storePropertyBindingMetadata`
|
|
5978
|
-
* function description.
|
|
5979
|
-
*/
|
|
5980
|
-
function getExpressionChangedErrorDetails(lView, bindingIndex, oldValue, newValue) {
|
|
5981
|
-
var tData = lView[TVIEW].data;
|
|
5982
|
-
var metadata = tData[bindingIndex];
|
|
5983
|
-
if (typeof metadata === 'string') {
|
|
5984
|
-
// metadata for property interpolation
|
|
5985
|
-
if (metadata.indexOf(INTERPOLATION_DELIMITER) > -1) {
|
|
5986
|
-
return constructDetailsForInterpolation(lView, bindingIndex, bindingIndex, metadata, newValue);
|
|
5987
|
-
}
|
|
5988
|
-
// metadata for property binding
|
|
5989
|
-
return { propName: metadata, oldValue: oldValue, newValue: newValue };
|
|
5990
|
-
}
|
|
5991
|
-
// metadata is not available for this expression, check if this expression is a part of the
|
|
5992
|
-
// property interpolation by going from the current binding index left and look for a string that
|
|
5993
|
-
// contains INTERPOLATION_DELIMITER, the layout in tView.data for this case will look like this:
|
|
5994
|
-
// [..., 'id�Prefix � and � suffix', null, null, null, ...]
|
|
5995
|
-
if (metadata === null) {
|
|
5996
|
-
var idx = bindingIndex - 1;
|
|
5997
|
-
while (typeof tData[idx] !== 'string' && tData[idx + 1] === null) {
|
|
5998
|
-
idx--;
|
|
5999
|
-
}
|
|
6000
|
-
var meta = tData[idx];
|
|
6001
|
-
if (typeof meta === 'string') {
|
|
6002
|
-
var matches = meta.match(new RegExp(INTERPOLATION_DELIMITER, 'g'));
|
|
6003
|
-
// first interpolation delimiter separates property name from interpolation parts (in case of
|
|
6004
|
-
// property interpolations), so we subtract one from total number of found delimiters
|
|
6005
|
-
if (matches && (matches.length - 1) > bindingIndex - idx) {
|
|
6006
|
-
return constructDetailsForInterpolation(lView, idx, bindingIndex, meta, newValue);
|
|
6007
|
-
}
|
|
6008
|
-
}
|
|
6009
|
-
}
|
|
6010
|
-
return { propName: undefined, oldValue: oldValue, newValue: newValue };
|
|
6011
|
-
}
|
|
6012
|
-
|
|
6013
6060
|
/**
|
|
6014
6061
|
* @license
|
|
6015
6062
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -8263,7 +8310,7 @@
|
|
|
8263
8310
|
return propStore;
|
|
8264
8311
|
}
|
|
8265
8312
|
/**
|
|
8266
|
-
* Initializes data structures required to work with directive
|
|
8313
|
+
* Initializes data structures required to work with directive inputs and outputs.
|
|
8267
8314
|
* Initialization is done for all directives matched on a given TNode.
|
|
8268
8315
|
*/
|
|
8269
8316
|
function initializeInputAndOutputAliases(tView, tNode) {
|
|
@@ -8394,7 +8441,7 @@
|
|
|
8394
8441
|
}
|
|
8395
8442
|
}
|
|
8396
8443
|
else {
|
|
8397
|
-
var textContent = "bindings=" + JSON.stringify((_a = {}, _a[attrName] = debugValue, _a), null, 2);
|
|
8444
|
+
var textContent = escapeCommentText("bindings=" + JSON.stringify((_a = {}, _a[attrName] = debugValue, _a), null, 2));
|
|
8398
8445
|
if (isProceduralRenderer(renderer)) {
|
|
8399
8446
|
renderer.setValue(element, textContent);
|
|
8400
8447
|
}
|
|
@@ -9113,8 +9160,10 @@
|
|
|
9113
9160
|
*/
|
|
9114
9161
|
function scheduleTick(rootContext, flags) {
|
|
9115
9162
|
var nothingScheduled = rootContext.flags === 0 /* Empty */;
|
|
9116
|
-
rootContext.flags |= flags;
|
|
9117
9163
|
if (nothingScheduled && rootContext.clean == _CLEAN_PROMISE) {
|
|
9164
|
+
// https://github.com/angular/angular/issues/39296
|
|
9165
|
+
// should only attach the flags when really scheduling a tick
|
|
9166
|
+
rootContext.flags |= flags;
|
|
9118
9167
|
var res_1;
|
|
9119
9168
|
rootContext.clean = new Promise(function (r) { return res_1 = r; });
|
|
9120
9169
|
rootContext.scheduler(function () {
|
|
@@ -11739,7 +11788,8 @@
|
|
|
11739
11788
|
// Check for circular dependencies.
|
|
11740
11789
|
if (ngDevMode && parents.indexOf(defType) !== -1) {
|
|
11741
11790
|
var defName = stringify(defType);
|
|
11742
|
-
|
|
11791
|
+
var path = parents.map(stringify);
|
|
11792
|
+
throwCyclicDependencyError(defName, path);
|
|
11743
11793
|
}
|
|
11744
11794
|
// Check for multiple imports of the same module
|
|
11745
11795
|
var isDuplicate = dedupStack.indexOf(defType) !== -1;
|
|
@@ -13954,7 +14004,7 @@
|
|
|
13954
14004
|
* found in the LICENSE file at https://angular.io/license
|
|
13955
14005
|
*/
|
|
13956
14006
|
var ɵ0$b = function (token, notFoundValue) {
|
|
13957
|
-
|
|
14007
|
+
throwProviderNotFoundError(token, 'NullInjector');
|
|
13958
14008
|
};
|
|
13959
14009
|
// TODO: A hack to not pull in the NullInjector from @angular/core.
|
|
13960
14010
|
var NULL_INJECTOR$1 = {
|
|
@@ -21677,7 +21727,7 @@
|
|
|
21677
21727
|
/**
|
|
21678
21728
|
* @publicApi
|
|
21679
21729
|
*/
|
|
21680
|
-
var VERSION = new Version('10.2.
|
|
21730
|
+
var VERSION = new Version('10.2.4');
|
|
21681
21731
|
|
|
21682
21732
|
/**
|
|
21683
21733
|
* @license
|
|
@@ -24866,13 +24916,6 @@
|
|
|
24866
24916
|
});
|
|
24867
24917
|
}
|
|
24868
24918
|
|
|
24869
|
-
/**
|
|
24870
|
-
* @license
|
|
24871
|
-
* Copyright Google LLC All Rights Reserved.
|
|
24872
|
-
*
|
|
24873
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
24874
|
-
* found in the LICENSE file at https://angular.io/license
|
|
24875
|
-
*/
|
|
24876
24919
|
/**
|
|
24877
24920
|
* Map of module-id to the corresponding NgModule.
|
|
24878
24921
|
* - In pre Ivy we track NgModuleFactory,
|
|
@@ -24894,18 +24937,36 @@
|
|
|
24894
24937
|
}
|
|
24895
24938
|
}
|
|
24896
24939
|
function registerNgModuleType(ngModuleType) {
|
|
24897
|
-
|
|
24898
|
-
|
|
24899
|
-
|
|
24900
|
-
|
|
24901
|
-
|
|
24902
|
-
|
|
24903
|
-
|
|
24904
|
-
|
|
24905
|
-
|
|
24906
|
-
|
|
24907
|
-
|
|
24908
|
-
|
|
24940
|
+
var visited = new Set();
|
|
24941
|
+
recurse(ngModuleType);
|
|
24942
|
+
function recurse(ngModuleType) {
|
|
24943
|
+
var e_1, _a;
|
|
24944
|
+
// The imports array of an NgModule must refer to other NgModules,
|
|
24945
|
+
// so an error is thrown if no module definition is available.
|
|
24946
|
+
var def = getNgModuleDef(ngModuleType, /* throwNotFound */ true);
|
|
24947
|
+
var id = def.id;
|
|
24948
|
+
if (id !== null) {
|
|
24949
|
+
var existing = modules.get(id);
|
|
24950
|
+
assertSameOrNotExisting(id, existing, ngModuleType);
|
|
24951
|
+
modules.set(id, ngModuleType);
|
|
24952
|
+
}
|
|
24953
|
+
var imports = maybeUnwrapFn(def.imports);
|
|
24954
|
+
try {
|
|
24955
|
+
for (var imports_1 = __values(imports), imports_1_1 = imports_1.next(); !imports_1_1.done; imports_1_1 = imports_1.next()) {
|
|
24956
|
+
var i = imports_1_1.value;
|
|
24957
|
+
if (!visited.has(i)) {
|
|
24958
|
+
visited.add(i);
|
|
24959
|
+
recurse(i);
|
|
24960
|
+
}
|
|
24961
|
+
}
|
|
24962
|
+
}
|
|
24963
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
24964
|
+
finally {
|
|
24965
|
+
try {
|
|
24966
|
+
if (imports_1_1 && !imports_1_1.done && (_a = imports_1.return)) _a.call(imports_1);
|
|
24967
|
+
}
|
|
24968
|
+
finally { if (e_1) throw e_1.error; }
|
|
24969
|
+
}
|
|
24909
24970
|
}
|
|
24910
24971
|
}
|
|
24911
24972
|
function clearModulesForTest() {
|
|
@@ -26301,7 +26362,7 @@
|
|
|
26301
26362
|
if (flags === void 0) { flags = exports.InjectFlags.Default; }
|
|
26302
26363
|
var value = injectChangeDetectorRef(true);
|
|
26303
26364
|
if (value == null && !(flags & exports.InjectFlags.Optional)) {
|
|
26304
|
-
|
|
26365
|
+
throwProviderNotFoundError('ChangeDetectorRef');
|
|
26305
26366
|
}
|
|
26306
26367
|
else {
|
|
26307
26368
|
return value;
|
|
@@ -32143,7 +32204,7 @@
|
|
|
32143
32204
|
var el = asElementData(view, elDef.nodeIndex).renderElement;
|
|
32144
32205
|
if (!elDef.element.name) {
|
|
32145
32206
|
// a comment.
|
|
32146
|
-
view.renderer.setValue(el, "bindings=" + JSON.stringify(bindingValues, null, 2));
|
|
32207
|
+
view.renderer.setValue(el, escapeCommentText("bindings=" + JSON.stringify(bindingValues, null, 2)));
|
|
32147
32208
|
}
|
|
32148
32209
|
else {
|
|
32149
32210
|
// a regular element.
|
|
@@ -32432,7 +32493,7 @@
|
|
|
32432
32493
|
return el;
|
|
32433
32494
|
};
|
|
32434
32495
|
DebugRenderer2.prototype.createComment = function (value) {
|
|
32435
|
-
var comment = this.delegate.createComment(value);
|
|
32496
|
+
var comment = this.delegate.createComment(escapeCommentText(value));
|
|
32436
32497
|
var debugCtx = this.createDebugContext(comment);
|
|
32437
32498
|
if (debugCtx) {
|
|
32438
32499
|
indexDebugNode(new DebugNode__PRE_R3__(comment, null, debugCtx));
|
|
@@ -32647,7 +32708,7 @@
|
|
|
32647
32708
|
* Use of this source code is governed by an MIT-style license that can be
|
|
32648
32709
|
* found in the LICENSE file at https://angular.io/license
|
|
32649
32710
|
*/
|
|
32650
|
-
if (ngDevMode) {
|
|
32711
|
+
if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
32651
32712
|
// This helper is to give a reasonable error message to people upgrading to v9 that have not yet
|
|
32652
32713
|
// installed `@angular/localize` in their app.
|
|
32653
32714
|
// tslint:disable-next-line: no-toplevel-property-access
|