@angular/core 13.1.0-next.3 → 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.
Files changed (41) hide show
  1. package/core.d.ts +49 -27
  2. package/esm2020/src/application_ref.mjs +10 -10
  3. package/esm2020/src/change_detection/differs/default_iterable_differ.mjs +6 -2
  4. package/esm2020/src/change_detection/differs/default_keyvalue_differ.mjs +6 -2
  5. package/esm2020/src/change_detection/differs/iterable_differs.mjs +6 -2
  6. package/esm2020/src/change_detection/differs/keyvalue_differs.mjs +6 -2
  7. package/esm2020/src/core_private_export.mjs +2 -2
  8. package/esm2020/src/di/injector_compatibility.mjs +10 -3
  9. package/esm2020/src/di/r3_injector.mjs +16 -5
  10. package/esm2020/src/error_details_base_url.mjs +16 -0
  11. package/esm2020/src/error_handler.mjs +2 -2
  12. package/esm2020/src/errors.mjs +18 -12
  13. package/esm2020/src/metadata/directives.mjs +2 -2
  14. package/esm2020/src/render3/errors.mjs +4 -6
  15. package/esm2020/src/render3/errors_di.mjs +11 -4
  16. package/esm2020/src/render3/features/inherit_definition_feature.mjs +6 -2
  17. package/esm2020/src/render3/i18n/i18n_apply.mjs +5 -2
  18. package/esm2020/src/render3/i18n/i18n_parse.mjs +2 -2
  19. package/esm2020/src/render3/instructions/element.mjs +3 -3
  20. package/esm2020/src/render3/instructions/shared.mjs +4 -4
  21. package/esm2020/src/render3/ng_module_ref.mjs +2 -2
  22. package/esm2020/src/render3/pipe.mjs +3 -3
  23. package/esm2020/src/render3/view_ref.mjs +6 -3
  24. package/esm2020/src/sanitization/sanitization.mjs +14 -7
  25. package/esm2020/src/util/errors.mjs +10 -2
  26. package/esm2020/src/version.mjs +1 -1
  27. package/esm2020/testing/src/logger.mjs +3 -3
  28. package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
  29. package/fesm2015/core.mjs +98 -79
  30. package/fesm2015/core.mjs.map +1 -1
  31. package/fesm2015/testing.mjs +2 -2
  32. package/fesm2020/core.mjs +98 -79
  33. package/fesm2020/core.mjs.map +1 -1
  34. package/fesm2020/testing.mjs +2 -2
  35. package/package.json +1 -1
  36. package/schematics/utils/import_manager.d.ts +0 -5
  37. package/schematics/utils/import_manager.js +3 -7
  38. package/schematics/utils/typescript/imports.js +2 -5
  39. package/testing/testing.d.ts +2 -2
  40. package/esm2020/src/render3/error_code.mjs +0 -42
  41. package/esm2020/src/render3/error_details_base_url.mjs +0 -16
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @license Angular v13.1.0-next.3
3
- * (c) 2010-2021 Google LLC. https://angular.io/
2
+ * @license Angular v13.1.3
3
+ * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
package/fesm2020/core.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @license Angular v13.1.0-next.3
3
- * (c) 2010-2021 Google LLC. https://angular.io/
2
+ * @license Angular v13.1.3
3
+ * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
@@ -141,7 +141,7 @@ function isForwardRef(fn) {
141
141
  *
142
142
  * Keep the files below in full sync:
143
143
  * - packages/compiler-cli/src/ngtsc/diagnostics/src/error_details_base_url.ts
144
- * - packages/core/src/render3/error_details_base_url.ts
144
+ * - packages/core/src/error_details_base_url.ts
145
145
  */
146
146
  const ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.io/errors';
147
147
 
@@ -158,30 +158,15 @@ class RuntimeError extends Error {
158
158
  this.code = code;
159
159
  }
160
160
  }
