@angular/core 13.2.0-next.1 → 13.2.0

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 (48) hide show
  1. package/core.d.ts +68 -28
  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/linker/compiler.mjs +1 -1
  14. package/esm2020/src/linker/component_factory.mjs +4 -1
  15. package/esm2020/src/linker/component_factory_resolver.mjs +4 -1
  16. package/esm2020/src/linker/ng_module_factory.mjs +1 -1
  17. package/esm2020/src/metadata/directives.mjs +2 -2
  18. package/esm2020/src/reflection/reflection_capabilities.mjs +2 -2
  19. package/esm2020/src/render3/component_ref.mjs +1 -1
  20. package/esm2020/src/render3/errors.mjs +4 -6
  21. package/esm2020/src/render3/errors_di.mjs +11 -4
  22. package/esm2020/src/render3/features/inherit_definition_feature.mjs +6 -2
  23. package/esm2020/src/render3/i18n/i18n_apply.mjs +5 -2
  24. package/esm2020/src/render3/i18n/i18n_parse.mjs +2 -2
  25. package/esm2020/src/render3/instructions/element.mjs +3 -3
  26. package/esm2020/src/render3/instructions/shared.mjs +4 -4
  27. package/esm2020/src/render3/namespaces.mjs +10 -3
  28. package/esm2020/src/render3/ng_module_ref.mjs +2 -2
  29. package/esm2020/src/render3/node_manipulation.mjs +5 -3
  30. package/esm2020/src/render3/pipe.mjs +3 -3
  31. package/esm2020/src/render3/view_ref.mjs +6 -3
  32. package/esm2020/src/sanitization/sanitization.mjs +14 -7
  33. package/esm2020/src/util/errors.mjs +10 -2
  34. package/esm2020/src/version.mjs +1 -1
  35. package/esm2020/src/zone/ng_zone.mjs +3 -2
  36. package/esm2020/testing/src/logger.mjs +3 -3
  37. package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
  38. package/fesm2015/core.mjs +119 -85
  39. package/fesm2015/core.mjs.map +1 -1
  40. package/fesm2015/testing.mjs +2 -2
  41. package/fesm2020/core.mjs +119 -85
  42. package/fesm2020/core.mjs.map +1 -1
  43. package/fesm2020/testing.mjs +2 -2
  44. package/package.json +1 -1
  45. package/schematics/migrations/typed-forms/index.js +3 -3
  46. package/testing/testing.d.ts +2 -2
  47. package/esm2020/src/render3/error_code.mjs +0 -42
  48. package/esm2020/src/render3/error_details_base_url.mjs +0 -16
@@ -26,9 +26,9 @@ export class Log {
26
26
  return this.logItems.join('; ');
27
27
  }
28
28
  }
29
- Log.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.0-next.1", ngImport: i0, type: Log, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
30
- Log.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.0-next.1", ngImport: i0, type: Log });
31
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0-next.1", ngImport: i0, type: Log, decorators: [{
29
+ Log.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.0", ngImport: i0, type: Log, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
30
+ Log.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.0", ngImport: i0, type: Log });
31
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImport: i0, type: Log, decorators: [{
32
32
  type: Injectable
33
33
  }], ctorParameters: function () { return []; } });
