Skip to content

Commit

Permalink
Enable generics for waitFor and require Dart 1.21+ in the pubspec SDK…
Browse files Browse the repository at this point in the history
… range (#131)
  • Loading branch information
travissanderson-wf authored and DrMarcII committed Jan 11, 2017
1 parent 4a496c5 commit 00bf9f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/support/async.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ const defaultTimeout = const Duration(seconds: 5);

const clock = const Clock();

Future/*<T>*/ waitFor/*<T>*/(/*=T*/ condition(),
Future<T> waitFor<T>(T condition(),
{matcher: null,
Duration timeout: defaultTimeout,
Duration interval: defaultInterval}) =>
clock.waitFor/*<T>*/(condition,
clock.waitFor<T>(condition,
matcher: matcher, timeout: timeout, interval: interval);

class Clock {
Expand All @@ -50,7 +50,7 @@ class Clock {
/// is returned. Otherwise, if [condition] throws, then that exception is
/// rethrown. If [condition] doesn't throw then an [expect] exception is
/// thrown.
Future/*<T>*/ waitFor/*<T>*/(/*=T*/ condition(),
Future<T> waitFor<T>(T condition(),
{matcher: null,
Duration timeout: defaultTimeout,
Duration interval: defaultInterval}) async {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: >
and as such, require the use of the WebDriver remote server.
homepage: https://github.com/google/webdriver.dart
environment:
sdk: '>=1.10.0 <2.0.0'
sdk: '>=1.21.0 <2.0.0'
dependencies:
archive: '^1.0.20'
matcher: '^0.12.0+1'
Expand Down

0 comments on commit 00bf9f1

Please sign in to comment.