Skip to content
Permalink
Browse files

Don't allow `null` as argument to `StreamIterator` constructor.

Change-Id: I10c8de2cd12660876908f719ee562006cd3f2c07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98001
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
  • Loading branch information...
lrhn authored and commit-bot@chromium.org committed Apr 30, 2019
1 parent 9cf5e51 commit 1dd0f88c84a0c22865ce3fff5fb32d9818c0a640
@@ -4,6 +4,11 @@

### Core library changes

#### `dart:async`
* BREAKING CHANGE:
Fixes bug in `StreamIterator` which allowed constructor argument to be `null`.
Also allowed `await for` on a `null` stream. This is now a runtime error.

#### `dart:core`

* **Breaking change**: The `RegExp` interface has been extended with two new
@@ -27,6 +32,11 @@
This change only affects implementers of the `RegExp` interface; current
code using Dart regular expressions will not be affected.

#### `dart:isolate`

* BREAKING CHANGE: The `await for` allowed `null` as a stream due to a bug
in `StreamIterator` class. This bug has now been fixed.

## 2.3.0

The focus in this release is on the new "UI-as-code" language features which
@@ -20,6 +20,7 @@ incomplete_field_formal_parameter: Fail # Fasta doesn't recover well
inference/bug31436: RuntimeError # Test exercises Dart 2.0 semantics
inference/constructors_too_many_positional_arguments: Fail
inference/downwards_inference_annotations_locals: Fail # Issue #30031
inference/downwards_inference_for_each: RuntimeError # Issue #36382
inference/future_then_explicit_future: RuntimeError
inference/generic_methods_infer_js_builtin: RuntimeError # Test attempts to access platform-private library leading to NSM.
inference/infer_assign_to_index: Fail
@@ -33,6 +33,7 @@ inference/constructors_infer_from_arguments_argument_not_assignable: TypeCheckEr
inference/constructors_too_many_positional_arguments: InstrumentationMismatch # Issue #30040
inference/do_not_infer_overridden_fields_that_explicitly_say_dynamic_infer: TypeCheckError
inference/downwards_inference_annotations_type_variable: InstrumentationMismatch # Issue 28981
inference/downwards_inference_for_each: RuntimeError # Issue #36382
inference/downwards_inference_on_function_of_t_using_the_t: InstrumentationMismatch # Issue #29798
inference/downwards_inference_on_list_literals_infer_downwards: RuntimeError
inference/future_then_explicit_future: InstrumentationMismatch # Issue #30040
@@ -967,7 +967,8 @@ class _StreamIterator<T> implements StreamIterator<T> {
/// completed.
bool _isPaused = false;

_StreamIterator(final Stream<T> stream) : _stateData = stream;
_StreamIterator(final Stream<T> stream)
: _stateData = stream ?? (throw ArgumentError.notNull("stream"));

T get current {
if (_subscription != null && _isPaused) {

0 comments on commit 1dd0f88

Please sign in to comment.
You can’t perform that action at this time.