34
34
  //# sourceMappingURL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aWNlbnNlXG4gKiBDb3B5cmlnaHQgR29vZ2xlIExMQyBBbGwgUmlnaHRzIFJlc2VydmVkLlxuICpcbiAqIFVzZSBvZiB0aGlzIHNvdXJjZSBjb2RlIGlzIGdvdmVybmVkIGJ5IGFuIE1JVC1zdHlsZSBsaWNlbnNlIHRoYXQgY2FuIGJlXG4gKiBmb3VuZCBpbiB0aGUgTElDRU5TRSBmaWxlIGF0IGh0dHBzOi8vYW5ndWxhci5pby9saWNlbnNlXG4gKi9cblxuaW1wb3J0IHtJbmplY3RhYmxlfSBmcm9tICdAYW5ndWxhci9jb3JlJztcblxuQEluamVjdGFibGUoKVxuZXhwb3J0IGNsYXNzIExvZyB7XG4gIGxvZ0l0ZW1zOiBhbnlbXTtcblxuICBjb25zdHJ1Y3RvcigpIHtcbiAgICB0aGlzLmxvZ0l0ZW1zID0gW107XG4gIH1cblxuICBhZGQodmFsdWU6IGFueSAvKiogVE9ETyAjOTEwMCAqLyk6IHZvaWQge1xuICAgIHRoaXMubG9nSXRlbXMucHVzaCh2YWx1ZSk7XG4gIH1cblxuICBmbih2YWx1ZTogYW55IC8qKiBUT0RPICM5MTAwICovKSB7XG4gICAgcmV0dXJuIChhMTogYW55ID0gbnVsbCwgYTI6IGFueSA9IG51bGwsIGEzOiBhbnkgPSBudWxsLCBhNDogYW55ID0gbnVsbCwgYTU6IGFueSA9IG51bGwpID0+IHtcbiAgICAgIHRoaXMubG9nSXRlbXMucHVzaCh2YWx1ZSk7XG4gICAgfTtcbiAgfVxuXG4gIGNsZWFyKCk6IHZvaWQge1xuICAgIHRoaXMubG9nSXRlbXMgPSBbXTtcbiAgfVxuXG4gIHJlc3VsdCgpOiBzdHJpbmcge1xuICAgIHJldHVybiB0aGlzLmxvZ0l0ZW1zLmpvaW4oJzsgJyk7XG4gIH1cbn1cbiJdfQ==
@@ -25,9 +25,9 @@ export class MockNgZone extends NgZone {
25
25
  this.onStable.emit(null);
26
26
  }
27
27
  }
28
- MockNgZone.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.0-next.1", ngImport: i0, type: MockNgZone, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
29
- MockNgZone.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.0-next.1", ngImport: i0, type: MockNgZone });
30
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0-next.1", ngImport: i0, type: MockNgZone, decorators: [{
28
+ MockNgZone.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.0", ngImport: i0, type: MockNgZone, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
29
+ MockNgZone.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.0", ngImport: i0, type: MockNgZone });
30
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0", ngImport: i0, type: MockNgZone, decorators: [{
31
31
  type: Injectable
32
32
  }], ctorParameters: function () { return []; } });
33
33
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmdfem9uZV9tb2NrLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY29yZS90ZXN0aW5nL3NyYy9uZ196b25lX21vY2sudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBRUgsT0FBTyxFQUFDLFlBQVksRUFBRSxVQUFVLEVBQUUsTUFBTSxFQUFDLE1BQU0sZUFBZSxDQUFDOztBQUcvRDs7R0FFRztBQUVILE1BQU0sT0FBTyxVQUFXLFNBQVEsTUFBTTtJQUdwQztRQUNFLEtBQUssQ0FBQyxFQUFDLG9CQUFvQixFQUFFLEtBQUssRUFBRSxrQ0FBa0MsRUFBRSxLQUFLLEVBQUMsQ0FBQyxDQUFDO1FBSHpFLGFBQVEsR0FBc0IsSUFBS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YWNrVHJhY2U6IGZhbHNlLCBzaG91bGRDb2FsZXNjZUV2ZW50Q2hhbmdlRGV0ZWN0aW9uOiBmYWxzZX0pO1xuICB9XG5cbiAgb3ZlcnJpZGUgcnVuKGZuOiBGdW5jdGlvbik6IGFueSB7XG4gICAgcmV0dXJuIGZuKCk7XG4gIH1cblxuICBvdmVycmlkZSBydW5PdXRzaWRlQW5ndWxhcihmbjogRnVuY3Rpb24pOiBhbnkge1xuICAgIHJldHVybiBmbigpO1xuICB9XG5cbiAgc2ltdWxhdGVab25lRXhpdCgpOiB2b2lkIHtcbiAgICB0aGlzLm9uU3RhYmxlLmVtaXQobnVsbCk7XG4gIH1cbn1cbiJdfQ==
package/fesm2015/core.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @license Angular v13.2.0-next.1
3
- * (c) 2010-2021 Google LLC. https://angular.io/
2
+ * @license Angular v13.2.0
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
  /**
@@ -1560,8 +1552,15 @@ const profiler = function (event, instance, hookOrListener) {
1560
1552
  * Use of this source code is governed by an MIT-style license that can be
1561
1553
  * found in the LICENSE file at https://angular.io/license
1562
1554
  */
