@angular/core 13.1.2 → 13.1.3
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/core.d.ts +14 -2
- package/esm2020/src/change_detection/differs/default_iterable_differ.mjs +6 -2
- package/esm2020/src/change_detection/differs/default_keyvalue_differ.mjs +6 -2
- package/esm2020/src/change_detection/differs/iterable_differs.mjs +6 -2
- package/esm2020/src/change_detection/differs/keyvalue_differs.mjs +6 -2
- package/esm2020/src/di/injector_compatibility.mjs +10 -3
- package/esm2020/src/di/r3_injector.mjs +16 -5
- package/esm2020/src/errors.mjs +1 -1
- package/esm2020/src/render3/features/inherit_definition_feature.mjs +6 -2
- package/esm2020/src/render3/i18n/i18n_apply.mjs +5 -2
- package/esm2020/src/render3/view_ref.mjs +6 -3
- package/esm2020/src/sanitization/sanitization.mjs +14 -7
- 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 +63 -22
- package/fesm2015/core.mjs.map +1 -1
- package/fesm2015/testing.mjs +1 -1
- package/fesm2020/core.mjs +63 -22
- package/fesm2020/core.mjs.map +1 -1
- package/fesm2020/testing.mjs +1 -1
- package/package.json +1 -1
- package/testing/testing.d.ts +1 -1
package/fesm2015/core.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v13.1.
|
|
2
|
+
* @license Angular v13.1.3
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -4729,7 +4729,10 @@ function setCurrentInjector(injector) {
|
|
|
4729
4729
|
}
|
|
4730
4730
|
function injectInjectorOnly(token, flags = InjectFlags.Default) {
|
|
4731
4731
|
if (_currentInjector === undefined) {
|
|
4732
|
-
|
|
4732
|
+
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
4733
|
+
`inject() must be called from an injection context` :
|
|
4734
|
+
'';
|
|
4735
|
+
throw new RuntimeError(203 /* MISSING_INJECTION_CONTEXT */, errorMessage);
|
|
4733
4736
|
}
|
|
4734
4737
|
else if (_currentInjector === null) {
|
|
4735
4738
|
return injectRootLimpMode(token, undefined, flags);
|
|
@@ -4793,7 +4796,10 @@ function injectArgs(types) {
|
|
|
4793
4796
|
const arg = resolveForwardRef(types[i]);
|
|
4794
4797
|
if (Array.isArray(arg)) {
|
|
4795
4798
|
if (arg.length === 0) {
|
|
4796
|
-
|
|
4799
|
+
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
4800
|
+
'Arguments array must have arguments.' :
|
|
4801
|
+
'';
|
|
4802
|
+
throw new RuntimeError(900 /* INVALID_DIFFER_INPUT */, errorMessage);
|
|
4797
4803
|
}
|
|
4798
4804
|
let type = undefined;
|
|
4799
4805
|
let flags = InjectFlags.Default;
|
|
@@ -5990,7 +5996,10 @@ function ɵɵsanitizeResourceUrl(unsafeResourceUrl) {
|
|
|
5990
5996
|
if (allowSanitizationBypassAndThrow(unsafeResourceUrl, "ResourceURL" /* ResourceUrl */)) {
|
|
5991
5997
|
return trustedScriptURLFromStringBypass(unwrapSafeValue(unsafeResourceUrl));
|
|
5992
5998
|
}
|
|
5993
|
-
|
|
5999
|
+
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
6000
|
+
'unsafe value used in a resource URL context (see https://g.co/ng/security#xss)' :
|
|
6001
|
+
'';
|
|
6002
|
+
throw new RuntimeError(904 /* UNSAFE_VALUE_IN_RESOURCE_URL */, errorMessage);
|
|
5994
6003
|
}
|
|
5995
6004
|
/**
|
|
5996
6005
|
* A `script` sanitizer which only lets trusted javascript through.
|
|
@@ -6012,7 +6021,10 @@ function ɵɵsanitizeScript(unsafeScript) {
|
|
|
6012
6021
|
if (allowSanitizationBypassAndThrow(unsafeScript, "Script" /* Script */)) {
|
|
6013
6022
|
return trustedScriptFromStringBypass(unwrapSafeValue(unsafeScript));
|
|
6014
6023
|
}
|
|
6015
|
-
|
|
6024
|
+
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
6025
|
+
'unsafe value used in a script context' :
|
|
6026
|
+
'';
|
|
6027
|
+
throw new RuntimeError(905 /* UNSAFE_VALUE_IN_SCRIPT */, errorMessage);
|
|
6016
6028
|
}
|
|
6017
6029
|
/**
|
|
6018
6030
|
* A template tag function for promoting the associated constant literal to a
|
|
@@ -6100,18 +6112,18 @@ function ɵɵsanitizeUrlOrResourceUrl(unsafeUrl, tag, prop) {
|
|
|
6100
6112
|
}
|
|
6101
6113
|
function validateAgainstEventProperties(name) {
|
|
6102
6114
|
if (name.toLowerCase().startsWith('on')) {
|
|
6103
|
-
const
|
|
6115
|
+
const errorMessage = `Binding to event property '${name}' is disallowed for security reasons, ` +
|
|
6104
6116
|
`please use (${name.slice(2)})=...` +
|
|
6105
6117
|
`\nIf '${name}' is a directive input, make sure the directive is imported by the` +
|
|
6106
6118
|
` current module.`;
|
|
6107
|
-
throw new
|
|
6119
|
+
throw new RuntimeError(306 /* INVALID_EVENT_BINDING */, errorMessage);
|
|
6108
6120
|
}
|
|
6109
6121
|
}
|
|
6110
6122
|
function validateAgainstEventAttributes(name) {
|
|
6111
6123
|
if (name.toLowerCase().startsWith('on')) {
|
|
6112
|
-
const
|
|
6124
|
+
const errorMessage = `Binding to event attribute '${name}' is disallowed for security reasons, ` +
|
|
6113
6125
|
`please use (${name.slice(2)})=...`;
|
|
6114
|
-
throw new
|
|
6126
|
+
throw new RuntimeError(306 /* INVALID_EVENT_BINDING */, errorMessage);
|
|
6115
6127
|
}
|
|
6116
6128
|
}
|
|
6117
6129
|
function getSanitizer() {
|
|
@@ -11283,7 +11295,10 @@ class R3Injector {
|
|
|
11283
11295
|
}
|
|
11284
11296
|
assertNotDestroyed() {
|
|
11285
11297
|
if (this._destroyed) {
|
|
11286
|
-
|
|
11298
|
+
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
11299
|
+
'Injector has already been destroyed.' :
|
|
11300
|
+
'';
|
|
11301
|
+
throw new RuntimeError(205 /* INJECTOR_ALREADY_DESTROYED */, errorMessage);
|
|
11287
11302
|
}
|
|
11288
11303
|
}
|
|
11289
11304
|
/**
|
|
@@ -11447,21 +11462,28 @@ function injectableDefOrInjectorDefFactory(token) {
|
|
|
11447
11462
|
// InjectionTokens should have an injectable def (ɵprov) and thus should be handled above.
|
|
11448
11463
|
// If it's missing that, it's an error.
|
|
11449
11464
|
if (token instanceof InjectionToken) {
|
|
11450
|
-
|
|
11465
|
+
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
11466
|
+
`Token ${stringify(token)} is missing a ɵprov definition.` :
|
|
11467
|
+
'';
|
|
11468
|
+
throw new RuntimeError(204 /* INVALID_INJECTION_TOKEN */, errorMessage);
|
|
11451
11469
|
}
|
|
11452
11470
|
// Undecorated types can sometimes be created if they have no constructor arguments.
|
|
11453
11471
|
if (token instanceof Function) {
|
|
11454
11472
|
return getUndecoratedInjectableFactory(token);
|
|
11455
11473
|
}
|
|
11456
11474
|
// There was no way to resolve a factory for this token.
|
|
11457
|
-
|
|
11475
|
+
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ? 'unreachable' : '';
|
|
11476
|
+
throw new RuntimeError(204 /* INVALID_INJECTION_TOKEN */, errorMessage);
|
|
11458
11477
|
}
|
|
11459
11478
|
function getUndecoratedInjectableFactory(token) {
|
|
11460
11479
|
// If the token has parameters then it has dependencies that we cannot resolve implicitly.
|
|
11461
11480
|
const paramLength = token.length;
|
|
11462
11481
|
if (paramLength > 0) {
|
|
11463
11482
|
const args = newArray(paramLength, '?');
|
|
11464
|
-
|
|
11483
|
+
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
11484
|
+
`Can't resolve all parameters for ${stringify(token)}: (${args.join(', ')}).` :
|
|
11485
|
+
'';
|
|
11486
|
+
throw new RuntimeError(204 /* INVALID_INJECTION_TOKEN */, errorMessage);
|
|
11465
11487
|
}
|
|
11466
11488
|
// The constructor function appears to have no parameters.
|
|
11467
11489
|
// This might be because it inherits from a super-class. In which case, use an injectable
|
|
@@ -12320,7 +12342,10 @@ function ɵɵInheritDefinitionFeature(definition) {
|
|
|
12320
12342
|
}
|
|
12321
12343
|
else {
|
|
12322
12344
|
if (superType.ɵcmp) {
|
|
12323
|
-
|
|
12345
|
+
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
12346
|
+
'Directives cannot inherit Components' :
|
|
12347
|
+
'';
|
|
12348
|
+
throw new RuntimeError(903 /* INVALID_INHERITANCE */, errorMessage);
|
|
12324
12349
|
}
|
|
12325
12350
|
// Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
|
|
12326
12351
|
superDef = superType.ɵdir;
|
|
@@ -19101,7 +19126,9 @@ function applyMutableOpCodes(tView, mutableOpCodes, lView, anchorRNode) {
|
|
|
19101
19126
|
setElementAttribute(renderer, getNativeByIndex(elementNodeIndex, lView), null, null, attrName, attrValue, null);
|
|
19102
19127
|
break;
|
|
19103
19128
|
default:
|
|
19104
|
-
|
|
19129
|
+
if (ngDevMode) {
|
|
19130
|
+
throw new RuntimeError(700 /* INVALID_I18N_STRUCTURE */, `Unable to determine the type of mutate operation for "${opCode}"`);
|
|
19131
|
+
}
|
|
19105
19132
|
}
|
|
19106
19133
|
}
|
|
19107
19134
|
else {
|
|
@@ -21028,7 +21055,7 @@ class Version {
|
|
|
21028
21055
|
/**
|
|
21029
21056
|
* @publicApi
|
|
21030
21057
|
*/
|
|
21031
|
-
const VERSION = new Version('13.1.
|
|
21058
|
+
const VERSION = new Version('13.1.3');
|
|
21032
21059
|
|
|
21033
21060
|
/**
|
|
21034
21061
|
* @license
|
|
@@ -21364,7 +21391,8 @@ class ViewRef$1 {
|
|
|
21364
21391
|
}
|
|
21365
21392
|
attachToViewContainerRef() {
|
|
21366
21393
|
if (this._appRef) {
|
|
21367
|
-
|
|
21394
|
+
const errorMessage = ngDevMode ? 'This view is already attached directly to the ApplicationRef!' : '';
|
|
21395
|
+
throw new RuntimeError(902 /* VIEW_ALREADY_ATTACHED */, errorMessage);
|
|
21368
21396
|
}
|
|
21369
21397
|
this._attachedToViewContainer = true;
|
|
21370
21398
|
}
|
|
@@ -21374,7 +21402,8 @@ class ViewRef$1 {
|
|
|
21374
21402
|
}
|
|
21375
21403
|
attachToAppRef(appRef) {
|
|
21376
21404
|
if (this._attachedToViewContainer) {
|
|
21377
|
-
|
|
21405
|
+
const errorMessage = ngDevMode ? 'This view is already attached to a ViewContainer!' : '';
|
|
21406
|
+
throw new RuntimeError(902 /* VIEW_ALREADY_ATTACHED */, errorMessage);
|
|
21378
21407
|
}
|
|
21379
21408
|
this._appRef = appRef;
|
|
21380
21409
|
}
|
|
@@ -27372,7 +27401,10 @@ class DefaultIterableDiffer {
|
|
|
27372
27401
|
if (collection == null)
|
|
27373
27402
|
collection = [];
|
|
27374
27403
|
if (!isListLikeIterable(collection)) {
|
|
27375
|
-
|
|
27404
|
+
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
27405
|
+
`Error trying to diff '${stringify(collection)}'. Only arrays and iterables are allowed` :
|
|
27406
|
+
'';
|
|
27407
|
+
throw new RuntimeError(900 /* INVALID_DIFFER_INPUT */, errorMessage);
|
|
27376
27408
|
}
|
|
27377
27409
|
if (this.check(collection)) {
|
|
27378
27410
|
return this;
|
|
@@ -27973,7 +28005,10 @@ class DefaultKeyValueDiffer {
|
|
|
27973
28005
|
map = new Map();
|
|
27974
28006
|
}
|
|
27975
28007
|
else if (!(map instanceof Map || isJsObject(map))) {
|
|
27976
|
-
|
|
28008
|
+
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
28009
|
+
`Error trying to diff '${stringify(map)}'. Only maps and objects are allowed` :
|
|
28010
|
+
'';
|
|
28011
|
+
throw new RuntimeError(900 /* INVALID_DIFFER_INPUT */, errorMessage);
|
|
27977
28012
|
}
|
|
27978
28013
|
return this.check(map) ? this : null;
|
|
27979
28014
|
}
|
|
@@ -28220,7 +28255,10 @@ class IterableDiffers {
|
|
|
28220
28255
|
return factory;
|
|
28221
28256
|
}
|
|
28222
28257
|
else {
|
|
28223
|
-
|
|
28258
|
+
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
28259
|
+
`Cannot find a differ supporting object '${iterable}' of type '${getTypeNameForDebugging(iterable)}'` :
|
|
28260
|
+
'';
|
|
28261
|
+
throw new RuntimeError(901 /* NO_SUPPORTING_DIFFER_FACTORY */, errorMessage);
|
|
28224
28262
|
}
|
|
28225
28263
|
}
|
|
28226
28264
|
}
|
|
@@ -28294,7 +28332,10 @@ class KeyValueDiffers {
|
|
|
28294
28332
|
if (factory) {
|
|
28295
28333
|
return factory;
|
|
28296
28334
|
}
|
|
28297
|
-
|
|
28335
|
+
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
28336
|
+
`Cannot find a differ supporting object '${kv}'` :
|
|
28337
|
+
'';
|
|
28338
|
+
throw new RuntimeError(901 /* NO_SUPPORTING_DIFFER_FACTORY */, errorMessage);
|
|
28298
28339
|
}
|
|
28299
28340
|
}
|
|
28300
28341
|
/** @nocollapse */
|