Skip to content

Commit d9956d8

Browse files
authored
Don't throw when invariant breaks (microsoft#182331)
1 parent 91070de commit d9956d8

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/vs/base/common/observableImpl/autorun.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import { BugIndicatingError } from 'vs/base/common/errors';
6+
import { assertFn } from 'vs/base/common/assert';
77
import { DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle';
88
import { IReader, IObservable, IObserver, IChangeContext } from 'vs/base/common/observableImpl/base';
99
import { getLogger } from 'vs/base/common/observableImpl/logging';
@@ -140,9 +140,7 @@ export class AutorunObserver<TChangeSummary = any> implements IObserver, IReader
140140
}
141141
this.updateCount--;
142142

143-
if (this.updateCount < 0) {
144-
throw new BugIndicatingError();
145-
}
143+
assertFn(() => this.updateCount >= 0);
146144
}
147145

148146
public handlePossibleChange(observable: IObservable<any>): void {

0 commit comments

Comments
 (0)