1563
- const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
1564
- const MATH_ML_NAMESPACE = 'http://www.w3.org/1998/MathML/';
1555
+ const SVG_NAMESPACE = 'svg';
1556
+ const SVG_NAMESPACE_URI = 'http://www.w3.org/2000/svg';
1557
+ const MATH_ML_NAMESPACE = 'math';
1558
+ const MATH_ML_NAMESPACE_URI = 'http://www.w3.org/1998/MathML/';
1559
+ function getNamespaceUri(namespace) {
1560
+ const name = namespace.toLowerCase();
1561
+ return name === SVG_NAMESPACE ? SVG_NAMESPACE_URI :
1562
+ (name === MATH_ML_NAMESPACE ? MATH_ML_NAMESPACE_URI : null);
1563
+ }
1565
1564
 
1566
1565
  /**
1567
1566
  * @license
@@ -4458,7 +4457,7 @@ const ES2015_INHERITED_CLASS_WITH_CTOR = /^class\s+[A-Za-z\d$_]*\s*extends\s+[^{
4458
4457
  * Regular expression that detects ES2015 classes which extend from other classes
4459
4458
  * and inherit a constructor.
4460
4459
  */
4461
- const ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR = /^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{[\s\S]*constructor\s*\(\)\s*{\s*super\(\.\.\.arguments\)/;
4460
+ const ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR = /^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{[\s\S]*constructor\s*\(\)\s*{[^}]*super\(\.\.\.arguments\)/;
4462
4461
  /**
4463
4462
  * Determine whether a stringified type is a class which delegates its constructor
4464
4463
  * to its parent.
@@ -4737,7 +4736,10 @@ function setCurrentInjector(injector) {
4737
4736
  }
4738
4737
  function injectInjectorOnly(token, flags = InjectFlags.Default) {
4739
4738
  if (_currentInjector === undefined) {
4740
- throw new Error(`inject() must be called from an injection context`);
4739
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
4740
+ `inject() must be called from an injection context` :
4741
+ '';
4742
+ throw new RuntimeError(203 /* MISSING_INJECTION_CONTEXT */, errorMessage);
4741
4743
  }
4742
4744
  else if (_currentInjector === null) {
4743
4745
  return injectRootLimpMode(token, undefined, flags);
@@ -4801,7 +4803,10 @@ function injectArgs(types) {
4801
4803
  const arg = resolveForwardRef(types[i]);
4802
4804
  if (Array.isArray(arg)) {
4803
4805
  if (arg.length === 0) {
4804
- throw new Error('Arguments array must have arguments.');
4806
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
4807
+ 'Arguments array must have arguments.' :
4808
+ '';
4809
+ throw new RuntimeError(900 /* INVALID_DIFFER_INPUT */, errorMessage);
4805
4810
  }
4806
4811
  let type = undefined;
4807
4812
  let flags = InjectFlags.Default;
@@ -5998,7 +6003,10 @@ function ɵɵsanitizeResourceUrl(unsafeResourceUrl) {
5998
6003
  if (allowSanitizationBypassAndThrow(unsafeResourceUrl, "ResourceURL" /* ResourceUrl */)) {
5999
6004
  return trustedScriptURLFromStringBypass(unwrapSafeValue(unsafeResourceUrl));
6000
6005
  }
6001
- throw new Error('unsafe value used in a resource URL context (see https://g.co/ng/security#xss)');
6006
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
6007
+ 'unsafe value used in a resource URL context (see https://g.co/ng/security#xss)' :
6008
+ '';
6009
+ throw new RuntimeError(904 /* UNSAFE_VALUE_IN_RESOURCE_URL */, errorMessage);
6002
6010
  }
6003
6011
  /**
6004
6012
  * A `script` sanitizer which only lets trusted javascript through.
@@ -6020,7 +6028,10 @@ function ɵɵsanitizeScript(unsafeScript) {
6020
6028
  if (allowSanitizationBypassAndThrow(unsafeScript, "Script" /* Script */)) {
6021
6029
  return trustedScriptFromStringBypass(unwrapSafeValue(unsafeScript));
6022
6030
  }
6023
- throw new Error('unsafe value used in a script context');
6031
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
6032
+ 'unsafe value used in a script context' :
6033
+ '';
6034
+ throw new RuntimeError(905 /* UNSAFE_VALUE_IN_SCRIPT */, errorMessage);
6024
6035
  }
6025
6036
  /**
6026
6037
  * A template tag function for promoting the associated constant literal to a
@@ -6108,18 +6119,18 @@ function ɵɵsanitizeUrlOrResourceUrl(unsafeUrl, tag, prop) {
6108
6119
  }
6109
6120
  function validateAgainstEventProperties(name) {
6110
6121
  if (name.toLowerCase().startsWith('on')) {
6111
- const msg = `Binding to event property '${name}' is disallowed for security reasons, ` +
6122
+ const errorMessage = `Binding to event property '${name}' is disallowed for security reasons, ` +
6112
6123
  `please use (${name.slice(2)})=...` +
6113
6124
  `\nIf '${name}' is a directive input, make sure the directive is imported by the` +
6114
6125
  ` current module.`;
6115
- throw new Error(msg);
6126
+ throw new RuntimeError(306 /* INVALID_EVENT_BINDING */, errorMessage);
6116
6127
  }