161
- // Contains a set of error messages that have details guides at angular.io.
162
- // Full list of available error guides can be found at https://angular.io/errors
163
- /* tslint:disable:no-toplevel-property-access */
164
- const RUNTIME_ERRORS_WITH_GUIDES = new Set([
165
- "100" /* EXPRESSION_CHANGED_AFTER_CHECKED */,
166
- "200" /* CYCLIC_DI_DEPENDENCY */,
167
- "201" /* PROVIDER_NOT_FOUND */,
168
- "300" /* MULTIPLE_COMPONENTS_MATCH */,
169
- "301" /* EXPORT_NOT_FOUND */,
170
- "302" /* PIPE_NOT_FOUND */,
171
- ]);
172
- /* tslint:enable:no-toplevel-property-access */
173
161
  /** Called to format a runtime error */
174
162
  function formatRuntimeError(code, message) {
175
- const fullCode = code ? `NG0${code}: ` : '';
176
- let errorMessage = `${fullCode}${message}`;
177
- // Some runtime errors are still thrown without `ngDevMode` (for example
178
- // `throwProviderNotFoundError`), so we add `ngDevMode` check here to avoid pulling
179
- // `RUNTIME_ERRORS_WITH_GUIDES` symbol into prod bundles.
180
- // TODO: revisit all instances where `RuntimeError` is thrown and see if `ngDevMode` can be added
181
- // there instead to tree-shake more devmode-only code (and eventually remove `ngDevMode` check
182
- // from this code).
183
- if (ngDevMode && RUNTIME_ERRORS_WITH_GUIDES.has(code)) {
184
- errorMessage = `${errorMessage}. Find more at ${ERROR_DETAILS_PAGE_BASE_URL}/NG0${code}`;
163
+ const codeAsNumber = code;
164
+ // Error code might be a negative number, which is a special marker that instructs the logic to
165
+ // generate a link to the error details page on angular.io.
166
+ const fullCode = `NG0${Math.abs(codeAsNumber)}`;
167
+ let errorMessage = `${fullCode}${message ? ': ' + message : ''}`;
168
+ if (ngDevMode && codeAsNumber < 0) {
169
+ errorMessage = `${errorMessage}. Find more at ${ERROR_DETAILS_PAGE_BASE_URL}/${fullCode}`;
185
170
  }
186
171
  return errorMessage;
187
172
  }
@@ -222,10 +207,17 @@ function stringifyForError(value) {
222
207
  return renderStringify(value);
223
208
  }
224
209
 
210
+ /**
211
+ * @license
212
+ * Copyright Google LLC All Rights Reserved.
213
+ *
214
+ * Use of this source code is governed by an MIT-style license that can be
215
+ * found in the LICENSE file at https://angular.io/license
216
+ */
225
217
  /** Called when directives inject each other (creating a circular dependency) */
226
218
  function throwCyclicDependencyError(token, path) {
227
219
  const depPath = path ? `. Dependency path: ${path.join(' > ')} > ${token}` : '';
228
- throw new RuntimeError("200" /* CYCLIC_DI_DEPENDENCY */, `Circular dependency in DI detected for ${token}${depPath}`);
220
+ throw new RuntimeError(-200 /* CYCLIC_DI_DEPENDENCY */, `Circular dependency in DI detected for ${token}${depPath}`);
229
221
  }
230
222
  function throwMixedMultiProviderError() {
231
223
  throw new Error(`Cannot mix multi providers and regular providers`);
@@ -242,7 +234,7 @@ function throwInvalidProviderError(ngModuleType, providers, provider) {
242
234
  /** Throws an error when a token is not found in DI. */
243
235
  function throwProviderNotFoundError(token, injectorName) {
244
236
  const injectorDetails = injectorName ? ` in ${injectorName}` : '';
245
- throw new RuntimeError("201" /* PROVIDER_NOT_FOUND */, `No provider for ${stringifyForError(token)} found${injectorDetails}`);
237
+ throw new RuntimeError(-201 /* PROVIDER_NOT_FOUND */, `No provider for ${stringifyForError(token)} found${injectorDetails}`);
246
238
  }
247
239
 
248
240
  /**
@@ -4758,7 +4750,10 @@ function setCurrentInjector(injector) {
4758
4750
  }
4759
4751
  function injectInjectorOnly(token, flags = InjectFlags.Default) {
4760
4752
  if (_currentInjector === undefined) {
4761
- throw new Error(`inject() must be called from an injection context`);
4753
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
4754
+ `inject() must be called from an injection context` :
4755
+ '';
4756
+ throw new RuntimeError(203 /* MISSING_INJECTION_CONTEXT */, errorMessage);
4762
4757
  }
4763
4758
  else if (_currentInjector === null) {
4764
4759
  return injectRootLimpMode(token, undefined, flags);
@@ -4822,7 +4817,10 @@ function injectArgs(types) {
4822
4817
  const arg = resolveForwardRef(types[i]);
4823
4818
  if (Array.isArray(arg)) {
4824
4819
  if (arg.length === 0) {
4825
- throw new Error('Arguments array must have arguments.');
4820
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
4821
+ 'Arguments array must have arguments.' :
4822
+ '';
4823
+ throw new RuntimeError(900 /* INVALID_DIFFER_INPUT */, errorMessage);
4826
4824
  }
4827
4825
  let type = undefined;
4828
4826
  let flags = InjectFlags.Default;
@@ -6013,7 +6011,10 @@ function ɵɵsanitizeResourceUrl(unsafeResourceUrl) {
6013
6011
  if (allowSanitizationBypassAndThrow(unsafeResourceUrl, "ResourceURL" /* ResourceUrl */)) {
6014
6012
  return trustedScriptURLFromStringBypass(unwrapSafeValue(unsafeResourceUrl));
6015
6013
  }
6016
- throw new Error('unsafe value used in a resource URL context (see https://g.co/ng/security#xss)');
6014
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
6015
+ 'unsafe value used in a resource URL context (see https://g.co/ng/security#xss)' :
6016
+ '';
6017
+ throw new RuntimeError(904 /* UNSAFE_VALUE_IN_RESOURCE_URL */, errorMessage);
6017
6018
  }
6018
6019
  /**
6019
6020
  * A `script` sanitizer which only lets trusted javascript through.
@@ -6035,7 +6036,10 @@ function ɵɵsanitizeScript(unsafeScript) {
6035
6036
  if (allowSanitizationBypassAndThrow(unsafeScript, "Script" /* Script */)) {
6036
6037
  return trustedScriptFromStringBypass(unwrapSafeValue(unsafeScript));
6037
6038
  }
6038
- throw new Error('unsafe value used in a script context');
6039
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
6040
+ 'unsafe value used in a script context' :
6041
+ '';
6042
+ throw new RuntimeError(905 /* UNSAFE_VALUE_IN_SCRIPT */, errorMessage);
6039
6043
  }
6040
6044
  /**
6041
6045
  * A template tag function for promoting the associated constant literal to a
@@ -6123,18 +6127,18 @@ function ɵɵsanitizeUrlOrResourceUrl(unsafeUrl, tag, prop) {
6123
6127
  }
6124
6128
  function validateAgainstEventProperties(name) {
6125
6129
  if (name.toLowerCase().startsWith('on')) {
6126
- const msg = `Binding to event property '${name}' is disallowed for security reasons, ` +
6130
+ const errorMessage = `Binding to event property '${name}' is disallowed for security reasons, ` +
6127
6131
  `please use (${name.slice(2)})=...` +
6128
6132
  `\nIf '${name}' is a directive input, make sure the directive is imported by the` +
6129
6133
  ` current module.`;
6130
- throw new Error(msg);
6134
+ throw new RuntimeError(306 /* INVALID_EVENT_BINDING */, errorMessage);
6131
6135
  }
