Remove upper case constants (#56)
Remove usage of upper-case constants.
diff --git a/CHANGELOG.md b/CHANGELOG.md
index dc79f29..08c8734 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,7 @@
## 2.0.7
* Fix Dart 2 runtime errors.
+* Stop using deprecated constants from the SDK.
## 2.0.6
diff --git a/lib/src/async_cache.dart b/lib/src/async_cache.dart
index af52cd0..8c25267 100644
--- a/lib/src/async_cache.dart
+++ b/lib/src/async_cache.dart
@@ -42,7 +42,7 @@
/// An ephemeral cache guarantees that a callback function will only be
/// executed at most once concurrently. This is useful for requests for which
/// data is updated frequently but stale data is acceptable.
- factory AsyncCache.ephemeral() => new AsyncCache(Duration.ZERO);
+ factory AsyncCache.ephemeral() => new AsyncCache(Duration.zero);
/// Creates a cache that invalidates its contents after [duration] has passed.
///
diff --git a/pubspec.yaml b/pubspec.yaml
index ae09136..e1ca801 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
name: async
-version: 2.0.7-dev
+version: 2.0.7
author: Dart Team <misc@dartlang.org>
description: Utility functions and classes related to the 'dart:async' library.
homepage: https://www.github.com/dart-lang/async
diff --git a/test/stream_group_test.dart b/test/stream_group_test.dart
index 95eb8c1..d94f4d0 100644
--- a/test/stream_group_test.dart
+++ b/test/stream_group_test.dart
@@ -721,4 +721,4 @@
}
/// Wait for all microtasks to complete.
-Future flushMicrotasks() => new Future.delayed(Duration.ZERO);
+Future flushMicrotasks() => new Future.delayed(Duration.zero);
diff --git a/test/stream_splitter_test.dart b/test/stream_splitter_test.dart
index 68a6b74..70266ee 100644
--- a/test/stream_splitter_test.dart
+++ b/test/stream_splitter_test.dart
@@ -289,4 +289,4 @@
}
/// Wait for all microtasks to complete.
-Future flushMicrotasks() => new Future.delayed(Duration.ZERO);
+Future flushMicrotasks() => new Future.delayed(Duration.zero);
diff --git a/test/typed_wrapper/future_test.dart b/test/typed_wrapper/future_test.dart
index 0c8b00a..7fb91c8 100644
--- a/test/typed_wrapper/future_test.dart
+++ b/test/typed_wrapper/future_test.dart
@@ -61,12 +61,12 @@
expect(
new TypeSafeFuture<int>(new Completer<Object>().future)
- .timeout(Duration.ZERO),
+ .timeout(Duration.zero),
throwsA(new isInstanceOf<TimeoutException>()));
expect(
new TypeSafeFuture<int>(new Completer<Object>().future)
- .timeout(Duration.ZERO, onTimeout: expectAsync0(() => 15)),
+ .timeout(Duration.zero, onTimeout: expectAsync0(() => 15)),
completion(equals(15)));
});
});
@@ -100,7 +100,7 @@
expect(
new TypeSafeFuture<int>(new Completer<Object>().future)
- .timeout(Duration.ZERO, onTimeout: expectAsync0(() => "foo"))
+ .timeout(Duration.zero, onTimeout: expectAsync0(() => "foo"))
.then((_) {}),
throwsCastError);
});
diff --git a/test/utils.dart b/test/utils.dart
index 9270886..39df0f6 100644
--- a/test/utils.dart
+++ b/test/utils.dart
@@ -9,7 +9,7 @@
import "package:test/test.dart";
/// A zero-millisecond timer should wait until after all microtasks.
-Future flushMicrotasks() => new Future.delayed(Duration.ZERO);
+Future flushMicrotasks() => new Future.delayed(Duration.zero);
typedef void OptionalArgAction([a, b]);