6117
6128
  }
6118
6129
  function validateAgainstEventAttributes(name) {
6119
6130
  if (name.toLowerCase().startsWith('on')) {
6120
- const msg = `Binding to event attribute '${name}' is disallowed for security reasons, ` +
6131
+ const errorMessage = `Binding to event attribute '${name}' is disallowed for security reasons, ` +
6121
6132
  `please use (${name.slice(2)})=...`;
6122
- throw new Error(msg);
6133
+ throw new RuntimeError(306 /* INVALID_EVENT_BINDING */, errorMessage);
6123
6134
  }
6124
6135
  }
6125
6136
  function getSanitizer() {
@@ -6439,7 +6450,6 @@ function discoverLocalRefs(lView, nodeIndex) {
6439
6450
  * Use of this source code is governed by an MIT-style license that can be
6440
6451
  * found in the LICENSE file at https://angular.io/license
6441
6452
  */
6442
- const ERROR_TYPE = 'ngType';
6443
6453
  const ERROR_ORIGINAL_ERROR = 'ngOriginalError';
6444
6454
  const ERROR_LOGGER = 'ngErrorLogger';
6445
6455
  function wrappedError(message, originalError) {
@@ -6448,17 +6458,6 @@ function wrappedError(message, originalError) {
6448
6458
  error[ERROR_ORIGINAL_ERROR] = originalError;
6449
6459
  return error;
6450
6460
  }
6451
-
6452
- /**
6453
- * @license
6454
- * Copyright Google LLC All Rights Reserved.
6455
- *
6456
- * Use of this source code is governed by an MIT-style license that can be
6457
- * found in the LICENSE file at https://angular.io/license
6458
- */
6459
- function getType(error) {
6460
- return error[ERROR_TYPE];
6461
- }
6462
6461
  function getOriginalError(error) {
6463
6462
  return error[ERROR_ORIGINAL_ERROR];
6464
6463
  }
@@ -6703,7 +6702,7 @@ function maybeUnwrapFn(value) {
6703
6702
  */
6704
6703
  /** Called when there are multiple component selectors that match a given node */
6705
6704
  function throwMultipleComponentError(tNode) {
6706
- throw new RuntimeError("300" /* MULTIPLE_COMPONENTS_MATCH */, `Multiple components match node with tagname ${tNode.value}`);
6705
+ throw new RuntimeError(-300 /* MULTIPLE_COMPONENTS_MATCH */, `Multiple components match node with tagname ${tNode.value}`);
6707
6706
  }
6708
6707
  /** Throws an ExpressionChangedAfterChecked error if checkNoChanges mode is on. */
6709
6708
  function throwErrorIfNoChangesMode(creationMode, oldValue, currValue, propName) {
@@ -6714,9 +6713,7 @@ function throwErrorIfNoChangesMode(creationMode, oldValue, currValue, propName)
6714
6713
  ` It seems like the view has been created after its parent and its children have been dirty checked.` +
6715
6714
  ` Has it been created in a change detection hook?`;
6716
6715
  }
6717
- // TODO: include debug context, see `viewDebugError` function in
6718
- // `packages/core/src/view/errors.ts` for reference.
6719
- throw new RuntimeError("100" /* EXPRESSION_CHANGED_AFTER_CHECKED */, msg);
6716
+ throw new RuntimeError(-100 /* EXPRESSION_CHANGED_AFTER_CHECKED */, msg);
6720
6717
  }
6721
6718
  function constructDetailsForInterpolation(lView, rootIndex, expressionIndex, meta, changedValue) {
6722
6719
  const [propName, prefix, ...chunks] = meta.split(INTERPOLATION_DELIMITER);
@@ -6983,8 +6980,9 @@ function createElementNode(renderer, name, namespace) {
6983
6980
  return renderer.createElement(name, namespace);
6984
6981
  }
6985
6982
  else {
6986
- return namespace === null ? renderer.createElement(name) :
6987
- renderer.createElementNS(namespace, name);
6983
+ const namespaceUri = namespace !== null ? getNamespaceUri(namespace) : null;
6984
+ return namespaceUri === null ? renderer.createElement(name) :
6985
+ renderer.createElementNS(namespaceUri, name);
6988
6986
  }
6989
6987
  }
6990
6988
  /**
@@ -10126,7 +10124,7 @@ function matchingSchemas(tView, tagName) {
10126
10124
  */
10127
10125
  function logUnknownPropertyError(propName, tNode) {
10128
10126
  let message = `Can't bind to '${propName}' since it isn't a known property of '${tNode.value}'.`;
10129
- console.error(formatRuntimeError("303" /* UNKNOWN_BINDING */, message));
10127
+ console.error(formatRuntimeError(303 /* UNKNOWN_BINDING */, message));
10130
10128
  }
10131
10129
  /**
10132
10130
  * Instantiate a root component.
@@ -10379,7 +10377,7 @@ function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {
10379
10377
  for (let i = 0; i < localRefs.length; i += 2) {
10380
10378
  const index = exportsMap[localRefs[i + 1]];
10381
10379
  if (index == null)
10382
- throw new RuntimeError("301" /* EXPORT_NOT_FOUND */, `Export of name '${localRefs[i + 1]}' not found!`);
10380
+ throw new RuntimeError(-301 /* EXPORT_NOT_FOUND */, `Export of name '${localRefs[i + 1]}' not found!`);
10383
10381
  localNames.push(localRefs[i], index);
10384
10382
  }
10385
10383
  }