6132
6136
  }
6133
6137
  function validateAgainstEventAttributes(name) {
6134
6138
  if (name.toLowerCase().startsWith('on')) {
6135
- const msg = `Binding to event attribute '${name}' is disallowed for security reasons, ` +
6139
+ const errorMessage = `Binding to event attribute '${name}' is disallowed for security reasons, ` +
6136
6140
  `please use (${name.slice(2)})=...`;
6137
- throw new Error(msg);
6141
+ throw new RuntimeError(306 /* INVALID_EVENT_BINDING */, errorMessage);
6138
6142
  }
6139
6143
  }
6140
6144
  function getSanitizer() {
@@ -6454,7 +6458,6 @@ function discoverLocalRefs(lView, nodeIndex) {
6454
6458
  * Use of this source code is governed by an MIT-style license that can be
6455
6459
  * found in the LICENSE file at https://angular.io/license
6456
6460
  */
6457
- const ERROR_TYPE = 'ngType';
6458
6461
  const ERROR_ORIGINAL_ERROR = 'ngOriginalError';
6459
6462
  const ERROR_LOGGER = 'ngErrorLogger';
6460
6463
  function wrappedError(message, originalError) {
@@ -6463,17 +6466,6 @@ function wrappedError(message, originalError) {
6463
6466
  error[ERROR_ORIGINAL_ERROR] = originalError;
6464
6467
  return error;
6465
6468
  }
6466
-
6467
- /**
6468
- * @license
6469
- * Copyright Google LLC All Rights Reserved.
6470
- *
6471
- * Use of this source code is governed by an MIT-style license that can be
6472
- * found in the LICENSE file at https://angular.io/license
6473
- */
6474
- function getType(error) {
6475
- return error[ERROR_TYPE];
6476
- }
6477
6469
  function getOriginalError(error) {
6478
6470
  return error[ERROR_ORIGINAL_ERROR];
6479
6471
  }
@@ -6718,7 +6710,7 @@ function maybeUnwrapFn(value) {
6718
6710
  */
6719
6711
  /** Called when there are multiple component selectors that match a given node */
6720
6712
  function throwMultipleComponentError(tNode) {
6721
- throw new RuntimeError("300" /* MULTIPLE_COMPONENTS_MATCH */, `Multiple components match node with tagname ${tNode.value}`);
6713
+ throw new RuntimeError(-300 /* MULTIPLE_COMPONENTS_MATCH */, `Multiple components match node with tagname ${tNode.value}`);
6722
6714
  }
6723
6715
  /** Throws an ExpressionChangedAfterChecked error if checkNoChanges mode is on. */
6724
6716
  function throwErrorIfNoChangesMode(creationMode, oldValue, currValue, propName) {
@@ -6729,9 +6721,7 @@ function throwErrorIfNoChangesMode(creationMode, oldValue, currValue, propName)
6729
6721
  ` It seems like the view has been created after its parent and its children have been dirty checked.` +
6730
6722
  ` Has it been created in a change detection hook?`;
6731
6723
  }
6732
- // TODO: include debug context, see `viewDebugError` function in
6733
- // `packages/core/src/view/errors.ts` for reference.
6734
- throw new RuntimeError("100" /* EXPRESSION_CHANGED_AFTER_CHECKED */, msg);
6724
+ throw new RuntimeError(-100 /* EXPRESSION_CHANGED_AFTER_CHECKED */, msg);
6735
6725
  }
6736
6726
  function constructDetailsForInterpolation(lView, rootIndex, expressionIndex, meta, changedValue) {
6737
6727
  const [propName, prefix, ...chunks] = meta.split(INTERPOLATION_DELIMITER);
@@ -10141,7 +10131,7 @@ function matchingSchemas(tView, tagName) {
10141
10131
  */
10142
10132
  function logUnknownPropertyError(propName, tNode) {
10143
10133
  let message = `Can't bind to '${propName}' since it isn't a known property of '${tNode.value}'.`;
10144
- console.error(formatRuntimeError("303" /* UNKNOWN_BINDING */, message));
10134
+ console.error(formatRuntimeError(303 /* UNKNOWN_BINDING */, message));
10145
10135
  }
10146
10136
  /**
10147
10137
  * Instantiate a root component.
@@ -10394,7 +10384,7 @@ function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {
10394
10384
  for (let i = 0; i < localRefs.length; i += 2) {
10395
10385
  const index = exportsMap[localRefs[i + 1]];
10396
10386
  if (index == null)
10397
- throw new RuntimeError("301" /* EXPORT_NOT_FOUND */, `Export of name '${localRefs[i + 1]}' not found!`);
10387
+ throw new RuntimeError(-301 /* EXPORT_NOT_FOUND */, `Export of name '${localRefs[i + 1]}' not found!`);
10398
10388
  localNames.push(localRefs[i], index);
10399
10389
  }
10400
10390
  }
@@ -11320,7 +11310,10 @@ class R3Injector {
11320
11310
  }
11321
11311
  assertNotDestroyed() {
11322
11312
  if (this._destroyed) {
11323
- throw new Error('Injector has already been destroyed.');
11313
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
11314
+ 'Injector has already been destroyed.' :
11315
+ '';
11316
+ throw new RuntimeError(205 /* INJECTOR_ALREADY_DESTROYED */, errorMessage);
11324
11317
  }
11325
11318
  }
11326
11319
  /**
@@ -11484,21 +11477,28 @@ function injectableDefOrInjectorDefFactory(token) {
11484
11477
  // InjectionTokens should have an injectable def (ɵprov) and thus should be handled above.
11485
11478
  // If it's missing that, it's an error.
11486
11479
  if (token instanceof InjectionToken) {
11487
- throw new Error(`Token ${stringify(token)} is missing a ɵprov definition.`);
11480
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
11481
+ `Token ${stringify(token)} is missing a ɵprov definition.` :
11482
+ '';
11483
+ throw new RuntimeError(204 /* INVALID_INJECTION_TOKEN */, errorMessage);
11488
11484
  }
