-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cf. #44395. Change-Id: I753a6a4fae65c50267d8cf1575d2ce87e7ac345b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175064 Reviewed-by: Lasse R.H. Nielsen <lrn@google.com> Commit-Queue: Erik Ernst <eernst@google.com>
- Loading branch information
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
import "package:expect/expect.dart"; | ||
|
||
Future<String> f() async { | ||
throw 'f'; | ||
} | ||
|
||
Future<String> g() async { | ||
try { | ||
// Should obtain the `Future<String>`, await it, then throw. | ||
return f(); | ||
} catch (e) { | ||
// Having caught the exception, we return a value. | ||
return 'g'; | ||
} | ||
} | ||
|
||
void main() async { | ||
Expect.equals('g', await g()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
import "package:expect/expect.dart"; | ||
|
||
Future<String> f() async { | ||
throw 'f'; | ||
} | ||
|
||
Future<String> g() async { | ||
try { | ||
// Should obtain the `Future<String>`, await it, then throw. | ||
return f(); | ||
} catch (e) { | ||
// Having caught the exception, we return a value. | ||
return 'g'; | ||
} | ||
} | ||
|
||
void main() async { | ||
Expect.equals('g', await g()); | ||
} |