@@ -11305,7 +11303,10 @@ class R3Injector {
11305
11303
  }
11306
11304
  assertNotDestroyed() {
11307
11305
  if (this._destroyed) {
11308
- throw new Error('Injector has already been destroyed.');
11306
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
11307
+ 'Injector has already been destroyed.' :
11308
+ '';
11309
+ throw new RuntimeError(205 /* INJECTOR_ALREADY_DESTROYED */, errorMessage);
11309
11310
  }
11310
11311
  }
11311
11312
  /**
@@ -11469,21 +11470,28 @@ function injectableDefOrInjectorDefFactory(token) {
11469
11470
  // InjectionTokens should have an injectable def (ɵprov) and thus should be handled above.
11470
11471
  // If it's missing that, it's an error.
11471
11472
  if (token instanceof InjectionToken) {
11472
- throw new Error(`Token ${stringify(token)} is missing a ɵprov definition.`);
11473
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
11474
+ `Token ${stringify(token)} is missing a ɵprov definition.` :
11475
+ '';
11476
+ throw new RuntimeError(204 /* INVALID_INJECTION_TOKEN */, errorMessage);
11473
11477
  }
11474
11478
  // Undecorated types can sometimes be created if they have no constructor arguments.
11475
11479
  if (token instanceof Function) {
11476
11480
  return getUndecoratedInjectableFactory(token);
11477
11481
  }
11478
11482
  // There was no way to resolve a factory for this token.
11479
- throw new Error('unreachable');
11483
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ? 'unreachable' : '';
11484
+ throw new RuntimeError(204 /* INVALID_INJECTION_TOKEN */, errorMessage);
11480
11485
  }