11489
11485
  // Undecorated types can sometimes be created if they have no constructor arguments.
11490
11486
  if (token instanceof Function) {
11491
11487
  return getUndecoratedInjectableFactory(token);
11492
11488
  }
11493
11489
  // There was no way to resolve a factory for this token.
11494
- throw new Error('unreachable');
11490
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ? 'unreachable' : '';
11491
+ throw new RuntimeError(204 /* INVALID_INJECTION_TOKEN */, errorMessage);
11495
11492
  }
11496
11493
  function getUndecoratedInjectableFactory(token) {
11497
11494
  // If the token has parameters then it has dependencies that we cannot resolve implicitly.
11498
11495
  const paramLength = token.length;
11499
11496
  if (paramLength > 0) {
11500
11497
  const args = newArray(paramLength, '?');
11501
- throw new Error(`Can't resolve all parameters for ${stringify(token)}: (${args.join(', ')}).`);
11498
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
11499
+ `Can't resolve all parameters for ${stringify(token)}: (${args.join(', ')}).` :
11500
+ '';
11501
+ throw new RuntimeError(204 /* INVALID_INJECTION_TOKEN */, errorMessage);
11502
11502
  }
11503
11503
  // The constructor function appears to have no parameters.
11504
11504
  // This might be because it inherits from a super-class. In which case, use an injectable
@@ -12356,7 +12356,10 @@ function ɵɵInheritDefinitionFeature(definition) {
12356
12356
  }
12357
12357
  else {
12358
12358
  if (superType.ɵcmp) {
12359
- throw new Error('Directives cannot inherit Components');
12359
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
12360
+ 'Directives cannot inherit Components' :
12361
+ '';
12362
+ throw new RuntimeError(903 /* INVALID_INHERITANCE */, errorMessage);
12360
12363
  }
12361
12364
  // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
12362
12365
  superDef = superType.ɵdir;
@@ -14618,7 +14621,7 @@ function logUnknownElementError(tView, element, tNode, hasDirectives) {
14618
14621
  message +=
14619
14622
  `2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.`;
14620
14623
  }
14621
- console.error(formatRuntimeError("304" /* UNKNOWN_ELEMENT */, message));
14624
+ console.error(formatRuntimeError(304 /* UNKNOWN_ELEMENT */, message));
14622
14625
  }
14623
14626
  }
