Update signatures for implementation of Iterable.singleWhere (#63)
* Update signatures for implementation of Iterable.singleWhere
* Add an check if orElse is passed in
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 50deb7f..0292123 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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
diff --git a/lib/dom.dart b/lib/dom.dart
index fb0d458..df9655e 100644
--- a/lib/dom.dart
+++ b/lib/dom.dart
@@ -951,7 +951,8 @@
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);
}
diff --git a/pubspec.yaml b/pubspec.yaml
index acbe3f6..59f1650 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -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