11481
11486
  function getUndecoratedInjectableFactory(token) {
11482
11487
  // If the token has parameters then it has dependencies that we cannot resolve implicitly.
11483
11488
  const paramLength = token.length;
11484
11489
  if (paramLength > 0) {
11485
11490
  const args = newArray(paramLength, '?');
11486
- throw new Error(`Can't resolve all parameters for ${stringify(token)}: (${args.join(', ')}).`);
11491
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
11492
+ `Can't resolve all parameters for ${stringify(token)}: (${args.join(', ')}).` :
11493
+ '';
11494
+ throw new RuntimeError(204 /* INVALID_INJECTION_TOKEN */, errorMessage);
11487
11495
  }
11488
11496
  // The constructor function appears to have no parameters.
11489
11497
  // This might be because it inherits from a super-class. In which case, use an injectable
@@ -12342,7 +12350,10 @@ function ɵɵInheritDefinitionFeature(definition) {
12342
12350
  }
12343
12351
  else {
12344
12352
  if (superType.ɵcmp) {
12345
- throw new Error('Directives cannot inherit Components');
12353
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
12354
+ 'Directives cannot inherit Components' :
12355
+ '';
12356
+ throw new RuntimeError(903 /* INVALID_INHERITANCE */, errorMessage);
12346
12357
  }
12347
12358
  // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
12348
12359
  superDef = superType.ɵdir;
@@ -14604,7 +14615,7 @@ function logUnknownElementError(tView, element, tNode, hasDirectives) {
14604
14615
  message +=
14605
14616
  `2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.`;
14606
14617
  }
14607
- console.error(formatRuntimeError("304" /* UNKNOWN_ELEMENT */, message));
14618
+ console.error(formatRuntimeError(304 /* UNKNOWN_ELEMENT */, message));
14608
14619
  }
14609
14620
  }
14610
14621
  }
@@ -19123,7 +19134,9 @@ function applyMutableOpCodes(tView, mutableOpCodes, lView, anchorRNode) {
19123
19134
  setElementAttribute(renderer, getNativeByIndex(elementNodeIndex, lView), null, null, attrName, attrValue, null);
19124
19135
  break;
19125
19136
  default:
19126
- throw new Error(`Unable to determine the type of mutate operation for "${opCode}"`);
19137
+ if (ngDevMode) {
19138
+ throw new RuntimeError(700 /* INVALID_I18N_STRUCTURE */, `Unable to determine the type of mutate operation for "${opCode}"`);
19139
+ }
19127
19140
  }
19128
19141
  }
19129
19142
  else {
@@ -19749,7 +19762,7 @@ function i18nStartFirstCreatePass(tView, parentTNodeIndex, lView, index, message
19749
19762
  };
19750
19763
  }
19751
19764
  /**
19752
- * Allocate space in i18n Range add create OpCode instruction to crete a text or comment node.
19765
+ * Allocate space in i18n Range add create OpCode instruction to create a text or comment node.
19753
19766
  *
19754
19767
  * @param tView Current `TView` needed to allocate space in i18n range.
19755
19768
  * @param rootTNode Root `TNode` of the i18n block. This node determines if the new TNode will be
@@ -20850,6 +20863,9 @@ class ComponentRef$1 {
20850
20863
  * @see [Dynamic Components](guide/dynamic-component-loader)
20851
20864
  *
20852
20865
  * @publicApi
20866
+ *
20867
+ * @deprecated Angular no longer requires Component factories. Please use other APIs where
20868
+ * Component class can be used directly.
20853
20869
  */
20854
20870
  class ComponentFactory$1 {
20855
20871
  }
