Skip to content
This repository has been archived by the owner on May 20, 2023. It is now read-only.

Commit

Permalink
Fix asserts to strictly accept a bool, not a closure.
Browse files Browse the repository at this point in the history
This is to prepare for the new language restriction: dart-lang/sdk#30326

PiperOrigin-RevId: 180941194
  • Loading branch information
Googler authored and nshahan committed Jan 9, 2018
1 parent ad53808 commit 8290364
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/utils/disposer/disposer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,7 @@ class Disposer implements Disposable {

// In dev-mode, throws if a oneShot disposer was already disposed.
void _checkIfAlreadyDisposed() {
assert(() {
if (_oneShot && _disposeCalled) {
throw new UnsupportedError(_oneShotDisposerMemoryLeakWarning);
}
return true;
});
assert(!(_oneShot && _disposeCalled), _oneShotDisposerMemoryLeakWarning);
}

@override
Expand Down

0 comments on commit 8290364

Please sign in to comment.