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 'dart:async'; | 7 import 'dart:async'; |
8 import 'package:async_helper/async_helper.dart'; | 8 import 'package:async_helper/async_helper.dart'; |
9 import 'package:compiler/src/commandline_options.dart'; | 9 import 'package:compiler/src/commandline_options.dart'; |
10 import 'package:compiler/src/common.dart'; | 10 import 'package:compiler/src/common.dart'; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 testThrow(); | 69 testThrow(); |
70 testSyncStar(); | 70 testSyncStar(); |
71 testAsync(); | 71 testAsync(); |
72 testAsyncStar(); | 72 testAsyncStar(); |
73 testIfThen(); | 73 testIfThen(); |
74 testIfThenElse(); | 74 testIfThenElse(); |
75 testForIn(null); | 75 testForIn(null); |
76 testForInTyped(null); | 76 testForInTyped(null); |
77 testAsyncForIn(null); | 77 testAsyncForIn(null); |
78 testAsyncForInTyped(null); | 78 testAsyncForInTyped(null); |
| 79 testTryCatch(); |
| 80 testTryCatchOn(); |
| 81 testTryCatchStackTrace(); |
| 82 testTryFinally(); |
79 testTopLevelInvoke(); | 83 testTopLevelInvoke(); |
80 testTopLevelInvokeTyped(); | 84 testTopLevelInvokeTyped(); |
81 testTopLevelFunctionTyped(); | 85 testTopLevelFunctionTyped(); |
82 testTopLevelFunctionGet(); | 86 testTopLevelFunctionGet(); |
| 87 testTopLevelGetterGet(); |
| 88 testTopLevelGetterGetTyped(); |
| 89 testTopLevelSetterSet(); |
| 90 testTopLevelSetterSetTyped(); |
83 testTopLevelField(); | 91 testTopLevelField(); |
84 testTopLevelFieldLazy(); | 92 testTopLevelFieldLazy(); |
85 testTopLevelFieldConst(); | 93 testTopLevelFieldConst(); |
86 testTopLevelFieldFinal(); | 94 testTopLevelFieldFinal(); |
87 testTopLevelFieldTyped(); | 95 testTopLevelFieldTyped(); |
88 testTopLevelFieldGeneric1(); | 96 testTopLevelFieldGeneric1(); |
89 testTopLevelFieldGeneric2(); | 97 testTopLevelFieldGeneric2(); |
90 testTopLevelFieldGeneric3(); | 98 testTopLevelFieldGeneric3(); |
| 99 testTopLevelFieldWrite(); |
91 testDynamicInvoke(null); | 100 testDynamicInvoke(null); |
92 testDynamicGet(null); | 101 testDynamicGet(null); |
93 testDynamicSet(null); | 102 testDynamicSet(null); |
94 testLocalWithoutInitializer(); | 103 testLocalWithoutInitializer(); |
95 testLocalWithInitializer(); | 104 testLocalWithInitializer(); |
96 testLocalWithInitializerTyped(); | 105 testLocalWithInitializerTyped(); |
97 testLocalFunction(); | 106 testLocalFunction(); |
98 testLocalFunctionTyped(); | 107 testLocalFunctionTyped(); |
99 testLocalFunctionInvoke(); | 108 testLocalFunctionInvoke(); |
100 testLocalFunctionGet(); | 109 testLocalFunctionGet(); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 } | 191 } |
183 testForInTyped(o) { | 192 testForInTyped(o) { |
184 for (int e in o) {} | 193 for (int e in o) {} |
185 } | 194 } |
186 testAsyncForIn(o) async { | 195 testAsyncForIn(o) async { |
187 await for (var e in o) {} | 196 await for (var e in o) {} |
188 } | 197 } |
189 testAsyncForInTyped(o) async { | 198 testAsyncForInTyped(o) async { |
190 await for (int e in o) {} | 199 await for (int e in o) {} |
191 } | 200 } |
| 201 testTryCatch() { |
| 202 try {} catch (e) {} |
| 203 } |
| 204 testTryCatchOn() { |
| 205 try {} on String catch (e) {} |
| 206 } |
| 207 testTryCatchStackTrace() { |
| 208 try {} catch (e, s) {} |
| 209 } |
| 210 testTryFinally() { |
| 211 try {} finally {} |
| 212 } |
192 topLevelFunction1(a) {} | 213 topLevelFunction1(a) {} |
193 topLevelFunction2(a, [b, c]) {} | 214 topLevelFunction2(a, [b, c]) {} |
194 topLevelFunction3(a, {b, c}) {} | 215 topLevelFunction3(a, {b, c}) {} |
195 testTopLevelInvoke() { | 216 testTopLevelInvoke() { |
196 topLevelFunction1(0); | 217 topLevelFunction1(0); |
197 topLevelFunction2(1); | 218 topLevelFunction2(1); |
198 topLevelFunction2(2, 3); | 219 topLevelFunction2(2, 3); |
199 topLevelFunction2(4, 5, 6); | 220 topLevelFunction2(4, 5, 6); |
200 topLevelFunction3(7); | 221 topLevelFunction3(7); |
201 topLevelFunction3(8, b: 9); | 222 topLevelFunction3(8, b: 9); |
(...skipping 22 matching lines...) Expand all Loading... |
224 topLevelFunctionTyped2(void a(num b, [String c])) {} | 245 topLevelFunctionTyped2(void a(num b, [String c])) {} |
225 topLevelFunctionTyped3(void a(num b, {String c, int d})) {} | 246 topLevelFunctionTyped3(void a(num b, {String c, int d})) {} |
226 topLevelFunctionTyped4(void a(num b, {String d, int c})) {} | 247 topLevelFunctionTyped4(void a(num b, {String d, int c})) {} |
227 testTopLevelFunctionTyped() { | 248 testTopLevelFunctionTyped() { |
228 topLevelFunctionTyped1(null); | 249 topLevelFunctionTyped1(null); |
229 topLevelFunctionTyped2(null); | 250 topLevelFunctionTyped2(null); |
230 topLevelFunctionTyped3(null); | 251 topLevelFunctionTyped3(null); |
231 topLevelFunctionTyped4(null); | 252 topLevelFunctionTyped4(null); |
232 } | 253 } |
233 testTopLevelFunctionGet() => topLevelFunction1; | 254 testTopLevelFunctionGet() => topLevelFunction1; |
| 255 get topLevelGetter => 0; |
| 256 testTopLevelGetterGet() => topLevelGetter; |
| 257 int get topLevelGetterTyped => 0; |
| 258 testTopLevelGetterGetTyped() => topLevelGetterTyped; |
| 259 set topLevelSetter(_) {} |
| 260 testTopLevelSetterSet() => topLevelSetter = 0; |
| 261 void set topLevelSetterTyped(int value) {} |
| 262 testTopLevelSetterSetTyped() => topLevelSetterTyped = 0; |
234 | 263 |
235 var topLevelField; | 264 var topLevelField; |
236 testTopLevelField() => topLevelField; | 265 testTopLevelField() => topLevelField; |
237 var topLevelFieldLazy = topLevelFunction1(null); | 266 var topLevelFieldLazy = topLevelFunction1(null); |
238 testTopLevelFieldLazy() => topLevelFieldLazy; | 267 testTopLevelFieldLazy() => topLevelFieldLazy; |
239 const topLevelFieldConst = 0; | 268 const topLevelFieldConst = 0; |
240 testTopLevelFieldConst() => topLevelFieldConst; | 269 testTopLevelFieldConst() => topLevelFieldConst; |
241 final topLevelFieldFinal = topLevelFunction1(null); | 270 final topLevelFieldFinal = topLevelFunction1(null); |
242 testTopLevelFieldFinal() => topLevelFieldFinal; | 271 testTopLevelFieldFinal() => topLevelFieldFinal; |
243 int topLevelFieldTyped; | 272 int topLevelFieldTyped; |
244 testTopLevelFieldTyped() => topLevelFieldTyped; | 273 testTopLevelFieldTyped() => topLevelFieldTyped; |
245 GenericClass topLevelFieldGeneric1; | 274 GenericClass topLevelFieldGeneric1; |
246 testTopLevelFieldGeneric1() => topLevelFieldGeneric1; | 275 testTopLevelFieldGeneric1() => topLevelFieldGeneric1; |
247 GenericClass<dynamic, dynamic> topLevelFieldGeneric2; | 276 GenericClass<dynamic, dynamic> topLevelFieldGeneric2; |
248 testTopLevelFieldGeneric2() => topLevelFieldGeneric2; | 277 testTopLevelFieldGeneric2() => topLevelFieldGeneric2; |
249 GenericClass<int, String> topLevelFieldGeneric3; | 278 GenericClass<int, String> topLevelFieldGeneric3; |
250 testTopLevelFieldGeneric3() => topLevelFieldGeneric3; | 279 testTopLevelFieldGeneric3() => topLevelFieldGeneric3; |
251 | 280 testTopLevelFieldWrite() => topLevelField = 3; |
252 testDynamicInvoke(o) { | 281 testDynamicInvoke(o) { |
253 o.f1(0); | 282 o.f1(0); |
254 o.f2(1); | 283 o.f2(1); |
255 o.f3(2, 3); | 284 o.f3(2, 3); |
256 o.f4(4, 5, 6); | 285 o.f4(4, 5, 6); |
257 o.f5(7); | 286 o.f5(7); |
258 o.f6(8, b: 9); | 287 o.f6(8, b: 9); |
259 o.f7(10, c: 11); | 288 o.f7(10, c: 11); |
260 o.f8(12, b: 13, c: 14); | 289 o.f8(12, b: 13, c: 14); |
261 o.f9(15, c: 16, b: 17); | 290 o.f9(15, c: 16, b: 17); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 // we cannot tell the diferrence. | 439 // we cannot tell the diferrence. |
411 builder.registerFeature(Feature.STRING_INTERPOLATION); | 440 builder.registerFeature(Feature.STRING_INTERPOLATION); |
412 builder.registerFeature(Feature.STRING_JUXTAPOSITION); | 441 builder.registerFeature(Feature.STRING_JUXTAPOSITION); |
413 break; | 442 break; |
414 default: | 443 default: |
415 } | 444 } |
416 } | 445 } |
417 impact.nativeData.forEach(builder.registerNativeData); | 446 impact.nativeData.forEach(builder.registerNativeData); |
418 return builder; | 447 return builder; |
419 } | 448 } |
OLD | NEW |