@@ -20886,6 +20902,9 @@ class _NullComponentFactoryResolver {
20886
20902
  * does **not** require resolving component factory: component class can be used directly.
20887
20903
  *
20888
20904
  * @publicApi
20905
+ *
20906
+ * @deprecated Angular no longer requires Component factories. Please use other APIs where
20907
+ * Component class can be used directly.
20889
20908
  */
20890
20909
  class ComponentFactoryResolver$1 {
20891
20910
  }
@@ -21050,7 +21069,7 @@ class Version {
21050
21069
  /**
21051
21070
  * @publicApi
21052
21071
  */
21053
- const VERSION = new Version('13.2.0-next.1');
21072
+ const VERSION = new Version('13.2.0');
21054
21073
 
21055
21074
  /**
21056
21075
  * @license
@@ -21386,7 +21405,8 @@ class ViewRef$1 {
21386
21405
  }
21387
21406
  attachToViewContainerRef() {
21388
21407
  if (this._appRef) {
21389
- 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);
21390
21410
  }
21391
21411
  this._attachedToViewContainer = true;
21392
21412
  }
@@ -21396,7 +21416,8 @@ class ViewRef$1 {
21396
21416
  }
21397
21417
  attachToAppRef(appRef) {
21398
21418
  if (this._attachedToViewContainer) {
21399
- 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);
21400
21421
  }
21401
21422
  this._appRef = appRef;
21402
21423
  }
@@ -21788,7 +21809,7 @@ class NgModuleRef extends NgModuleRef$1 {
21788
21809
  }
21789
21810
  ], stringify(ngModuleType));
21790
21811
  // We need to resolve the injector types separately from the injector creation, because
21791
- // 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
21792
21813
  // circular error that will eventually error out, because the injector isn't created yet.
21793
21814
  this._r3Injector._resolveInjectorDefTypes();
21794
21815
  this.instance = this.get(ngModuleType);
@@ -22267,7 +22288,7 @@ function getPipeDef(name, registry) {
22267
22288
  const declarationLView = lView[DECLARATION_COMPONENT_VIEW];
22268
22289
  const context = declarationLView[CONTEXT];
22269
22290
  const component = context ? ` in the '${context.constructor.name}' component` : '';
22270
- 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}!`);
22271
22292
  }
22272
22293
  }
22273
22294
  /**
@@ -24516,7 +24537,7 @@ const HostBinding = makePropDecorator('HostBinding', (hostPropertyName) => ({ ho
24516
24537
  * @HostListener('click', ['$event.target'])
24517
24538
  * onClick(btn) {
24518
24539
  * console.log('button', btn, 'number of clicks:', this.numberOfClicks++);
24519
- * }
24540
+ * }
24520
24541
  * }
24521
24542
  *
24522
24543
  * @Component({
@@ -25276,7 +25297,8 @@ class NgZone {
25276
25297
  forkInnerZoneWithAngularBehavior(self);
25277
25298
  }
25278
25299
  static isInAngularZone() {
25279
- return Zone.current.get('isAngularZone') === true;
25300
+ // Zone needs to be checked, because this method might be called even when NoopNgZone is used.
25301
+ return typeof Zone !== 'undefined' && Zone.current.get('isAngularZone') === true;
25280
25302
  }
25281
25303
  static assertInAngularZone() {
25282
25304
  if (!NgZone.isInAngularZone()) {
@@ -25860,7 +25882,7 @@ function createPlatform(injector) {
25860
25882
  const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
25861
25883
  'There can be only one platform. Destroy the previous one to create a new one.' :
25862
25884
  '';
25863
- throw new RuntimeError("400" /* MULTIPLE_PLATFORMS */, errorMessage);
25885
+ throw new RuntimeError(400 /* MULTIPLE_PLATFORMS */, errorMessage);
25864
25886
  }
25865
25887
  publishDefaultGlobalUtils();
25866
25888
  _platform = injector.get(PlatformRef);
@@ -25909,11 +25931,11 @@ function assertPlatform(requiredToken) {
25909
25931
  const platform = getPlatform();
25910
25932
  if (!platform) {
25911
25933
  const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ? 'No platform exists!' : '';
25912
- throw new RuntimeError("401" /* PLATFORM_NOT_FOUND */, errorMessage);
25934
+ throw new RuntimeError(401 /* PLATFORM_NOT_FOUND */, errorMessage);
25913
25935
  }
25914
25936
  if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
25915
25937
  !platform.injector.get(requiredToken, null)) {
25916
- throw new RuntimeError("400" /* MULTIPLE_PLATFORMS */, 'A platform with a different configuration has been created. Please destroy it first.');
25938
+ throw new RuntimeError(400 /* MULTIPLE_PLATFORMS */, 'A platform with a different configuration has been created. Please destroy it first.');
25917
25939
  }
25918
25940
  return platform;
25919
25941
  }
@@ -26000,7 +26022,7 @@ class PlatformRef {
26000
26022
  const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
26001
26023
  'No ErrorHandler. Is platform module (BrowserModule) included?' :
26002
26024
  '';
26003
- throw new RuntimeError("402" /* ERROR_HANDLER_NOT_FOUND */, errorMessage);
26025
+ throw new RuntimeError(402 /* ERROR_HANDLER_NOT_FOUND */, errorMessage);
26004
26026
  }