14624
14627
  }
@@ -19137,7 +19140,9 @@ function applyMutableOpCodes(tView, mutableOpCodes, lView, anchorRNode) {
19137
19140
  setElementAttribute(renderer, getNativeByIndex(elementNodeIndex, lView), null, null, attrName, attrValue, null);
19138
19141
  break;
19139
19142
  default:
19140
- throw new Error(`Unable to determine the type of mutate operation for "${opCode}"`);
19143
+ if (ngDevMode) {
19144
+ throw new RuntimeError(700 /* INVALID_I18N_STRUCTURE */, `Unable to determine the type of mutate operation for "${opCode}"`);
19145
+ }
19141
19146
  }
19142
19147
  }
19143
19148
  else {
@@ -19763,7 +19768,7 @@ function i18nStartFirstCreatePass(tView, parentTNodeIndex, lView, index, message
19763
19768
  };
19764
19769
  }
19765
19770
  /**
19766
- * Allocate space in i18n Range add create OpCode instruction to crete a text or comment node.
19771
+ * Allocate space in i18n Range add create OpCode instruction to create a text or comment node.
19767
19772
  *
19768
19773
  * @param tView Current `TView` needed to allocate space in i18n range.
19769
19774
  * @param rootTNode Root `TNode` of the i18n block. This node determines if the new TNode will be
@@ -21064,7 +21069,7 @@ class Version {
21064
21069
  /**
21065
21070
  * @publicApi
21066
21071
  */
