Skip to content

Commit aee6563

Browse files
lrhncommit-bot@chromium.org
authored andcommitted
Add constructors to Stream which creates single data or error event streams.
Change-Id: I3f570b15d29601a488dc634ab3cc563783868ac2 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108102 Commit-Queue: Lasse R.H. Nielsen <[email protected]> Reviewed-by: Jonas Jensen <[email protected]> Reviewed-by: Leaf Petersen <[email protected]>
1 parent d914839 commit aee6563

20 files changed

+233
-457
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@
4747
* `Uint32List.sublist()``Uint32List`
4848
* `Uint64List.sublist()``Uint64List`
4949

50-
50+
#### `dart:async`
51+
52+
* Add `value` and `error` constructors on `Stream`
53+
to allow easily creating single-value or single-error streams.
54+
5155
#### `dart:core`
5256

5357
* Update `Uri` class to support [RFC6874](https://tools.ietf.org/html/rfc6874):

pkg/expect/lib/expect.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ bool _identical(a, b) => identical(a, b);
662662
/// Exception thrown on a failed expectation check.
663663
///
664664
/// Always recognized by [Expect.throws] as an unexpected error.
665-
class ExpectException implements Exception {
665+
class ExpectException {
666666
final String message;
667667
ExpectException(this.message);
668668
String toString() => message;

pkg/front_end/testcases/extension_methods.dart.hierarchy.expect

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -94,28 +94,10 @@ Expect:
9494
Expect.throwsFormatException
9595
classSetters:
9696

97-
Exception:
98-
superclasses:
99-
Object
100-
interfaces:
101-
classMembers:
102-
Object.toString
103-
Object.runtimeType
104-
Object._simpleInstanceOf
105-
Object._instanceOf
106-
Object.noSuchMethod
107-
Object._identityHashCode
108-
Object.hashCode
109-
Object._simpleInstanceOfFalse
110-
Object._simpleInstanceOfTrue
111-
Object.==
112-
classSetters:
113-
11497
ExpectException:
115-
Longest path to Object: 2
11698
superclasses:
11799
Object
118-
interfaces: Exception
100+
interfaces:
119101
classMembers:
120102
ExpectException.message
121103
ExpectException.toString
@@ -129,19 +111,6 @@ ExpectException:
129111
Object._simpleInstanceOfTrue
130112
Object.==
131113
classSetters:
132-
interfaceMembers:
133-
ExpectException.message
134-
ExpectException.toString
135-
Object.runtimeType
136-
Object._simpleInstanceOf
137-
Object._instanceOf
138-
Object.noSuchMethod
139-
Object._identityHashCode
140-
Object.hashCode
141-
Object._simpleInstanceOfFalse
142-
Object._simpleInstanceOfTrue
143-
Object.==
144-
interfaceSetters:
145114

146115
Immutable:
147116
superclasses:

pkg/front_end/testcases/function_type_is_check.dart.hierarchy.expect

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -76,28 +76,10 @@ Expect:
7676
Expect.throwsFormatException
7777
classSetters:
7878

79-
Exception:
80-
superclasses:
81-
Object
82-
interfaces:
83-
classMembers:
84-
Object.toString
85-
Object.runtimeType
86-
Object._simpleInstanceOf
87-
Object._instanceOf
88-
Object.noSuchMethod
89-
Object._identityHashCode
90-
Object.hashCode
91-
Object._simpleInstanceOfFalse
92-
Object._simpleInstanceOfTrue
93-
Object.==
94-
classSetters:
95-
9679
ExpectException:
97-
Longest path to Object: 2
9880
superclasses:
9981
Object
100-
interfaces: Exception
82+
interfaces:
10183
classMembers:
10284
ExpectException.message
10385
ExpectException.toString
@@ -111,19 +93,6 @@ ExpectException:
11193
Object._simpleInstanceOfTrue
11294
Object.==
11395
classSetters:
114-
interfaceMembers:
115-
ExpectException.message
116-
ExpectException.toString
117-
Object.runtimeType
118-
Object._simpleInstanceOf
119-
Object._instanceOf
120-
Object.noSuchMethod
121-
Object._identityHashCode
122-
Object.hashCode
123-
Object._simpleInstanceOfFalse
124-
Object._simpleInstanceOfTrue
125-
Object.==
126-
interfaceSetters:
12796

12897
Immutable:
12998
superclasses:

pkg/front_end/testcases/implicit_scope_test.dart.hierarchy.expect

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -95,28 +95,10 @@ Expect:
9595
Expect.throwsFormatException
9696
classSetters:
9797

98-
Exception:
99-
superclasses:
100-
Object
101-
interfaces:
102-
classMembers:
103-
Object.toString
104-
Object.runtimeType
105-
Object._simpleInstanceOf
106-
Object._instanceOf
107-
Object.noSuchMethod
108-
Object._identityHashCode
109-
Object.hashCode
110-
Object._simpleInstanceOfFalse
111-
Object._simpleInstanceOfTrue
112-
Object.==
113-
classSetters:
114-
11598
ExpectException:
116-
Longest path to Object: 2
11799
superclasses:
118100
Object
119-
interfaces: Exception
101+
interfaces:
120102
classMembers:
121103
ExpectException.message
122104
ExpectException.toString
@@ -130,19 +112,6 @@ ExpectException:
130112
Object._simpleInstanceOfTrue
131113
Object.==
132114
classSetters:
133-
interfaceMembers:
134-
ExpectException.message
135-
ExpectException.toString
136-
Object.runtimeType
137-
Object._simpleInstanceOf
138-
Object._instanceOf
139-
Object.noSuchMethod
140-
Object._identityHashCode
141-
Object.hashCode
142-
Object._simpleInstanceOfFalse
143-
Object._simpleInstanceOfTrue
144-
Object.==
145-
interfaceSetters:
146115

147116
Immutable:
148117
superclasses:

pkg/front_end/testcases/instantiate_to_bound/supertypes.dart.hierarchy.expect

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -128,28 +128,10 @@ Expect:
128128
Expect.throwsFormatException
129129
classSetters:
130130

131-
Exception:
132-
superclasses:
133-
Object
134-
interfaces:
135-
classMembers:
136-
Object.toString
137-
Object.runtimeType
138-
Object._simpleInstanceOf
139-
Object._instanceOf
140-
Object.noSuchMethod
141-
Object._identityHashCode
142-
Object.hashCode
143-
Object._simpleInstanceOfFalse
144-
Object._simpleInstanceOfTrue
145-
Object.==
146-
classSetters:
147-
148131
ExpectException:
149-
Longest path to Object: 2
150132
superclasses:
151133
Object
152-
interfaces: Exception
134+
interfaces:
153135
classMembers:
154136
ExpectException.message
155137
ExpectException.toString
@@ -163,19 +145,6 @@ ExpectException:
163145
Object._simpleInstanceOfTrue
164146
Object.==
165147
classSetters:
166-
interfaceMembers:
167-
ExpectException.message
168-
ExpectException.toString
169-
Object.runtimeType
170-
Object._simpleInstanceOf
171-
Object._instanceOf
172-
Object.noSuchMethod
173-
Object._identityHashCode
174-
Object.hashCode
175-
Object._simpleInstanceOfFalse
176-
Object._simpleInstanceOfTrue
177-
Object.==
178-
interfaceSetters:
179148

180149
Immutable:
181150
superclasses:

pkg/front_end/testcases/mixin_constructors_with_default_values.dart.hierarchy.expect

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -250,28 +250,10 @@ Expect:
250250
Expect.throwsFormatException
251251
classSetters:
252252

253-
Exception:
254-
superclasses:
255-
Object
256-
interfaces:
257-
classMembers:
258-
Object.toString
259-
Object.runtimeType
260-
Object._simpleInstanceOf
261-
Object._instanceOf
262-
Object.noSuchMethod
263-
Object._identityHashCode
264-
Object.hashCode
265-
Object._simpleInstanceOfFalse
266-
Object._simpleInstanceOfTrue
267-
Object.==
268-
classSetters:
269-
270253
ExpectException:
271-
Longest path to Object: 2
272254
superclasses:
273255
Object
274-
interfaces: Exception
256+
interfaces:
275257
classMembers:
276258
ExpectException.message
277259
ExpectException.toString
@@ -285,19 +267,6 @@ ExpectException:
285267
Object._simpleInstanceOfTrue
286268
Object.==
287269
classSetters:
288-
interfaceMembers:
289-
ExpectException.message
290-
ExpectException.toString
291-
Object.runtimeType
292-
Object._simpleInstanceOf
293-
Object._instanceOf
294-
Object.noSuchMethod
295-
Object._identityHashCode
296-
Object.hashCode
297-
Object._simpleInstanceOfFalse
298-
Object._simpleInstanceOfTrue
299-
Object.==
300-
interfaceSetters:
301270

302271
Immutable:
303272
superclasses:

pkg/front_end/testcases/rasta/issue_000002.dart.hierarchy.expect

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -94,28 +94,10 @@ Expect:
9494
Expect.throwsFormatException
9595
classSetters:
9696

97-
Exception:
98-
superclasses:
99-
Object
100-
interfaces:
101-
classMembers:
102-
Object.toString
103-
Object.runtimeType
104-
Object._simpleInstanceOf
105-
Object._instanceOf
106-
Object.noSuchMethod
107-
Object._identityHashCode
108-
Object.hashCode
109-
Object._simpleInstanceOfFalse
110-
Object._simpleInstanceOfTrue
111-
Object.==
112-
classSetters:
113-
11497
ExpectException:
115-
Longest path to Object: 2
11698
superclasses:
11799
Object
118-
interfaces: Exception
100+
interfaces:
119101
classMembers:
120102
ExpectException.message
121103
ExpectException.toString
@@ -129,19 +111,6 @@ ExpectException:
129111
Object._simpleInstanceOfTrue
130112
Object.==
131113
classSetters:
132-
interfaceMembers:
133-
ExpectException.message
134-
ExpectException.toString
135-
Object.runtimeType
136-
Object._simpleInstanceOf
137-
Object._instanceOf
138-
Object.noSuchMethod
139-
Object._identityHashCode
140-
Object.hashCode
141-
Object._simpleInstanceOfFalse
142-
Object._simpleInstanceOfTrue
143-
Object.==
144-
interfaceSetters:
145114

146115
Immutable:
147116
superclasses:

pkg/front_end/testcases/rasta/issue_000004.dart.hierarchy.expect

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -76,28 +76,10 @@ Expect:
7676
Expect.throwsFormatException
7777
classSetters:
7878

79-
Exception:
80-
superclasses:
81-
Object
82-
interfaces:
83-
classMembers:
84-
Object.toString
85-
Object.runtimeType
86-
Object._simpleInstanceOf
87-
Object._instanceOf
88-
Object.noSuchMethod
89-
Object._identityHashCode
90-
Object.hashCode
91-
Object._simpleInstanceOfFalse
92-
Object._simpleInstanceOfTrue
93-
Object.==
94-
classSetters:
95-
9679
ExpectException:
97-
Longest path to Object: 2
9880
superclasses:
9981
Object
100-
interfaces: Exception
82+
interfaces:
10183
classMembers:
10284
ExpectException.message
10385
ExpectException.toString
@@ -111,19 +93,6 @@ ExpectException:
11193
Object._simpleInstanceOfTrue
11294
Object.==
11395
classSetters:
114-
interfaceMembers:
115-
ExpectException.message
116-
ExpectException.toString
117-
Object.runtimeType
118-
Object._simpleInstanceOf
119-
Object._instanceOf
120-
Object.noSuchMethod
121-
Object._identityHashCode
122-
Object.hashCode
123-
Object._simpleInstanceOfFalse
124-
Object._simpleInstanceOfTrue
125-
Object.==
126-
interfaceSetters:
12796

12897
Immutable:
12998
superclasses:

0 commit comments

Comments
 (0)