OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 library dart2js.kernel.impact_test; | 5 library dart2js.kernel.impact_test; |
6 | 6 |
7 import 'package:async_helper/async_helper.dart'; | 7 import 'package:async_helper/async_helper.dart'; |
8 import 'package:compiler/src/commandline_options.dart'; | 8 import 'package:compiler/src/commandline_options.dart'; |
9 import 'package:compiler/src/common.dart'; | 9 import 'package:compiler/src/common.dart'; |
10 import 'package:compiler/src/common/names.dart'; | 10 import 'package:compiler/src/common/names.dart'; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 testAsGenericRaw(); | 92 testAsGenericRaw(); |
93 testAsGenericDynamic(); | 93 testAsGenericDynamic(); |
94 testThrow(); | 94 testThrow(); |
95 testIfNotNull(null); | 95 testIfNotNull(null); |
96 testIfNotNullSet(null); | 96 testIfNotNullSet(null); |
97 testIfNull(null); | 97 testIfNull(null); |
98 testSetIfNull(null); | 98 testSetIfNull(null); |
99 testSyncStar(); | 99 testSyncStar(); |
100 testAsync(); | 100 testAsync(); |
101 testAsyncStar(); | 101 testAsyncStar(); |
| 102 testLocalSyncStar(); |
| 103 testLocalAsync(); |
| 104 testLocalAsyncStar(); |
| 105 testAnonymousSyncStar(); |
| 106 testAnonymousAsync(); |
| 107 testAnonymousAsyncStar(); |
102 testIfThen(); | 108 testIfThen(); |
103 testIfThenElse(); | 109 testIfThenElse(); |
104 testForIn(null); | 110 testForIn(null); |
105 testForInTyped(null); | 111 testForInTyped(null); |
106 testAsyncForIn(null); | 112 testAsyncForIn(null); |
107 testAsyncForInTyped(null); | 113 testAsyncForInTyped(null); |
108 testTryCatch(); | 114 testTryCatch(); |
109 testTryCatchOn(); | 115 testTryCatchOn(); |
110 testTryCatchStackTrace(); | 116 testTryCatchStackTrace(); |
111 testTryFinally(); | 117 testTryFinally(); |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 testAsGenericDynamic() => null as GenericClass<dynamic, dynamic>; | 254 testAsGenericDynamic() => null as GenericClass<dynamic, dynamic>; |
249 testThrow() => throw ''; | 255 testThrow() => throw ''; |
250 testIfNotNull(o) => o?.foo; | 256 testIfNotNull(o) => o?.foo; |
251 testIfNotNullSet(o) => o?.foo = 42; | 257 testIfNotNullSet(o) => o?.foo = 42; |
252 testIfNull(o) => o ?? 42; | 258 testIfNull(o) => o ?? 42; |
253 testSetIfNull(o) => o ??= 42; | 259 testSetIfNull(o) => o ??= 42; |
254 | 260 |
255 testSyncStar() sync* {} | 261 testSyncStar() sync* {} |
256 testAsync() async {} | 262 testAsync() async {} |
257 testAsyncStar() async* {} | 263 testAsyncStar() async* {} |
| 264 testLocalSyncStar() { |
| 265 local() sync* {} |
| 266 return local; |
| 267 } |
| 268 testLocalAsync() { |
| 269 local() async {} |
| 270 return local; |
| 271 } |
| 272 testLocalAsyncStar() { |
| 273 local() async* {} |
| 274 return local; |
| 275 } |
| 276 testAnonymousSyncStar() { |
| 277 return () sync* {}; |
| 278 } |
| 279 testAnonymousAsync() { |
| 280 return () async {}; |
| 281 } |
| 282 testAnonymousAsyncStar() { |
| 283 return () async* {}; |
| 284 } |
| 285 |
258 testIfThen() { | 286 testIfThen() { |
259 if (false) return 42; | 287 if (false) return 42; |
260 return 1; | 288 return 1; |
261 } | 289 } |
262 testIfThenElse() { | 290 testIfThenElse() { |
263 if (true) { | 291 if (true) { |
264 return 42; | 292 return 42; |
265 } else { | 293 } else { |
266 return 1; | 294 return 1; |
267 } | 295 } |
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
891 visitList(type.optionalParameterTypes), | 919 visitList(type.optionalParameterTypes), |
892 type.namedParameters, | 920 type.namedParameters, |
893 visitList(type.namedParameterTypes)); | 921 visitList(type.namedParameterTypes)); |
894 } | 922 } |
895 } | 923 } |
896 | 924 |
897 /// Perform unaliasing of all typedefs nested within a [ResolutionDartType]. | 925 /// Perform unaliasing of all typedefs nested within a [ResolutionDartType]. |
898 ResolutionDartType unalias(ResolutionDartType type) { | 926 ResolutionDartType unalias(ResolutionDartType type) { |
899 return const Unaliaser().visit(type); | 927 return const Unaliaser().visit(type); |
900 } | 928 } |
OLD | NEW |