21067
- const VERSION = new Version('13.1.0-next.3');
21072
+ const VERSION = new Version('13.1.3');
21068
21073
 
21069
21074
  /**
21070
21075
  * @license
@@ -21400,7 +21405,8 @@ class ViewRef$1 {
21400
21405
  }
21401
21406
  attachToViewContainerRef() {
21402
21407
  if (this._appRef) {
21403
- throw new Error('This view is already attached directly to the ApplicationRef!');
21408
+ const errorMessage = ngDevMode ? 'This view is already attached directly to the ApplicationRef!' : '';
21409
+ throw new RuntimeError(902 /* VIEW_ALREADY_ATTACHED */, errorMessage);
21404
21410
  }
21405
21411
  this._attachedToViewContainer = true;
21406
21412
  }
@@ -21410,7 +21416,8 @@ class ViewRef$1 {
21410
21416
  }
21411
21417
  attachToAppRef(appRef) {
21412
21418
  if (this._attachedToViewContainer) {
21413
- throw new Error('This view is already attached to a ViewContainer!');
21419
+ const errorMessage = ngDevMode ? 'This view is already attached to a ViewContainer!' : '';
21420
+ throw new RuntimeError(902 /* VIEW_ALREADY_ATTACHED */, errorMessage);
21414
21421
  }
21415
21422
  this._appRef = appRef;
21416
21423
  }
@@ -21802,7 +21809,7 @@ class NgModuleRef extends NgModuleRef$1 {
21802
21809
  }
21803
21810
  ], stringify(ngModuleType));
21804
21811
  // We need to resolve the injector types separately from the injector creation, because
21805
- // the module might be trying to use this ref in its contructor for DI which will cause a
21812
+ // the module might be trying to use this ref in its constructor for DI which will cause a
21806
21813
  // circular error that will eventually error out, because the injector isn't created yet.
21807
21814
  this._r3Injector._resolveInjectorDefTypes();
21808
21815
  this.instance = this.get(ngModuleType);
