| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // VMOptions=--enable_async --optimization-counter-threshold=5 | 5 // VMOptions=--enable_async --optimization-counter-threshold=5 |
| 6 | 6 |
| 7 import 'package:expect/expect.dart'; | 7 import 'package:expect/expect.dart'; |
| 8 | 8 |
| 9 import 'dart:async'; | 9 import 'dart:async'; |
| 10 | 10 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 var a = await y(); | 63 var a = await y(); |
| 64 throw a; | 64 throw a; |
| 65 } catch (e2) { | 65 } catch (e2) { |
| 66 throw e2 + 1; | 66 throw e2 + 1; |
| 67 } | 67 } |
| 68 } catch (e3) { | 68 } catch (e3) { |
| 69 return e3; | 69 return e3; |
| 70 } | 70 } |
| 71 } | 71 } |
| 72 | 72 |
| 73 awaitAsUnary(a,b) async { |
| 74 return await a + await b; |
| 75 } |
| 76 |
| 73 awaitIf(p) async { | 77 awaitIf(p) async { |
| 74 if (p < (await bar(5))) { | 78 if (p < (await bar(5))) { |
| 75 return "p<5"; | 79 return "p<5"; |
| 76 } else { | 80 } else { |
| 77 return "p>=5"; | 81 return "p>=5"; |
| 78 } | 82 } |
| 79 } | 83 } |
| 80 | 84 |
| 81 awaitNestedIf(p,q) async { | 85 awaitNestedIf(p,q) async { |
| 82 if (p == (await bar(5))) { | 86 if (p == (await bar(5))) { |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 result = await awaitElseIf(6); | 186 result = await awaitElseIf(6); |
| 183 Expect.equals("p>5", result); | 187 Expect.equals("p>5", result); |
| 184 result = await awaitElseIf(4); | 188 result = await awaitElseIf(4); |
| 185 Expect.equals("p<5", result); | 189 Expect.equals("p<5", result); |
| 186 result = await awaitElseIf(5); | 190 result = await awaitElseIf(5); |
| 187 Expect.equals("p==5", result); | 191 Expect.equals("p==5", result); |
| 188 result = await awaitNestedWhile(5,3); | 192 result = await awaitNestedWhile(5,3); |
| 189 Expect.equals(15, result); | 193 Expect.equals(15, result); |
| 190 result = await awaitNestedWhile(4,6); | 194 result = await awaitNestedWhile(4,6); |
| 191 Expect.equals(24, result); | 195 Expect.equals(24, result); |
| 196 result = await awaitAsUnary(bar(1), bar(2)); |
| 197 Expect.equals(3, result); |
| 192 } | 198 } |
| 193 } | 199 } |
| OLD | NEW |