File tree 2 files changed +46
-0
lines changed 2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
2
+ // for details. All rights reserved. Use of this source code is governed by a
3
+ // BSD-style license that can be found in the LICENSE file.
4
+
5
+ import "package:expect/expect.dart" ;
6
+
7
+ Future <String > f () async {
8
+ throw 'f' ;
9
+ }
10
+
11
+ Future <String > g () async {
12
+ try {
13
+ // Should obtain the `Future<String>`, await it, then throw.
14
+ return f ();
15
+ } catch (e) {
16
+ // Having caught the exception, we return a value.
17
+ return 'g' ;
18
+ }
19
+ }
20
+
21
+ void main () async {
22
+ Expect .equals ('g' , await g ());
23
+ }
Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
2
+ // for details. All rights reserved. Use of this source code is governed by a
3
+ // BSD-style license that can be found in the LICENSE file.
4
+
5
+ import "package:expect/expect.dart" ;
6
+
7
+ Future <String > f () async {
8
+ throw 'f' ;
9
+ }
10
+
11
+ Future <String > g () async {
12
+ try {
13
+ // Should obtain the `Future<String>`, await it, then throw.
14
+ return f ();
15
+ } catch (e) {
16
+ // Having caught the exception, we return a value.
17
+ return 'g' ;
18
+ }
19
+ }
20
+
21
+ void main () async {
22
+ Expect .equals ('g' , await g ());
23
+ }
You can’t perform that action at this time.
0 commit comments