@@ -22281,7 +22288,7 @@ function getPipeDef(name, registry) {
22281
22288
  const declarationLView = lView[DECLARATION_COMPONENT_VIEW];
22282
22289
  const context = declarationLView[CONTEXT];
22283
22290
  const component = context ? ` in the '${context.constructor.name}' component` : '';
22284
- throw new RuntimeError("302" /* PIPE_NOT_FOUND */, `The pipe '${name}' could not be found${component}!`);
22291
+ throw new RuntimeError(-302 /* PIPE_NOT_FOUND */, `The pipe '${name}' could not be found${component}!`);
22285
22292
  }
22286
22293
  }
22287
22294
  /**
@@ -24542,7 +24549,7 @@ const HostBinding = makePropDecorator('HostBinding', (hostPropertyName) => ({ ho
24542
24549
  * @HostListener('click', ['$event.target'])
24543
24550
  * onClick(btn) {
24544
24551
  * console.log('button', btn, 'number of clicks:', this.numberOfClicks++);
24545
- * }
24552
+ * }
24546
24553
  * }
24547
24554
  *
24548
24555
  * @Component({
@@ -25882,7 +25889,7 @@ function createPlatform(injector) {
25882
25889
  const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
25883
25890
  'There can be only one platform. Destroy the previous one to create a new one.' :
25884
25891
  '';
25885
- throw new RuntimeError("400" /* MULTIPLE_PLATFORMS */, errorMessage);
25892
+ throw new RuntimeError(400 /* MULTIPLE_PLATFORMS */, errorMessage);
25886
25893
  }
25887
25894
  publishDefaultGlobalUtils();
25888
25895
  _platform = injector.get(PlatformRef);
@@ -25931,11 +25938,11 @@ function assertPlatform(requiredToken) {
25931
25938
  const platform = getPlatform();
25932
25939
  if (!platform) {
25933
25940
  const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ? 'No platform exists!' : '';
25934
- throw new RuntimeError("401" /* PLATFORM_NOT_FOUND */, errorMessage);
25941
+ throw new RuntimeError(401 /* PLATFORM_NOT_FOUND */, errorMessage);
25935
25942
  }
25936
25943
  if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
25937
25944
  !platform.injector.get(requiredToken, null)) {
25938
- throw new RuntimeError("400" /* MULTIPLE_PLATFORMS */, 'A platform with a different configuration has been created. Please destroy it first.');
25945
+ throw new RuntimeError(400 /* MULTIPLE_PLATFORMS */, 'A platform with a different configuration has been created. Please destroy it first.');
25939
25946
  }
25940
25947
  return platform;
25941
25948
  }
@@ -26022,7 +26029,7 @@ class PlatformRef {
26022
26029
  const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
26023
26030
  'No ErrorHandler. Is platform module (BrowserModule) included?' :
26024
26031
  '';
26025
- throw new RuntimeError("402" /* ERROR_HANDLER_NOT_FOUND */, errorMessage);
26032
+ throw new RuntimeError(402 /* ERROR_HANDLER_NOT_FOUND */, errorMessage);
26026
26033
  }
