Skip to content

Commit

Permalink
Update signatures for implementation of Iterable.singleWhere (#63)
Browse files Browse the repository at this point in the history
* Update signatures for implementation of Iterable.singleWhere

* Add an check if orElse is passed in
  • Loading branch information
keertip authored Jan 9, 2018
1 parent fda417f commit 82bea83
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.13.2+2

* Update signature for implementations of `Iterable.singleWhere` to include
optional argument.

## 0.13.2+1

* Changed the implementation of `Set` and `List` classes to use base classes
Expand Down
3 changes: 2 additions & 1 deletion lib/dom.dart
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,8 @@ class FilteredElementList extends IterableBase<Element>
return _filtered.lastWhere(test, orElse: orElse);
}

Element singleWhere(bool test(Element value)) {
Element singleWhere(bool test(Element value), {Element orElse()}) {
if (orElse != null) throw new UnimplementedError('orElse');
return _filtered.singleWhere(test);
}

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: html
version: 0.13.2+1
version: 0.13.2+2
author: Dart Team <misc@dartlang.org>
description: A library for working with HTML documents. Previously known as html5lib.
homepage: https://github.com/dart-lang/html
Expand Down

0 comments on commit 82bea83

Please sign in to comment.