@angular/core 19.0.0-next.4 → 19.0.0-next.5

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/fesm2022/core.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v19.0.0-next.4
2
+ * @license Angular v19.0.0-next.5
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -3009,7 +3009,7 @@ class R3Injector extends EnvironmentInjector {
3009
3009
  * hook was found.
3010
3010
  */
3011
3011
  destroy() {
3012
- this.assertNotDestroyed();
3012
+ assertNotDestroyed(this);
3013
3013
  // Set destroyed = true first, in case lifecycle hooks re-enter destroy().
3014
3014
  this._destroyed = true;
3015
3015
  const prevConsumer = setActiveConsumer$1(null);
@@ -3035,12 +3035,12 @@ class R3Injector extends EnvironmentInjector {
3035
3035
  }
3036
3036
  }
3037
3037
  onDestroy(callback) {
3038
- this.assertNotDestroyed();
3038
+ assertNotDestroyed(this);
3039
3039
  this._onDestroyHooks.push(callback);
3040
3040
  return () => this.removeOnDestroy(callback);
3041
3041
  }
3042
3042
  runInContext(fn) {
3043
- this.assertNotDestroyed();
3043
+ assertNotDestroyed(this);
3044
3044
  const previousInjector = setCurrentInjector(this);
3045
3045
  const previousInjectImplementation = setInjectImplementation(undefined);
3046
3046
  let prevInjectContext;
@@ -3057,7 +3057,7 @@ class R3Injector extends EnvironmentInjector {
3057
3057
  }
3058
3058
  }
3059
3059
  get(token, notFoundValue = THROW_IF_NOT_FOUND, flags = InjectFlags.Default) {
3060
- this.assertNotDestroyed();
3060
+ assertNotDestroyed(this);
3061
3061
  if (token.hasOwnProperty(NG_ENV_ID)) {
3062
3062
  return token[NG_ENV_ID](this);
3063
3063
  }
@@ -3167,11 +3167,6 @@ class R3Injector extends EnvironmentInjector {
3167
3167
  }
3168
3168
  return `R3Injector[${tokens.join(', ')}]`;
3169
3169
  }
3170
- assertNotDestroyed() {
3171
- if (this._destroyed) {
3172
- throw new RuntimeError(205 /* RuntimeErrorCode.INJECTOR_ALREADY_DESTROYED */, ngDevMode && 'Injector has already been destroyed.');
3173
- }
3174
- }
3175
3170
  /**
3176
3171
  * Process a `SingleProvider` and add it.
3177
3172
  */
@@ -3357,6 +3352,11 @@ function providerToFactory(provider, ngModuleType, providers) {
3357
3352
  }
3358
3353
  return factory;
3359
3354
  }
3355
+ function assertNotDestroyed(injector) {
3356
+ if (injector.destroyed) {
3357
+ throw new RuntimeError(205 /* RuntimeErrorCode.INJECTOR_ALREADY_DESTROYED */, ngDevMode && 'Injector has already been destroyed.');
3358
+ }
3359
+ }
3360
3360
  function makeRecord(factory, value, multi = false) {
3361
3361
  return {
3362
3362
  factory: factory,
@@ -3405,7 +3405,7 @@ function forEachSingleProvider(providers, fn) {
3405
3405
  */
3406
3406
  function runInInjectionContext(injector, fn) {
3407
3407
  if (injector instanceof R3Injector) {
3408
- injector.assertNotDestroyed();
3408
+ assertNotDestroyed(injector);
3409
3409
  }
3410
3410
  let prevInjectorProfilerContext;
3411
3411
  if (ngDevMode) {
@@ -16962,7 +16962,7 @@ function createRootComponent(componentView, rootComponentDef, rootDirectives, ho
16962
16962
  function setRootNodeAttributes(hostRenderer, componentDef, hostRNode, rootSelectorOrNode) {
16963
16963
  if (rootSelectorOrNode) {
16964
16964
  // The placeholder will be replaced with the actual version at build time.
16965
- setUpAttributes(hostRenderer, hostRNode, ['ng-version', '19.0.0-next.4']);
16965
+ setUpAttributes(hostRenderer, hostRNode, ['ng-version', '19.0.0-next.5']);
16966
16966
  }
16967
16967
  else {
16968
16968
  // If host element is created as a part of this function call (i.e. `rootSelectorOrNode`
@@ -31052,7 +31052,7 @@ class Version {
31052
31052
  /**
31053
31053
  * @publicApi
31054
31054
  */
31055
- const VERSION = new Version('19.0.0-next.4');
31055
+ const VERSION = new Version('19.0.0-next.5');
31056
31056
 
31057
31057
  /*
31058
31058
  * This file exists to support compilation of @angular/core in Ivy mode.