26027
26034
  ngZone.runOutsideAngular(() => {
26028
26035
  const subscription = ngZone.onError.subscribe({
@@ -26083,7 +26090,7 @@ class PlatformRef {
26083
26090
  `but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. ` +
26084
26091
  `Please define one of these.` :
26085
26092
  '';
26086
- throw new RuntimeError("403" /* BOOTSTRAP_COMPONENTS_NOT_FOUND */, errorMessage);
26093
+ throw new RuntimeError(403 /* BOOTSTRAP_COMPONENTS_NOT_FOUND */, errorMessage);
26087
26094
  }
26088
26095
  this._modules.push(moduleRef);
26089
26096
  }
@@ -26109,7 +26116,7 @@ class PlatformRef {
26109
26116
  const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
26110
26117
  'The platform has already been destroyed!' :
26111
26118
  '';
26112
- throw new RuntimeError("404" /* ALREADY_DESTROYED_PLATFORM */, errorMessage);
26119
+ throw new RuntimeError(404 /* ALREADY_DESTROYED_PLATFORM */, errorMessage);
26113
26120
  }
26114
26121
  this._modules.slice().forEach(module => module.destroy());
26115
26122
  this._destroyListeners.forEach(listener => listener());
@@ -26373,7 +26380,7 @@ class ApplicationRef {
26373
26380
  'Cannot bootstrap as there are still asynchronous initializers running. ' +
26374
26381
  'Bootstrap components in the `ngDoBootstrap` method of the root module.' :
26375
26382
  '';
26376
- throw new RuntimeError("405" /* ASYNC_INITIALIZERS_STILL_RUNNING */, errorMessage);
26383
+ throw new RuntimeError(405 /* ASYNC_INITIALIZERS_STILL_RUNNING */, errorMessage);
26377
26384
  }
26378
26385
  let componentFactory;
26379
26386
  if (componentOrFactory instanceof ComponentFactory$1) {
@@ -26423,7 +26430,7 @@ class ApplicationRef {
26423
26430
  const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
26424
26431
  'ApplicationRef.tick is called recursively' :
26425
26432
  '';
26426
- throw new RuntimeError("101" /* RECURSIVE_APPLICATION_REF_TICK */, errorMessage);
26433
+ throw new RuntimeError(101 /* RECURSIVE_APPLICATION_REF_TICK */, errorMessage);
26427
26434
  }
26428
26435
  try {
26429
26436
  this._runningTick = true;
@@ -27412,7 +27419,10 @@ class DefaultIterableDiffer {
27412
27419
  if (collection == null)
27413
27420
  collection = [];
27414
27421
  if (!isListLikeIterable(collection)) {
27415
- throw new Error(`Error trying to diff '${stringify(collection)}'. Only arrays and iterables are allowed`);
27422
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
27423
+ `Error trying to diff '${stringify(collection)}'. Only arrays and iterables are allowed` :
27424
+ '';
27425
+ throw new RuntimeError(900 /* INVALID_DIFFER_INPUT */, errorMessage);
27416
27426
  }
27417
27427
  if (this.check(collection)) {
27418
27428
  return this;
@@ -28013,7 +28023,10 @@ class DefaultKeyValueDiffer {
28013
28023
  map = new Map();
28014
28024
  }
28015
28025
  else if (!(map instanceof Map || isJsObject(map))) {
28016
- throw new Error(`Error trying to diff '${stringify(map)}'. Only maps and objects are allowed`);
28026
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
28027
+ `Error trying to diff '${stringify(map)}'. Only maps and objects are allowed` :
28028
+ '';
28029
+ throw new RuntimeError(900 /* INVALID_DIFFER_INPUT */, errorMessage);
28017
28030
  }
28018
28031
  return this.check(map) ? this : null;
28019
28032
  }
@@ -28260,7 +28273,10 @@ class IterableDiffers {
28260
28273
  return factory;
28261
28274
  }
28262
28275
  else {
28263
- throw new Error(`Cannot find a differ supporting object '${iterable}' of type '${getTypeNameForDebugging(iterable)}'`);
28276
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
28277
+ `Cannot find a differ supporting object '${iterable}' of type '${getTypeNameForDebugging(iterable)}'` :
28278
+ '';
28279
+ throw new RuntimeError(901 /* NO_SUPPORTING_DIFFER_FACTORY */, errorMessage);
28264
28280
  }
28265
28281
  }
28266
28282
  }
@@ -28334,7 +28350,10 @@ class KeyValueDiffers {
28334
28350
  if (factory) {
28335
28351
  return factory;
28336
28352
  }
28337
- throw new Error(`Cannot find a differ supporting object '${kv}'`);
28353
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
28354
+ `Cannot find a differ supporting object '${kv}'` :
28355
+ '';
28356
+ throw new RuntimeError(901 /* NO_SUPPORTING_DIFFER_FACTORY */, errorMessage);
28338
28357
  }
28339
28358
  }
28340
28359
  /** @nocollapse */