Skip to content

Commit fe8ec38

Browse files
authored
Fix an ArgumentError constructor call (dart-archive/async#197)
The arguments that were passed match the intention of the `ArgumentError` constructor, while the `ArgumentError.value` constructor reverses the message and argument name, and includes the argument value. Including the value is not useful in this case since it is always `[]` and in most cases won't be the exact instance that was passed because of the `.toList()` call which would usually construct a copy. Bump the min SDK constraint to `2.14` which is the first release allowing the `name` argument to the `ArgumentError` constructor.
1 parent cbce1bc commit fe8ec38

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

pkgs/async/.github/workflows/test-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
matrix:
4848
# Add macos-latest and/or windows-latest if relevant for this package.
4949
os: [ubuntu-latest]
50-
sdk: [2.12.0, dev]
50+
sdk: [2.14.1, dev]
5151
steps:
5252
- uses: actions/checkout@v2
5353
- uses: dart-lang/setup-dart@v1.0

pkgs/async/lib/src/cancelable_operation.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class CancelableOperation<T> {
6969
Iterable<CancelableOperation<T>> operations) {
7070
operations = operations.toList();
7171
if (operations.isEmpty) {
72-
throw ArgumentError.value("May not be empty", "operations");
72+
throw ArgumentError("May not be empty", "operations");
7373
}
7474

7575
var done = false;

pkgs/async/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Utility functions and classes related to the 'dart:async' library.
55
repository: https://github.com/dart-lang/async
66

77
environment:
8-
sdk: ">=2.12.0 <3.0.0"
8+
sdk: ">=2.14.0 <3.0.0"
99

1010
dependencies:
1111
collection: ^1.15.0

0 commit comments

Comments
 (0)