Skip to content

Commit efc4fc2

Browse files
committed
Uses assertFn instead of BugIndicatingError
1 parent 695ed7f commit efc4fc2

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/vs/base/common/observableInternal/derived.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
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';
7-
import { IDisposable, DisposableStore } from 'vs/base/common/lifecycle';
8-
import { IReader, IObservable, BaseObservable, IObserver, _setDerivedOpts, IChangeContext, getFunctionName, DebugNameFn, getDebugName, Owner } from 'vs/base/common/observableInternal/base';
6+
import { assertFn } from 'vs/base/common/assert';
7+
import { DisposableStore, IDisposable } from 'vs/base/common/lifecycle';
8+
import { BaseObservable, DebugNameFn, IChangeContext, IObservable, IObserver, IReader, Owner, _setDerivedOpts, getDebugName, getFunctionName } from 'vs/base/common/observableInternal/base';
99
import { getLogger } from 'vs/base/common/observableInternal/logging';
1010

1111
export type EqualityComparer<T> = (a: T, b: T) => boolean;
@@ -300,9 +300,7 @@ export class Derived<T, TChangeSummary = any> extends BaseObservable<T, void> im
300300
r.endUpdate(this);
301301
}
302302
}
303-
if (this.updateCount < 0) {
304-
throw new BugIndicatingError();
305-
}
303+
assertFn(() => this.updateCount >= 0);
306304
}
307305

308306
public handlePossibleChange<T>(observable: IObservable<T, unknown>): void {

0 commit comments

Comments
 (0)