Fix deprecated zone API usage (dart-lang/watcher#95)
diff --git a/pkgs/watcher/.travis.yml b/pkgs/watcher/.travis.yml index a3bc070..2c6dc5a 100644 --- a/pkgs/watcher/.travis.yml +++ b/pkgs/watcher/.travis.yml
@@ -2,7 +2,7 @@ dart: - dev -- 2.2.0 +- 2.8.4 os: - linux @@ -16,7 +16,7 @@ include: - dart: dev dart_task: dartfmt - - dart: 2.2.0 + - dart: 2.8.4 dart_task: dartanalyzer: --fatal-warnings . - dart: dev
diff --git a/pkgs/watcher/CHANGELOG.md b/pkgs/watcher/CHANGELOG.md index a98ae20..881aa2f 100644 --- a/pkgs/watcher/CHANGELOG.md +++ b/pkgs/watcher/CHANGELOG.md
@@ -1,6 +1,7 @@ -# 0.9.8 +# 0.9.8-dev * Add the ability to create custom Watcher types for specific file paths. +* Require at least Dart 2.8.4. # 0.9.7+15
diff --git a/pkgs/watcher/lib/src/directory_watcher/windows.dart b/pkgs/watcher/lib/src/directory_watcher/windows.dart index f5093c5..ae4670d 100644 --- a/pkgs/watcher/lib/src/directory_watcher/windows.dart +++ b/pkgs/watcher/lib/src/directory_watcher/windows.dart
@@ -379,11 +379,11 @@ void _startWatch() { // Note: "watcher closed" exceptions do not get sent over the stream // returned by watch, and must be caught via a zone handler. - runZoned(() { + runZonedGuarded(() { var innerStream = Directory(path).watch(recursive: true); _watchSubscription = innerStream.listen(_onEvent, onError: _eventsController.addError, onDone: _onDone); - }, onError: (error, StackTrace stackTrace) { + }, (error, StackTrace stackTrace) { if (error is FileSystemException && error.message.startsWith('Directory watcher closed unexpectedly')) { _watchSubscription.cancel();
diff --git a/pkgs/watcher/pubspec.yaml b/pkgs/watcher/pubspec.yaml index e86192d..c4cafad 100644 --- a/pkgs/watcher/pubspec.yaml +++ b/pkgs/watcher/pubspec.yaml
@@ -1,13 +1,13 @@ name: watcher -version: 0.9.7+15 +version: 0.9.8-dev description: >- A file system watcher. It monitors changes to contents of directories and sends notifications when files have been added, removed, or modified. -homepage: https://github.com/dart-lang/watcher +repository: https://github.com/dart-lang/watcher environment: - sdk: '>=2.2.0 <3.0.0' + sdk: '>=2.8.4 <3.0.0' dependencies: async: ^2.0.0