Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Unified Diff: pkg/analyzer/lib/src/dart/analysis/file_state.dart

Issue 2834533002: Fix front-end tests: the original code is correct, this is a workaround for issue #29393 (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/analysis/file_state.dart
diff --git a/pkg/analyzer/lib/src/dart/analysis/file_state.dart b/pkg/analyzer/lib/src/dart/analysis/file_state.dart
index 1c45917e8ef2430d05e2090cb2d36114bf6bf85b..2519e41dc04fadd83683a5fe17e56dc2ae62786b 100644
--- a/pkg/analyzer/lib/src/dart/analysis/file_state.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/file_state.dart
@@ -825,14 +825,17 @@ class FileSystemState {
void _scheduleKnownFilesSetChange() {
Duration delay = _knownFilesSetChangesDelay ?? new Duration(seconds: 1);
- _knownFilesSetChangesTimer ??= new Timer(delay, () {
- Set<String> addedFiles = _addedKnownFiles.toSet();
- Set<String> removedFiles = new Set<String>();
- _knownFilesSetChangesController
- .add(new KnownFilesSetChange(addedFiles, removedFiles));
- _addedKnownFiles.clear();
- _knownFilesSetChangesTimer = null;
- });
+ // Note: we don't use ??= here due to issue #29393
+ if (_knownFilesSetChangesTimer == null) {
+ _knownFilesSetChangesTimer = new Timer(delay, () {
+ Set<String> addedFiles = _addedKnownFiles.toSet();
+ Set<String> removedFiles = new Set<String>();
+ _knownFilesSetChangesController
+ .add(new KnownFilesSetChange(addedFiles, removedFiles));
+ _addedKnownFiles.clear();
+ _knownFilesSetChangesTimer = null;
+ });
+ }
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698