| Index: frog/tests/await/src/TryCatch9Test.dart
|
| diff --git a/frog/tests/await/src/TryCatch9Test.dart b/frog/tests/await/src/TryCatch9Test.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..2b1ecd3d8e3229ebcad1b7c11f6247da6211b963
|
| --- /dev/null
|
| +++ b/frog/tests/await/src/TryCatch9Test.dart
|
| @@ -0,0 +1,33 @@
|
| +// Copyright (c) 2011, 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.
|
| +
|
| +// Await within a try-catch block with typed catches.
|
| +
|
| +#import("await_test_helper.dart");
|
| +
|
| +class E1 implements Exception {
|
| + const E1([msg=null]);
|
| +}
|
| +class E2 implements Exception {
|
| + const E2([msg=null]);
|
| +}
|
| +
|
| +awaitAndThrow(Exception ex) {
|
| + try {
|
| + final t = await futureOf(3);
|
| + throw ex;
|
| + return t;
|
| + } catch (E1 e) {
|
| + return 1;
|
| + } catch (E2 e) {
|
| + return 2;
|
| + }
|
| +}
|
| +
|
| +main() {
|
| + int t = await awaitAndThrow(const E1());
|
| + Expect.equals(1, t);
|
| + int t = await awaitAndThrow(const E2());
|
| + Expect.equals(2, t);
|
| +}
|
|
|