@angular/core 13.3.4 → 13.3.7

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v13.3.4
2
+ * @license Angular v13.3.7
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
package/fesm2020/core.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v13.3.4
2
+ * @license Angular v13.3.7
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1850,8 +1850,16 @@ function updateTransplantedViewCount(lContainer, amount) {
1850
1850
  const instructionState = {
1851
1851
  lFrame: createLFrame(null),
1852
1852
  bindingsEnabled: true,
1853
- isInCheckNoChangesMode: false,
1854
1853
  };
1854
+ /**
1855
+ * In this mode, any changes in bindings will throw an ExpressionChangedAfterChecked error.
1856
+ *
1857
+ * Necessary to support ChangeDetectorRef.checkNoChanges().
1858
+ *
1859
+ * The `checkNoChanges` function is invoked only in ngDevMode=true and verifies that no unintended
1860
+ * changes exist in the change detector or its children.
1861
+ */
1862
+ let _isInCheckNoChangesMode = false;
1855
1863
  /**
1856
1864
  * Returns true if the instruction state stack is empty.
1857
1865
  *
@@ -1978,11 +1986,12 @@ function getContextLView() {
1978
1986
  return instructionState.lFrame.contextLView;
1979
1987
  }
1980
1988
  function isInCheckNoChangesMode() {
1981
- // TODO(misko): remove this from the LView since it is ngDevMode=true mode only.
1982
- return instructionState.isInCheckNoChangesMode;
1989
+ !ngDevMode && throwError('Must never be called in production mode');
1990
+ return _isInCheckNoChangesMode;
1983
1991
  }
1984
1992
  function setIsInCheckNoChangesMode(mode) {
1985
- instructionState.isInCheckNoChangesMode = mode;
1993
+ !ngDevMode && throwError('Must never be called in production mode');
1994
+ _isInCheckNoChangesMode = mode;
1986
1995
  }
1987
1996
  // top level variables should not be exported for performance reasons (PERF_NOTES.md)
1988
1997
  function getBindingRoot() {
@@ -8402,7 +8411,7 @@ const NO_CHANGE = (typeof ngDevMode === 'undefined' || ngDevMode) ? { __brand__:
8402
8411
  */
8403
8412
  function ɵɵadvance(delta) {
8404
8413
  ngDevMode && assertGreaterThan(delta, 0, 'Can only advance forward');
8405
- selectIndexInternal(getTView(), getLView(), getSelectedIndex() + delta, isInCheckNoChangesMode());
8414
+ selectIndexInternal(getTView(), getLView(), getSelectedIndex() + delta, !!ngDevMode && isInCheckNoChangesMode());
8406
8415
  }
8407
8416
  function selectIndexInternal(tView, lView, index, checkNoChangesMode) {
8408
8417
  ngDevMode && assertIndexInDeclRange(lView, index);
@@ -9493,7 +9502,7 @@ function refreshView(tView, lView, templateFn, context) {
9493
9502
  enterView(lView);
9494
9503
  // Check no changes mode is a dev only mode used to verify that bindings have not changed
9495
9504
  // since they were assigned. We do not want to execute lifecycle hooks in that mode.
9496
- const isInCheckNoChangesPass = isInCheckNoChangesMode();
9505
+ const isInCheckNoChangesPass = ngDevMode && isInCheckNoChangesMode();
9497
9506
  try {
9498
9507
  resetPreOrderHookFlags(lView);
9499
9508
  setBindingIndex(tView.bindingStartIndex);
@@ -9603,10 +9612,13 @@ function refreshView(tView, lView, templateFn, context) {
9603
9612
  }
9604
9613
  function renderComponentOrTemplate(tView, lView, templateFn, context) {
9605
9614
  const rendererFactory = lView[RENDERER_FACTORY];
9606
- const normalExecutionPath = !isInCheckNoChangesMode();
9615
+ // Check no changes mode is a dev only mode used to verify that bindings have not changed
9616
+ // since they were assigned. We do not want to invoke renderer factory functions in that mode
9617
+ // to avoid any possible side-effects.
9618
+ const checkNoChangesMode = !!ngDevMode && isInCheckNoChangesMode();
9607
9619
  const creationModeIsActive = isCreationMode(lView);
9608
9620
  try {
9609
- if (normalExecutionPath && !creationModeIsActive && rendererFactory.begin) {
9621
+ if (!checkNoChangesMode && !creationModeIsActive && rendererFactory.begin) {
9610
9622
  rendererFactory.begin();
9611
9623
  }
9612
9624
  if (creationModeIsActive) {
@@ -9615,7 +9627,7 @@ function renderComponentOrTemplate(tView, lView, templateFn, context) {
9615
9627
  refreshView(tView, lView, templateFn, context);
9616
9628
  }
9617
9629
  finally {
9618
- if (normalExecutionPath && !creationModeIsActive && rendererFactory.end) {
9630
+ if (!checkNoChangesMode && !creationModeIsActive && rendererFactory.end) {
9619
9631
  rendererFactory.end();
9620
9632
  }
9621
9633
  }
@@ -9628,7 +9640,7 @@ function executeTemplate(tView, lView, templateFn, rf, context) {
9628
9640
  if (isUpdatePhase && lView.length > HEADER_OFFSET) {
9629
9641
  // When we're updating, inherently select 0 so we don't
9630
9642
  // have to generate that instruction for most update blocks.
9631
- selectIndexInternal(tView, lView, HEADER_OFFSET, isInCheckNoChangesMode());
9643
+ selectIndexInternal(tView, lView, HEADER_OFFSET, !!ngDevMode && isInCheckNoChangesMode());
9632
9644
  }
9633
9645
  const preHookType = isUpdatePhase ? 2 /* TemplateUpdateStart */ : 0 /* TemplateCreateStart */;
9634
9646
  profiler(preHookType, context);
@@ -21142,7 +21154,7 @@ class Version {
21142
21154
  /**
21143
21155
  * @publicApi
21144
21156
  */
21145
- const VERSION = new Version('13.3.4');
21157
+ const VERSION = new Version('13.3.7');
21146
21158
 
21147
21159
  /**
21148
21160
  * @license
@@ -21474,7 +21486,9 @@ class ViewRef$1 {
21474
21486
  * introduce other changes.
21475
21487
  */
21476
21488
  checkNoChanges() {
21477
- checkNoChangesInternal(this._lView[TVIEW], this._lView, this.context);
21489
+ if (ngDevMode) {
21490
+ checkNoChangesInternal(this._lView[TVIEW], this._lView, this.context);
21491
+ }
21478
21492
  }
21479
21493
  attachToViewContainerRef() {
21480
21494
  if (this._appRef) {
@@ -21505,7 +21519,9 @@ class RootViewRef extends ViewRef$1 {
21505
21519
  detectChangesInRootView(this._view);
21506
21520
  }
21507
21521
  checkNoChanges() {
21508
- checkNoChangesInRootView(this._view);
21522
+ if (ngDevMode) {
21523
+ checkNoChangesInRootView(this._view);
21524
+ }
21509
21525
  }
21510
21526
  get context() {
21511
21527
  return null;