Skip to content
This repository was archived by the owner on Nov 1, 2024. It is now read-only.

Commit 82bea83

Browse files
authored
Update signatures for implementation of Iterable.singleWhere (#63)
* Update signatures for implementation of Iterable.singleWhere * Add an check if orElse is passed in
1 parent fda417f commit 82bea83

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.13.2+2
2+
3+
* Update signature for implementations of `Iterable.singleWhere` to include
4+
optional argument.
5+
16
## 0.13.2+1
27

38
* Changed the implementation of `Set` and `List` classes to use base classes

lib/dom.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,8 @@ class FilteredElementList extends IterableBase<Element>
951951
return _filtered.lastWhere(test, orElse: orElse);
952952
}
953953

954-
Element singleWhere(bool test(Element value)) {
954+
Element singleWhere(bool test(Element value), {Element orElse()}) {
955+
if (orElse != null) throw new UnimplementedError('orElse');
955956
return _filtered.singleWhere(test);
956957
}
957958

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: html
2-
version: 0.13.2+1
2+
version: 0.13.2+2
33
author: Dart Team <[email protected]>
44
description: A library for working with HTML documents. Previously known as html5lib.
55
homepage: https://github.com/dart-lang/html

0 commit comments

Comments
 (0)