26005
26027
  ngZone.runOutsideAngular(() => {
26006
26028
  const subscription = ngZone.onError.subscribe({
@@ -26061,7 +26083,7 @@ class PlatformRef {
26061
26083
  `but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. ` +
26062
26084
  `Please define one of these.` :
26063
26085
  '';
26064
- throw new RuntimeError("403" /* BOOTSTRAP_COMPONENTS_NOT_FOUND */, errorMessage);
26086
+ throw new RuntimeError(403 /* BOOTSTRAP_COMPONENTS_NOT_FOUND */, errorMessage);
26065
26087
  }
26066
26088
  this._modules.push(moduleRef);
26067
26089
  }
@@ -26087,7 +26109,7 @@ class PlatformRef {
26087
26109
  const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
26088
26110
  'The platform has already been destroyed!' :
26089
26111
  '';
26090
- throw new RuntimeError("404" /* ALREADY_DESTROYED_PLATFORM */, errorMessage);
26112
+ throw new RuntimeError(404 /* ALREADY_DESTROYED_PLATFORM */, errorMessage);
26091
26113
  }
26092
26114
  this._modules.slice().forEach(module => module.destroy());
26093
26115
  this._destroyListeners.forEach(listener => listener());
@@ -26353,7 +26375,7 @@ class ApplicationRef {
26353
26375
  'Cannot bootstrap as there are still asynchronous initializers running. ' +
26354
26376
  'Bootstrap components in the `ngDoBootstrap` method of the root module.' :
26355
26377
  '';
26356
- throw new RuntimeError("405" /* ASYNC_INITIALIZERS_STILL_RUNNING */, errorMessage);
26378
+ throw new RuntimeError(405 /* ASYNC_INITIALIZERS_STILL_RUNNING */, errorMessage);
26357
26379
  }
26358
26380
  let componentFactory;
26359
26381
  if (componentOrFactory instanceof ComponentFactory$1) {
@@ -26403,7 +26425,7 @@ class ApplicationRef {
26403
26425
  const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
26404
26426
  'ApplicationRef.tick is called recursively' :
26405
26427
  '';
26406
- throw new RuntimeError("101" /* RECURSIVE_APPLICATION_REF_TICK */, errorMessage);
26428
+ throw new RuntimeError(101 /* RECURSIVE_APPLICATION_REF_TICK */, errorMessage);
26407
26429
  }
26408
26430
  try {
26409
26431
  this._runningTick = true;
@@ -27394,7 +27416,10 @@ class DefaultIterableDiffer {
27394
27416
  if (collection == null)
27395
27417
  collection = [];
27396
27418
  if (!isListLikeIterable(collection)) {
27397
- throw new Error(`Error trying to diff '${stringify(collection)}'. Only arrays and iterables are allowed`);
27419
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
27420
+ `Error trying to diff '${stringify(collection)}'. Only arrays and iterables are allowed` :
27421
+ '';
27422
+ throw new RuntimeError(900 /* INVALID_DIFFER_INPUT */, errorMessage);
27398
27423
  }
27399
27424
  if (this.check(collection)) {
27400
27425
  return this;
@@ -27995,7 +28020,10 @@ class DefaultKeyValueDiffer {
27995
28020
  map = new Map();
27996
28021
  }
27997
28022
  else if (!(map instanceof Map || isJsObject(map))) {
27998
- throw new Error(`Error trying to diff '${stringify(map)}'. Only maps and objects are allowed`);
28023
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
28024
+ `Error trying to diff '${stringify(map)}'. Only maps and objects are allowed` :
28025
+ '';
28026
+ throw new RuntimeError(900 /* INVALID_DIFFER_INPUT */, errorMessage);
27999
28027
  }
28000
28028
  return this.check(map) ? this : null;
28001
28029
  }
@@ -28242,7 +28270,10 @@ class IterableDiffers {
28242
28270
  return factory;
28243
28271
  }
28244
28272
  else {
28245
- throw new Error(`Cannot find a differ supporting object '${iterable}' of type '${getTypeNameForDebugging(iterable)}'`);
28273
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
28274
+ `Cannot find a differ supporting object '${iterable}' of type '${getTypeNameForDebugging(iterable)}'` :
28275
+ '';
28276
+ throw new RuntimeError(901 /* NO_SUPPORTING_DIFFER_FACTORY */, errorMessage);
28246
28277
  }
28247
28278
  }
28248
28279
  }
@@ -28316,7 +28347,10 @@ class KeyValueDiffers {
28316
28347
  if (factory) {
28317
28348
  return factory;
28318
28349
  }
28319
- throw new Error(`Cannot find a differ supporting object '${kv}'`);
28350
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
28351
+ `Cannot find a differ supporting object '${kv}'` :
28352
+ '';
28353
+ throw new RuntimeError(901 /* NO_SUPPORTING_DIFFER_FACTORY */, errorMessage);
28320
28354
  }
28321
28355
  }
28322
28356
  /** @nocollapse */